try { 
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
} catch (e) { 
try { 
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} catch (E) { 
xmlhttp = false; 
} 
} 
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
xmlhttp = new XMLHttpRequest(); 
}

function showPage(inPage) {
	objID =	document.getElementById('maincontent');
	xmlhttp.open("GET", inPage);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			objID.innerHTML = xmlhttp.responseText;
		}
	};
	xmlhttp.send();
}

function swapImage(inID, inFile) {
	document.getElementById(inID).src = 'images/' + inFile;
}

function checkContact() {
	var verifyarray = ['fullname', 'city', 'state', 'email', 'subject', 'message'];
	var counter = 0;
	while (counter < verifyarray.length) {
		if (document.getElementById(verifyarray[counter]).value == "") {
			alert ("Plese fill out all required fields");
			counter = verifyarray.length;
			return false;
		}
		counter++;
	}
	return true;
}

function checkZip() {
	if (document.searchstore.zipcode.value == "") {
		alert ('Please enter a zipcode.');
		return false;
	}
	
	if (document.searchstore.zipcode.value.length > "5") {
		alert ('The zipcode must contain 5 numbers');
		return false;
	}
	
	if (document.searchstore.zipcode.value.length < "5") {
		alert ('The zipcode must contain 5 numbers');
		return false;
	}
	
	return true;
}