function validateForm()
{

if(document.frmsignup.emailid.value=="")
	{
	alert("Please enter Email Id.")
	document.frmsignup.emailid.focus();
	document.frmsignup.emailid.value=""
	return false;
	}
if (echeck(document.frmsignup.emailid.value)==false)
	{
	document.frmsignup.emailid.focus();
	document.frmsignup.emailid.value=""
	return false;
	}
if(document.frmsignup.pass.value=="")
	{
	alert("Please enter Password.")
	document.frmsignup.pass.focus();
	return false;
	}
if(document.frmsignup.cpass.value=="")
	{
	alert("Please enter Confirm Password.")
	document.frmsignup.cpass.focus();
	return false;
	}
if(document.frmsignup.pass.value!=document.frmsignup.cpass.value)
	{
	alert("Password and Confirm Password are not matching.")
	document.frmsignup.pass.focus();
	document.frmsignup.pass.value=""
	document.frmsignup.cpass.value=""
	return false;
	}
if(document.frmsignup.fname.value=="")
	{
	alert("Please enter the Name.")
	document.frmsignup.fname.focus();
	document.frmsignup.fname.value=""
	return false;
	}
if(document.frmsignup.city.value=="")
	{
	alert("Please enter City.")
	document.frmsignup.city.focus();
	return false;
	}
if(document.frmsignup.country.value=="Please Select")
	{
	alert("Please select Country.")
	document.frmsignup.country.focus();
	return false;
	}
if(document.frmsignup.phone.value=="")
	{
	alert("Please enter Phone No.")
	document.frmsignup.phone.focus();
	return false;
	}
//document.frmsignup.btnsubmit.value="Sign Up";
return true;

}





function echeck(str) {
  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)
  if (str.indexOf(at)==-1){
     alert("Invalid E-mail ID")
     return false
  }
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     alert("Invalid E-mail ID")
     return false
  }
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      alert("Invalid E-mail ID")
      return false
  }
   if (str.indexOf(at,(lat+1))!=-1){
      alert("Invalid E-mail ID")
      return false
   }
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      alert("Invalid E-mail ID")
      return false
   }
   if (str.indexOf(dot,(lat+2))==-1){
      alert("Invalid E-mail ID")
      return false
   }
   if (str.indexOf(" ")!=-1){
      alert("Invalid E-mail ID")
      return false
   }
   return true;
}

