

//create ajax object
function ajax() {
	var xml_http=false;
	try {
		xml_http = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xml_http = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xml_http = false;
		}
	}
	if (!xml_http && typeof XMLHttpRequest!='undefined') {
		xml_http = new XMLHttpRequest();
	}
	return xml_http;
}


//verify email
function check_email_address(email) {
	xml_http = ajax();
	if (xml_http) {
		url = encodeURI("./mail/validate.php?email="+email);
		xml_http.open("GET",url,true);
		xml_http.onreadystatechange=function() {
			if (xml_http.readyState == 4) {
				if (xml_http.responseText != "valid") {
					alert("Please verify that your email address is entered correctly.");
					document.getElementById('Contact0Email').focus();
					document.getElementById('Submit').disabled = true;
				}
				else {
					document.getElementById('Submit').disabled = false;
				}
			}
		}
		xml_http.send(null);
	}
}




