  function validate()
      {
      	if(document.getElementById("uname").value=="")
          {
           alert("please provide user name");
           document.getElementById("uname").focus();
            document.getElementById("uname").select();
           return false;
          }
           
            if(document.getElementById("uname").value==null)
              {
	               alert("please provide user id");
	               document.getElementById("uname").focus();
	                document.getElementById("uname").select();
	               return false;
                 }
	          if(document.getElementById("uname").value.length==0) 
	          {
	           alert("please provide user name");
		   document.getElementById("uname").focus();
		    document.getElementById("uname").select();
	           return false;
	          }
	        
           if(document.getElementById("uname").value.length<4)
	            {
	             alert("User Name length shoud be atleast 4 characters.");
	             document.getElementById("uname").focus();
	             document.getElementById("uname").select();
	             return false;
          }
          if(document.getElementById("uname").value.length>15)
	  	            {
	  	             alert("User Name length shoud not be greater than 15 characters.");
	  	             document.getElementById("uname").focus();
	  	             document.getElementById("uname").select();
	  	             return false;
                           }
          if(document.getElementById("uname").value=="\t")
	          
	         {
	             alert("tab is not allowed in username");
		    		     document.getElementById("uname").focus();
		    		     document.getElementById("uname").select();
		    	             return false;     
	              }
	   if(document.getElementById("uname").value==" ")
	         {
	             alert("space is not allowed in username");
		    		     document.getElementById("uname").focus();
		    		     document.getElementById("uname").select();
		    	             return false;     
	              }
	   				 validChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.";
			        	ulen=document.getElementById("uname").value.length;	
		        	for (i = 0; i < ulen; i++) 
		               {	
		            	Char = document.getElementById("uname").value.charAt(i);
		        		if (validChars.indexOf(Char) == -1) 
		                       {
		                	alert("Special characters and spaces are not allowed in username");
		        			document.getElementById("uname").focus();
		        			document.getElementById("uname").select();
		        			return false;
		                       }			
                                }                      
       if(document.getElementById("pass").value=="")
           {
             alert("please provide password");
             document.getElementById("pass").focus();
             document.getElementById("pass").select();
             return false;
           }
           if(document.getElementById("pass").value.length<4)
	   	   	            {
	   	   	             alert("Password length shoud be atleast 4 characters.");
	   	   	             document.getElementById("pass").focus();
	   	   	             document.getElementById("pass").select();
	   	   	             return false;
                            }
       if(document.getElementById("pass").value.length>10)
	   	   	            {
	   	   	             alert("Password length shoud not be greater than 10 characters.");
	   	   	             document.getElementById("pass").focus();
	   	   	             document.getElementById("pass").select();
	   	   	             return false;
                            }
      if(document.getElementById("pass").value=="\t")
	         		{
	            		 alert("tab is not allowed in password");
		    		     document.getElementById("pass").focus();
		    		     document.getElementById("pass").select();
		    	             return false;     
	              }
	   			if(document.getElementById("pass").value==" ")
	         {
	             alert("space is not allowed in password");
		    		     document.getElementById("pass").focus();
		    		     document.getElementById("pass").select();
		    	             return false;     
	              }
	   				 passChar="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
			        	passlen=document.getElementById("pass").value.length;	
		        	for (i = 0; i < passlen; i++) 
		               {	
		            	Char = document.getElementById("pass").value.charAt(i);
		        		if (passChar.indexOf(Char) == -1) 
		                       {
		                	alert("Special characters and spaces are not allowed in password");
		        			document.getElementById("pass").focus();
		        			document.getElementById("pass").select();
		        			return false;
		                       }			
                                } 
         if(document.getElementById("confirm").value=="")
           {
             alert("please provide confirm password");
             document.getElementById("confirm").focus();
             return false;
           }
         var pw=document.getElementById("pass").value;
         var con=document.getElementById("confirm").value;
         if(pw!=con)
           {
            alert("password mismatch");
            document.getElementById("pass").value="";
            document.getElementById("confirm").value="";
            document.getElementById("pass").focus();
            return false;
           } 
           if(document.getElementById("name").value=="")
           {
            alert("please enter your name");
            document.getElementById("name").focus();
            return false;
           }
           var u = /^[0-9]*$/;
	   	 if (u.test(document.getElementById("name").value)) 
	   		 {
	         	alert("Please enter letter in the field");
	         	document.getElementById("fname").focus();
	         	document.getElementById("fname").select();
	         	return false;
	        }
          var str=document.getElementById("email").value;
				var at="@"
				var dot="."
				var lat=str.indexOf(at)
				var lstr=str.length
				var ldot=str.indexOf(dot)
				var InvalidChars="!#$%^&*()+|-=\[]{};':,/<>?`~";
				if (str.length<1)
				{		
					alert("Please enter email-id");	
					document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);
				}
				if (str.indexOf(at)==-1)
				{
				   	alert("Invalid email-id")
				   	document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				}
				if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
				{
				   	alert("Invalid email-id")
				   	document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				}
				if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
				{
				    	alert("Invalid email-id")
				    document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				}
				if (str.indexOf(at,(lat+1))!=-1)
				{
				   	alert("Invalid email-id")
				   	document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				}
				if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
				{
				   	alert("Invalid email-id")
				   	document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				}
				if (str.indexOf(dot,(lat+2))==-1)
				{
				   	alert("Invalid email-id")
				   	document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				}		
				if (str.indexOf(" ")!=-1)
				{
				   	alert("Invalid email-id")
				   document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);	
				} 		
				for (i = 0; i < str.length; i++) 
		    	{	
					Char = str.charAt(i);
					//alert("index"+ValidChars.indexOf(Char));
					if (InvalidChars.indexOf(Char) != -1) 
					{
						alert("Invalid email-id");
						document.getElementById("email").focus();
						document.getElementById("email").select();
						return(false);
					}			
		    	}
		
				if(str.length > 50)
	                 	       	{ 
		    		alert("Email must be less than ten characters!")
		    		document.getElementById("email").focus();
					document.getElementById("email").select();
					return(false);
                         	}
		 if(document.getElementById("mob").value=="")
               {
                alert("please enter your Contact No");
                document.getElementById("mob").focus();
                return false;
               }
              if(document.getElementById("mob").value!=="")
               {
                	var m=document.getElementById("mob").value;
                	if(isNaN(m))
                 {
                  	alert("Please provide valid no")
                  	document.getElementById("mob").focus();
                  	return false;
                 }
                 if(document.getElementById("mob").value.length<10)
                 {
                 	alert("Please provide 10 digit contact no")
                  	document.getElementById("mob").focus();
                  	return false;
                 }
                 if(document.getElementById("mob").value.length>10)
                 {
                 	alert("Please provide 10 digit contact no")
                  	document.getElementById("mob").focus();
                  	return false;
                 }
              else
                 {
                  document.getElementById("mob").focus();
                 }
				}
			if(document.getElementById("code").value=="")
           {
	       alert("please enter verfication code");
	       document.getElementById("code").focus();
	       return false;
           }
           if(document.getElementById("code").value!=="")
           {
           		var n=document.getElementById("code").value;
           		if(n.indexOf("-")==-1)
           		{
           			alert("please provide valid code");
           			document.getElementById("code").focus();
           			return false;
           		}
           }
           if(!document.form.subscription[0].checked && !document.form.subscription[1].checked&& !document.form.subscription[2].checked)
           {
             alert("Please select one option for subscription");
             document.getElementById("subscription").focus();
             return false;
           }
    }
    	function popup1()
    	{
    		objcall=window.open("active.html","win", "height=240,width=400,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,status=no");
    		objcall.moveTo(screen.width/2,screen.height/2);
    	}
    	function popup2()
    	{
			objcall=window.open("basic.html", "win", "height=240,width=400,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,status=no");
			objcall.moveTo(screen.width/2,screen.height/2);
    	}
    	function popup3()
    	{
			objcall=window.open("freeuser.html", "win", "height=200,width=200,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,status=no");
			objcall.moveTo(screen.width/2,screen.height/2);
    	}