var xmlHttp

function showCustomer(form)
{ 
var company = document.subscribe.company.value;   
var contact = document.subscribe.contact.value;  
var email = document.subscribe.email.value;
var countryid = document.subscribe.country.selectedIndex;
var country = document.subscribe.country(countryid).value;

if (document.subscribe.mailme[0].checked) {
mailme = document.subscribe.mailme[0].value;
}
if (document.subscribe.mailme[1].checked) {
mailme = document.subscribe.mailme[1].value;
}
if (document.subscribe.mailme[2].checked) {
mailme = document.subscribe.mailme[2].value;
}

if (company==null||company=="")
{
	alert("Company Name Required"); return false;
}
if (contact==null||contact=="")
{
	alert("Contact Name Required"); return false;
}
if (email==null||email=="")
{
	alert("Email Address Required"); return false;
}
if (country==null||country=="")
{
	alert("Country Required"); return false;
}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax-01.php";
url=url+"?company="+company;
url=url+"&contact="+contact;
url=url+"&email="+email;
url=url+"&country="+country;
url=url+"&mailme="+mailme;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}

function quoteCustomer(form)
{ 
var company = document.quoteme.company.value;   
var contact = document.quoteme.contact.value;  
var email = document.quoteme.email.value;
var stockid = document.quoteme.stockid.value

if (company==null||company=="")
{
	alert("Company Name Required"); return false;
}
if (contact==null||contact=="")
{
	alert("Contact Name Required"); return false;
}
if (email==null||email=="")
{
	alert("Email Address Required"); return false;
}


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/quotesent.php";
url=url+"?company="+company;
url=url+"&contact="+contact;
url=url+"&email="+email;
url=url+"&stockid="+stockid;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=quotesent;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function quotesent() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("quotation").innerHTML=xmlHttp.responseText;
}
}

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;
}
