﻿
   var IsAmpErr = "false";
   var IsDotErr = "false";
   var CIsAmpErr = "false";
   var CIsDotErr = "false";

   
 function verifyAgree(agreeField)
    {
        if (!agreeField.checked)
        {
            alert("Please confirm that you do not wish to be contacted by Bristol-Myers Squibb & Gilead Sciences, LLC or their subsidiaries and affiliates.");
            agreeField.focus();
            return false;
        }
        return true;
    }  
    function checkDisclaimer(disclaimerField)
    {
        if (!disclaimerField.checked)
        {
            alert("Please confirm that you are 18 years of age or older and a resident of the United States.");
            disclaimerField.focus();
            return false;
        }
        return true;
    }  
    function checkCertification(certificationField)
    {
        if(!certificationField.checked)
        {
            alert("Please certify that you are a U.S. healthcare professional.");
            certificationField.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;
                     
                }    
             
            
       }