var xmlhttp = false;
try {
	xmlhttp = new XMLHttpRequest();
} 
catch (trymicrosoft) {
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} 
	catch (othermicrosoft) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (failed) {
			xmlhttp = false;
		}
	}
}
function GetModelByMake(str,page) {
	//alert("Initial Ready State is:"+xmlhttp.readyState);	
	page=page+"?function=GetModelByMake&themake="+str;
	alert(page);
	xmlhttp.onreadystatechange = RenderTheModel;
	xmlhttp.open("GET", page, true);
	xmlhttp.send(null);
}
function searchAJAX(ty) {
	//alert("Initial Ready State is:"+xmlhttp.readyState);
	var url="search.php";
	var qstring=document.getElementById("query2").value;
	if(qstring=="") qstring=" ";
	if(ty=="Reports")
		qstring=qstring+"&yr="+document.getElementById("ryr").value;
		
	url=url+"?qs="+qstring+"&tps="+ty;
	xmlhttp.onreadystatechange = myReturnMethod;
	xmlhttp.open("GET", url, true);
	xmlhttp.send(null);
}
function myReturnMethod() {
	//alert("New Ready State is:"+xmlhttp.readyState);
	if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
	 { 
		document.getElementById("mysearch").innerHTML=xmlhttp.responseText 
	 }
	 else{
		document.getElementById("mysearch").innerHTML="Loading ..."
	}
}
function RenderTheModel(){
	//alert("New Ready State is:"+xmlhttp.readyState);
	if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
	 { 
		document.getElementById("myModels").innerHTML=xmlhttp.responseText 
	 }
	 else{
		document.getElementById("myModels").innerHTML="Loading ..."
	}
}
function displayVehicles(str){
	window.location.href="display.php?model="+str;
}
function displayVehiclesbyMake(str){
	window.location.href="display.php?make="+str;
}