var xmlMHttp

function getModel(name,model,ntype)
{ 

xmlMHttp=GetXmlHttpObject();
if (xmlMHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="hlist.cfm";
url=url+"?n="+name;
url=url+"&m="+model;
url=url+"&t="+ntype;
url=url+"&sid="+Math.random();
xmlMHttp.onreadystatechange=callChanged;
xmlMHttp.open("GET",url,true);
xmlMHttp.send(null);

}

function callChanged() 
{ 

if (xmlMHttp.readyState==4 || xmlMHttp.readyState=="complete")
	{ 
	if(xmlMHttp.status==200){
	textmodels = xmlMHttp.responseText;
	document.getElementById("showmodels").innerHTML = textmodels;
	


	if(document.getElementById("Model").selectedIndex != 0)
	{
		//document.getElementById("Name").selectedIndex = 0;
	}else{
	document.getElementById("Model").selectedIndex = 0;
	}



	}
	}
}



function GetXmlHttpObject()
{
var xmlMHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlMHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlMHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlMHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlMHttp;
}



function showModels(name,model) {
	
	if(name != ""){
		
		getModel(name,model);
		
	}else{
		document.write("Please select a make");
	}
	
		
}
