function printreceipt(url) {
    receipt=window.open(url,'receipt');
    setTimeout("receipt.print()",1250);
}
/* - - - */
function getVacuums(manufacturer_id) {
	//create the Cross-browser XMLHttpRequest object
	var gURL = 'inc/get_vacuums.php?manufacturer_id='+manufacturer_id;
	if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
		   xmlhttp=new XMLHttpRequest();
		  if (xmlhttp.overrideMimeType) {
				 xmlhttp.overrideMimeType('text/xml');
		  }      
		  xmlhttp.onreadystatechange=loadVacuums;
		  xmlhttp.open("GET", gURL, true);
		  xmlhttp.send(null);
   } else if (window.ActiveXObject) { //IE
		  xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		  if (xmlhttp) {
				 xmlhttp.onreadystatechange=loadVacuums;
				 xmlhttp.open('GET', gURL, true);
				 xmlhttp.send();
		  }
   }
   document.getElementById('submit_disabled').style.display='none';
   document.getElementById('submit_enabled').style.display='';
   if(manufacturer_id==0) {
	   document.getElementById('submit_disabled').style.display='';
	   document.getElementById('submit_enabled').style.display='none';
   }
}
/* - - - */
function getTypes(vacuum_id) {
	//create the Cross-browser XMLHttpRequest object
	var gURL = 'inc/get_types.php?vacuum_id='+vacuum_id;
	if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
		   xmlhttp=new XMLHttpRequest();
		  if (xmlhttp.overrideMimeType) {
				 xmlhttp.overrideMimeType('text/xml');
		  }      
		  xmlhttp.onreadystatechange=loadTypes;
		  xmlhttp.open("GET", gURL, true);
		  xmlhttp.send(null);
   } else if (window.ActiveXObject) { //IE
		  xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		  if (xmlhttp) {
				 xmlhttp.onreadystatechange=loadTypes;
				 xmlhttp.open('GET', gURL, true);
				 xmlhttp.send();
		  }
   }
   document.getElementById('submit_disabled').style.display='none';
   document.getElementById('submit_enabled').style.display='';
   if(vacuum_id==0) {
	   document.getElementById('submit_disabled').style.display='';
	   document.getElementById('submit_enabled').style.display='none';
   }
}
/* - - - */
function showSubmit() {
   document.getElementById('submit_disabled').style.display='none';
   document.getElementById('submit_enabled').style.display='';
}
/* - - - */
function loadVacuums() {
   if (xmlhttp.readyState==4) {
		  if (xmlhttp.status==200) {
				 document.getElementById('vacuums').innerHTML=xmlhttp.responseText;
		  }
   }
}
/* - - - */
function loadTypes() {
   if (xmlhttp.readyState==4) {
		  if (xmlhttp.status==200) {
				 document.getElementById('types').innerHTML=xmlhttp.responseText;
		  }
   }
}
/* - - - */
function highlight(item) {
   item.style.color = "#0AF";
}
/* - - - */
function unhighlight(item) {
   item.style.color = "#417489";
}
