function chkmember(frm)
{
	var cond=true;
	if (document.frm.fname.value.length==0){
		alert("Please Enter First Name.");
		if(cond==true){
		document.frm.fname.focus();
		}
		cond=false;
		return false;
	}
	if (document.frm.lname.value.length==0){
		alert("Please Enter Lastname.");
		if(cond==true){
		document.frm.lname.focus();
		}
		cond=false;
		return false;
	}
	if (document.frm.uname.value.length==0){
		alert("Please Enter username.");
		if(cond==true){
		document.frm.uname.focus();
		}
		cond=false;
		return false;
	}
	if (document.frm.email.value.length==0){
		alert("Please Enter Email Address.");
		if(cond==true){
		document.frm.email.focus();
		}
		cond=false;
		return false;
	}
	if(!checkMail(document.frm.email.value)){
		alert("Email must contain an email address.");
		if(cond==true){
			document.frm.email.focus();
		}
		cond=false;
		return false;
	}	
	if (document.frm.pwd.value.length==0){
		alert("Please Enter Password.");
		if(cond==true){
		document.frm.pwd.focus();
		}
		cond=false;
		return false;
	}
	if (document.frm.age.value.length==0 || isNaN(document.frm.age.value)){
		
		alert("Please Enter Proper Age.");
		if(cond==true){
		document.frm.age.focus();
		}
		cond=false;
		return false;
	}	
	
	if (document.frm.selectgender.value==""){
		alert("Please Select Gender.");
		if(cond==true){
		document.frm.selectgender.focus();
		}
		cond=false;
		return false;
	}
	if (document.frm.cellno.value.length==0)
	{
		alert("Please Enter Proper Mobile  Number.");
		if(cond==true){
		document.frm.cellno.focus();
		}cond=false;
		return false;
	}
	if(!IsNumericdate(document.frm.cellno.value))
	 {
		alert("Enter proper mobile number");
	    document.frm.cellno.value="";
		cond=false;
		return false;
	 }
	if (document.frm.country.value==""){
		alert("Please Select Country.");
		if(cond==true){
		document.frm.country.focus();
		}
		cond=false;
		return false;
	}
	return true;

}
function IsNumericdate(sText)
{
   var ValidChars = "0123456789 ";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}
function checkPhone(sText)
{
	var checkPhone=true;
	var Char;
	   var ValidChars = "0123456789";
	for(i = 0; i < sText.length &&  checkPhone== true; i++) 
      { 
	   if(i==3 || i==7)
	     i++;
		 
       Char = sText.charAt(i); 
        if (ValidChars.indexOf(Char) == -1) 
         {
           checkPhone = false;
		   return checkPhone;
         }
      }
	if(sText.length<12)
	 {
		     checkPhone=false;
	         return checkPhone;
	 }
	 if(sText.charAt(3)!='-' || sText.charAt(7)!='-')
	  {
			 checkPhone=false;
			 return checkPhone;
	  }
	
 return checkPhone;	
}
function checkMail(email){
var x = email;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)){
	return true;
	}
	else {
	  return false;
	}
}