//
function validate_required(field,alerttxt)
{
with (field)
  {

    	
    if (value==null|| value=="")
    {
    document.getElementById(name+"Error").innerHTML = alerttxt;
	return false;
    }
	
    else
    {
		
		    
		   if(name == "contactEmail"){
	                   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
                       if(reg.test(value) == false) {
                                 document.getElementById(name + "Error").innerHTML = 'Invalid Email Address';
                                  return false;
	                   }
            }
           return true;
    }
}
}


function validate_form(thisform)
{
	

document.getElementById("mailNotify").innerHTML = "";
/*** Clear all the error fields ***/
document.getElementById("contactNameError").innerHTML = "";
document.getElementById("contactEmailError").innerHTML = "";
document.getElementById("contactMessageError").innerHTML = "";



with (thisform)
  {

  if (validate_required(contactName,"Name must be filled out!")==false)
  {contactName.focus();return false;}

  if (validate_required(contactEmail,"Email must be filled out!")==false)
  {contactEmail.focus();return false;}


  if (validate_required(contactMessage,"Give us some suggestion!")==false)
  {contactMessage.focus();return false;}

  }
}




