
function xmlHttpRequest_init()
{
	var oXMLHTTP=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		oXMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			oXMLHTTP = false;
			}
	}
	@end @*/

	// For Mozilla browsers
	if (!oXMLHTTP && typeof XMLHttpRequest!='undefined') {
		oXMLHTTP = new XMLHttpRequest();
	}

	return oXMLHTTP;
}

function changeList(item, model, id)
{
	var oXMLHTTP = xmlHttpRequest_init();

	if (oXMLHTTP) {
		// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
		// Due to security reason, the domain of the URL request destination must be 
		// the same as the one that serves up the page containing the script.
		var sURL = location.protocol + "//" + location.host + "/includes/createList.asp?make=" + escape(item) + "&model=" + escape(model) + "&id=" + id;
		oXMLHTTP.open("GET", sURL, true);

		// With IE browser, data are being cached in the client's system. 
		// Changing the header would allow the application to reset.
		oXMLHTTP.setRequestHeader('If-Modified-Since','Mon, 20 Nov 1995 00:00:01 GMT');

		// Execute the request
		oXMLHTTP.send(null);

		// Determine the state change status
		oXMLHTTP.onreadystatechange=function() {
		    if (oXMLHTTP.readyState==4 && oXMLHTTP.status == 200) {
				// alert (oXMLHTTP.responseText);
				document.getElementById("trimdiv"+id).innerHTML = oXMLHTTP.responseText;
				document.getElementById("slt"+id).style.width = "100px";
		    }
		}
    }
    else {
		// For users with browsers that don't support XMLHttpRequest Object
		var formObj = document.quoteform;

		eval('formObj.modellist'+id+'.value=modelArray[item]');
		formObj.action=formObj.referer.value;
		formObj.submit();
	}
}
