function processAjaxRequestData(responseText, responseStatus) {
	if (responseStatus==200) {
		clearForm();
		document.getElementById("contactMessage").innerHTML = "Thanks for contacting us.";//responseText;
	} else {
		//alert('There was an error retrieving the page: ' + responseStatus);
	}
}
function sendAjaxRequest(url, method){
	var path = url.split('?');
	url = path[0];
	var get = '';
	if(path.length > 1){
		get = path[1];
	}
	var myRequest = new ajaxObject(url, processAjaxRequestData);
	myRequest.update(get, method);
}
function HandleAjaxForm(form){
	
	if(checkContactUs(form)){
		var action = form.attributes.getNamedItem("action").value;
		var get = "";
		var append = "?";
		
		//if there's a ? then start with &
		if(action.indexOf("?") != -1){
			append = "&";
		}
		
		for (var n=0; n < form.elements.length; n++) {
		    get += append + form.elements[n].name + "=" + form.elements[n].value;
		    append = "&";
		}
		
		sendAjaxRequest(form.attributes.getNamedItem("action").value + get + "&to=mdepaolo@otpartners.com", 'POST');
		//sendAjaxRequest(form.attributes.getNamedItem("action").value + get + "&to=mstiles@otpartners.com", 'POST');
		sendAjaxRequest(form.attributes.getNamedItem("action").value + get + "&to=golf@libertynationalgc.com", 'POST');
		sendAjaxRequest(form.attributes.getNamedItem("action").value + get + "&to=sandydiamond@pgatourhq.com", 'POST');
		sendAjaxRequest(form.attributes.getNamedItem("action").value + get + "&to=JonathanWerbeck@pgatourhq.com", 'POST');
	}
}
