﻿   
   
 //Create Your Account
 
 function CreateNewAccValidation()
   	{
	if (document.getElementById("ctl00_ContentPlaceHolder1_txtUserName").value=='')
	    {
	        alert("Please Enter Email Id");
	        document.getElementById("ctl00_ContentPlaceHolder1_txtUserName").focus();
	        return false;
	    }
	    
   	  if (document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").value=='')
		        {
		            alert("Please Enter Password");
		            document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").focus();
		            return false;
		        }
	    var your = document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").value
        if (your.length<6)
	        {
	            alert("Password Field cannot be less than 6 Char.");
	            document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").focus();
	            return false;
	        }
	    var your = document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").value
            if (your.length>25)
	        {
	            alert("Password Field cannot be more than 15 Char.");
	            document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").focus();
	            return false;
	        }
	    var pass = document.getElementById("ctl00_ContentPlaceHolder1_txtPwd").value
	    var Confirm = document.getElementById("ctl00_ContentPlaceHolder1_txtConfirmPwd").value
            if (Confirm!=pass)
	        {
	            alert("Please enter the Confirm Password Correctly");
	            document.getElementById("ctl00_ContentPlaceHolder1_txtConfirmPwd").focus();
	            return false;
	        }
	         if (document.getElementById("ctl00_ContentPlaceHolder1_CmbQuestion").value=='')
            {
                alert("Security Question Cannot be blank");
                document.getElementById("ctl00_ContentPlaceHolder1_CmbQuestion").focus();
                return false;
            }
           
		  if (document.getElementById("ctl00_ContentPlaceHolder1_txtAnswer").value=='')
            {
                alert("Security Answer Cannot be blank");
                document.getElementById("ctl00_ContentPlaceHolder1_txtAnswer").focus();
                return false;
            }
             
		  }

   
  
   //CheckUserValidation
    function CheckUserValidation(ctlId)
        {

            if (document.getElementById(ctlId + 'txtSrchUser').value == '')
            {
                document.getElementById(ctlId + 'txtSrchUser').focus();
                alert("Pelase Enter Proper UserId");
                return false;
            }
        }
        
    //showAlert
    function showAlert(msg, url) {
        alert(msg);
        if (url != '') {
            redirectWindow(url);
        }
    }
        
    //redirectWindow
    function redirectWindow(url) {
        if (navigator.appName == 'Microsoft Internet Explorer') {
            location.href(url);
        }
        else if (navigator.appName == 'Netscape') {
            window.open(url, '_parent', 1);
            window.close();
        }
    }
    
    function Contact()
		   {
		      if (document.getElementById("ctl00_ContentPlaceHolder1_txtname").value=='')
		    {
		        alert("Full Name cannot be blank");
		        document.getElementById("ctl00_ContentPlaceHolder1_txtname").focus();
		        return false;
		    }
		     if (document.getElementById("ctl00_ContentPlaceHolder1_txtaddress").value=='')
		    {
		        alert("Address cannot be blank");
		        document.getElementById("ctl00_ContentPlaceHolder1_txtaddress").focus();
		        return false;
		    }
		     if (document.getElementById("ctl00_ContentPlaceHolder1_txtcity").value=='')
		    {
		        alert("City cannot be blank");
		        document.getElementById("ctl00_ContentPlaceHolder1_txtcity").focus();
		        return false;
		    }
		     if (document.getElementById("ctl00_ContentPlaceHolder1_txtcountry").value=='')
		    {
		        alert("Country cannot be blank");
		        document.getElementById("ctl00_ContentPlaceHolder1_txtcountry").focus();
		        return false;
		    }
		     var fl=0;
    		
			    if(document.getElementById("ctl00_ContentPlaceHolder1_txtMobile").value!='')
			    {
				    fl =1;
			    }
    		
                if (document.getElementById("ctl00_ContentPlaceHolder1_txtphone").value!='')
                  {
				    fl =1;
			        }
	 		        if (fl==0)
	 		        {
 				    alert("Please Enter any one of them ( Mobile No or Telephone No) ");
 				    document.getElementById("ctl00_ContentPlaceHolder1_txtphone").focus();
 				    return false; 
 				    }
		      if (document.getElementById("ctl00_ContentPlaceHolder1_txtemail").value=='')
		    {
		        alert("E-Mail Address cannot be blank");
		        document.getElementById("ctl00_ContentPlaceHolder1_txtemail").focus();
		        return false;
		    }
		   var msg = ''
		    if (document.getElementById("ctl00_ContentPlaceHolder1_txtemail").value!='')
	        {
	            regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ //new RegExp(pattern);
	                if (!regex.test(document.getElementById("ctl00_ContentPlaceHolder1_txtemail").value))
					        {
						        msg=msg + "Please enter a valid E-Mail Address,\nfor example : \n     yourname@domain.com  OR\n     yourid@yourdomain.co.in  OR\n     yourid.somname@domain.co.in\n "
						        alert(msg);
						        document.getElementById("ctl00_ContentPlaceHolder1_txtemail").focus();
						        return false;
					        } 
		    }
		     if (document.getElementById("ctl00_ContentPlaceHolder1_txtinquiry").value=='')
		    {
		        alert("Inquiry cannot be blank");
		        document.getElementById("ctl00_ContentPlaceHolder1_txtinquiry").focus();
		        return false;
		    }
		  }

		  function FriendValidate() {
		      var Id = 'ctl00_ContentPlaceHolder1_';
		      var intSucess = '1';

		      if (document.getElementById(Id + 'txtEmail').value == '') {
		          alert("E-Mail Address cannot be blank");
		          document.getElementById(Id + 'txtEmail').focus();
		          return false;

		      }
		      if (document.getElementById(Id + 'txtEmailF').value == '') {
		          alert("E-Mail Address cannot be blank");
		          document.getElementById(Id + 'txtEmailF').focus();
		          return false;

		      }
		      
		      var msg = ''
		      if (document.getElementById(Id + 'txtEmail').value != '') {
		          regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ //new RegExp(pattern);
		          if (!regex.test(document.getElementById(Id + 'txtEmail').value)) {
		              msg = msg + "Please enter a valid E-Mail Address,\nfor example : \n     yourname@domain.com  OR\n     yourid@yourdomain.co.in  OR\n     yourid.somname@domain.co.in OR\n     yourid@yourdomain.co.uk  OR\n     yourid.somname@domain.co.uk\n"
		              alert(msg);
		              document.getElementById(Id + 'txtEmail').focus();
		              return false;
		          }
		      }

		      var msg = ''
		      if (document.getElementById(Id + 'txtEmailF').value != '') {
		          regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ //new RegExp(pattern);
		          if (!regex.test(document.getElementById(Id + 'txtEmailF').value)) {
		              msg = msg + "Please enter a valid E-Mail Address,\nfor example : \n     yourname@domain.com  OR\n     yourid@yourdomain.co.in  OR\n     yourid.somname@domain.co.in OR\n     yourid@yourdomain.co.uk  OR\n     yourid.somname@domain.co.uk\n"
		              alert(msg);
		              document.getElementById(Id + 'txtEmailF').focus();
		              return false;
		          }
		      }
		      
		      if (document.getElementById(Id + 'txtName').value == '') {
		          alert("Full Name Cannot be blank");
		          document.getElementById(Id + 'txtName').focus();
		          return false;
		      }
		  
		  }

		  function Validate() {
		      var Id = 'ctl00_ContentPlaceHolder1_Registration1_';
		      var intSucess = '1';

		      if (document.getElementById(Id + 'txtEmail').value == '') {
		          alert("E-Mail Address cannot be blank");
		          document.getElementById(Id + 'txtEmail').focus();
		          return false;

		      }
		      var msg = ''
		      if (document.getElementById(Id + 'txtEmail').value != '') {
		          regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ //new RegExp(pattern);
		          if (!regex.test(document.getElementById(Id + 'txtEmail').value)) {
		              msg = msg + "Please enter a valid E-Mail Address,\nfor example : \n     yourname@domain.com  OR\n     yourid@yourdomain.co.in  OR\n     yourid.somname@domain.co.in OR\n     yourid@yourdomain.co.uk  OR\n     yourid.somname@domain.co.uk\n"
		              alert(msg);
		              document.getElementById(Id + 'txtEmail').focus();
		              return false;
		          }
		      }
                
              if (document.getElementById(Id + 'dvPassword').style.display != 'none') {
              
		          if (document.getElementById(Id + 'txtPwd').value == '') {
		              alert("Password Cannot be blank");
		              document.getElementById(Id + 'txtPwd').focus();
		              return false;
		          }
		     
		          var your = document.getElementById(Id + 'txtPwd').value
		          if (your.length < 6) {
		              alert("Password Field cannot be less than 6 Char.");
		              document.getElementById(Id + 'txtPwd').focus();
		              return false;
		          }
		          var your = document.getElementById(Id + 'txtPwd').value
		          if (your.length > 25) {
		              alert("Password Field cannot be more than 15 Char.");
		              document.getElementById(Id + 'txtPwd').focus();
		              return false;
		          }
		          var pass = document.getElementById(Id + 'txtPwd').value
		          var Confirm = document.getElementById(Id + 'txtConfirmPwd').value
		          if (Confirm != pass) {
		              alert("Please enter the Confirm Password Correctly");
		              document.getElementById(Id + 'txtConfirmPwd').focus();
		              return false;
		          }
		      
		      }
		      if (document.getElementById(Id + 'txtName').value == '') {
		          alert("Full Name Cannot be blank");
		          document.getElementById(Id + 'txtName').focus();
		          return false;
		      }

		      return true;
		  }

		  function Login() {

		      var Id = 'ctl00_ContentPlaceHolder1_LoginControl1_';
		      var intSucess = '1';

		      if (document.getElementById(Id + 'txtUserName').value == '') {
		          alert("E-Mail Address cannot be blank");
		          document.getElementById(Id + 'txtUserName').focus();
		          return false;

		      }
		      var msg = ''
		      if (document.getElementById(Id + 'txtUserName').value != '') {
		          regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ //new RegExp(pattern);
		          if (!regex.test(document.getElementById(Id + 'txtUserName').value)) {
		              msg = msg + "Please enter a valid E-Mail Address,\nfor example : \n     yourname@domain.com  OR\n     yourid@yourdomain.co.in  OR\n     yourid.somname@domain.co.in\n "
		              alert(msg);
		              document.getElementById(Id + 'txtUserName').focus();
		              return false;
		          }
		      }

		      if (document.getElementById(Id + 'txtLoginPwd').value == '') {
		          alert("Password Cannot be blank");
		          document.getElementById(Id + 'txtLoginPwd').focus();
		          return false;
		      }
		  }
		  
		  
		   function forgotpassword()
		   
		   {
		       if (document.getElementById("ctl00_ContentPlaceHolder1_txtEmailid").value == '')
		                    {
		                        alert("E-Mail Address cannot be blank");
		                        document.getElementById("ctl00_ContentPlaceHolder1_txtEmailid").focus();
		                        return false;
		                    }
		                   var msg = ''
		                   if (document.getElementById("ctl00_ContentPlaceHolder1_txtEmailid").value != '')
	                        {
	                            regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ //new RegExp(pattern);
	                            if (!regex.test(document.getElementById("ctl00_ContentPlaceHolder1_txtEmailid").value))
					                        {
						                        msg=msg + "Please enter a valid E-Mail Address,\nfor example : \n     yourname@domain.com  OR\n     yourid@yourdomain.co.in  OR\n     yourid.somname@domain.co.in\n "
						                        alert(msg);
						                        document.getElementById("ctl00_ContentPlaceHolder1_txtEmailid").focus();
						                        return false;
					                        } 
		                    }
   		  }