
var xmlhttp;

function getxmlhttpobject()
{
var xmlhttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlhttp;
}

function display1()
{	//alert(toshow);
	//alert("hi");
	var url="enquiry.php";
		//alert(url);
		xmlHttp=getxmlhttpobject();
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				document.form2.addenquiry.style.display="block";
				document.form2.addenquiry.innerHTML=xmlHttp.responseText;
			}		
		}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function feedback(val)
{	//alert(toshow);
	//alert("hi");
	var url="view.php?id="+val;
		//alert(url);
		xmlHttp=getxmlhttpobject();
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				//alert(xmlHttp.responseText);
				//document.getElementById('image').style.display='none';
				document.getElementById('feedback').innerHTML=xmlHttp.responseText;
			}		
		}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}

function image(id){
	//alert(id);
	var url="image.php";
	//alert(url);
		xmlHttp=getxmlhttpobject();
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				//alert(xmlHttp.responseText);
				document.getElementById(id).innerHTML=xmlHttp.responseText;
				
			}		
		}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
	}
	
	
	
function chk_code(code){
	//alert(code);
	var url="submit-quote.php?code="+code;
	//alert(url);
		xmlHttp=getxmlhttpobject();
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				//alert(xmlHttp.responseText);
				$check=parseInt(xmlHttp.responseText);
				//alert($check);
				if($check==1)
				{
					document.getElementById("Submit").disabled=false;
					document.getElementById("Reset").disabled=false;
				}else{
					document.getElementById("Submit").disabled=true;
					document.getElementById("Reset").disabled=true;
				}
				
				//document.getElementById(id).innerHTML=xmlHttp.responseText;
				
			}		
		}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
	}
	
	
function chk_codeindex(){
	code=document.getElementById("vcode").value;

	var url="submit-quoteindex.php?code="+code+"val="+Math.random();
	//alert(url);
		xmlHttp=getxmlhttpobject();
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				
				//alert(xmlHttp.responseText);
				return false;
				//document.getElementById(id).innerHTML=xmlHttp.responseText;
				
			}		
		}
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);	
	}
