﻿
   var IsAmpErr = "false";
   var IsDotErr = "false";
   var CIsAmpErr = "false";
   var CIsDotErr = "false";
 function verifyAgree(agreeField)
    {
        if (!agreeField.checked)
        {
            alert("In order to continue the unsubscribe process, please confirm that you do not wish to be contacted by the www.DestinationAccess.com program by checking the box on the form.");
            agreeField.focus();
            return false;
        }
        return true;
    }  
function ClientAmperEmailValidate(source, arguments)
       {
           
            var CharIdx = arguments.Value.indexOf("@",0);  
            if(CharIdx > 0)
                {
                    arguments.IsValid = true; 
                    IsAmpErr = "false";    
                }
            else
                {
                    arguments.IsValid = false;
                    IsAmpErr = "true";
                }    
               
            
       }
       
       function ClientDotEmailValidate(source, arguments)
       {
          if(IsAmpErr == "true")
            {
                arguments.IsValid = true;
                return; 
            }  
          var CharIdx = arguments.Value.indexOf(".",0);  
            if(CharIdx > 0)
                {
                    arguments.IsValid = true; 
                    IsDotErr = "false";
                }
            else
                {
                    arguments.IsValid = false;
                    IsDotErr = "true";
                }    
               
            
       }
       
       function ClientGeneralEmailValidate(source, arguments)
       {
          if(IsAmpErr == "true" || IsDotErr == "true")
            {
                arguments.IsValid = true;
                return; 
            }
           var reg1 = /^(\s*)[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z](\s*)$/; 
           if (reg1.test(arguments.Value)) 
           {
               arguments.IsValid = true; 
                 
           }
            else
                {
                    arguments.IsValid = false;
                     
                }    
             
            
       }
  