var xmlHttp
var countrystring
var supopt
function checkopt(supportopt)

{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
supopt=supportopt
var url="http://www.elliott-tool.com/espanol/contactchannel2.php"
url=url+"?support="+supportopt
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
if (supopt=='2')
{
removeElement('countrycode');
removeElement('txtCZ');
}
if (supopt=='1')
{
restoreElement('countrycode');
restoreElement('txtCZ');
}



}

function showContact(state)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var zip = "0"
var url="http://www.elliott-tool.com/espanol/contactchannel.php"
url=url+"?z="+zip
url=url+"&s="+state
url=url+"&c="+countrystring
url=url+"&support="+supopt
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function checkzip(zip) {

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var state = "0"
var url="http://www.elliott-tool.com/espanol/contactchannel.php"
url=url+"?z="+zip
url=url+"&s="+state
url=url+"&c="+countrystring
url=url+"&support="+supopt
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)


}


function showCityOrZip(str, parentDiv, childDiv, parentDiv2, childDiv2)
{ 


xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 if (str=="USA" || str=="MEX" || str=="CAN" || str=="VEN")
 {

  countrystring=str
var url="http://www.elliott-tool.com/espanol/cityorzip.php"
url=url+"?s="+str
xmlHttp.onreadystatechange=stateChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
 restoreElement('txtCZ');
 
 removeElement('add');

 
 }
 else{

removeElement('txtCZ');
var state = "0"
 var zip = "0"
 countrystring=str
var url="http://www.elliott-tool.com/espanol/contactchannel.php"
url=url+"?z="+zip
url=url+"&s="+state
url=url+"&c="+str
url=url+"&support="+supopt
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
restoreElement('txtcontact');
}



}


function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtCZ").innerHTML=xmlHttp.responseText 
 } 
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtcontact").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;
}
function removeElement(childDiv){
try
{
     document.getElementById(childDiv).style.display = 'none';
}
catch (e)
{
return
}
}
function restoreElement(childDiv) {
try
{
	document.getElementById(childDiv).style.display = '';
}
catch (e)
{
return
}
}

