// contactus page using this JS file

function contactValidation()
{	
missinginfo = "";
	
	document.cform.category.style.background = '#ffffff';
	document.cform.fname.style.background = '#ffffff';
	document.cform.email.style.background = '#ffffff';
	document.cform.comments.style.background = '#ffffff';
	document.cform.security_code.style.background = '#ffffff';
			
	if (document.cform.category.value == "")
	{
	document.cform.category.style.background = '#FF9999';
	missinginfo += "\n     - Please select any Category ";
	}
	
	if (document.cform.fname.value == "")
	{
	document.cform.fname.style.background = '#FF9999';
	missinginfo += "\n     - Please enter your Name ";
	}
	
	if (document.cform.email.value == "")
	{
	document.cform.email.style.background = '#FF9999';
	missinginfo += "\n     - Please enter your Email ";
	}
	
	if (document.cform.email.value != "")
	{
		var str=document.cform.email.value
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			if (filter.test(str))
			testresults=true
			else{
				document.cform.email.style.background = '#FF9999';
				missinginfo += "\n     - A valid email address is required ";	
		}
	}
			
	if (document.cform.comments.value == "")
	{
	document.cform.comments.style.background = '#FF9999';
	missinginfo += "\n     - Please enter your Comments ";
	}
	
	if (document.cform.security_code.value == "")
	{
	document.cform.security_code.style.background = '#FF9999';
	missinginfo += "\n     - Please enter Security Code ";
	}

	if (missinginfo != "") {
//missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
//missinginfo + "\n_____________________________" +
//"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

function chk_other_fld () {
if (document.cform.category_aboutus.value == "Other" || document.cform.category_aboutus.value == "Referral"){
	document.getElementById("other_source").style.display = "";
	document.cform.other_src.focus();
	}
else {
	document.getElementById("other_source").style.display = "none";
	}
}

