////////////////VALIDATE MESSAGE SENT FROM contact.htm

function validMsg(frm)
	{
	//declare variables and assign values	
	
	var vEmail = frm.txtEmail.value;
	var vFName = frm.txtFirstName.value;
	var vLName = frm.txtLastName.value;
	
	var vComments = frm.txtComments.value;
	
	//END declaring variables
	
	//check that the fields are not empty
	
	////Check Email Address 

		if (vEmail =="" || vEmail =="  ")
			{
			alert("Please enter your Email Address")
			frm.txtEmail.focus()
			return false
			}

	  //////Check Email Address format
			
		var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/   
	
		if (re.test(vEmail)) 
			{
	    }
		else
			{
	    	alert("Email Address is invalid"+ '\r ' + '\r' + "Please enter email address in the following format: address@hostname.com")
	    	frm.txtEmail.focus()
	    	frm.txtEmail.select()
	    	return false
	    }
	 //////END checking email format
	 
	////END checking email address
	
	//// Check the first name
	
		if (vFName =="" || vFName =="  ")
			{
			alert("Please enter your First Name")
			frm.txtFirstName.focus()
			return false
			}
	////END checking the first name
	
	////Check the last name		

		if (vLName =="" || vLName =="  ")
			{
			alert("Please enter your Last Name")
			frm.txtLastName.focus()
			return false
			}
			
  ////END checking the last name
  
  ////Check comment

		if (vComments =="" || vComments =="  ")
			{
			alert("Please enter your Comments")
			frm.txtComments.focus()
			return false
			}
	
	////END checking comment

  //END checking empty fields
	

}
//////////////////////////END VALIDATING MESSAGE SENT FROM contactus.asp
