function validate()
{
var txtemail1 = document.getElementById("email").value  
     var re=new RegExp(/^[a-z0-9._-]+@[a-z0-9-]+\.[a-z.]{2,5}$/i);
  if (txtemail1 == "")
  { 
  
   alert("Please enter your email address");
   document.getElementById('email').focus();
   return false;
  }
  if (txtemail1.length > 0)
  {
   if(!re.test(txtemail1))
   {
    alert("Please enter valid email address.");
    document.getElementById('email').focus();
    return false;
   }
  }		
if(document.form1.uname.value == "")
{
alert("Please enter username");
document.form1.uname.focus();
return false;
}
if(document.form1.uname.value.length < 3 || document.form1.uname.value.length > 20 )
{
alert("Username should be between 3 - 20 characters");
document.form1.uname.focus();
return false;
}
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(document.form1.uname.value))
	{
	alert("Username cannot contain illegal characters");
	document.form1.uname.value = '';
	document.form1.uname.focus();
	return false;
}
if(document.form1.pwd.value == "")
{
alert("Please enter password");
document.form1.pwd.focus();
return false;
}
if(document.form1.pwd.value.length < 6 || document.form1.pwd.value.length > 20 )
{
alert("Password should be between 6 - 20 characters");
document.form1.pwd.focus();
return false;
}
if(document.form1.cpwd.value == "")
{
alert("Please enter confirm password");
document.form1.cpwd.focus();
return false;
}
if(document.form1.cpwd.value.length < 6 || document.form1.cpwd.value.length > 20 )
{
alert("Confrim password should be between 6 - 20 characters");
document.form1.cpwd.focus();
return false;
}
if(document.form1.pwd.value != document.form1.cpwd.value)
{
alert("Your passwords doesn't match");
document.form1.cpwd.focus();
return false;
}
if(document.form1.loc.value == "")
{
alert("Please enter location");
document.form1.loc.focus();
return false;
}
if(document.form1.security_code.value == "")
{
alert("Please enter verify code");
document.form1.security_code.focus();
return false;
}

 var terms=document.form1.terms.checked;
	  if(!terms)
	  {
		 alert("please check terms and conditions"); 
		 return false;
	  }  
  
}
 function ShowGenBlock(_169){var id=document.getElementById(_169);

id.style.display="block";}