
// declare a global  XMLHTTP Request object
var XmlHttpObj;
function getYearCatalogSearchPart(CatCatalog, varkeyword)
{
   //alert(Rec_id);
   var strURL="findYearCatalogSearchPart.asp?KeyWord="+varkeyword+"&CatCatalog="+CatCatalog;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
   //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('yearsearch').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}
function getYearCatalog(CatCatalog)
{
   //alert(Rec_id);
   var strURL="findYearCatalog.asp?CatCatalog="+CatCatalog;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
   //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('yearsearch').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}
function getYears(Make)
{
   //alert(Make);
   var strURL="findYears.asp?Make="+Make;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
   //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('yeardiv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}

function getDoors(Make, Year)
{
   //alert(Make);
  // alert(Year);
   var strURL="findDoors.asp?Make="+Make+"&Year="+Year;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('doordiv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}

function getBodyStyle(Make, Year)
{
   alert(Make);
   alert(Year);
   var strURL="findBodyStyle.asp?Make="+Make+"&Year="+Year;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('bodystylediv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}

function getVehicleOption(Make, Year)
{
  // alert(Make);
   var strURL="findVehicleOption.asp?Make="+Make+"&Year="+Year;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('vehicleoptiondiv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}
/* new line -- do 2nd phase */
function getInteriorStyle(Make, Year)
{
   //alert(Make);
   //alert(Year);
   var strURL="findInteriorStyle.asp?Make="+Make+"&Year="+Year;
   //alert(strURL);
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    //alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('interiorstylediv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}

function getInteriorColor(Make, Year)
{
   alert(Make);
   var strURL="findInteriorColor.asp?Make="+Make+"&Year="+Year;
   alert (strURL);
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    alert(req.status);
	 //if (req.status == 200)
         //{
	    document.getElementById('interiorcolordiv').innerHTML=req.responseText;
	 //} else {
   	  // alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	// }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}

function getTransmission(Make, Year)
{
   //alert(Make);
   var strURL="findTransmission.asp?Make="+Make+"&Year="+Year;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('transmissiondiv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}
function getEngine()
{
   //alert(Make);
   var strURL="findEngine.asp?";
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"
    alert(req.status);
	 if (req.status == 200)
         {
	    document.getElementById('enginediv').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}

function getXMLHTTP()
{
var xmlhttp=null;
// code for Mozilla, etc.
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
// code for IE
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

return xmlhttp;
}









