var xmlHttp


if (!xmlHttp) {
try {
  //xmlHttp = new XMLHttpRequest();
  
  if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
 xmlHttp=new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
}
catch (e) {
  xmlHttp=false
}
}



function xmlHttp_send_post(URLto, xmlMessage) { 
    xmlHttp.open("POST", URLto, false)
    // for ie compatability
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(xmlMessage)
	//alert(xmlHttp.responseText);
	return xmlHttp.responseText;
} 

function chkSubscriber(path,subemail)
{	

    var mpath=path +'/subscriber.php?';
	var chksub = xmlHttp_send_post(mpath,"subemail="+ subemail +"&chkSubscriberId=chkSubscriberId");
	 if(chksub=='ok')
	 {  
	      alert("You are successfully subscribed for Newsletter.");
		  return true;
	 }
	if(chksub=='notok')
	 {
		  alert("This email Id already present!");
		  //document.getElementById('subemail').focus();
		  return false;
	 }
	 
}



function chkId(fname,lname,email,phone,cname,address,product,pid,url,inquiry,path)
{	
 

    var mpath=path +'/product-email.php?';
	var chk = xmlHttp_send_post(mpath,"fname="+ fname +"&lname="+ lname  +"&email="+ email +"&cname="+ cname+"&phone="+ phone+"&address="+address+"&inquiry="+inquiry+"&product="+product+"&pid="+pid+"&url="+url+"&chkId=chk");
	 if(chk=='ok')
	 {  
	    //document.getElementById('frm').style='none';
	   // document.getElementById('thnks').style='block';
		 return true;
	 }
	 
}

function commanEmail(fname,lname,email,phone,cname,inquiry,path)
{	
 

    var mpath=path +'/comman-email.php?';
	var chk = xmlHttp_send_post(mpath,"fname="+ fname +"&lname="+ lname  +"&email="+ email +"&cname="+ cname+"&phone="+ phone+"&inquiry="+inquiry+"&commanMail=chkMail");
	//$("#inquiryfrm").slideUp("slow",1000);
	if(chk=='ok')
	 {  
	  //$("#thnkMsg").show("slow",3000);
	 }
	 
}
