// JavaScript Document

function getSelectedTexts (select) {
  var r = new Array();
  for (var i = 0; i < select.options.length; i++)
    if (select.options[i].selected)
      r[r.length] = select.options[i].value;
  return r;
}



var xmlHttp;
function get_Make(select_Id)
{	


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="get_make.php";
url=url+"?year_with_make="+select_Id;
xmlHttp.onreadystatechange=stateChangedMake;
xmlHttp.open("post",url,true);
xmlHttp.send(null);

} 

function stateChangedMake() 
{ 
if (xmlHttp.readyState==4)
{ 
if(document.getElementById("make_show")!=null && document.getElementById("make_show")!=''){
document.getElementById("make_show").innerHTML=xmlHttp.responseText;
document.getElementById('mman').style.display="none";
}
}
}
///




function getModel(select_Id)
{	


xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  var year=document.getElementById("year").value;

var url="get_model.php";
url=url+"?make_select="+select_Id;
url=url+"&year="+year;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("post",url,true);
xmlHttp.send(null);

} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
if(document.getElementById("model")!=null && document.getElementById("model")!=''){
document.getElementById("model").innerHTML=xmlHttp.responseText;
document.getElementById('first').style.display="none";
}
}
}
////////////////////////////////



////////////




/////

function get_Sub(select_Id)
{	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="get_sub.php";
url=url+"?make_sub1="+select_Id;
xmlHttp.onreadystatechange=stateChangedYear11;
xmlHttp.open("post",url,true);
xmlHttp.send(null);

} 



function stateChangedYear11() 
{ 
if (xmlHttp.readyState==4)
{ 
if(document.getElementById("sub_model")!=null && document.getElementById("sub_model")!=''){
document.getElementById("sub_model").innerHTML=xmlHttp.responseText;
document.getElementById('four').style.display="none";

}
}
}





function get_endyear(select_Id)
{	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  var url1="get_end_year.php";
url1=url1+"?make_start="+select_Id;
xmlHttp.onreadystatechange=stateChangedYearend;
xmlHttp.open("post",url1,true);
xmlHttp.send(null);
}
  

function stateChangedYearend() 
{ 
if (xmlHttp.readyState==4)
{ 
if(document.getElementById("year_end")!=null && document.getElementById("year_end")!=''){
document.getElementById("year_end").innerHTML=xmlHttp.responseText;
document.getElementById('five').style.display="none";

}
}
}
///////cab////



function get_Cab(select_Id)
{	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  var year=document.getElementById('year').value;
  var make=document.getElementById('make').value;
  var url3="get_cab.php";
url3=url3+"?main_my="+select_Id;
url3=url3+"&year="+year;
url3=url3+"&make="+make;
xmlHttp.onreadystatechange=stateChangedcab;
xmlHttp.open("post",url3,true);
xmlHttp.send(null);
}

function stateChangedcab() 
{ 
if (xmlHttp.readyState==4)
{ 
if(document.getElementById("cab")!=null && document.getElementById("cab")!=''){
document.getElementById("cab").innerHTML=xmlHttp.responseText;
/*document.getElementById('six').style.display="none";*/

}
}
}
function get_Box(select_Id2)
{	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  var year=document.getElementById('year').value;
  var make=document.getElementById('make').value;
  
var url1="get_box.php";
  	url1=url1+"?mdl="+select_Id2;
	url1=url1+"&year="+year;
	url1=url1+"&make="+make;

xmlHttp.onreadystatechange=stateChangedbox;
xmlHttp.open("post",url1,true);
xmlHttp.send(null);
}

function stateChangedbox() 
{ 
if (xmlHttp.readyState==4)
{ 
if(document.getElementById("box")!=null && document.getElementById("box")!=''){
document.getElementById("box").innerHTML=xmlHttp.responseText;
/*document.getElementById('seven').style.display="none";*/

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


