 
// For footer date

var myDate = new Date();
var myYear = myDate.getFullYear();
 

// for form validation
function checkForm(contactForm)
{//description of function goes here
   	if(!checkText(contactForm.FromName,"Please Enter Your Name")){return false;}
   	if(!regExEmail(contactForm.FromMail)){return false;}
    if(!checkText(contactForm.eSubject,"Please Enter a subject")){return false;} 
	if(!checkText(contactForm.Comments,"Please Enter a comment")){return false;}
   return true; //returns true, unless there is a problem! 
}

function checkText(fObj,msg)
{//will take in a text and check for input
   if(fObj.value == "")
   {
	   alert(msg);
	   fObj.focus();
	   return false;
   }
  return true;	
}

function regExEmail(eObj)
{//Uses regular expression for email check
var rePattern = /^[a-zA-Z0-9\-]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;
 if(rePattern.test(eObj.value))
 {
 	return true;
 }else{
    alert("Please enter a valid email address");
	eObj.value = "";
	eObj.focus();
	return false;
 }
}
