﻿// JScript File

    var theform;	
	if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) 
		theform = document.forms["aspnetForm"];
	else
		theform = document.aspnetForm;
			
			
    function ValidateNewForm()
	{	  
		var postback = true;	
			
        if (Validate_LoginID() == false)
            postback = false;
             
        if (Validate_NewPassword() == false)
            postback = false;  
            
        if (Validate_ConfirmPassword() == false)
            postback = false;     
            
        if (Validate_SecretQuestion() == false)
            postback = false;                      
            
        if (Validate_SecretAnswer() == false)
            postback = false; 
             
        if (Validate_FirstName() == false)
            postback = false;  
            
        if (Validate_LastName() == false)
            postback = false;         
            
        if (Validate_Address() == false)
            postback = false;                  
            
        if (Validate_Country() == false)
            postback = false; 
            
        if (Validate_Zip() == false)
            postback = false;

        if (Validate_Phone() == false)
            postback = false;
         
        if (Validate_Email() == false)
            postback = false; 
             
		if(postback == true)
		{
		   // alert("True");
		    return true;
		 }
		else
		{
		   // alert("False");
		    return false;		
		}
	}
	
	function Validate_LoginID()
	{
		var postback = true;	
		
        if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtLoginId,'Please Enter Login ID','div_error_loginID') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_loginID'); 
             
		if(postback == true)
		    return true;
		else
		    return false;		
	}
	
	
	
	function Validate_NewPassword()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtPassword,'Please Enter Password','div_error_password') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_password');  		
             
		if(postback == true)
		    return true;
		else
		    return false;	
	}

	function Validate_ConfirmPassword()
	{
        var postback = true;	
        
        if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtCnfPassword,'Enter Confirm Password','div_error_ConfirmPassword') == false)
            postback = false;
        else if (DivCompareTwoFieldValidation(theform.ctl00_cphMainBody_txtPassword,theform.ctl00_cphMainBody_txtCnfPassword,'Conf. Password Missmatch','div_error_ConfirmPassword') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_ConfirmPassword');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}	
	
	function Validate_SecretQuestion()
	{
        var postback = true;	
        
       if (DivDropDownSelectValidation(theform.ctl00_cphMainBody_drpSecretQuestion,'Select Secret Question','div_error_SecretQuestion') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_SecretQuestion');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}		
	
	function Validate_SecretAnswer()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtSecretAnswer,'Enter Secret Answer','div_error_SecretAnswer') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_SecretAnswer');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}	
	
	function Validate_FirstName()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtFirstName,'Please Enter First Name','div_error_FirstName') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_FirstName');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}		
	
	function Validate_LastName()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtLastName,'Please Enter Last Name','div_error_LastName') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_LastName');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}		
		
	function Validate_Address()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtAddress,'Please Enter Address','div_error_Address') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_Address');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}	
	
	function Validate_Country()
	{
        var postback = true;	
        
       if (DivDropDownSelectValidation(theform.ctl00_cphMainBody_drpCountry,'Please Select Country','div_error_Country') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_Country');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}
	
	function Validate_Zip()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtZip,'Enter ZipCode','div_error_Zip') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_Zip');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}	
	
	function Validate_Phone()
	{
        var postback = true;	
        
       if (DivEmptyFieldValidation(theform.ctl00_cphMainBody_txtPhone,'Enter Phone Number','div_error_Phone') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_Phone');  	
             
		if(postback == true)
		    return true;
		else
		    return false;
	}	
	
	function Validate_Email()
	{
        var postback = true;	
        
       if (DivEmailFieldValidation(theform.ctl00_cphMainBody_txtEmail,'Please Enter Email','div_error_Email') == false)
            postback = false;
        else
             ClearErrorMessage('div_error_Email');  
             
		if(postback == true)
		    return true;
		else
		    return false;
	}