// JavaScript Document
function chkAppForm()
{
	var $tmpvar,$errlvl;
	$tmpvar = "";
	
	// Get email value and store it into variable
	$tmpvar = document.appointment.fromemail.value;
	
	//Start email validation
	$apos = $tmpvar.indexOf("@");
	$dotpos = $tmpvar.lastIndexOf(".");
	if ($apos == -1)
		{
			alert("Please enter a valid email address.");
			return false;
		}
	if ($dotpos == -1)
		{
			alert("Please enter a valid email address.");
			return false;
		}
	if (($apos < 1)||($dotpos - $apos < 2))
		{
			alert("Please enter a valid email address.");
			return false;
		}
	if ($tmpvar.length - $dotpos < 2)
		{
			alert("Please enter a valid email address.");
			return false;
		}
	
	// Start validtion of the rest of the form
	if (document.appointment.firstname.value == "")
		{
			alert("Please enter your first name.");
			return false;
		}
	if (document.appointment.lastname.value == "")
		{
			alert("Please enter your last name.");
			return false;
		}
	if ((document.appointment.workphone.value == "")&&(document.appointment.homephone.value == "")&&(document.appointment.cellphone.value == ""))
		{
			alert("Please enter a phone number.");
			return false;
		}
	if (!(document.appointment.dow1.checked)&&!(document.appointment.dow2.checked)&&!(document.appointment.dow3.checked)&&!(document.appointment.dow4.checked)&&!(document.appointment.dow5.checked)&&!(document.appointment.dow6.checked))
		{
			alert("Please check one of the boxes for Preferred Day.");
			return false;
		}
	return true;
}

