
function saveYear(Year)
{
 	//alert(Year);
   var strURL="/saveYear.php?Year="+Year;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"

	 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 getMakes(year)
{
	//alert("hello");
 	
	//alert(year);

   var strURL="/getMakes.php?year="+year;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"

	 if (req.status == 200)
         {
	    document.getElementById('make-ymm').innerHTML=req.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + req.statusText);
	 }
       }
      }
   req.open("GET", strURL, true);
   req.send(null);
   }
}
function getModels(year, MakeID)
{
	//alert(year);
 	//alert(MakeID);

   var strURL="/getModels.php?year="+year+"&makeID="+MakeID;
   var req = getXMLHTTP();
   if (req)
   {
     req.onreadystatechange = function()
     {
      if (req.readyState == 4)
      {
	 // only if "OK"

	 if (req.status == 200)
         {
	    document.getElementById('model-ymm').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;
}
