﻿// JScript File

var ichars="~%^&*()+=[]\\\';/{}|\":<>?";

function __checkform()
        {     
            var postback = true;       
                   
            if (checkLoginID() == false)
            {
                postback = false;
                return false;
            }
            
            if (checkLoginPassword() == false)
            {
                postback = false;
                return false;
            }   
            
            if(postback == true)
            {
	            FullClearErrorMessage('error_div');
	            return true;
            }	
        }
        
       
        function checkLoginID()
	    {
		    var postback = true;	
            var theform;

            if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) 
               theform = document.forms["frm"];
            else
               theform = document.frm;		    
    		
            if (DivEmptyFieldValidation(theform.txtLoginId,'Please Enter Username','error_div') == false)
            {                
               postback = false;
            }
            else if(theform.txtLoginId.value.length>0)
            {
               for(var i=0;i<theform.txtLoginId.value.length;i++)
               {
                    var strLoginId=theform.txtLoginId.value;
                    if(ichars.indexOf(strLoginId.charAt(i)) != -1)
                    {
                        document.getElementById('error_div').innerHTML="<img src='images/warning.gif' border='0' alt=''>&nbsp;&nbsp;The box has special characters. \nThese are not allowed.\n";
                        postback = false;
                    }
               }                 
            }
            else
            {
                FullClearErrorMessage('error_div');   
            }
                 
		    if(postback == true)
		        return true;
		    else
		        return false;		
	    }        
        
         
        function checkLoginPassword()
	    {
		    var postback = true;	
            var theform;

            if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) 
               theform = document.forms["frm"];
            else
               theform = document.frm;
                   		
            if (DivEmptyFieldValidation(theform.txtPwd,'Please Enter Password','error_div') == false)
            {                
              postback = false;
            }
            else if(theform.txtPwd.value.length>0)
            {
              for(var i=0;i<theform.txtPwd.value.length;i++)
               {
                    var strPwd = theform.txtPwd.value;
                    if(ichars.indexOf(strPwd.charAt(i)) != -1)
                    {
                        document.getElementById('error_div').innerHTML="<img src='images/warning.gif' border='0' alt=''>&nbsp;&nbsp;The box has special characters. \nThese are not allowed.\n";
                        postback = false;
                    }
               }             
            }
            else
            {
              FullClearErrorMessage('error_div');   
            }                 
		    if(postback == true)
		        return true;
		    else
		        return false;		
	    }


function opendhtmlpopupUser(getId)
    {


        var Sample_Name = "Forgot Password";
        var retURL = 'ForgetPassword.aspx';    

        htmlpopupwindow = dhtmlmodal.open('Forgot Password', 'iframe', retURL, Sample_Name, 'width=700px,height=250px,left=210px,top=112px,resize=0,scrolling=0');    
        return false;
    } 
    
function CheckEmailLogin()
        {
            
            var theform;
		    var postback = true;
    				
		    if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) 
			    theform = document.forms["aspnetForm"];
		    else
			    theform = document.aspnetForm;
            
             
		    if (DivEmptyFieldValidation(document.getElementById('txtLoginId'),'Please Enter Login Id','error_div1')==false)
		    {
		       document.getElementById('txtLoginId').focus();
			    postback = false; 
			    return false;
		    }
    		
	        FullClearErrorMessage('error_div1');		
		    return true;
    		
      }

