function getKeyCode(e)
{
	if (window.event)
	   return window.event.keyCode;
	else if (e)
	   return e.which;
	else
	   return null;
}
function keyRestrict(e, validchars)
{
	var key='', keychar='';
	key = getKeyCode(e);
	if (key == null) return true;
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	validchars = validchars.toLowerCase();
	if (validchars.indexOf(keychar) != -1)
		return true;
	if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
		return true;
	return false;
}

function vadidation()
{   

function trim(str)
{
 
    return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
}

  
  if(trim(document.frm.fname.value) == "" )
   {
		 alert("Please Enter Name");
		 document.frm.fname.select();	
		 return false; 
   }
     if(trim(document.frm.mobile.value) == "" )
   {
		 alert("Please Enter Mobile No.");
		 document.frm.mobile.focus();	
		 return false; 
   }
 
     if(trim(document.frm.mobile.value) != "")
   {
        
     var nineMob = trim(document.frm.mobile.value);
	 var nine= nineMob.substr(0,1);        
 
      if(trim(document.frm.mobile.value).length < 10)
	  {
		 alert("Please Enter Valid Mobile No");
		  document.frm.mobile.value="";
		 document.frm.mobile.select();		
		 return false; 
	  }
	
   } 
		if(trim(document.frm.email.value) == "" )
     {
	 alert("E-mail id  Can't be blank");
     document.frm.email.select();
      return false;
      }  
     else
 {
       var val =document.frm.email.value;
       var bol=0; 
  for(var i=0;i<= val.length;i++)
  {
      if(val.charAt(i)=="@") 
        {
         bol=1;
         } 
		 if(val.charAt(i)==".") 
        {
         bol=2;
         }   
   }
  if(bol==0 )
   {
     alert("@  should be include in the E-mail id");
	  document.frm.email.value="";
     document.frm.email.focus();
     return false;
    }
        if(bol!=2)
      {
      alert(". should be include in the E-mail id");
 	  document.frm.email.value="";
      document.frm.email.focus();
      return false;
        }
   }
    if(trim(document.frm.vercode.value) == "" )
   {
		 alert("Please Enter Verification Code");
		 document.frm.vercode.select();	
		 return false; 
   }
 }

