﻿
       // Validates empty strings
       function ClientValidate(source, arguments)
       {
          if (arguments.Value == '')
          {
            arguments.IsValid = false;
            }
          else
          {
            arguments.IsValid = true;
          }
       }
       // Validates empty strings
       function ClientValidateSEARCHSITE(source, arguments)
       {
          if (arguments.Value == 'SEARCH SITE')
            arguments.IsValid = false;
          else
            arguments.IsValid = true;
       }
       
       // Validates contact us drop down
       function CheckDropDown(source,arguments)
       {
           if (arguments.Value == '-')
             arguments.IsValid = false;
           else
             arguments.IsValid = true;
       }
       
       // Validates text box length
       function CheckLength(source,arguments)
       {
           if (arguments.Value.length > source.MaximumLength)
           {
            arguments.IsValid = false;
           }else{
            arguments.IsValid = true;
           }
       }
              
       function CheckContent(source,arguments)
       {
           var reg = new RegExp("[^\\w\\s.\"@',&/?-]");
           
           if (reg.test(arguments.Value) == true)
           {
            arguments.IsValid = false;
           }else{
            arguments.IsValid = true;
           }
       }
       
       function CheckString(source,arguments)
       {
           var reg = new RegExp("[^\\w\\s.\"@',&/?-`!)(:]$");
           
           if (reg.test(arguments.Value) == true)
           {
            arguments.IsValid = false;
           }else{
            arguments.IsValid = true;
           }
       }



       // Validates e-mail addresses
       function CheckEmail(source, arguments) {
           var reg = new RegExp("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");

           if (reg.test(arguments.Value) == true) {
               arguments.IsValid = true;
           } else {
               arguments.IsValid = false;
           }
       }
       
       
       // Validates contact us drop down
       function CheckDropDown(source,arguments)
       {
           if (arguments.Value === '-')
             arguments.IsValid = false;
           else
             arguments.IsValid = true;
       }
       
       // Validates text box length
       function CheckLength(source,arguments)
       {
           if (arguments.Value.length > source.MaximumLength)
           {
            arguments.IsValid = false;
           }else{
            arguments.IsValid = true;
           }
       }

       function CheckContent(source, arguments) {
           var reg = new RegExp("[^\\w\\s.\"@',&/?-]");

           if (reg.test(arguments.Value) == true) {
               arguments.IsValid = false;
           } else {
               arguments.IsValid = true;
           }
       }

      
       function CheckTelephone(source,arguments)
       {
           var reg = new RegExp("^[+]*[0-9]+$");
       
       if (reg.test(arguments.Value) == true)
           {
            arguments.IsValid = true;
           }else{
            arguments.IsValid = false;
           }
       }
       //Replaces the image search with white background
        function doClear(element){
            if(element.value == ''){
            element.style.background = '#FFFFFF';
            }
        }
      
      function doClearMsg(strObjId)
        {
         if (strObjId.value === "type your e-mail address here")
            {
                strObjId.value = "";
            }
        }

        
