function GetXmlHttpObject() {
	var xmlHttp;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {    
		try {
			// Internet Explorer
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
		}
	}
	return xmlHttp;
}

function ajax_it(file, containerID) {
	var xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null) {
		alert('Your browser does not support latest Javascript version, sorry.');
		return false;
	} else {
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4) { // indicates completed state
				//alert(xmlHttp.responseText);
				document.getElementById(containerID).innerHTML = xmlHttp.responseText;
			}
		}
	}
	xmlHttp.open('GET', file, true);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp.send(null);
}

function getModles(makeID) {
	var file = 'ajax_carver_boat_models.php?makeID=' + escape(makeID);
	if (categoriesArray.length > 0) {
		file += '&industryID[]=' + categoriesArray.join('&industryID[]=');
	}
	var xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null) {
		alert('Your browser does not support latest Javascript version, sorry.');
		return false;
	} else {
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4) { // indicates completed state
				var container = document.getElementById(containerID);
				container.style.display = 'block';
				urlMore = 'find_dealer.htm?zip=' + escape(zip);
				if (categoriesArray.length > 0) {
					urlMore += '&industryID[]=' + categoriesArray.join('&industryID[]=');
				}
				container.innerHTML = formatted_dealer_html(xmlHttp.responseText, urlMore);
				return false;
			}
		}
	}
	xmlHttp.open('GET', file, true);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp.send(null);
}