function TryToSubmitContactUsForm()
{
	//1.	Validate input
	//2.	Submit via AJAX
	
	//1.
	if (document.ContactForm.Name.value == "")
	{
		ShowPopup("ERROR", "Please enter your name.");
		return false;
	}
	else if (!IsValidEmail(document.ContactForm.Email.value))
	{
		ShowPopup("ERROR", "Please enter a valid e-mail address.");
		return false;
	}
	else if (document.ContactForm.Comments.value == "")
	{
		ShowPopup("ERROR", "Please enter your comments.");
		return false;
	}
	else if (document.ContactForm.Captcha.value == "")
	{
		ShowPopup("ERROR", "Please enter the code in the box to the right.");
		return false;
	}
	
	//2.
	var Parameters = "SubmitContact=1" +
				"&Name=" + escape(document.ContactForm.Name.value) +
				"&Email=" + escape(document.ContactForm.Email.value) +
				"&Comments=" + escape(document.ContactForm.Comments.value) +
				"&Captcha=" + escape(document.ContactForm.Captcha.value);
	
	var MyAjax = new AjaxConnection("ajax/ajax_submit_contact.php", Parameters, "AfterTryToSubmitContactForm"); 
}


function AfterTryToSubmitContactForm(xml, text)
{
	if (text.length == 0)
	{
		//Do this for Google goal tracking.
		//pageTracker._trackPageview("/submit_contact_us_form.html");
		_gaq.push(['_trackPageview("/submit_contact_us_form.html")']);

		ShowPopup("Comments Sent", "Thank you, your comments have been received.");
	}
	else
		ShowPopup("ERROR", text);
}


function SetBackgrounds(elem)
{
	//1.	Remove background-color from all elements
	//2.	Add background-color to this element

	//1.
	//ClearBackgrounds();

	//2.
	elem.style.backgroundColor = "#FFFF99";
}


function ClearBackgrounds(MyForm)
{
	for(i = 0; i < MyForm.elements.length; i++)
		MyForm.elements[i].style.backgroundColor = "";
}

