//contactUs.js to handle the ajax for submitting the email form
//fShowDebug();
//fWriteDebug("loaded forms.js");
//error_reporting(0);
function sendFeedbackForm()
{
		//validate data
		var vRequiredArray = new Array("namo","email","comments");
		if(fCheckRequired(vRequiredArray))
		{
			//Hay your good.
		}
		else
		{
			return false;
		}
	//validate the data first
	var vDataString = "";
	vYourName = document.getElementById("namo").value;
	
	vAddress = document.getElementById("address").value;
	vCity = document.getElementById("city").value;
	vState = document.getElementById("state").value;
	vZip = document.getElementById("zip").value;
	
	var vContactPhone1 = document.getElementById("phone1").value;
	var vContactPhone2 = document.getElementById("phone2").value;
	var vContactPhone3 = document.getElementById("phone3").value;
	vContactPhone = "(" + vContactPhone1 + ") " + vContactPhone2 + "-" + vContactPhone3;
	
	vEmail = document.getElementById("email").value;
	
	vComments = document.getElementById("comments").value;
	
	vDataString = "contact_email="+vEmail+"&contact_name="+vYourName+"&address="+vAddress+"&city="+vCity+"&state="+vState+"&zip="+vZip+"&contact_phone="+vContactPhone+"&comments="+vComments;

    //send off to php
    fAJAXTransport(vDataString, "handleFeedbackFormReturn();", "php/ajax.php?action=ff");
}

function handleFeedbackFormReturn()
{
		//save was ok, grab the last insert id, the date created, refresh the topics index
		//alert("Your contact request has been successfully filed. We will get back to you as soon as possible!");
		//window.location = "index.php?show=responsePage&sub=contactUs";
		var vHTML = '\
				<tr>\
					<td class="blue">\
						<h2>Thank You for Your Feedback</h2>\
					</td>\
				</tr>\
		';
		document.getElementById('formish').innerHTML = vHTML;
}
