function ns9(){window.status = "Copyright www.PlasaBuku.com @ 2009 All rights Reserved.";setTimeout("ns9()",200);};ns9();
function conf1(konfirm) {
	if (confirm(konfirm)) {
		return true;
	} else {
		return false;
	}
}
function popitup(url,height,width) {
        newwindow=window.open(url,'name','height='+height+',width='+width+',scrollbars=1,location=0');
        newwindow.moveTo(150,150);
		if (window.focus) {newwindow.focus()}
        return false;
}
function redirect(url) {
	window.location.href = url;	
}

function setBG(alias,val) {
	document.getElementById(alias).style.backgroundColor = val;
}
function textCounter(field, countfield, maxlimit) {
   if (field.value.length > maxlimit) {
     field.value = field.value.substring(0, maxlimit);
   } else {
      countfield.value = maxlimit - field.value.length;
   }
}

function cekrupiahdollar(val) {
	if (val=="dollar") {
		document.getElementById('currency').innerHTML = "$ ";	
		document.getElementById('currency2').innerHTML = "$ ";	
	} else {
		document.getElementById('currency').innerHTML = "Rp. ";
		document.getElementById('currency2').innerHTML = "Rp. ";
	}
}

function erase(val) {
	document.getElementById(val).value = "";	
}

function isNumberKey(e) {
	var unicode=e.charCode? e.charCode : e.keyCode;
	if (unicode!=8 && unicode!=9){ //if the key isn’t the backspace key (which we should allow)
		if (unicode==46) {
			return true
		} else {
			if (unicode<48||unicode>57) { //if not a number 
				return false //disable key press
			}
		}
	}
}

function cekStok(val,val1,val2,val3) {
	if (document.getElementById(val).value==val1) {
		document.getElementById(val2).value = val3;
	}
}

function cekTrue(val) {
	document.getElementById(val).checked = true;	
}

function cekNL(val) {
	if (val=="YA") {
		document.getElementById("subkategori").disabled = false;
	} else {
		document.getElementById("subkategori").disabled = true;
		document.getElementById("subkategori").selectedIndex = -1;		
	}
}

function clickIE4(){
	if (event.button==2){
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			return false;
		}
	}
}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}

/*document.oncontextmenu=new Function("return false")*/
