
//**************************Java Script Source File**************************

var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;


//to check maximum char in text area
function textarea_max(maxchars,q) {
  	   var msg = "Please enter data, at most "+ maxchars+" characters";
       if (q > maxchars)
	   	{alert(msg);
		 return false;
		}
	   else{
	     return true; }
 }

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function validate_month(val)
{ if(isInteger(val)==false)
   { return false}
  else
 {  val = val*1;
  if(val<1 || val>12)
  {return false}
  else 
  {return true}
  
}}

function validate_year(val)
{ if(isInteger(val)==false)
   { return false}
  else
 {  val = val*1;
  if(val.length > 4)
  {return false}
  else
  {return true}

}}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function validate_name(s)
{ var pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "; 
  var i;
  for(i=0; i<s.length; i++)
  {
    var c = s.charAt(i);
    if (pool.indexOf(c) == -1) {return false}
  }
  return true;
}

function validate_uandp(s)
{ var spl = "~!@#$%^&*()+=?'[]{}|\/><,:;";
  var i;
  for(i=0; i<s.length; i++)
  {
    var c = s.charAt(i);
    if (spl.indexOf(c) == -1) {}
    else {return false}
  }
  return true;
}
function validate_telephone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}


function validate_phone(strPhone){
if(strPhone==""){return true}
else{
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);}
}

function validate_zipcode(zip){
if(zip.length == 5)
{return(isInteger(zip));}
else
return false;
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
}
}
function validate_password(str1,str2)
{ if(str1==str2){return true}
  else {return false}
}
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}
/******************************************************************************
                        Registration Form Validation
******************************************************************************/
function validate_form(thisform)
{
with (thisform)
{

if (validate_required(firstName,"First Name is required!")==false)
  {firstName.focus();return false}

if (validate_name(firstName.value)==false)
  {alert("First Name should be letters!");
   firstName.focus();return false}

if (validate_required(lastName,"Last Name is required!")==false)
  {lastName.focus();return false}
if (validate_name(lastName.value)==false)
  {alert("Last Name should be letters!");
   lastName.focus();return false}

if (!(thisform.gender[0].checked || thisform.gender[1].checked)){
alert("Please choose the gender");
return false}


if (validate_required(address,"Address is required!")==false)
  {address.focus();return false}

if (validate_required(city,"City is required!")==false)
  {city.focus();return false}

if (validate_name(city.value)==false)
  {alert("Enter valid City!");
   city.focus();return false}


if (validate_required(zipCode,"Zip Code is required!")==false)
  {zipCode.focus();return false}
if (validate_zipcode(zipCode.value)==false)
  {alert("Please Enter a Valid Zip Code!")
   zipCode.value=""
   zipCode.focus(); return false}

if (validate_required(country,"Country is required!")==false)
  {country.focus();return false}
if (validate_name(country.value)==false)
  {alert("Enter valid Country!");
   country.focus();return false}

if (validate_required(dateOfBirth,"Date Of Birth is required!")==false)
  {dateOfBirth.focus(); return false}
if (validate_date(dateOfBirth.value)==false)
  {dateOfBirth.focus(); return false}

if (validate_required(telephone,"Phone number is required!")==false)
  {telephone.focus();return false}
if (validate_telephone(telephone.value)==false)
  {alert("Please Enter a Valid Phone Number")
	telephone.value=""
       telephone.focus();return false}

if (validate_phone(cellPhone.value)==false)
  {alert("Please Enter a valid Cell Phone Number")
    cellPhone.focus();return false}

if (validate_phone(fax.value)==false)
  {alert("Please Enter a Valid Fax Number!")
   fax.value=""
   fax.focus();return false}

if (validate_required(emailAddress,"Email is required!")==false)
  {emailAddress.focus();return false}
if (validate_email(emailAddress,"Not a valid email address!")==false)
  { emailAddress.value=""
    emailAddress.focus();return false}

if (validate_required(username,"Username is required!")==false)
  {username.focus();return false}
if (validate_uandp(username.value)==false)
  {alert("Username can be only letters numbers _ . and -");
   username.focus(); return false}

if (validate_required(password,"Password is required!")==false)
  {password.focus();return false}
if (validate_uandp(password.value)==false)
  {alert("Password can be only letters numbers _ . and -");
   password.focus(); return false}

if (validate_required(rpassword,"Please Re-type your Password")==false)
  {rpassword.focus();return false}
if (validate_password(password.value,rpassword.value)==false)
  {alert("Passwords do not match. Please re-type your Password")
   rpassword.value=""
   rpassword.focus(); return false}
if (validate_required(lifeLicense,"Enter your Life and Health License #")==false){lifeLicense.focus();return false}

if (thisform.propLicenseYN[0].checked){
if (validate_required(propLicense,"Enter your Property and Casualty License #")==false){propLicense.focus();return false}}

if (thisform.series6LicenseYN[0].checked){
if (validate_required(series6License,"Enter your Series 6 License #")==false){series6License.focus();return false}}

if (thisform.series7LicenseYN[0].checked){
if (validate_required(series7License,"Enter your Series 7 License #")==false){series7License.focus();return false}}

if (thisform.series63LicenseYN[0].checked){
if (validate_required(series63License,"Enter your Series 63 License #")==false){series63License.focus();return false}}

if (thisform.series66LicenseYN[0].checked){
if (validate_required(series66License,"Enter your Series 66 License #")==false){series66License.focus();return false}}

if(textarea_max(50,eval(thisform.otherLicenses.value.length))==false)
  {otherLicenses.focus();return false}

if(validate_required(eoCarrier,"Please enter E&O Carrier!")==false)
{eoCarrier.focus(); return false}

if(validate_required(effDateEO,"Please enter the Effective Date for E&O!")==false)
{effDateEO.focus(); return false}

if(validate_date(effDateEO.value)==false){effDateEO.focus(); return false}

if(validate_required(expDateEO,"Please enter the Expiration Date for E&O!")==false){expDateEO.focus(); return false}

if(validate_date(expDateEO.value)==false){expDateEO.focus(); return false}
if(validate_expdate(effDateEO.value,expDateEO.value)==false){expDateEO.focus(); return false}

if(agencyEstablished.value)
{ 
if (validate_date(agencyEstablished.value)==false)
  {agencyEstablished.focus(); return false;}
}
if(numberofEmployees.value)
{
if (isInteger(numberofEmployees.value)==false)
  {alert("Please enter a valid number of Employees");
   numberofEmployees.focus();  return false}
}
if(numberofAgents.value)
{if (isInteger(numberofAgents.value)==false)
  {alert("Please enter a valid number of Agents");
  numberofAgents.focus(); return false}
}
{if (isInteger(numberofCSR.value)==false)
  {alert("Please enter a valid number of CSR");
  numberofCSR.focus(); return false}
}

if (validate_required(hearAboutUs,"Where did you hear about us?")==false)
  {hearAboutUs.focus();return false}
  
if(textarea_max(100,eval(thisform.hearAboutUs.value.length))==false)
  {hearAboutUs.focus();return false}

if(!(thisform.term_service[0].checked || thisform.term_service[1].checked))
{  alert("You must agree to our terms and conditions to Register");
  return false}

}
}// end of Registration validation form

function confirmChoice(radioObj, newValue) {
question = confirm ("Are you sure you want to decline the Terms of Service? Click Cancel to continue with registration.");
if (question == true) {
  location='http://www.eibwebsite.com';
} else{ 
  radioObj[1].checked = false;
        }
}

function validate_date(dateStr) {
// Checks for the following valid date formats:
// MM/DD/YY   MM/DD/YYYY   MM-DD-YY   MM-DD-YYYY
// Also separates date into month, day, and year variables

//var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;

// To require a 4 digit year entry, use this line instead:
 var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;

var matchArray = dateStr.match(datePat); // is the format ok?
if (matchArray == null) {
alert("Please enter a valid Date!");
return false;
}
month = matchArray[1]; // parse date into variables
day = matchArray[3];
year = matchArray[4];

if (month < 1 || month > 12) { // check month range
alert("Month must be between 1 and 12.");
return false;
}
if (day < 1 || day > 31) {
alert("Day must be between 1 and 31.");
return false;
}
if ((month==4 || month==6 || month==9 || month==11) && day==31) {
alert("Month "+month+" doesn't have 31 days!")
return false
}
if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day>29 || (day==29 && !isleap)) {
alert("February " + year + " doesn't have " + day + " days!");
return false;
   }
}
return true;  // date is valid
}

// Function for validating the effective and expiration dates
function validate_expdate(s1,s2)
{
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;

var matchArray1 = s1.match(datePat); // is the format ok?
var matchArray2 = s2.match(datePat);

 month1 = (matchArray1[1] * 1); // parse date into variables
 day1 = (matchArray1[3] * 1);
 year1 = (matchArray1[4] * 1);

 month2 = (matchArray2[1] * 1); // parse date into variables
 day2 = (matchArray2[3] * 1);
 year2 = (matchArray2[4] * 1);

if(year1 > year2)
  {alert("Please enter a valid Expiration Date!");return false}
if(year1 == year2)
  { if(month1 > month2)
           {alert("Please enter valid Expiration Date!"); return false}
    if(month1 == month2)
           {if(day1 > day2)
              {alert("Please enter valid Expiration Date!");return false}
            else
             {return true}
           }
     return true
   }
 
return true
}

function validate_ssn(ssn) {
var matchArr = ssn.match(/^(\d{3})-?\d{2}-?\d{4}$/);
var numDashes = ssn.split('-').length - 1;
if (matchArr == null || numDashes == 1) {
alert('Invalid SSN. Must be 9 digits or in the form NNN-NN-NNNN.');
return false;
}
else 
if (parseInt(matchArr[1],10)==0) {
alert("Invalid SSN: SSN's can't start with 000.");
return false;
}
return true;
}

/******************************************************************************
                 Business Registration Form Validation
******************************************************************************/
function validate_busiform(thisform)
{
with (thisform)
{
if (validate_required(firstName,"First Name is required!")==false)
  {firstName.focus();return false }

if (validate_name(firstName.value)==false)
  {alert("First Name should be letters!");
   firstName.focus();return false }

if (validate_required(lastName,"Last Name is required!")==false)
  {lastName.focus();return false}
if (validate_name(lastName.value)==false)
  {alert("Last Name should be letters!");
   lastName.focus();return false}

if (validate_required(address,"Address is required!")==false)
  {address.focus();return false}

if (validate_required(city,"City is required!")==false)
  {city.focus();return false}

if (validate_name(city.value)==false)
  {alert("Enter valid City!");
   city.focus();return false}


//if (validate_required(zipCode,"Zip Code is required!")==false)
//  {zipcode.focus();return false}
if (validate_zipcode(zipCode.value)==false)
  {alert("Please Enter a Valid Zip Code!")
   zipCode.focus(); return false}

if (validate_required(country,"Country is required!")==false)
  {country.focus();return false}
if (validate_name(country.value)==false)
  {alert("Enter valid Country!");
   country.focus();return false}

if (validate_required(dateOfBirth,"Date Of Birth is required!")==false)
  {dateOfBirth.focus(); return false}
if (validate_date(dateOfBirth.value)==false)
  {dateOfBirth.focus(); return false}


if (validate_required(telephone,"Phone number is required!")==false)
  {telephone.focus();return false}
if (validate_telephone(telephone.value)==false)
  {alert("Please Enter a Valid Phone Number")
	telephone.value=""
       telephone.focus();return false}

if (validate_phone(cellPhone.value)==false)
  {alert("Please Enter a valid Cell Phone Number")
    cellPhone.focus();return false}

if (validate_phone(fax.value)==false)
  {alert("Please Enter a Valid Fax Number!")
   fax.value=""
   fax.focus();return false}

if (validate_required(emailAddress,"Email is required!")==false)
  {emailAddress.focus();return false}
if (validate_email(emailAddress,"Not a valid email address!")==false)
  { emailAddress.value=""
    emailAddress.focus();return false}

if (validate_required(socialSecurity,"Social Security Number is required!")==false) {socialSecurity.focus(); return false}
if (validate_ssn(socialSecurity.value)==false)
  {socialSecurity.focus(); return false}

if(!(thisform.lifeLicenseYN[0].checked || thisform.lifeLicenseYN[1].checked))
{alert("Please choose if you currently have a Life and Health License!");
 return false;}

if (thisform.lifeLicenseYN[0].checked){
if (validate_required(lifeLicense,"Enter your Life and Health License #")==false){lifeLicense.focus();return false}}

if(!(thisform.propLicenseYN[0].checked || thisform.propLicenseYN[1].checked))
{alert("Please choose if you currently have a Property and Casualty License!");
 return false;}

if (thisform.propLicenseYN[0].checked){
if (validate_required(propLicense,"Enter your Property and Casualty License #")==false){propLicense.focus();return false}}

if(!(thisform.series6LicenseYN[0].checked || thisform.series6LicenseYN[1].checked))
{alert("Please choose if you currently have a Series 6 License!");
 return false;}

if (thisform.series6LicenseYN[0].checked){
if (validate_required(series6License,"Enter your Series 6 License #")==false){series6License.focus();return false}}

if(!(thisform.series7LicenseYN[0].checked || thisform.series7LicenseYN[1].checked))
{alert("Please choose if you currently have a Series 7 License!");
 return false;}

if (thisform.series7LicenseYN[0].checked){
if (validate_required(series7License,"Enter your Series 7 License #")==false){series7License.focus();return false}}

if(!(thisform.series63LicenseYN[0].checked || thisform.series63LicenseYN[1].checked))
{alert("Please choose if you currently have a Series 63 License!");
 return false;}

if (thisform.series63LicenseYN[0].checked){
if (validate_required(series63License,"Enter your Series 63 License #")==false){series63License.focus();return false}}

if(!(thisform.series66LicenseYN[0].checked || thisform.series66LicenseYN[1].checked))
{alert("Please choose if you currently have a Series 66 License!");
 return false;}

if (thisform.series66LicenseYN[0].checked){
if (validate_required(series66License,"Enter your Series 66 License #")==false){series66License.focus();return false}}

if(validate_required(eoCarrier,"Please enter E&O Carrier!")==false)
{eoCarrier.focus(); return false}

if(validate_required(effDateEO,"Please enter the Effective Date for E&O!")==false)
{effDateEO.focus(); return false}

if(validate_date(effDateEO.value)==false){effDateEO.focus(); return false}

if(validate_required(expDateEO,"Please enter the Expiration Date for E&O!")==false){expDateEO.focus(); return false}

if(validate_date(expDateEO.value)==false){expDateEO.focus(); return false}
if(validate_expdate(effDateEO.value,expDateEO.value)==false){expDateEO.focus(); return false}

if(agencyEstablished.value)
{ 
if (validate_date(agencyEstablished.value)==false)
  {agencyEstablished.focus(); return false;}
}
if(numberofEmployees.value)
{
if (isInteger(numberofEmployees.value)==false)
  {alert("Please enter a valid number of Employees");
   numberofEmployees.focus();  return false}
}
if(numberofAgents.value)
{if (isInteger(numberofAgents.value)==false)
  {alert("Please enter a valid number of Agents");
  numberofAgents.focus(); return false}
}
{if (isInteger(numberofCSR.value)==false)
  {alert("Please enter a valid number of CSR");
  numberofCSR.focus(); return false}
}
if (validate_required(hearAboutUs,"Where did you hear about us?")==false)
  {hearAboutUs.focus();return false}

}}//end of Business Registration Form

/******************************************************************************
                   Alcohol and Drug Abuse Quote Form Validation
******************************************************************************/

function validate_alcohol(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}
  
if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}

if (!(thisform.alcoholAbuse.checked || thisform.drugAbuse.checked)){
alert("Please check patients condition!");alcoholAbuse.focus(); return false}

if (thisform.consumeAlocoholYN[0].checked){
if (validate_required(alcoholHowOftenWhatAmts,"Please enter how often and in what amounts the alcohol is consumed ")==false){alcoholHowOftenWhatAmts.focus();return false}}

if (thisform.alcoholHospitalizedYN[0].checked){
if (validate_required(alcoholTimeofDischarge,"Please list time of discharge if the client is hospitalized ")==false){alcoholTimeofDischarge.focus();return false}}

if(alcoholMonthDUI1.value)
{ if(validate_month(alcoholMonthDUI1.value)==false)
   {alert("Please enter valid month!");
    alcoholMonthDUI1.focus(); return false}
}

if(alcoholYearDUI1.value)
{ if(validate_year(alcoholYearDUI1.value)==false)
  {alert("Please enter valid year");
   alcoholYearDUI1.focus(); return false}
}

if(alcoholMonthDUI2.value)
{ if(validate_month(alcoholMonthDUI2.value)==false)
   {alert("Please enter valid month!");
    alcoholMonthDUI2.focus(); return false}
}

if(alcoholYearDUI2.value)
{ if(validate_year(alcoholYearDUI2.value)==false)
  {alert("Please enter valid year");
   alcoholYearDUI2.focus(); return false}
}
if(alcoholMonthDUI3.value)
{ if(validate_month(alcoholMonthDUI3.value)==false)
   {alert("Please enter valid month!");
    alcoholMonthDUI3.focus(); return false}
}

if(alcoholYearDUI3.value)
{ if(validate_year(alcoholYearDUI3.value)==false)
  {alert("Please enter valid year");
   alcoholYearDUI3.focus(); return false}
}
if(alcoholMonthDUI4.value)
{ if(validate_month(alcoholMonthDUI4.value)==false)
   {alert("Please enter valid month!");
    alcoholMonthDUI4.focus(); return false}
}

if(alcoholYearDUI4.value)
{ if(validate_year(alcoholYearDUI4.value)==false)
  {alert("Please enter valid year");
   alcoholYearDUI4.focus(); return false}
}
if(alcoholMonthDUI5.value)
{ if(validate_month(alcoholMonthDUI5.value)==false)
   {alert("Please enter valid month!");
    alcoholMonthDUI5.focus(); return false}
}

if(alcoholYearDUI5.value)
{ if(validate_year(alcoholYearDUI5.value)==false)
  {alert("Please enter valid year");
   alcoholYearDUI5.focus(); return false}
}
if(alcoholMonthDUI6.value)
{ if(validate_month(alcoholMonthDUI6.value)==false)
   {alert("Please enter valid month!");
    alcoholMonthDUI6.focus(); return false}
}

if(alcoholYearDUI6.value)
{ if(validate_year(alcoholYearDUI6.value)==false)
  {alert("Please enter valid year");
   alcoholYearDUI6.focus(); return false}
}

if (!(thisform.alcoholLiverTest[0].checked || thisform.alcoholLiverTest[1].checked || thisform.alcoholLiverTest[2].checked || thisform.alcoholLiverTest[3].checked)){alert("Please select client's most recent liver function test");
alcoholLiverTest[0].focus(); return false}

if (!(thisform.alcoholAntabuseYN[0].checked||thisform.alcoholAntabuseYN[1].checked)){alert("Please select if Client is taking any medication");
alcoholAntabuseYN[0].focus(); return false}

if(thisform.alcoholOtherYN.checked){
if(validate_required(alcoholOtherDesc,"Please list other substances or drugs")==false){alcoholOtherDesc.focus(); return false}}

if(alcoholSubstanceMonth.value)
{ if(validate_month(alcoholSubstanceMonth.value)==false)
   {alert("Please enter valid month for substance!");
    alcoholSubstanceMonth.focus(); return false}
}

if(alcoholSubstanceYear.value)
{ if(validate_year(alcoholSubstanceYear.value)==false)
  {alert("Please enter valid year");
   alcoholSubstanceYear.focus(); return false}
}

if(!(thisform.alcoholSubstanceAbuseYN[0].checked || thisform.alcoholSubstanceAbuseYN[1].checked)){alert("Please select if Client is been treated for Substance abuse!");
 alcoholSubstanceAbuseYN[0].focus(); return false}
if(thisform.alcoholSubstanceAbuseYN[0].checked)
{if(validate_required(alcoholSubstanceAbuseMonth,"Please enter month!")==false)
 {alcoholSubstanceAbuseMonth.focus(); return false}
 if(validate_month(alcoholSubstanceAbuseMonth.value)==false)
   {alert("Please enter valid month!");
    alcoholSubstanceAbuseMonth.focus(); return false}

 if(validate_required(alcoholSubstanceAbuseYear,"Please enter Year!")==false)
 {alcoholSubstanceAbuseYear.focus(); return false}
 if(validate_year(alcoholSubstanceAbuseYear.value)==false)
  {alert("Please enter valid year");
   alcoholSubstanceAbuseYear.focus(); return false}

if(validate_required(alcoholSubstanceAbusePlace,"Please enter Place!")==false)
 {alcoholSubstanceAbusePlace.focus(); return false}
//if (validate_name(alcoholSubstanceAbusePlace.value)==false)
  //{alert("Enter valid Alcohol Substance Abuse Place!");
   //alcoholSubstanceAbusePlace.focus();return false}

}

if(!(thisform.alcoholPossessionYN[0].checked || thisform.alcoholPossessionYN[1].checked)){alert("Please select if client ever been arrested for possession, use, distribution of, or sale of an illegal substance!");
 alcoholPossessionYN[0].focus(); return false}
if(thisform.alcoholPossessionYN[0].checked)
{if(validate_required(alcoholPossessionMonth,"Please enter month!")==false)
 {alcoholPossessionMonth.focus(); return false}
if(validate_month(alcoholSubstanceAbuseMonth.value)==false)
   {alert("Please enter valid month!");
    alcoholSubstanceMonth.focus(); return false}

 if(validate_required(alcoholPossessionYear,"Please enter Year!")==false)
 {alcoholPossessionYear.focus(); return false}
 if(validate_year(alcoholPossessionYear.value)==false)
 {alert("Please enter valid year!");
  alcoholPossessionYear.focus();return false}

if(validate_required(alcoholPossessionCityState,"Please enter Place!")==false)
 {alcoholPossessionCityState.focus(); return false}
//if (validate_name(alcoholPossessionCityState.value)==false)
  //{alert("Enter valid Alcohol Posession Place!");
   //alcoholPossessionCityState.focus();return false}
}


if (!(thisform.clientMaritalStatus[0].checked ||thisform.clientMaritalStatus[1].checked || thisform.clientMaritalStatus[2].checked || thisform.clientMaritalStatus[3].checked)){alert("Please select Client's marital status");
clientMaritalStatus[0].focus(); return false}



}}// end of Alcohol and Drug Abuse Quote form


/******************************************************************************
                        Diabetes Quote Form Validation
******************************************************************************/
function validate_diabetes(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}
  
if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}

if(diabetesClientAgeDiabetes.value)
{ if(isInteger(diabetesClientAgeDiabetes.value)==false)
  {alert("Please enter valid Age for Client!");
   diabetesClientAgeDiabetes.focus(); return false}
}

if(!(thisform.diabetesControl_Method[0].checked || thisform.diabetesControl_Method[1].checked ||thisform.diabetesControl_Method[2].checked))
{alert("Please select Diabetes Control Method!");
 diabetesControl_Method[0].focus(); return false}
 
if(!(thisform.diabetesTimes_Insulin_administered[0].checked || thisform.diabetesTimes_Insulin_administered[1].checked ||thisform.diabetesTimes_Insulin_administered[2].checked))
{alert("Please select how many times a day is client's insulin administered!");
 diabetesTimes_Insulin_administered[0].focus(); return false}

if(!(thisform.diabetesSugar_Level[0].checked || thisform.diabetesSugar_Level[1].checked))
{alert("Please select how often are client's blood sugar levels monitored!");
 diabetesSugar_Level[0].focus(); return false}

if(!(thisform.diabetesA1C[0].checked || thisform.diabetesA1C[1].checked))
{alert("Please select if the client had a glycohemoglobin (A1C) test during the past six months"); diabetesA1C[0].focus(); return false}
if(thisform.diabetesA1C[0].checked)
{if (!(thisform.diabetesA1C_Level[0].checked || thisform.diabetesA1C_Level[1].checked || thisform.diabetesA1C_Level[2].checked || thisform.diabetesA1C_Level[3].checked))
{alert("Please detail the level!"); diabetesA1C_Level[0].focus(); return false}
}

if(!(thisform.clientDied65[0].checked || thisform.clientDied65[1].checked))
{alert("Please select if a parent, brother or sister died prior to age 65, other than by accident?"); thisform.clientDied65[0].focus(); return false}
if(thisform.clientDied65[0].checked)
{if(validate_required(clientDied65Detail,"Please detail")==false)
 {clientDied65Detail.focus(); return false}
}

if(!(thisform.clientExercise[0].checked || thisform.clientExercise[1].checked))
{alert("Does the client exercise three or more times per week?"); 
 clientExercise[0].focus(); return false}
if(clientExercise[0].checked)
{if(validate_required(clientExerciseDetail,"Please detail")==false)
 clientExerciseDetail.focus(); return false}

}}// end of diabetes quote form validation

/*******************************************************************************
                   Stroke Quote Form Validation
*******************************************************************************/
function validate_stroke(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}
  
if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}

if(strokeMonthFirstStroke.value)
{ if(validate_month(strokeMonthFirstStroke.value)==false)
   {alert("Please enter valid month!");
    strokeMonthFirstStroke.focus(); return false}
}

if(strokeYearFirstStroke.value)
{ if(validate_year(strokeYearFirstStroke.value)==false)
  {alert("Please enter valid year");
   strokeYearFirstStroke.focus(); return false}
}

if(strokeMonthLastStroke.value)
{ if(validate_month(strokeMonthLastStroke.value)==false)
   {alert("Please enter valid month!");
    strokeMonthLastStroke.focus(); return false}
}

if(strokeYearLastStroke.value)
{ if(validate_year(strokeYearLastStroke.value)==false)
  {alert("Please enter valid year");
   strokeYearLastStroke.focus(); return false}
}
if(strokeCarotidSurgeryMonth.value)
{ if(validate_month(strokeCarotidSurgeryMonth.value)==false)
   {alert("Please enter valid month!");
    strokeCarotidSurgeryMonth.focus(); return false}
}

if(strokeCarotidSurgeryYear.value)
{ if(validate_year(strokeCarotidSurgeryYear.value)==false)
  {alert("Please enter valid year");
   strokeCarotidSurgeryYear.focus(); return false}
}
}}// end of stroke quote form validation

/******************************************************************************
                         Depression Quote Form Validation
******************************************************************************/
function validate_depression(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}
  
if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}

if(depressionMonthSuicide.value)
{ if(validate_month(depressionMonthSuicide.value)==false)
   {alert("Please enter valid month!");
    depressionMonthSuicide.focus(); return false}
}

if(depressionYearSuicide.value)
{ if(validate_year(depressionYearSuicide.value)==false)
  {alert("Please enter valid year");
   depressionYearSuicide.focus(); return false}
}

if(depressionMonthHospitalized.value)
{ if(validate_month(depressionMonthHospitalized.value)==false)
   {alert("Please enter valid month!");
    depressionMonthHospitalized.focus(); return false}
}

if(depressionYearHospitalized.value)
{ if(validate_year(depressionYearHospitalized.value)==false)
  {alert("Please enter valid year");
   depressionYearHospitalized.focus(); return false}
}
if(depressionMonthHospitalized2.value)
{ if(validate_month(depressionMonthHospitalized2.value)==false)
   {alert("Please enter valid month!");
    depressionMonthHospitalized2.focus(); return false}
}

if(depressionYearHospitalized2.value)
{ if(validate_year(depressionYearHospitalized2.value)==false)
  {alert("Please enter valid year");
   depressionYearHospitalized2.focus(); return false}
}

if(depressionStartMonth.value)
{ if(validate_month(depressionStartMonth.value)==false)
   {alert("Please enter valid month!");
    depressionStartMonth.focus(); return false}
}

if(depressionStartYear.value)
{ if(validate_year(depressionStartYear.value)==false)
  {alert("Please enter valid year");
   depressionStartYear.focus(); return false}
}

if(depressionEndMonth.value)
{ if(validate_month(depressionEndMonth.value)==false)
   {alert("Please enter valid month!");
    depressionEndMonth.focus(); return false}
}

if(depressionEndYear.value)
{ if(validate_year(depressionEndYear.value)==false)
  {alert("Please enter valid year");
   depressionEndYear.focus(); return false}
}
}} // end of derpession quote form validation

/******************************************************************************
                      Heart Attack Quote Form Validation
******************************************************************************/
function validate_heart(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}
  
if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}
}} // end of heart quote form validation

/******************************************************************************
                     Parkinson's Disease Quote Form Validation
*******************************************************************************/
function validate_park(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}

if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}
}}// end of parkinson's quote form

/******************************************************************************                         Cancer Quote Form Validation
******************************************************************************/

function validate_cancer(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}

if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}

if(cancerMonthMetastasized.value)
{if(validate_month(cancerMonthMetastasized.value)==false)
 {alert("Please enter valid month!");
  cancerMonthMetastasized.focus(); return false }
}
 
if(cancerYearMetastasized.value)
{if(validate_year(cancerYearMetastasized.value)==false)
 {alert("Please enter valid Year(4 digits)!");
  cancerYearMetastasized.focus(); return false }
}

if(cancerMonthLastTreatment.value)
{if(validate_month(cancerMonthLastTreatment.value)==false)
 {alert("Please enter valid month!");
  cancerMonthLastTreatment.focus(); return false }
}

if(cancerYearLastTreatment.value)
{if(validate_year(cancerYearLastTreatment.value)==false)
 {alert("Please enter valid Year(4 digits)!");
  cancerYearLastTreatment.focus(); return false }
}

if(cancerRecurrent_Month.value)
{if(validate_month(cancerRecurrent_Month.value)==false)
 {alert("Please enter valid month!");
  cancerRecurrent_Month.focus(); return false }
}

if(cancerRecurrent_Year.value)
{if(validate_year(cancerRecurrent_Year.value)==false)
 {alert("Please enter valid Year(4 digits)!");
  cancerRecurrent_Year.focus(); return false }
}
}}// end of Cancer quote form validation

/*******************************************************************************                    Other Illness Quote Form Validation
*******************************************************************************/
 
function validate_illquote(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Client Name is required!")==false)
  {clientName1.focus();return false }

if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{alert("Please choose the Gender!");
 return false;}
  
if(clientBirthday1.value)
{
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}
}

if(clientAge.value)
{if (isInteger(clientAge.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientAge.focus(); return false}
}

if(clientHeight.value)
{if (isInteger(clientHeight.value)==false)
  {alert("Please enter a valid Height for the Client");
  clientHeight.focus(); return false}
}

if(clientWeight.value)
{if (isInteger(clientWeight.value)==false)
  {alert("Please enter a valid Weight for the Client");
  clientWeight.focus(); return false}
}

if(clientAmountRequested.value)
{if (isInteger(clientAmountRequested.value)==false)
  {alert("Please enter a valid Amount Requested for the Client");
  clientAmountRequested.focus(); return false}
}

if(clientMaxAnnualPremium.value)
{if (isInteger(clientMaxAnnualPremium.value)==false)
  {alert("Please enter a valid Maximum Annual Premium for the Client");
  clientMaxAnnualPremium.focus(); return false}
}

if(clientLastLifeInsYear.value)
{if (isInteger(clientLastLifeInsYear.value)==false)
  {alert("Please enter a valid Age for the Client");
  clientLastLifeInsYear.focus(); return false}
}

if(fax.value)
{if(validate_phone(fax.value)==false)
 {alert("Please enter valid fax number!");
  fax.focus(); return false}
}

if(otherMonthIllness1.value)
{ if(validate_month(otherMonthIllness1.value)==false)
   {alert("Please enter valid month!");
    otherMonthIllness1.focus(); return false}
}

if(otherYearIllness1.value)
{ if(validate_year(otherYearIllness1.value)==false)
  {alert("Please enter valid year");
   otherYearIllness1.focus(); return false}
}

if(otherMonthIllness2.value)
{ if(validate_month(otherMonthIllness2.value)==false)
   {alert("Please enter valid month!");
    otherMonthIllness2.focus(); return false}
}

if(otherYearIllness2.value)
{ if(validate_year(otherYearIllness2.value)==false)
  {alert("Please enter valid year");
   otherYearIllness2.focus(); return false}
}
if(otherMonthIllness3.value)
{ if(validate_month(otherMonthIllness3.value)==false)
   {alert("Please enter valid month!");
    otherMonthIllness3.focus(); return false}
}

if(otherYearIllness3.value)
{ if(validate_year(otherYearIllness3.value)==false)
  {alert("Please enter valid year");
   otherYearIllness3.focus(); return false}
}
}} // end of other illness quote form validation

/*******************************************************************************
                    Disability Quote Form Validation
*******************************************************************************/

function validate_disability(thisform)
{
with (thisform)
{
if(fax.value){
if (validate_phone(fax.value)==false)
  {alert("Please Enter a Valid Fax Number!")
   fax.focus();return false}}

if(agentsDate.value){
if (validate_date(agentsDate.value)==false)
  {agentsDate.focus(); return false}}

if (validate_required(clientName1,"Please enter Client Name!")==false)
  {clientName1.focus();return false }
if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if (validate_required(clientBirthday1,"Please enter Client Birthday!")==false)
  {clientBirthday1.focus();return false }
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{ alert("Please select Client Gender!");
  clientSex1[0].focus(); return false}

if(!(thisform.clientTobacco[0].checked || thisform.clientTobacco[1].checked))
{ alert("Please select Tobacco use!");
  clientSex1[0].focus(); return false}

if (validate_required(clientOccupation,"Please enter Client's Job Title and Duties!")==false)
  {clientOccupation.focus();return false }

if (validate_required(clientAnnualIncomeBonuses,"Please enter Client's Annual Income and Bonuses!")==false)
  {clientAnnualIncomeBonuses.focus();return false }

if(!(thisform.clientBusinessOwnerYN[0].checked || thisform.clientBusinessOwnerYN[1].checked))
{ alert("Please select Yes/No in Client's Business Owner!");
  clientBusinessOwnerYN[0].focus(); return false}

if(thisform.clientBusinessOwnerYN[0].checked)
{if (validate_required(clientYearsofOwnership,"Please enter years of ownership!")==false)
  {clientYearsofOwnership.focus();return false }}

if (validate_required(clientNumOfFulltimeemployees,"Please enter Client's num of Fulltime employees!")==false)
  {clientNumOfFulltimeemployees.focus();return false }
if(isInteger(clientNumOfFulltimeemployees.value)==false)
{alert("Please enter valid number for full time employees!");
 clientNumOfFulltimeemployees.focus(); return false}

if(!(thisform.clientCoverageIndOrGup[0].checked || thisform.clientCoverageIndOrGup[1].checked))
{ alert("Please select Individual/Group in Client Existing Coverage");
  clientCoverageIndOrGup[0].focus(); return false}

if (validate_required(clientEliminationPeriod,"Please enter Client's Elimination Period!")==false)
  {clientEliminationPeriod.focus();return false }

if (validate_required(clientBenefitPeriod,"Please enter Client's Benefit Period!")==false)
  {clientBenefitPeriod.focus();return false }

if (validate_required(monthlyBenefitDesiredAmt,"Please enter Monthly Benefit - Desired Amount!")==false)
  {monthlyBenefitDesiredAmt.focus();return false }

if (validate_required(monthlyBenefitQuoteMax,"Please enter Monthly Benefit - Quote Max!")==false)
  {monthlyBenefitQuoteMax.focus();return false }

}}// end of Disability Quote form

/*******************************************************************************
                    Long Term Care Quote Form Validation
*******************************************************************************/

function validate_longterm(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Please enter Client's Name!")==false)
  {clientName1.focus();return false }
if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if (validate_required(clientBirthday1,"Please enter Client Birthday!")==false)
  {clientBirthday1.focus();return false }
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}

if(clientName2.value){
if (validate_name(clientName2.value)==false)
  {alert("Client Name should be letters!");
   clientName2.focus();return false }}

if(clientBirthday2.value){
if (validate_date(clientBirthday2.value)==false)
  {clientBirthday2.focus(); return false}}

if(!(thisform.clientSex2[0].checked || thisform.clientSex2[1].checked))
{ alert("Please select Spouse Gender!");
  clientSex2[0].focus(); return false}

if(!(thisform.longtermDuplicatefromAbove[0].checked || thisform.longtermDuplicatefromAbove[1].checked))
{ alert("Please select Yes/No for Duplicate Benefits!");
  longtermDuplicatefromAbove[0].focus(); return false}

if(thisform.longtermDuplicatefromAbove[1].checked)
{if (validate_required(longtermSpouseDailyBenefitAmt,"Please enter Spouse's daily benefit amount!")==false)
  {longtermSpouseDailyBenefitAmt.focus();return false }}
}}// end of Long Term Care Quote Form

/*******************************************************************************
                    Annuity Quote Form Validation
*******************************************************************************/

function validate_annuity(thisform)
{
with (thisform)
{
if (validate_required(clientName1,"Please enter Client's Name!")==false)
  {clientName1.focus();return false }
if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if (validate_required(clientBirthday1,"Please enter Client Birthday!")==false)
  {clientBirthday1.focus();return false }
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}

if(clientName2.value){
if (validate_name(clientName2.value)==false)
  {alert("Client Name should be letters!");
   clientName2.focus();return false }}

if(clientBirthday2.value){
if (validate_date(clientBirthday2.value)==false)
  {clientBirthday2.focus(); return false}}

if(!(thisform.clientSex2[0].checked || thisform.clientSex2[1].checked))
{ alert("Please select Gender for Joint Annuitant!");
  clientSex2[0].focus(); return false}

if(annDateOfDeposit.value){
if (validate_date(annDateOfDeposit.value)==false)
  {annDateOfDeposit.focus(); return false}}

if(annDateofInitialBenefit.value){
if (validate_date(annDateofInitialBenefit.value)==false)
  {annDateofInitialBenefit.focus(); return false}}

if(annNumOfYears.value){
if(isInteger(annNumOfYears.value)==false)
{alert("Please enter valid number of years!");
 annNumOfYears.focus(); return false}}
}} //end of Annuity Quote Form

/*******************************************************************************
                    Permanent Quote Form Validation
*******************************************************************************/

function validate_permanent(thisform)
{
with (thisform)
{if(!(thisform.agentsReturn_Method[0].checked || thisform.agentsReturn_Method[1].checked || thisform.agentsReturn_Method[2].checked || thisform.agentsReturn_Method[3].checked)){
alert("Please select a return method!");
agentsReturn_Method[0].focus(); return false}

if (validate_required(clientName1,"Please enter Client's Name!")==false)
  {clientName1.focus();return false }
if (validate_name(clientName1.value)==false)
  {alert("Client Name should be letters!");
   clientName1.focus();return false }

if (validate_required(clientBirthday1,"Please enter Client Birthday!")==false)
  {clientBirthday1.focus();return false }
if (validate_date(clientBirthday1.value)==false)
  {clientBirthday1.focus(); return false}

if(!(thisform.clientSex1[0].checked || thisform.clientSex1[1].checked))
{ alert("Please select Gender for the Client!");
  clientSex1[0].focus(); return false}

if(clientName2.value)
{if (validate_name(clientName2.value)==false)
  {alert("Client Name should be letters!");
   clientName2.focus();return false }}

if(clientBirthday2.value)
{if (validate_date(clientBirthday2.value)==false)
  {clientBirthday2.focus(); return false}}

if(!(thisform.clientSex2[0].checked || thisform.clientSex2[1].checked))
{ alert("Please select Gender for the Client!");
  clientSex2[0].focus(); return false}

if(riderName.value)
{if (validate_name(riderName.value)==false)
  {alert("Rider Name should be letters!");
   riderName.focus();return false }}

if(riderBirthday.value)
{if (validate_date(riderBirthday.value)==false)
  {riderBirthday.focus(); return false}}
}} // end of Permanent Quote Form Validation

/*******************************************************************************
                    Password Request Form Validation
*******************************************************************************/

function validate_sendpassword(thisform)
{
with (thisform)
{
  if(!(username.value))
  { if(!(emailAddress.value))
    {alert("Please enter either your Username or Email!");
     return false}
  }
  if(username.value){
  if (validate_uandp(username.value)==false)
  {alert("Username can be only letters numbers _ . and -");
   username.focus(); return false}
    }
if(emailAddress.value){
if (validate_email(emailAddress,"Not a valid email address!")==false)
  { emailAddress.value=""
    emailAddress.focus();return false}
}

}}


