String.prototype.isvalid = function(){
 return !!this.match(/^([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})@([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})\.([a-zA-Z]{2,4})$/)
}



function dropdown_validator() {

 if (document.form2.name.value=="") {
  alert("Please Enter Your Name.");
  return false;
 } 

 if (document.form2.phone.value=="") {
  alert("Please Enter Your Phone Number.");
  return false;
 }


else if (!document.form2.email.value.isvalid()) {
  alert("Please Enter A Valid Email Address.");
  return false;
 } else {
 return true;
 }



}



function contact_form_validator()
{
if (document.contact_form1.fname.value == "")
{
alert("Please enter your Name");
return false;
}

   //FOR CHECKING NULL VALUES IN EMAIL FIELD
  
  if((!document.contact_form1.email.value) || (document.contact_form1.email.value==""))
  {
    alert("Please Enter A Valid Email Address");
    return false;
  }  


  //FOR CHECKING VALIDITY OF E-MAIL ADDRESS

  var email=document.contact_form1.email.value;
  var email1="";var index2=-1;
  var index1=email.indexOf("@");
  if(index1!=-1)
  email1=email.substring(index1+1);
  if((email1.length)!=0)
  index2=email.indexOf(".");
  if(index1==-1 || index2==-1)
  {
    alert("Enter Valid Email address");
    document.contact_form1.email.value="";
    document.contact_form1.email.focus();
    return false;
  }
  email2=email.substring(index2+1)
	if(email2=="")
	  {
	   alert("Enter valid email address");
 	   document.contact_form1.email.focus()
	   return false;
	  }

	if (document.contact_form1.comments.value == "")
	{
	alert("Please enter your Comments");
	document.contact_form1.comments.focus();
	return (false);
	}
return (true);
}




String.prototype.isvalid = function(){
 return !!this.match(/^([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})@([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})\.([a-zA-Z]{2,4})$/)
}


/*
function dropdown_validator() {
 if (document.form1.fname.value=="") {
  alert("Please Enter Your First Name.");
  return false;
 } 


else if (!document.form1.email.value.isvalid()) {
  alert("Please Enter A Valid Email Address.");
  return false;
 } else {
 return true;
 }

}
*/

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=420,height=250,left = 376,top = 357');");
}


