function validateForm(contactFrm){

   var header = "The following fields are required.\n";
   var message = "";

  
   if(contactFrm.comments.value == ""){
   message += "* Brief Description.\n";
   contactFrm.comments.focus();

   }


   if(contactFrm.subject.value == ""){
   message += "* Job Title.\n";
   contactFrm.subject.focus();

   }

   if(contactFrm.company.value == ""){
   message += "* Company Name.\n";
   contactFrm.company.focus();

   }

   if(contactFrm.phone.value == "" || isNaN(contactFrm.phone.value)){
   message += "* Phone Number.\n";
   contactFrm.phone.focus();

   }


   if(contactFrm.email.value == "" || Email(contactFrm.email.value)){
   message += "* Email Address.\n";
   contactFrm.email.focus();

   }


   if(contactFrm.name.value == ""){
   message += "* First Name.\n";
   contactFrm.name.focus();

   }

  

   if(message != ""){
   alert(header + message);
   return false;

   }

}

function Email(str)
{
	{
		mail_count=0;
		mail_temp=0;
		mail_flag=0;
				 first_char=str.charAt(0);
				 if(!isNaN(first_char))
				 {
				      test=1;
				      alert("First Charter must be alphabets in Email id");
				      return true;
				 }
				 else
				 {
				       for(i=0;i<str.length;i++)
				       {
					    if(str.charAt(i)=='@')
					    {
					       mail_count++;
					    }
					   if(str.charAt(i)==',')
					    {
					      mail_temp++;
					    }
					    if(str.charAt(i)==' ')
					    {
						mail_temp++;
					     }
					    if(str.charAt(i)==';')
					    {
						mail_temp++;
					    }
					    if(str.charAt(i)==':')
					    {
						mail_temp++;
					     }
					     if(str.charAt(i)=='.')
					     {
					       mail_flag++;
					     }
					}//for loop (charter reader)
				       if(mail_count>1 || mail_temp>0)
				       {
					 alert("Invalid Email ID");
					 return true;
				       }
				       else
					   {
						if(mail_count==1 && mail_flag>0)
						{
						  test=0;
						  return false;
						 }
						 else
						 {
						   alert("invalid Email ID");
						    return true;
						  }
					      }
				     }
			     }
}
