var xmlHttp = null;

function changeMakeAddcar()
{
	makeselect = document.getElementById('make');
	newValue = makeselect.value;
	
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(error)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(error)
		{
			xmlHttp = null;
		}
	}

	if(xmlHttp != null)
	{
		var data = "q=modelsformake&makeid=" + newValue;

		xmlHttp.open("POST", "model_functions.php", true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", data.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = makeChanged;
		xmlHttp.send(data);
	}
}

function makeChanged()
{
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200 || xmlHttp.status == 304)
		{
			resultdiv = document.getElementById('modeldiv');
			resultdiv.innerHTML = xmlHttp.responseText;
		}
	}
}
