NS4 = (document.layers) ? true : false;
function isEnter(event) {     
	var code = 0;
	if (NS4) { code = event.which; }
	else { code = event.keyCode; }
	return code==13 ? true : false;
}
function checkEnter(event, act, objForm) {     
	var code = 0;
	if (NS4) { code = event.which; }
	else { code = event.keyCode; }
	if (code==13) { doPost(act ? act : '', '', objForm); }
}
function showTip(obj,divid){
	document.getElementById(divid).style.visibility = "visible";
}
function hideTip(obj,divid){
	document.getElementById(divid).style.visibility = "hidden";
}
function getMoney(x) {
	x = ""+x;
	x = x.replace(/,/g, "");
	var pos = x.indexOf(".");
	if (!x.match(/^\-?[\d\.]+$/) || ((pos > -1) && (x.indexOf(".", 1+pos) > pos))) { return "0.00"; }
	if (pos == -1) { x += ".00"; }
	else if (pos == 0) { x = "0"+x; }
	else if ((pos == 1) && (x.substr(0, 1) == "-")) { x = x.replace(/^\-\./, "-0."); }

	var pos = x.indexOf(".");	
	if (pos+1 == x.length) { x += "00"; }	
	else if (pos+2 == x.length) { x += "0"; }
	else if (pos+3 < x.length) {
		x = (Math.round(x*100)/100); 
//		x = x.substr(0, pos+3); 
	}
	return x; 
}
