




function ConferenceUser()
{

 var x,y
 var userid;
 // user name validation
 if (document.Form.dnn_txtusername.value <=null) {
      	alert("Please enter name !");
      	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
      	return false;
}
}






function Search()
{
document.aspnetForm.ctl00_tt1.value="";
}
function SearchValidation()
{
     if (document.Form.dnn_tt1.value <=null)
      {
      	alert("Please enter search criteria !");
      	document.Form.dnn_tt1.focus();
	    document.Form.dnn_tt1.select();
      	return false;
      }
     else
     {
          return true;
     }
}
function forgot()
{

 var x,y
 var userid;
 // user name validation
 if (document.Form.dnn_txtusername.value <=null) {
      	alert("Please enter user name !");
      	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
      	return false;
}
y = isNaN(document.Form.dnn_txtusername.value);
if(y==false)  {
	alert("Please enter user id in characters !");
	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
	return false;
}
if (document.Form.dnn_txtusername.value!="" ) {
	userid=isPropervalueswhitespace(document.Form.dnn_txtusername.value)
	if(userid==false) {
	   alert("Please do not enter white space[s] or special characters in user name!")
	   document.Form.dnn_txtusername.focus();
	   document.Form.dnn_txtusername.select();
	   return false;
	 }

  }
  else
  {
    return true;
  }
}


function survey()
{

if (document.Form.dnn_txtSurveyName.value <=null) {
      	alert("Please enter survey name !");
      	document.Form.dnn_txtSurveyName.focus();
	    document.Form.dnn_txtSurveyName.select();
      	return false;
      	}
      	if (document.Form.dnn_txtQuestion.value <=null) {
      	alert("Please enter question !");
      	document.Form.dnn_txtQuestion.focus();
	    document.Form.dnn_txtQuestion.select();
      	return false;
      	}
      
      	if(document.Form.dnn_ddlQuestionType.options[document.Form.dnn_ddlQuestionType.selectedIndex].innerText == "Multiple Choice")
      	{      	 
      	        if (document.Form.dnn_txtMAns1.value <=null) {
      	            alert("Please enter first answer !");
                	document.Form.dnn_txtMAns1.focus();
	                document.Form.dnn_txtMAns1.select();
      	            return false;
      	        }
      	       
      	         
      	}
//      	if(document.Form.dnn_ddlQuestionType.options(2).value==2)
//      	{
//      	alert('hi');
//      	        if (document.Form.dnn_txtMAns1.value <=null) {
//      	            alert("Please enter answer !");
//                	document.Form.dnn_txtMAns1.focus();
//	                document.Form.dnn_txtMAns1.select();
//      	            return false;
//      	        }
//      	       
//      	}
//      	if(document.Form.dnn_ddlQuestionType.options(3).value==3)
//      	{
//      	          
//      	        if (document.Form.dnn_FileUpload1.innerHTML<=null) {
//      	            alert("Please browse document !");
//                	document.Form.dnn_FileUpload1.focus();
//	                document.Form.dnn_FileUpload1.select();
//      	            return false;
//      	        }
//      	       
//      	}
      	
      	return true;

}
function poll()
{

if (document.Form.dnn_txtPollName.value <=null) {
      	alert("Please enter poll name !");
      	document.Form.dnn_txtPollName.focus();
	    document.Form.dnn_txtPollName.select();
      	return false;
      	}
      	if (document.Form.dnn_txtQuestion.value <=null) {
      	alert("Please enter question !");
      	document.Form.dnn_txtQuestion.focus();
	    document.Form.dnn_txtQuestion.select();
      	return false;
      	}      	 
        if(document.Form.dnn_ddlQuestionType.options[document.Form.dnn_ddlQuestionType.selectedIndex].innerText == "Multiple Choice")
      	{
      	      
      	        if (document.Form.dnn_txtMAns1.value <=null) {
      	            alert("Please enter first answer !");
                	document.Form.dnn_txtMAns1.focus();
	                document.Form.dnn_txtMAns1.select();
      	            return false;
      	        }
      	       
      	}
      	else
      	{    
      	
      	return true;
      	}

}

function category()
{
if (document.Form.dnn_txtCatName.value <=null) {
      	alert("Please enter category name !");
      	document.Form.dnn_txtCatName.focus();
	    document.Form.dnn_txtCatName.select();
      	return false;
      	}
      	else
      	{    
      	
      	return true;
      	}
}

function product()
{
        if (document.Form.dnn_txtProdName.value <=null) {
      	alert("Please enter product name !");
      	document.Form.dnn_txtProdName.focus();
	    document.Form.dnn_txtProdName.select();
      	return false;
      	}
      	if (document.Form.dnn_txtProdDesc.value <=null) {
      	            alert("Please enter product description !");
                	document.Form.dnn_txtProdDesc.focus();
	                document.Form.dnn_txtProdDesc.select();
      	            return false;
      	        }
      	         if (document.Form.dnn_txtProdPrice.value <=null) {
      	         
      	            alert("Please enter product price !");
                	document.Form.dnn_txtProdPrice.focus();
	                document.Form.dnn_txtProdPrice.select();
      	            return false;
      	        }
      	      if (isNaN(document.Form.dnn_txtProdPrice.value)==true)
      	       { 
      	       alert('Please enter only number!');
      	       return false;
      	        }
      	else
      	{        	
      	return true;
      	}
}

function newsletter()
{

document.Form.dnn_Msg.value= document.getElementById('textarea1').value;
if (document.Form.dnn_txtSubject.value <=null) {
      	alert("Please enter subject !");
      	document.Form.dnn_txtSubject.focus();
	    document.Form.dnn_txtSubject.select();
      	return false;
      	}  	  	
        return true;	
       
      	//var chkBoxList = document.getElementById(cbControl);
      
       
}
function AgencyMember()
{
     if (document.Form.dnn_txtAgencyName.value <=null) {
      	alert("Please enter agency name !");
      	document.Form.dnn_txtAgencyName.focus();
	    document.Form.dnn_txtAgencyName.select();
      	return false;
      	}
      	return AgencyMember1();
      	//second member
      	if (document.Form.dnn_txtUserName2.value!="")
      	{   
           return AgencyMember2();
      	}
   
}
////////////////////////////////////validations for agency memebers//////////////////////////////
function AgencyMember1()
{
 var x,y
 var userid;
 

 
  // user name validation
 if (document.Form.dnn_txtUserName1.value <=null) {
      	alert("Please enter user name for first memeber !");
      	document.Form.dnn_txtUserName1.focus();
	document.Form.dnn_txtUserName1.select();
      	return false;
}
y = isNaN(document.Form.dnn_txtUserName1.value);
if(y==false)  {
	alert("Please enter user id in characters !");
	document.Form.dnn_txtUserName1.focus();
	document.Form.dnn_txtUserName1.select();
	return false;
}
if (document.Form.dnn_txtUserName1.value!="" ) {
	userid=isPropervalueswhitespace(document.Form.dnn_txtUserName1.value)
	if(userid==false) {
	   alert("Please do not enter white space[s] or special characters in user name!")
	   document.Form.dnn_txtUserName1.focus();
	   document.Form.dnn_txtUserName1.select();
	   return false;
	 }

}
 
    //password validation
if (document.Form.dnn_txtPassword1.value <=null) {
      	alert("Please enter password for first member!");
      	document.Form.dnn_txtPassword1.focus();
      	document.Form.dnn_txtPassword1.select();
      	return false;
        }
      
        if (document.Form.dnn_txtPassword1.value!="" ) {
      	userid=isPropervalueswhitespace(document.Form.dnn_txtPassword1.value)
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !")
      	   document.Form.dnn_txtPassword1.focus();
      	   document.Form.dnn_txtPassword1.select();
      	   return false;
      	 }
}
 

   //confirm password validation
if (document.Form.dnn_txtConPassword1.value <=null) {
      	alert("Please enter confirm password for first member!");
      	document.Form.dnn_txtConPassword1.focus();
      	document.Form.dnn_txtConPassword1.select();
      	return false;
        }
      
        if (document.Form.dnn_txtConPassword1.value!="" ) {
      	userid=isPropervalueswhitespace(document.Form.dnn_txtPassword1.value)
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !")
      	   document.Form.dnn_txtConPassword1.focus();
      	   document.Form.dnn_txtConPassword1.select();
      	   return false;
      	 }
}
     
     
     //first name validation
      if (document.Form.dnn_txtFName1.value <=null) {
      	alert("Please enter first name for first member!");
      	document.Form.dnn_txtFName1.focus();
	    document.Form.dnn_txtFName1.select();
      	return false;
}

//last name validation
      if (document.Form.dnn_txtLName1.value <=null) {
      	alert("Please enter last name for first member!");
      	document.Form.dnn_txtLName1.focus();
	document.Form.dnn_txtLName1.select();
      	return false;
}
      //email validation        
      
if (document.Form.dnn_txtEmail1.value <=null) {
	alert("Please enter email address for first member!");
	document.Form.dnn_txtEmail1.focus();
	document.Form.dnn_txtEmail1.select();
	return false;
}
     
     
if (document.Form.dnn_txtEmail1.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtEmail1.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtEmail1.focus();
		document.Form.dnn_txtEmail1.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtEmail1.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtEmail1.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtEmail1.focus();
		document.Form.dnn_txtEmail1.select();
		return false;
	}

}

//////// re enter email validation
if (document.Form.dnn_txtRmail1.value<=null) {
	alert("Please re enter email address for first member!");
	document.Form.dnn_txtRmail1.focus();
	document.Form.dnn_txtRmail1.select();
	return false;
}
     
     
if (document.Form.dnn_txtRmail1.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtRmail1.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtRmail1.focus();
		document.Form.dnn_txtRmail1.select();
		 return false;
	 }

}     
if (document.Form.dnn_txtRmail1.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtRmail1.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtRmail1.focus();
		document.Form.dnn_ttxtRmail1.select();
		return false;
	}

}
//matching two emails

var  emailmatch = matchpassword(document.Form.dnn_txtEmail1.value,document.Form.dnn_txtRmail1.value)

  	  if(emailmatch==false)
  	  {
  	    alert("Mismatch Email Ids!")
        	document.Form.dnn_txtRmail1.focus();
          document.Form.dnn_txtRmail1.select();
        	return false;
  	  }
  
  //address1 validation
	
	 if (document.Form.dnn_txtAddress11.value <=null) {
	         	alert("Please enter address1 for first member!");
	         	document.Form.dnn_txtAddress11.focus();
	      		document.Form.dnn_txtAddress11.select();
	         	return false;
	            }
	       if (document.Form.dnn_txtAddress11.value!="" ) {
	         	userid=isPropervalues(document.Form.dnn_txtAddress1.value)
	         	if(userid==false) {
	         	   alert("Please do not enter special characters in address1!")
	         	   document.Form.dnn_txtAddress11.focus();
	         	   document.Form.dnn_txtAddress11.select();
	         	   
	         	   return false;
	         	 }
	      
	       }  
	       
	                //Phone Number validation
      if (document.Form.dnn_txtPhoneNumber1.value <=null) {
      	alert("Please enter phone number !");
      	document.Form.dnn_txtPhoneNumber1.focus();
	document.Form.dnn_txtPhoneNumber1.select();
      	return false;  
	     } 
	     if (document.Form.dnn_txtJurisdiction1.value <=null) {
      	    alert("Please enter jurisdiction !");
      	    document.Form.dnn_txtJurisdiction1.focus();
	        document.Form.dnn_txtJurisdiction1.select();
      	       return false;  
	     }
	     else
	     {
	       return true;  
	   }
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//second member validations
function AgencyMember2()
{
 var x,y
 var userid;
 

 
  // user name validation
 if (document.Form.dnn_txtUserName2.value <=null) {
      	alert("Please enter user name for second memeber !");
      	document.Form.dnn_txtUserName2.focus();
	document.Form.dnn_txtUserName2.select();
      	return false;
}
y = isNaN(document.Form.dnn_txtUserName2.value);
if(y==false)  {
	alert("Please enter user id in characters !");
	document.Form.dnn_txtUserName2.focus();
	document.Form.dnn_txtUserName2.select();
	return false;
}
if (document.Form.dnn_txtUserName2.value!="" ) {
	userid=isPropervalueswhitespace(document.Form.dnn_txtUserName2.value)
	if(userid==false) {
	   alert("Please do not enter white space[s] or special characters in user name!")
	   document.Form.dnn_txtUserName2.focus();
	   document.Form.dnn_txtUserName2.select();
	   return false;
	 }

}
 
    //password validation
if (document.Form.dnn_txtPassword2.value <=null) {
      	alert("Please enter password for second member!");
      	document.Form.dnn_txtPassword2.focus();
      	document.Form.dnn_txtPassword2.select();
      	return false;
        }
      
        if (document.Form.dnn_txtPassword2.value!="" ) {
      	userid=isPropervalueswhitespace(document.Form.dnn_txtPassword2.value)
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !")
      	   document.Form.dnn_txtPassword2.focus();
      	   document.Form.dnn_txtPassword2.select();
      	   return false;
      	 }
}
 

   //confirm password validation
if (document.Form.dnn_txtConPassword2.value <=null) {
      	alert("Please enter confirm password for second member!");
      	document.Form.dnn_txtConPassword2.focus();
      	document.Form.dnn_txtConPassword2.select();
      	return false;
        }
      
        if (document.Form.dnn_txtConPassword2.value!="" ) {
      	userid=isPropervalueswhitespace(document.Form.dnn_txtPassword2.value)
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !")
      	   document.Form.dnn_txtConPassword2.focus();
      	   document.Form.dnn_txtConPassword2.select();
      	   return false;
      	 }
}
     
     
     //first name validation
      if (document.Form.dnn_txtFName1.value <=null) {
      	alert("Please enter first name for second member!");
      	document.Form.dnn_txtFName2.focus();
	    document.Form.dnn_txtFName2.select();
      	return false;
}

//last name validation
      if (document.Form.dnn_txtLName2.value <=null) {
      	alert("Please enter last name for second member!");
      	document.Form.dnn_txtLName2.focus();
	document.Form.dnn_txtLName2.select();
      	return false;
}
      //email validation        
      
if (document.Form.dnn_txtEmail2.value <=null) {
	alert("Please enter email address for second member!");
	document.Form.dnn_txtEmail2.focus();
	document.Form.dnn_txtEmail2.select();
	return false;
}
     
     
if (document.Form.dnn_txtEmail2.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtEmail2.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtEmail2.focus();
		document.Form.dnn_txtEmail2.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtEmail2.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtEmail1.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtEmail2.focus();
		document.Form.dnn_txtEmail2.select();
		return false;
	}

}

//////// re enter email validation
if (document.Form.dnn_txtRmail2.value<=null) {
	alert("Please re enter email address for second member!");
	document.Form.dnn_txtRmail2.focus();
	document.Form.dnn_txtRmail2.select();
	return false;
}
     
     
if (document.Form.dnn_txtRmail2.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtRmail2.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtRmail2.focus();
		document.Form.dnn_txtRmail2.select();
		 return false;
	 }

}     
if (document.Form.dnn_txtRmail2.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtRmail2.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtRmail2.focus();
		document.Form.dnn_ttxtRmail2.select();
		return false;
	}

}
//matching two emails

var  emailmatch = matchpassword(document.Form.dnn_txtEmail2.value,document.Form.dnn_txtRmail2.value)

  	  if(emailmatch==false)
  	  {
  	    alert("Mismatch Email Ids!")
        	document.Form.dnn_txtRmail2.focus();
          document.Form.dnn_txtRmail2.select();
        	return false;
  	  }
  
  
  //address1 validation
	
	 if (document.Form.dnn_txtAddress12.value <=null) {
	         	alert("Please enter address1 for second member!");
	         	document.Form.dnn_txtAddress12.focus();
	      		document.Form.dnn_txtAddress12.select();
	         	return false;
	            }
	       if (document.Form.dnn_txtAddress12.value!="" ) {
	         	userid=isPropervalues(document.Form.dnn_txtAddress1.value)
	         	if(userid==false) {
	         	   alert("Please do not enter special characters in address1!")
	         	   document.Form.dnn_txtAddress12.focus();
	         	   document.Form.dnn_txtAddress12.select();
	         	   
	         	   return false;
	         	 }
	      
	       }  
	       
	                //Phone Number validation
      if (document.Form.dnn_txtPhoneNumber2.value <=null) {
      	alert("Please enter phone number for second member!");
      	document.Form.dnn_txtPhoneNumber2.focus();
	document.Form.dnn_txtPhoneNumber2.select();
      	return false;  
	     } 
	     if (document.Form.dnn_txtJurisdiction2.value <=null) {
      	    alert("Please enter jurisdiction !");
      	    document.Form.dnn_txtJurisdiction2.focus();
	        document.Form.dnn_txtJurisdiction2.select();
      	       return false;  
	     }
	     else
	     {
	       return true;  
	   }
}
/////////////////////////////////// agency members validations over here///////////////////////////
function Individualmember()
{

 var x,y
 var userid;
 // user name validation
 if (document.Form.dnn_txtusername.value <=null) {
      	alert("Please enter user name !");
      	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
      	return false;
}
y = isNaN(document.Form.dnn_txtusername.value);
if(y==false)  {
	alert("Please enter user id in characters !");
	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
	return false;
}
if (document.Form.dnn_txtusername.value!="" ) {
	userid=isPropervalueswhitespace(document.Form.dnn_txtusername.value)
	if(userid==false) {
	   alert("Please do not enter white space[s] or special characters in user name!")
	   document.Form.dnn_txtusername.focus();
	   document.Form.dnn_txtusername.select();
	   return false;
	 }

}
 
   //password validation
if (document.Form.dnn_txtPassword.value <=null) {
      	alert("Please enter password!");
      	document.Form.dnn_txtPassword.focus();
      	document.Form.dnn_txtPassword.select();
      	return false;
        }
      
        if (document.Form.dnn_txtPassword.value!="" ) {
      	userid=isPropervalueswhitespace(document.Form.dnn_txtPassword.value)
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !")
      	   document.Form.dnn_txtPassword.focus();
      	   document.Form.dnn_txtPassword.select();
      	   return false;
      	 }
}
   //confirm password validation
if (document.Form.dnn_txtConPassword.value <=null) {
      	alert("Please enter confirm password!");
      	document.Form.dnn_txtConPassword.focus();
      	document.Form.dnn_txtConPassword.select();
      	return false;
        }
      
        if (document.Form.dnn_txtConPassword.value!="" ) {
      	userid=isPropervalueswhitespace(document.Form.dnn_txtPassword.value)
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !")
      	   document.Form.dnn_txtConPassword.focus();
      	   document.Form.dnn_txtConPassword.select();
      	   return false;
      	 }
}
     
     //first name validation
      if (document.Form.dnn_txtFname.value <=null) {
      	alert("Please enter first name !");
      	document.Form.dnn_txtFname.focus();
	document.Form.dnn_txtFname.select();
      	return false;
}

//last name validation
      if (document.Form.dnn_txtLname.value <=null) {
      	alert("Please enter last name !");
      	document.Form.dnn_txtLname.focus();
	document.Form.dnn_txtLname.select();
      	return false;
}
      //email validation        
      
if (document.Form.dnn_txtEmail.value <=null) {
	alert("Please enter email address!");
	document.Form.dnn_txtEmail.focus();
	document.Form.dnn_txtEmail.select();
	return false;
}
     
     
if (document.Form.dnn_txtEmail.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtEmail.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtEmail.value  != null) {
	var retval = emailCheck(document.Form.dnn_txtEmail.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		return false;
	}

}

//////// re enter email validation
if (document.Form.dnn_txtRmail.value <=null) {
	alert("Please re enter email address!");
	document.Form.dnn_txtRmail.focus();
	document.Form.dnn_txtRmail.select();
	return false;
}
     
     
if (document.Form.dnn_txtRmail.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtRmail.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtRmail.focus();
		document.Form.dnn_txtRmail.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtRmail.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtRmail.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtRmail.focus();
		document.Form.dnn_ttxtRmail.select();
		return false;
	}

}

//matching two emails

var  emailmatch1 = matchpassword(document.Form.dnn_txtEmail.value,document.Form.dnn_txtRmail.value)

  	  if(emailmatch1==false)
  	  {
  	    alert("Mismatch Email Ids!")
        	document.Form.dnn_txtRmail.focus();
          document.Form.dnn_txtRmail.select();
        	return false;
  	  }

 //address1 validation
	
	 if (document.Form.dnn_txtAddress1.value <=null) {
	         	alert("Please enter address1 !");
	         	document.Form.dnn_txtAddress1.focus();
	      		document.Form.dnn_txtAddress1.select();
	         	return false;
	            }
	       if (document.Form.dnn_txtAddress1.value!="" ) {
	         	userid=isPropervalues(document.Form.dnn_txtAddress1.value)
	         	if(userid==false) {
	         	   alert("Please do not enter special characters in address1 !")
	         	   document.Form.dnn_txtAddress1.focus();
	         	   document.Form.dnn_txtAddress1.select();
	         	   
	         	   return false;
	         	 }
	      
	       }  
	       
	         //Phone Number validation
      if (document.Form.dnn_txtPhoneNumber.value <=null) {
      	alert("Please enter phone number !");
      	document.Form.dnn_txtPhoneNumber.focus();
	document.Form.dnn_txtPhoneNumber.select();
      	return false;  
	     }
	     
	     if (document.Form.dnn_txtJurisdiction.value <=null) {
      	    alert("Please enter jurisdiction !");
      	    document.Form.dnn_txtJurisdiction.focus();
	        document.Form.dnn_txtJurisdiction.select();
      	       return false;  
	     }
	     else
	     {
	       return true;  
	   }
}

      
  //Email validation

  
  function emailCheck (emailStr) 
  {
  	var emailPat=/^(.+)@(.+)$/
  	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
  	var validChars="\[^\\s" + specialChars + "\]"
  	var quotedUser="(\"[^\"]*\")"
  	var	ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
  	var atom=validChars + '+'
  	var word="(" + atom + "|" + quotedUser + ")"
  	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
  	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
  	var matchArray=emailStr.match(emailPat)
  
  	if (matchArray==null)
  	 {
  		alert("please enter a valid email-id !") 
  		return false;
  	}
  	var user=matchArray[1]
  	var domain=matchArray[2]
  	if (user.match(userPat)==null) {
  		    // user is not valid
  	    alert('please enter a valid email-id !');
  	    return false;
  	}
  
  	/* if the e-mail address is at an IP address (as opposed to a symbolic
  		   host name) make sure the IP address is valid. */
  			var IPArray=domain.match(ipDomainPat)
  			if (IPArray!=null) {
  		    // this is an IP address
  			  for (var i=1;i<=4;i++) {
  			    if (IPArray[i]>255) {
  			        alert('please enter a valid email-id !')
  
  				return false;
  			    }
  		    }
  		  return true;
  		}
  
  		// Domain is symbolic name
  			var domainArray=domain.match(domainPat)
  		if (domainArray==null) {
  			alert('please enter a valid email-id !')
  		    return false
  		}
  
  		/* domain name seems valid, but now make sure that it ends in a
  		   three-letter word (like com, edu, gov) or a two-letter word,
  		   representing country (uk, nl), and that there's a hostname preceding
  		   the domain or country. */
  
  			var atomPat=new RegExp(atom,"g")
  			var domArr=domain.match(atomPat)
  			var len=domArr.length
  			if (domArr[domArr.length-1].length<2 ||
  		    domArr[domArr.length-1].length>3) {
  		   // the address must end in a two letter or three letter word.
  		    alert('please enter a valid email-id !')
  
  		   return false
  		}
  
  		// Make sure there's a host name preceding the domain.
  		 if (len<2) {
  		//   var errStr="This address is missing a hostname!"
  		  alert('please enter a valid email-id !')
  
  		    return false;
  			}
  		   return true;
  		}
  		
  function setfocusmonth(){
	if(document.Registration.txtmonth.value.length > 1){
			document.Registration.txtday.focus();
			}
	}
	 
	function setfocusday(){ 		
	if(document.Registration.txtday.value.length >1){
				document.Registration.txtyear.focus();
			}
	}		
	

//special charachter back slash validation

function isPropervalues(string)
      {
        if (!string) return false;
         var iChars = "\\";
     
         for (var i = 0; i < string.length; i++) 
         {
            if (iChars.indexOf(string.charAt(i)) != -1)
     		{	
              return false;
              }  
            }
          } 	
   //special charachter back slash and whitespace validation

function isPropervalueswhitespace(string)
      {
        if (!string) return false;
         var iChars = "\\  ";
     
         for (var i = 0; i < string.length; i++) 
         {
            if (iChars.indexOf(string.charAt(i)) != -1)
     		{	
              return false;
              }  
            }
          } 
          
         
function isProperdecimalvalues(deval)
      {
        var iChars = ".";
     
         for (var i = 0; i <deval.length; i++) 
         {
            if (iChars.indexOf(deval.charAt(i)) != -1)
     		{	
             	 return false;
              }  
            }
} 	


      
//----------------------------------------------------------------------------------------

//				lOGIN PAGE VALIDATION:

//---------------------------------------------------------------------------------------
function Loginvalidation()
{	

if (document.getElementById('dnn_txtLoginUserName').value <=null) 
	{
	
      	alert("Please enter user name !");
      	document.getElementById('dnn_txtLoginUserName').focus();
	     document.getElementById('dnn_txtLoginUserName').select();
      	return false;
         }
        
         y = isNaN(document.getElementById('dnn_txtLoginUserName').value);
         if(y==false)  {
		alert("Please enter user id in characters !");
	  	document.getElementById('dnn_txtLoginUserName').focus();
	      	document.getElementById('dnn_txtLoginUserName').select();
		return false;
         }
         if (document.getElementById('dnn_txtLoginUserName').value!="" ) {
      	userid=isPropervalueswhitespace(document.getElementById('dnn_txtLoginUserName').value);
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters in user name!");
      	    	document.getElementById('dnn_txtLoginUserName').focus();
	      	document.getElementById('dnn_txtLoginUserName').select();
      	   return false;
      	 }
  }

  
 // password validation
   if (document.getElementById('dnn_txtLoginPassword').value <=null) {
   
      	alert("Please enter password!");
      	document.getElementById('dnn_txtLoginPassword').focus();
        document.getElementById('dnn_txtLoginPassword').select();
      	return false;
        }
      
        if (document.getElementById('dnn_txtLoginPassword').value!="" ) {
      	userid=isPropervalueswhitespace(document.getElementById('dnn_txtLoginPassword').value);
      	if(userid==false) {
      	   alert("Please do not enter white space[s] or special characters  in password !");
      	document.getElementById('dnn_txtLoginPassword').focus();
      	  document.getElementById('dnn_txtLoginPassword').select();
      	   return false;
      	 }
     }
     else
     {
          return true;
     }
  } 
       
      
 //----------------------------------------------------------------------------------------------     
  // change passowrd validation 
  
  
  function changepassowrd()
  {

    // old password validation
     if (document.Form.dnn_txtOldPassword.value <=null) {
        	alert("Please enter old password!");
        	document.Form.dnn_txtOldPassword.focus();
        	document.Form.dnn_txtOldPassword.select();
        	return false;
          }
        
          if (document.Form.dnn_txtOldPassword.value!="" ) {
        	userid=isPropervalueswhitespace(document.Form.dnn_txtOldPassword.value)
        	if(userid==false) {
        	   alert("Please do not enter white space[s] or special characters  in password !")
        	  document.Form.dnn_txtOldPassword.focus();
        	   document.Form.dnn_txtOldPassword.select();
        	   return false;
        	 }
     }
     
    //new password validation
     if (document.Form.dnn_txtNewPassword.value <=null) {
        	alert("Please enter new password!");
        	document.Form.dnn_txtNewPassword.focus();
        	document.Form.dnn_txtNewPassword.select();
        	return false;
          }
        
          if (document.Form.dnn_txtNewPassword.value!="" ) {
        	userid=isPropervalueswhitespace(document.Form.dnn_txtNewPassword.value)
        	if(userid==false) {
        	   alert("Please do not enter white space[s] or special characters in password !")
        	  document.Form.dnn_txtNewPassword.focus();
        	   document.Form.dnn_txtNewPassword.select();
        	   return false;
        	 }
     }
     
      //Confirm  password validation 
     if (document.Form.dnn_txtConfirmPassword.value <=null) {
        	alert("Please enter confirm password!");
        	document.Form.dnn_txtConfirmPassword.focus();
        	document.Form.dnn_txtConfirmPassword.select();
        	return false;
          }
        
          if (document.Form.dnn_txtConfirmPassword.value!="" ) {
        	userid=isPropervalueswhitespace(document.Form.dnn_txtConfirmPassword.value)
        	if(userid==false) {
        	   alert("Please do not enter white space[s] or special characters in password !")
        	   document.Form.dnn_txtConfirmPassword.focus();
        	  document.Form.dnn_txtConfirmPassword.select();
        	   return false;
     	 }
     	 if(document.Form.dnn_txtNewPassword.value.length != document.Form.dnn_txtConfirmPassword.value.length)
     	   {
     		alert("Mismatch Passwords!")
        	document.Form.dnn_txtNewPassword.focus();
        	document.Form.dnn_txtNewPassword.select();
        	return false;
        }	   
       if(document.Form.dnn_txtNewPassword.value!="" && document.Form.dnn_txtConfirmPassword!="")
       {
        pwdmatch = matchpassword(document.Form.dnn_txtNewPassword.value,document.Form.dnn_txtConfirmPassword.value)
  	  if(pwdmatch==false)
  	  {
  	    alert("Mismatch Passwords!")
        	document.Form.dnn_txtConfirmPassword.focus();
          document.Form.dnn_txtConfirmPassword.select();
        	return false;
  	  }
       }
     }
     else
     {
       return true;
     }
   } 
   
  //match the new password and re enter password
  function matchpassword(string1,string2)
        {
        
         var iChars = string2
          for (var i = 0; i < string1.length; i++) 
           {
       	 if(iChars.indexOf(string1.charAt(i))== -1)
       			{
       			  // alert(iChars.indexOf(string1.charAt(i)));
       			   return false; 
       			   break;
  			 }  
  	 } 
           return true;	
 } 	
      
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    //All Toggle None
////////////////////////////////////////////////////////////////////////////////////////////////////////////////   
function CheckBoxListSelect(cbControl, state)
{    
       if(document.getElementById(cbControl)!=null)
       {
       var chkBoxList = document.getElementById(cbControl);
        var chkBoxCount= chkBoxList.getElementsByTagName("input");
        
        for(var i=0;i<chkBoxCount.length;i++) 
        {
            chkBoxCount[i].checked = state;
        }
        }
        return false; 
}
function CheckBoxListToggle(cbControl)
{    
  if(document.getElementById(cbControl)!=null)
       {

       var chkBoxList = document.getElementById(cbControl);
        var chkBoxCount= chkBoxList.getElementsByTagName("input");
        for(var i=0;i<chkBoxCount.length;i++) 
        {
            if (chkBoxCount[i].checked == true)
            {
                chkBoxCount[i].checked = false;
            }
            else
            {
                    chkBoxCount[i].checked = true;
            }
            
            
        }
        }
        
        return false; 
}

function PersonalInfo()
{
      
      if (document.Form.dnn_txtFName.value <=null) {
      	alert("Please enter first name !");
      	document.Form.dnn_txtFName.focus();
	    document.Form.dnn_txtFName.select();
      	return false;
      	}
      	 //email validation        
      
if (document.Form.dnn_txtEmail.value <=null) {
	alert("Please enter email address !");
	document.Form.dnn_txtEmail.focus();
	document.Form.dnn_txtEmail.select();
	return false;
}
     
     
if (document.Form.dnn_txtEmail.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtEmail.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtEmail.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtEmail.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		return false;
	}

}

}

//====================================================================================================================        
//Edit Profile
//====================================================================================================================        


function EditProfile()
{

 var x,y
 var userid;
 // user name validation
 if (document.Form.dnn_txtusername.value <=null) {
      	alert("Please enter user name !");
      	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
      	return false;
}
y = isNaN(document.Form.dnn_txtusername.value);
if(y==false)  {
	alert("Please enter user id in characters !");
	document.Form.dnn_txtusername.focus();
	document.Form.dnn_txtusername.select();
	return false;
}
if (document.Form.dnn_txtusername.value!="" ) {
	userid=isPropervalueswhitespace(document.Form.dnn_txtusername.value)
	if(userid==false) {
	   alert("Please do not enter white space[s] or special characters in user name!")
	   document.Form.dnn_txtusername.focus();
	   document.Form.dnn_txtusername.select();
	   return false;
	 }

}
 
 
     
     //first name validation
      if (document.Form.dnn_txtFname.value <=null) {
      	alert("Please enter first name !");
      	document.Form.dnn_txtFname.focus();
	document.Form.dnn_txtFname.select();
      	return false;
}

//last name validation
      if (document.Form.dnn_txtLname.value <=null) {
      	alert("Please enter last name !");
      	document.Form.dnn_txtLname.focus();
	document.Form.dnn_txtLname.select();
      	return false;
}
      //email validation        
      
if (document.Form.dnn_txtEmail.value <=null) {
	alert("Please enter email address!");
	document.Form.dnn_txtEmail.focus();
	document.Form.dnn_txtEmail.select();
	return false;
}
     
     
if (document.Form.dnn_txtEmail.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtEmail.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtEmail.value  != null) {
	var retval = emailCheck(document.Form.dnn_txtEmail.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		return false;
	}

}

//////// re enter email validation
if (document.Form.dnn_txtRmail.value <=null) {
	alert("Please re enter email address!");
	document.Form.dnn_txtRmail.focus();
	document.Form.dnn_txtRmail.select();
	return false;
}
     
     
if (document.Form.dnn_txtRmail.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtRmail.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtRmail.focus();
		document.Form.dnn_txtRmail.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtRmail.value!= null) {
	var retval = emailCheck(document.Form.dnn_txtRmail.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtRmail.focus();
		document.Form.dnn_ttxtRmail.select();
		return false;
	}

}
//matching two emails

var  emailmatch = matchpassword(document.Form.dnn_txtEmail.value,document.Form.dnn_txtRmail.value)

  	  if(emailmatch==false)
  	  {
  	    alert("Mismatch Email Ids!")
        	document.Form.dnn_txtRmail.focus();
          document.Form.dnn_txtRmail.select();
        	return false;
  	  }

 //address1 validation
	
	 if (document.Form.dnn_txtAddress1.value <=null) {
	         	alert("Please enter address1 !");
	         	document.Form.dnn_txtAddress1.focus();
	      		document.Form.dnn_txtAddress1.select();
	         	return false;
	            }
	       if (document.Form.dnn_txtAddress1.value!="" ) {
	         	userid=isPropervalues(document.Form.dnn_txtAddress1.value)
	         	if(userid==false) {
	         	   alert("Please do not enter special characters in address1 !")
	         	   document.Form.dnn_txtAddress1.focus();
	         	   document.Form.dnn_txtAddress1.select();
	         	   
	         	   return false;
	         	 }
	      
	       }  
	       
	         //Phone Number validation
      if (document.Form.dnn_txtPhoneNumber.value <=null) {
      	alert("Please enter phone number !");
      	document.Form.dnn_txtPhoneNumber.focus();
	document.Form.dnn_txtPhoneNumber.select();
      	return false;  
	     }
	     
	      if (document.Form.dnn_txtJurisdiction.value <=null) {
      	alert("Please enter jurisdiction !");
      	document.Form.dnn_txtJurisdiction.focus();
	    document.Form.dnn_txtJurisdiction.select();
      	return false;  
	     }
	     else
	     {
	       return true;  
	   }
}

/////////////////////////////////// agency members validations over here///////////////////////////
function ShipMember()
{

 var x,y
 var userid;
      
     //first name validation
      if (document.Form.dnn_txtFname.value <=null) {
      	alert("Please enter first name !");
      	document.Form.dnn_txtFname.focus();
	document.Form.dnn_txtFname.select();
      	return false;
}

//last name validation
      if (document.Form.dnn_txtLname.value <=null) {
      	alert("Please enter last name !");
      	document.Form.dnn_txtLname.focus();
	document.Form.dnn_txtLname.select();
      	return false;
}
      //email validation        
      
if (document.Form.dnn_txtEmail.value <=null) {
	alert("Please enter email address!");
	document.Form.dnn_txtEmail.focus();
	document.Form.dnn_txtEmail.select();
	return false;
}
     
     
if (document.Form.dnn_txtEmail.value!="" ) {
	 userid=isPropervalues(document.Form.dnn_txtEmail.value)
	 if (userid==false) {
		alert("Please do not enter white space[s] or special characters in email address !")
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		 return false;
	 }

}
     
if (document.Form.dnn_txtEmail.value  != null) {
	var retval = emailCheck(document.Form.dnn_txtEmail.value ) // if check the email  domain name.
	if (retval == false) {
		document.Form.dnn_txtEmail.focus();
		document.Form.dnn_txtEmail.select();
		return false;
	}

}  


 //address1 validation
	
	 if (document.Form.dnn_txtAddress1.value <=null) {
	         	alert("Please enter address1 !");
	         	document.Form.dnn_txtAddress1.focus();
	      		document.Form.dnn_txtAddress1.select();
	         	return false;
	            }
	       if (document.Form.dnn_txtAddress1.value!="" ) {
	         	userid=isPropervalues(document.Form.dnn_txtAddress1.value)
	         	if(userid==false) {
	         	   alert("Please do not enter special characters in address1 !")
	         	   document.Form.dnn_txtAddress1.focus();
	         	   document.Form.dnn_txtAddress1.select();
	         	   
	         	   return false;
	         	 }
	      
	       }  
	       
	         //Phone Number validation
      if (document.Form.dnn_txtPhoneNumber.value <=null) {
      	alert("Please enter phone number !");
      	document.Form.dnn_txtPhoneNumber.focus();
	document.Form.dnn_txtPhoneNumber.select();
      	return false;  
	     }
	     
	     if (document.Form.dnn_txtJurisdiction.value <=null) {
      	    alert("Please enter jurisdiction !");
      	    document.Form.dnn_txtJurisdiction.focus();
	        document.Form.dnn_txtJurisdiction.select();
      	       return false;  
	     }
	     else
	     {
	       return true;  
	   }
}




            
        
  
   
   
   
	 
	
