// JavaScript Document
function valida(thisform)
{
	var name=document.getElementById("name").value
	var email=document.getElementById("email").value
if (name=="" && email=="")
	{
      alert("All fields marked with (*) are required")
	  return false
	}
	else
	{
		  if (name=="")
		  {
			alert("Field name is required")
			return false
		  }

		  with (thisform)
		  {
			if (validate_email(email,"It's not a valid e-mail")==false)
			{
			 email.focus();
			 return false
			}
		  }			  
    }
	
}
function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos < 1 || dotpos-apos < 2) 
		{
		  alert(alerttxt);
		  return false
		}
		else
		 {
			return true
		 }
	}
}
