var xmlHttp
function showUser(pname,cname,address,country,email,countrycode,areacode,phone,website,comment,sendmecopy)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
document.getElementById("txtHint").innerHTML="<span class='stylea1'><center><br><br><br><br><br><br><br><img src='loading.gif' width='12' height='12'>&nbsp; loading... </center><br><br><br><br><br><br><br></span>"
var url="sendpricewatch.php"
url=url+"?pname="+pname+"&cname="+cname+"&address="+address+"&country="+country+"&email="+email+"&countrycode="+countrycode+"&areacode="+areacode+"&phone="+phone+"&website="+website+"&comment="+comment+"&sendmecopy="+sendmecopy
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("txtHint").innerHTML=xmlHttp.responseText}}
function showUser1()
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
document.getElementById("txtHint").innerHTML="<span class='stylea1'><center><br><br><br><br><br><br><br><img src='loading.gif' width='12' height='12'>&nbsp; loading... </center><br><br><br><br><br><br><br></span>"
var url="pricewatch_form.php3"
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function stateChanged1()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("txtHint").innerHTML=xmlHttp.responseText}}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function validator()
{var errormsg=""
if(document.frmSample.pname.value=="")
{if(errormsg=="")
{errormsg=errormsg+"Person Name";}
else
{errormsg=errormsg+"Person Name";}}
if(document.frmSample.cname.value=="")
{if(errormsg=="")
{errormsg=errormsg+"Company Name";}
else
{errormsg=errormsg+", Company Name";}}
if(document.frmSample.country.options[document.frmSample.country.selectedIndex].text=="Select One")
{if(errormsg=="")
{errormsg=errormsg+"Country";}
else
{errormsg=errormsg+", Country";}}
if(document.frmSample.email.value!="")
{with(document.frmSample.email)
{apos=value.indexOf("@");dotpos=value.lastIndexOf(".");if((apos<1)||((dotpos-apos)<2))
{if(errormsg=="")
{errormsg=errormsg+"Email";}
else
{errormsg=errormsg+", Email";}}
else
{}}}
else
{if(errormsg=="")
{errormsg=errormsg+"Email";}
else
{errormsg=errormsg+", Email";}}
if((document.frmSample.countrycode.value=="")||(document.frmSample.countrycode.value=="Country"))
{if(errormsg=="")
{errormsg=errormsg+"Country Code";}
else
{errormsg=errormsg+", Country Code";}}
if((document.frmSample.areacode.value=="")||(document.frmSample.areacode.value=="Area"))
{if(errormsg=="")
{errormsg=errormsg+"Area Code";}
else
{errormsg=errormsg+", Area Code";}}
if((document.frmSample.phone.value=="")||(document.frmSample.phone.value=="Telephone"))
{if(errormsg=="")
{errormsg=errormsg+"Telephone";}
else
{errormsg=errormsg+", Telephone";}}
if(errormsg=="")
{showUser(document.frmSample.pname.value,document.frmSample.cname.value,document.frmSample.address.value,document.frmSample.country.options[document.frmSample.country.selectedIndex].text,document.frmSample.email.value,document.frmSample.countrycode.value,document.frmSample.areacode.value,document.frmSample.phone.value,document.frmSample.website.value,document.frmSample.comment.value,document.frmSample.sendmecopy.checked);}
else
{alert("Please enter a valid "+errormsg);}}
