// JavaScript Document

function getQuote()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
			//document.getElementById(containerid).innerHTML=xmlHttp.responseText;
			if(xmlHttp.responseText!='')
			{
				popup('Quotation','Quotation successfully generated.','',false,2000);
				window.open(xmlHttp.responseText);
			}
			else
			{
				popup('Quotation Error','There was an error generating your quotation! Please check your reference number and password.','',false);
			}
		  }
		}
	popup('Generating Quotation','Please wait while your quotation is generated.','',true);
		
	  xmlHttp.open("POST",'quote-print.php',true);
	  param = "reference="+document.quoteForm.reference.value+"&pass="+document.quoteForm.pass.value;
	  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	  xmlHttp.setRequestHeader("Content-length", param.length);
	  xmlHttp.send(param);

}