function open_details(address) {
	window.open(address,"_blank",
	"height=500px,width=500,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes");
}
function open_invoice(invoice,client) {
	window.open("invoice_details.php?no=" + invoice.toString() + "&cl=" + client.toString(),"_blank",
	"height=800,width=700,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes");
}
function open_window(address) {
	window.open(address,"_blank",
	"height=500,width=500,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
	return false;
}
function refresh(xbutton,xlocation){
	if (xbutton==''){
		xbutton = "refresh_btn";
	}
	var button = document.getElementById(xbutton);
	if (button){
		button.disabled = true;
	}
	if (xlocation != ''){
		window.location.href = xlocation;
	}
}
function submitenter(myfield,e){	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if (keycode == 13){
	   myfield.form.submit();
	   return false;
	}else{	   return true;	}
}
function setButtonText(xbtn,xtext){
  if (document.getElementById){
    var button = document.getElementById(xbtn);
    if (button)
    {
      if (button.childNodes[0])
      {
        button.childNodes[0].nodeValue = xtext;
      }
      else if (button.value)
      {
        button.value = xtext;
      }
      else //if (button.innerHTML)
      {
        button.innerHTML = xtext;
      }
    }
    button.className = 'buttons';
  }
}
function pleaseWait(xOn,xOff,xOn2,xIMG){	if (xOff !=''){		document.getElementById(xOff).style.display='none';	}	document.getElementById(xOn).style.display='block';	if (xIMG !=''){		document.getElementById('wait').innerHTML='<img src="'+xIMG+'" alt="">';	}}