<!--
function validate(endpolsalesfrm){

var valid = true;

// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = endpolsalesfrm.txtEmail.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
// phone validation
var checkOK = "0123456789 ";
var checkStr = endpolsalesfrm.txtContact.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
//PolicyTerm validation
//var checkOK = "0123456789 ";
//var checkStr = endpolsalesfrm.txtTerm.value;
//var ValidTerm = true;
//var allNum = "";
//for (i = 0;  i < checkStr.length;  i++)
//{
//ch = checkStr.charAt(i);
//for (j = 0;  j < checkOK.length;  j++)
//if (ch == checkOK.charAt(j))
//break;
//if (j == checkOK.length)
//{
//ValidTerm = false;
//break;
//}
//if (ch != ",")
//allNum += ch;
//}
//Sum Assured validation
//var checkOK = "0123456789.,";
//var checkStr = endpolsalesfrm.txtSumAss.value;
//var ValidSumAss = true;
//var allNum = "";
//for (i = 0;  i < checkStr.length;  i++)
//{
//ch = checkStr.charAt(i);
//for (j = 0;  j < checkOK.length;  j++)
//if (ch == checkOK.charAt(j))
//break;
//if (j == checkOK.length)
//{
//ValidSumAss = false;
//break;
//}
//if (ch != ",")
//allNum += ch;
//}
//Policy Premium validation
//var checkOK = "0123456789.,";
//var checkStr = endpolsalesfrm.txtPrem.value;
//var ValidPrem = true;
//var allNum = "";
//for (i = 0;  i < checkStr.length;  i++)
//{
//ch = checkStr.charAt(i);
//for (j = 0;  j < checkOK.length;  j++)
//if (ch == checkOK.charAt(j))
//break;
//if (j == checkOK.length)
//{
//ValidPrem = false;
//break;
//}
//if (ch != ",")
//allNum += ch;
//}
//Sum Assured validation
//var checkOK = "0123456789.,";
//var checkStr = endpolsalesfrm.txtSurrVal.value;
//var ValidSV = true;
//var allNum = "";
//for (i = 0;  i < checkStr.length;  i++)
//{
//ch = checkStr.charAt(i);
//for (j = 0;  j < checkOK.length;  j++)
//if (ch == checkOK.charAt(j))
//break;
//if (j == checkOK.length)
//{
//ValidSV = false;
//break;
//}
//if (ch != ",")
//allNum += ch;
//}


//start of validation
if (endpolsalesfrm.txtName.value == ""){
valid = false ;
endpolsalesfrm.ErrorMail.value = "";
endpolsalesfrm.ErrorContact.value = "";
endpolsalesfrm.ErrorPostCode.value = "";
endpolsalesfrm.ErrorLifeOffice.value = "";
endpolsalesfrm.ErrorPolicyNo.value = "";
endpolsalesfrm.ErrorSDate.value = "";
endpolsalesfrm.ErrorTerm.value = "";
endpolsalesfrm.ErrorSumAss.value = "";
endpolsalesfrm.ErrorPrem.value = "";
endpolsalesfrm.ErrorPersDets.value = "Your full name is required";
endpolsalesfrm.ErrorName.value = "Full name is required";
endpolsalesfrm.txtName.focus();
}
else if (endpolsalesfrm.txtEmail.value == ""){
valid = false ;
endpolsalesfrm.ErrorName.value = "";
endpolsalesfrm.ErrorContact.value = "";
endpolsalesfrm.ErrorPostCode.value = "";
endpolsalesfrm.ErrorLifeOffice.value = "";
endpolsalesfrm.ErrorPolicyNo.value = "";
endpolsalesfrm.ErrorSDate.value = "";
endpolsalesfrm.ErrorTerm.value = "";
endpolsalesfrm.ErrorSumAss.value = "";
endpolsalesfrm.ErrorPrem.value = "";
endpolsalesfrm.ErrorPersDets.value = "Your email address is required";
endpolsalesfrm.ErrorMail.value = "Email address is required";
endpolsalesfrm.txtEmail.focus();
}
else if (!EmailValid)
{
valid = false;
endpolsalesfrm.ErrorName.value = "";
endpolsalesfrm.ErrorContact.value = "";
endpolsalesfrm.ErrorPostCode.value = "";
endpolsalesfrm.ErrorLifeOffice.value = "";
endpolsalesfrm.ErrorPolicyNo.value = "";
endpolsalesfrm.ErrorSDate.value = "";
endpolsalesfrm.ErrorTerm.value = "";
endpolsalesfrm.ErrorSumAss.value = "";
endpolsalesfrm.ErrorPrem.value = "";
endpolsalesfrm.ErrorPersDets.value = "Your email address must be a valid one please";
endpolsalesfrm.ErrorMail.value = "Email must be valid";
endpolsalesfrm.txtEmail.focus();
}
else if (endpolsalesfrm.txtContact.value == ""){
valid = false ;
endpolsalesfrm.ErrorName.value = "";
endpolsalesfrm.ErrorMail.value = "";
endpolsalesfrm.ErrorPostCode.value = "";
endpolsalesfrm.ErrorLifeOffice.value = "";
endpolsalesfrm.ErrorPolicyNo.value = "";
endpolsalesfrm.ErrorSDate.value = "";
endpolsalesfrm.ErrorTerm.value = "";
endpolsalesfrm.ErrorSumAss.value = "";
endpolsalesfrm.ErrorPrem.value = "";
endpolsalesfrm.ErrorPersDets.value = "Your contact telephone number is required";
endpolsalesfrm.ErrorContact.value = "A telephone number is required";
endpolsalesfrm.txtContact.focus();
}
else if (!allValid)
{
endpolsalesfrm.ErrorName.value = "";
endpolsalesfrm.ErrorMail.value = "";
endpolsalesfrm.ErrorPostCode.value = "";
endpolsalesfrm.ErrorLifeOffice.value = "";
endpolsalesfrm.ErrorPolicyNo.value = "";
endpolsalesfrm.ErrorSDate.value = "";
endpolsalesfrm.ErrorTerm.value = "";
endpolsalesfrm.ErrorSumAss.value = "";
endpolsalesfrm.ErrorPrem.value = "";
endpolsalesfrm.ErrorPersDets.value = "Your contact number must be numbers only please";
endpolsalesfrm.ErrorContact.value = "Number's only please";
endpolsalesfrm.txtContact.focus();
valid = false;
}
else if (endpolsalesfrm.txtPostCode.value == ""){
valid = false ;
endpolsalesfrm.ErrorName.value = "";
endpolsalesfrm.ErrorMail.value = "";
endpolsalesfrm.ErrorContact.value = "";
endpolsalesfrm.ErrorPostCode.value = "Post Code is required";
endpolsalesfrm.ErrorLifeOffice.value = "";
endpolsalesfrm.ErrorPolicyNo.value = "";
endpolsalesfrm.ErrorSDate.value = "";
endpolsalesfrm.ErrorTerm.value = "";
endpolsalesfrm.ErrorSumAss.value = "";
endpolsalesfrm.ErrorPrem.value = "";
endpolsalesfrm.ErrorPersDets.value = "Your Post Code is required";
endpolsalesfrm.ErrorPostCode.value = "Post Code is required";
endpolsalesfrm.txtPostCode.focus();
}
//else if (endpolsalesfrm.selLifeOffice.value == '1')
//{
//valid = false;

//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "Life Office is required";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";

//endpolsalesfrm.ErrorPolDets.value = "Your Life Office is required";
//endpolsalesfrm.selLifeOffice.focus();
//}
//else if (endpolsalesfrm.txtPolicyNo.value == ""){
//valid = false ;
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorPolDets.value = "Your policy number is required";
//endpolsalesfrm.ErrorPolicyNo.value = "Policy number is required";
//endpolsalesfrm.txtPolicyNo.focus();
//}
//else if (endpolsalesfrm.selSDay.value == "1")
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorPolDets.value = "The policy start day is required";
//endpolsalesfrm.ErrorSDate.value = "The DAY your policy started is required";
//endpolsalesfrm.selSDay.focus();
//valid = false;
//}
//else if (endpolsalesfrm.selSMonth.value == "1")
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorPolDets.value = "The policy start month is required";
//endpolsalesfrm.ErrorSDate.value = "The MONTH your policy started is required";
//endpolsalesfrm.selSMonth.focus();
//valid = false;
//}
//else if (endpolsalesfrm.selSYear.value == "1")
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorPolDets.value = "The policy start year is required";
//endpolsalesfrm.ErrorSDate.value = "The YEAR your policy started is required";
//endpolsalesfrm.selSYear.focus();
//valid = false;
//}
//else if (endpolsalesfrm.txtTerm.value == ""){
//valid = false ;
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorPolDets.value = "How long is the term of your policy?";
//endpolsalesfrm.ErrorTerm.value = "The life of your Policy is required";
//endpolsalesfrm.txtTerm.focus();
//}
//else if (!ValidTerm)
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorPolDets.value = "Your policy term must be numbers only please";
//endpolsalesfrm.ErrorTerm.value = "Your policy can only be 0 to 99 years";
//endpolsalesfrm.txtTerm.focus();
//valid = false;
//}
//else if (endpolsalesfrm.txtSumAss.value == ""){
//valid = false ;
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "The Sum Assured is required";
//endpolsalesfrm.ErrorPrem.value = "";

//endpolsalesfrm.ErrorPolDets.value = "What is the Basic Sum Assured on your policy?";
//endpolsalesfrm.txtSumAss.focus();
//}
//else if (!ValidSumAss)
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "Numbers, Commas and Full stops";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorSurrVal.value = "";

//endpolsalesfrm.ErrorPolDets.value = "Your policy term must be numbers and (,) or (.) i.e. 500,000.00";
//endpolsalesfrm.txtSumAss.focus();
//valid = false;
//}
//else if (endpolsalesfrm.txtPrem.value == ""){
//valid = false ;
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "Policy Premium is required";
//endpolsalesfrm.ErrorSurrVal.value = "";

//endpolsalesfrm.ErrorPremDets.value = "The premium you pay on your policy is required";
//endpolsalesfrm.txtPrem.focus();
//}
//else if (!ValidPrem)
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "Numbers, Commas and Full stops";
//endpolsalesfrm.ErrorSurrVal.value = "";

//endpolsalesfrm.ErrorPremDets.value = "Policy Premium must be numbers and (,) or (.) i.e. 1,000.00";
//endpolsalesfrm.txtPrem.focus();
//valid = false;
//}
//else if (endpolsalesfrm.txtSurrVal.value == ""){
//valid = false ;
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorSurrVal.value = "Surrender Value is required";

//endpolsalesfrm.ErrorPremDets.value = "The premium you pay on your policy is required";
//endpolsalesfrm.txtSurrVal.focus();
//}
//else if (!ValidSV)
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorSurrVal.value = "Numbers, Commas and Full stops";

//endpolsalesfrm.ErrorPremDets.value = "Policy Premium must be numbers and (,) or (.) i.e. 1,000.00";
//endpolsalesfrm.txtSurrVal.focus();
//valid = false;
//}
//else if (endpolsalesfrm.selSVDay.value == "1")
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorSurrVal.value = "";
//endpolsalesfrm.ErrorSVDate.value = "The DAY your policy started is required";

//endpolsalesfrm.ErrorPremDets.value = "The Surrender Value day is required";
//endpolsalesfrm.selSVDay.focus();
//valid = false;
//}
//else if (endpolsalesfrm.selSVMonth.value == "1")
//{
//endpolsalesfrm.ErrorName.value = "";
//endpolsalesfrm.ErrorMail.value = "";
//endpolsalesfrm.ErrorContact.value = "";
//endpolsalesfrm.ErrorPostCode.value = "";
//endpolsalesfrm.ErrorLifeOffice.value = "";
//endpolsalesfrm.ErrorPolicyNo.value = "";
//endpolsalesfrm.ErrorSDate.value = "";
//endpolsalesfrm.ErrorTerm.value = "";
//endpolsalesfrm.ErrorSumAss.value = "";
//endpolsalesfrm.ErrorPrem.value = "";
//endpolsalesfrm.ErrorSurrVal.value = "";
//endpolsalesfrm.ErrorSVDate.value = "The MONTH your policy started is required";

//endpolsalesfrm.ErrorPremDets.value = "The Surrender Value month is required";
//endpolsalesfrm.selSVMonth.focus();
//valid = false;
//}


return valid;
}
//-->
























<!--
function Valid_Comp(endpolcompfrm){

var valid = true;

// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = endpolcompfrm.txtEmail.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
// phone validation
var checkOK = "0123456789 ";
var checkStr = endpolcompfrm.txtContact.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
//PolicyTerm validation
var checkOK = "0123456789 ";
var checkStr = endpolcompfrm.txtTerm.value;
var ValidTerm = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
ValidTerm = false;
break;
}
if (ch != ",")
allNum += ch;
}
//Sum Assured validation
var checkOK = "0123456789.,";
var checkStr = endpolcompfrm.txtSumAss.value;
var ValidSumAss = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
ValidSumAss = false;
break;
}
if (ch != ",")
allNum += ch;
}

// require at least one radio button be selected
var IFASelected = false;
for (i = 0;  i < endpolcompfrm.radIFA.length;  i++)
{
if (endpolcompfrm.radIFA[i].checked)
IFASelected = true;
}

// require at least one radio button be selected
var PrevSelected = false;
for (i = 0;  i < endpolcompfrm.radReclaim.length;  i++)
{
if (endpolcompfrm.radReclaim[i].checked)
PrevSelected = true;
}

//endpolcompfrm.ErrorName.value = "";
//endpolcompfrm.ErrorMail.value = "";
//endpolcompfrm.ErrorContact.value = "";
//endpolcompfrm.ErrorPostCode.value = "";
//endpolcompfrm.ErrorIFA.value = "";
//endpolcompfrm.ErrorLifeOffice.value = "";
//endpolcompfrm.ErrorPolicyNo.value = "";
//endpolcompfrm.ErrorSDate.value = "";
//endpolcompfrm.ErrorTerm.value = "";
//endpolcompfrm.ErrorSumAss.value = "";



//start of validation
if (endpolcompfrm.txtName.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "Full name is required";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPersDets.value = "Your full name is required";
endpolcompfrm.txtName.focus();
}
else if (endpolcompfrm.txtEmail.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "Email address is required";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPersDets.value = "Your email address is required";
endpolcompfrm.txtEmail.focus();
}
else if (!EmailValid)
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "Email must be valid";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPersDets.value = "Your email address must be a valid one please";
endpolcompfrm.txtEmail.focus();
valid = false;
}
else if (endpolcompfrm.txtContact.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "A telephone number is required";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPersDets.value = "Your contact telephone number is required";
endpolcompfrm.txtContact.focus();
}
else if (!allValid)
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "Number's only please";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPersDets.value = "Your contact number must be numbers only please";
endpolcompfrm.txtContact.focus();
valid = false;
}
else if (endpolcompfrm.txtPostCode.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "Post Code is required";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPersDets.value = "Your Post Code is required";
endpolcompfrm.txtPostCode.focus();
}
else if (!IFASelected)
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "Please Select";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "Please tell us where your policy came from";
valid = false;
}
else if (!PrevSelected)
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "Please Select";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "Please tell us where your policy came from";
valid = false;
}
else if (endpolcompfrm.selLifeOffice.value == '1')
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "Life Office is required";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "Your Life Office is required";
endpolcompfrm.selLifeOffice.focus();
valid = false;
}
else if (endpolcompfrm.txtPolicyNo.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "Policy number is required";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "Your policy number is required";
endpolcompfrm.txtPolicyNo.focus();
}
else if (endpolcompfrm.selSDay.value == '1')
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "The DAY your policy started is required";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "The policy start day is required";
endpolcompfrm.selSDay.focus();
valid = false;
}
else if (endpolcompfrm.selSMonth.value == '1')
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "The MONTH your policy started is required";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "The policy start month is required";
endpolcompfrm.selSMonth.focus();
valid = false;
}
else if (endpolcompfrm.selSYear.value == '1')
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "The YEAR your policy started is required";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "The policy start year is required";
endpolcompfrm.selSYear.focus();
valid = false;
}
else if (endpolcompfrm.txtTerm.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "The life of your Policy is required";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "How long is the term of your policy?";
endpolcompfrm.txtTerm.focus();
}
else if (!ValidTerm)
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "Your policy can only be 0 to 99 years";
endpolcompfrm.ErrorSumAss.value = "";

endpolcompfrm.ErrorPolDets.value = "Your policy term must be numbers only please";
endpolcompfrm.txtTerm.focus();
valid = false;
}
else if (endpolcompfrm.txtSumAss.value == ""){
valid = false ;
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorPrev.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "The Sum Assured is required";

endpolcompfrm.ErrorPolDets.value = "What is the Basic Sum Assured on your policy?";
endpolcompfrm.txtSumAss.focus();
}
else if (!ValidSumAss)
{
endpolcompfrm.ErrorName.value = "";
endpolcompfrm.ErrorMail.value = "";
endpolcompfrm.ErrorContact.value = "";
endpolcompfrm.ErrorPostCode.value = "";
endpolcompfrm.ErrorIFA.value = "";
endpolcompfrm.ErrorLifeOffice.value = "";
endpolcompfrm.ErrorPolicyNo.value = "";
endpolcompfrm.ErrorSDate.value = "";
endpolcompfrm.ErrorTerm.value = "";
endpolcompfrm.ErrorSumAss.value = "Numbers, Commas and Full stops";

endpolcompfrm.ErrorPolDets.value = "Policy term must be numbers and (,) or (.) i.e. 500,000.00";
endpolcompfrm.txtSumAss.focus();
valid = false;
}

return valid;
}
//-->

