function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

var http = createRequestObject(); 

function getModels(id){


	http.open('get', 'http://www.fquick.com/tools/makemodel.php?make=' + id);
	http.onreadystatechange = handleModels; 
	http.send(null);
}

function getModelsSearch(id){


	http.open('get', 'http://www.fquick.com/tools/makemodel.php?advsearch=1&make=' + id);

	http.onreadystatechange = handleModels; 

	http.send(null);
}

function getModelsEdit(make, model, year){

	http.open('get', 'http://www.fquick.com/tools/makemodel.php?make=' + make + '&model=' + model + '&year=' + year);

	http.onreadystatechange = handleModels; 

	http.send(null);

}

/* Function called to handle the list that was returned from the internal_request.php file.. */
function handleModels(){

	if(http.readyState == 4){ //Finished loading the response
		var response = http.responseText;
		document.getElementById('makemodel').innerHTML = response;
	}
}