﻿// JScript File

function sendData(salt)
			{
			
			try
			{
//////			alert('kartik');
//////                alert(document.Form1.cookie);
//////		
//////		//document.frm.sesnVal.value=document.cookie;
//////		
//////		document.Form1.sesnVal.value=document.Form1.cookie; 
//////		
			
              var roll_no1 = document.getElementById('ddlCourse');

	        if ((roll_no1.options[roll_no1.selectedIndex].text)=="--Select--")
	         {
	     
                             alert ("Select Course");
                             roll_no1.focus();
                               return false;
          
            }
     
   
              if (document.Form1.txtLogin.value == "")
    	       {
    		     alert("Enter Your Roll Number");
    		     document.Form1.txtLogin.focus();
    		     return (false);
        	 }
    
	         var numericExpression = /^[0-9a-zA-Z][0-9a-zA-Z][0-9]+$/;
	   if(!document.Form1.txtLogin.value.match(numericExpression)|| document.Form1.txtLogin.value.length<7)
	    {
		   alert("Enter Valid Roll Number of minimum 7 character");
		   document.Form1.txtLogin.focus(); 
		   return false;
		
	     }

              if (document.Form1.txtPWD.value == "")
    	       {
    		     alert(" Enter Your Password");
    		     document.Form1.txtPWD.focus();
    		     return (false);
	         } 
	         ///real one///////
	          //var aaas= /(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,12})$/;
	          /////////////////
	         // var aaas= /(?!^[0-9]*$)(?=.*[!@#$*])(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,12})$/;
	          //var aaas= /(?!^[0-9]*$)(?!^[!@#$*a-zA-Z]*$)^([!@#$*a-zA-Z0-9]{6,12})$/;
	         var aaas=/(?=^.{6,12}$)(?=.*\d)(?=.*[\!\@\#\$\*])((?=.*[A-Z])|(?=.*[a-z])).*$/;
	           if(!document.Form1.txtPWD.value.match(aaas))
	                   {
	                       // alert(" Password must be minimum 6 character and combination of  alphabets (A-Z )or(a-z)and numerics(0 to 9)");
	                       alert("Password must be 6 character long and should contain at least one alphabet(a-z or (A-Z)),one numeric digit (0-9) and one special character(!@#$*).");
	                        document.Form1.txtPWD.focus();
	                        return false;
	                   }
//	        var pwd=document.getElementById('txtPwd');
	         //var pwd=document.getElementById("<%=txtPWD.ClientID%>").value;
		if(document.Form1.txtPWD.value != "")
	     {
	      document.Form1.txtPWD.value = hex_md5(document.Form1.txtPWD.value);
	      document.Form1.txtPWD.value =document.Form1.txtPWD.value+salt;
		   //document.Form1.txtPWD.value = hex_md5(document.Form1.txtPWD.value+salt);
	    }
   }
           catch(err)
          {
                alert("Server is busy please try again after some time");
                return false;
                
          }
 }