// JavaScript Document

var win= null;
function NewWindow(fieldName)
{
// Save the name of the target input field to the hidden input
document.frmFree.fieldName.value=fieldName
// Opens the Job List Popup
win2=window.open('templates/za.html','jobPop','height=300,width=450,top=150,left=100,scrollbars=yes,resizable=no');
}
function doIt(job)
{
// Get the selected job and send it to the target input field
eval('document.frmFree.' + document.frmFree.fieldName.value + '.value=\'' + job + '\'');
}
function info()
{
window.open('templates/info.html','infowindow','height=350,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip1()
{
window.open('templates/tip1.html','infowindow','height=200,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip2()
{
window.open('templates/tip2.html','tipwindow2','height=350,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip3()
{
window.open('templates/tip3.html','tipwindow3','height=200,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip4()
{
window.open('templates/tip4.html','tipwindow4','height=350,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip5()
{
window.open('templates/tip5.html','tipwindow5','height=200,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip6()
{
window.open('templates/tip6.html','tipwindow6','height=175,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip7()
{
window.open('templates/tip7.html','tipwindow7','height=350,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip8()
{
window.open('templates/tip8.html','tipwindow8','height=175,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip9()
{
window.open('tip9.html','tipwindow9','height=350,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip10()
{
window.open('templates/tip10.html','tipwindow10','height=200,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}
function tip11()
{
window.open('templates/tip11.html','tipwindow11','height=200,width=500,top=150,left=100,scrollbars=yes,resizable=no');
}



function calculate (frmFree) {
	  var op1 = parseFloat(frmFree.phdy.value);
	  if (isNaN(op1)) {
	    window.alert("You have not entered a valid number of years for PhD. If not applicable, please enter a zero (0).");
	    frmFree.phdy.focus();
	    frmFree.phdy.select();
	    return;
	  }
	  var op1m = parseFloat(frmFree.phdm.value);
	  if (isNaN(op1m)) {
	    window.alert("You have not entered a valid number of months for PhD. If not applicable, please enter a zero (0).");
	    frmFree.phdm.focus();
	    frmFree.phdm.select();
	    return;
	  }
	  var op2 = parseFloat(frmFree.mastery.value);
	  if (isNaN(op2)) {
	    window.alert("You have not entered a valid number of years for your Master degree. If not applicable, please enter a zero (0).");
	    frmFree.mastery.focus();
	    frmFree.mastery.select();
	    return;
	  }
	  var op2m = parseFloat(frmFree.masterm.value);
	  if (isNaN(op2m)) {
	    window.alert("You have not entered a valid number of months for your Master degree. If not applicable, please enter a zero (0).");
	    frmFree.masterm.focus();
	    frmFree.masterm.select();
	    return;
	  }
	  var op3 = parseFloat(frmFree.deg2y.value);
	  if (isNaN(op3)) {
	    window.alert("You have not entered a valid number of years for your Second Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.deg2y.focus();
	    frmFree.deg2y.select();
	    return;
	  }
	  var op3m = parseFloat(frmFree.deg2m.value);
	  if (isNaN(op3m)) {
	    window.alert("You have not entered a valid number of months for your Second Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.deg2m.focus();
	    frmFree.deg2m.select();
	    return;
	  }
	  var op4 = parseFloat(frmFree.deg1y.value);
	  if (isNaN(op4)) {
	    window.alert("You have not entered a valid number of years for your First Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.deg1y.focus();
	    frmFree.deg1y.select();
	    return;
	  }
	  var op4m = parseFloat(frmFree.deg1m.value);
	  if (isNaN(op4m)) {
	    window.alert("You have not entered a valid number of months for your First Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.deg1m.focus();
	    frmFree.deg1m.select();
	    return;
	  }
	  var op5 = parseFloat(frmFree.diply.value);
	  if (isNaN(op5)) {
	    window.alert("You have not entered a valid number of years for Diploma. If not applicable, please enter a zero (0).");
	    frmFree.diply.focus();
	    frmFree.diply.select();
	    return;
	  }
	  var op5m = parseFloat(frmFree.diplm.value);
	  if (isNaN(op5m)) {
	    window.alert("You have not entered a valid number of months for Diploma. If not applicable, please enter a zero (0).");
	    frmFree.diplm.focus();
	    frmFree.diplm.select();
	    return;
	  }
	  var op6 = parseFloat(frmFree.certy.value);
	  if (isNaN(op6)) {
	    window.alert("You have not entered a valid number of years for Certificate. If not applicable, please enter a zero (0).");
	    frmFree.certy.focus();
	    frmFree.certy.select();
	    return;
	  }
	  var op6m = parseFloat(frmFree.certm.value);
	  if (isNaN(op6m)) {
	    window.alert("You have not entered a valid number of months for Certificate. If not applicable, please enter a zero (0).");
	    frmFree.certm.focus();
	    frmFree.certm.select();
	    return;
	  }
	  var op7 = parseFloat(frmFree.appy.value);
	  if (isNaN(op7)) {
	    window.alert("You have not entered a valid number of years for Apprenticeship. If not applicable, please enter a zero (0).");
	    frmFree.appy.focus();
	    frmFree.appy.select();
	    return;
	  }
	  var op7m = parseFloat(frmFree.appm.value);
	  if (isNaN(op7m)) {
	    window.alert("You have not entered a valid number of months for Apprenticeship. If not applicable, please enter a zero (0).");
	    frmFree.appm.focus();
	    frmFree.appm.select();
	    return;
	  }
	    if (frmFree.high.value == "0" ) {
	    window.alert("Enter number of years spent at secondary school/high school.");
	    frmFree.high.focus();
	    frmFree.high.select();
	    return;
	  }
	  var op8 = parseFloat(frmFree.high.value);
	  if (isNaN(op8)) {
	    window.alert("You have not entered a valid number of years for your time at secondary school/high school. If not applicable, please enter a zero (0).");
	    frmFree.high.focus();
	    frmFree.high.select();
	    return;
	  }
	    if (frmFree.pmy.value == "0" ) {
	    window.alert("Enter number of years at primary school, including years at creche or kindergarten.");
	    frmFree.pmy.focus();
	    frmFree.pmy.select();
	    return;
	  }
	  var op9 = parseFloat(frmFree.pmy.value);
	  if (isNaN(op9)) {
	    window.alert("You have not entered a valid number for your years at primary school as well as creche or kindergarten.");
	    frmFree.pmy.focus();
	    frmFree.pmy.select();
	    return;
	  }

	  var T_O_T_A_L = "";
 	  T_O_T_A_L = op1+op2+op3+op4+op5+op6+op7+op8+op9+op1m/12+op2m/12+op3m/12+op4m/12+op5m/12+op6m/12+op7m/12;
	  var rndtot= String((Math.round(T_O_T_A_L * 10)/10));
	  frmFree.edytotal.value = rndtot;
	}
//now do the spouse/partner
function calcsp (frmFree) {
	  var sop1 = parseFloat(frmFree.spphdy.value);
	  if (isNaN(sop1)) {
	    window.alert("You have not entered a valid number of years for Spouse/Partner's PhD. If not applicable, please enter a zero (0).");
	    frmFree.spphdy.focus();
	    frmFree.spphdy.select();
	    return;
	  }
	  var sop1m = parseFloat(frmFree.spphdm.value);
	  if (isNaN(sop1m)) {
	    window.alert("You have not entered a valid number of months for Spouse/Partner's PhD. If not applicable, please enter a zero (0).");
	    frmFree.spphdm.focus();
	    frmFree.spphdm.select();
	    return;
	  }
	  var sop2 = parseFloat(frmFree.spmastery.value);
	  if (isNaN(sop2)) {
	    window.alert("You have not entered a valid number of years for your Spouse/Partner's Master degree. If not applicable, please enter a zero (0).");
	    frmFree.spmastery.focus();
	    frmFree.spmastery.select();
	    return;
	  }
	  var sop2m = parseFloat(frmFree.spmasterm.value);
	  if (isNaN(sop2m)) {
	    window.alert("You have not entered a valid number of months for your Spouse/Partner's Master degree. If not applicable, please enter a zero (0).");
	    frmFree.spmasterm.focus();
	    frmFree.spmasterm.select();
	    return;
	  }
	  var sop3 = parseFloat(frmFree.spdeg2y.value);
	  if (isNaN(sop3)) {
	    window.alert("You have not entered a valid number of years for your Spouse/Partner's Second Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.spdeg2y.focus();
	    frmFree.spdeg2y.select();
	    return;
	  }
	  var sop3m = parseFloat(frmFree.spdeg2m.value);
	  if (isNaN(sop3m)) {
	    window.alert("You have not entered a valid number of months for your Spouse/Partner's Second Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.spdeg2m.focus();
	    frmFree.spdeg2m.select();
	    return;
	  }
	  var sop4 = parseFloat(frmFree.spdeg1y.value);
	  if (isNaN(sop4)) {
	    window.alert("You have not entered a valid number of years for your Spouse/Partner's First Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.spdeg1y.focus();
	    frmFree.spdeg1y.select();
	    return;
	  }
	  var sop4m = parseFloat(frmFree.spdeg1m.value);
	  if (isNaN(sop4m)) {
	    window.alert("You have not entered a valid number of months for your Spouse/Partner's First Bachelor degree. If not applicable, please enter a zero (0).");
	    frmFree.spdeg1m.focus();
	    frmFree.spdeg1m.select();
	    return;
	  }
	  var sop5 = parseFloat(frmFree.spdiply.value);
	  if (isNaN(sop5)) {
	    window.alert("You have not entered a valid number of years for Spouse/Partner's Diploma. If not applicable, please enter a zero (0).");
	    frmFree.spdiply.focus();
	    frmFree.spdiply.select();
	    return;
	  }
	  var sop5m = parseFloat(frmFree.spdiplm.value);
	  if (isNaN(sop5m)) {
	    window.alert("You have not entered a valid number of months for Spouse/Partner's Diploma. If not applicable, please enter a zero (0).");
	    frmFree.spdiplm.focus();
	    frmFree.spdiplm.select();
	    return;
	  }
	  var sop6 = parseFloat(frmFree.spcerty.value);
	  if (isNaN(sop6)) {
	    window.alert("You have not entered a valid number of years for Spouse/Partner's Certificate. If not applicable, please enter a zero (0).");
	    frmFree.spcerty.focus();
	    frmFree.spcerty.select();
	    return;
	  }
	  var sop6m = parseFloat(frmFree.spcertm.value);
	  if (isNaN(sop6m)) {
	    window.alert("You have not entered a valid number of months for Spouse/Partner's Certificate. If not applicable, please enter a zero (0).");
	    frmFree.spcertm.focus();
	    frmFree.spcertm.select();
	    return;
	  }
	  var sop7 = parseFloat(frmFree.spappy.value);
	  if (isNaN(sop7)) {
	    window.alert("You have not entered a valid number of years for Spouse/Partner's Apprenticeship. If not applicable, please enter a zero (0).");
	    frmFree.spappy.focus();
	    frmFree.spappy.select();
	    return;
	  }
	  var sop7m = parseFloat(frmFree.spappm.value);
	  if (isNaN(sop7m)) {
	    window.alert("You have not entered a valid number of months for Spouse/Partner's Apprenticeship. If not applicable, please enter a zero (0).");
	    frmFree.spappm.focus();
	    frmFree.spappm.select();
	    return;
	  }
	    if (frmFree.sphigh.value == "" ) {
	    window.alert("Enter number of Spouse/Partner's years at secondary school/high school. If not applicable, please enter a zero (0).");
	    frmFree.sphigh.focus();
	    frmFree.sphigh.select();
	    return;
	  }
	  var sop8 = parseFloat(frmFree.sphigh.value);
	  if (isNaN(sop8)) {
	    window.alert("You have not entered a valid number of years for your Spouse/Partner's time at secondary school/high school. If not applicable, please enter a zero (0).");
	    frmFree.sphigh.focus();
	    frmFree.sphigh.select();
	    return;
	  }
	    if (frmFree.sppmy.value == "0" ) {
	    window.alert("Enter number of Spouse/Partner's years at primary school, including years at creche or kindergarten.");
	    frmFree.sppmy.focus();
	    frmFree.sppmy.select();
	    return;
	  }
	  var sop9 = parseFloat(frmFree.sppmy.value);
	  if (isNaN(sop9)) {
	    window.alert("You have not entered a valid number for your Spouse/Partner's years at primary school as well as at creche or kindergarten.");
	    frmFree.sppmy.focus();
	    frmFree.sppmy.select();
	    return;
	  }

	  var SpT_O_T_A_L = "";
	    SpT_O_T_A_L = 
sop1+sop2+sop3+sop4+sop5+sop6+sop7+sop8+sop9+sop1m/12+sop2m/12+sop3m/12+sop4m/12+sop5m/12+sop6m/12+sop7m/12;
	  var sprndtot= String((Math.round(SpT_O_T_A_L * 10)/10));
	  frmFree.spedytotal.value = sprndtot;
	}

function check() {
                         if (document.frmFree.Fam_Name.value == "") {
                         alert("Enter your Family Name or Surname. Please note that you will not receive an Assessment from Abrams & Krochak if you do not provide a legitimate name.")
	    		// frmFree.info1.focus();
	    		 frmFree.Fam_Name.select();
                         return false
                         }
                         if (document.frmFree.First_Name.value == "") {
                         alert("Please enter your First Name.")
	    		// frmFree.info1.focus();
	    		 frmFree.First_Name.select();
                         return false
                         }
                         if (document.frmFree.Title______[0].selected) {
                         alert("Please enter your Title.")
	    		 frmFree.Title______.focus();
                         return false
                         }
                         if (document.frmFree.Country___[0].selected) {
                         alert("Please indicate country of current residence in Step 1. This is required for Assessment purposes.")
	    		 frmFree.Country___.focus();
                         return false
                         }
                         if (document.frmFree.Tel_Home.value == "") {
                         alert("Please provide a contact Telephone Number. This will only be used in the event that we cannot contact you at the E-mail address you have provided to deliver your Free Assessment.")
	    		 // frmFree.info1.focus();
	    		 frmFree.Tel_Home.select();
                         return false
                         }
                         if (document.frmFree.email.value == "") {
                         alert("IMPORTANT - You have not entered an E-mail address. This is required in order to send you your FREE assessment. Please enter your E-mail address in Step 1 before resubmitting.")
	    		 frmFree.Tel_Home.focus();
	    		 frmFree.email.select();
                         return false
                         }
			 if (document.frmFree.email.value.indexOf(".") == -1) {
		 	 alert("You have NOT entered a valid E-mail address. A valid E-mail address always includes a full stop (.) and is required in order for us to return your FREE assessment to you. Please enter a valid E-mail address in Step 1 before resubmitting.");
	    		 frmFree.Tel_Home.focus();
	    		 frmFree.email.select();
	 	 	 return false;
			 }
			 if (document.frmFree.email.value.indexOf("@") == -1) {
			 alert("You have NOT entered a valid E-mail address. Where is your @ sign ? We need your correct E-mail address to return your FREE assessment to you. Please enter a valid E-mail address in Step 1 before resubmitting.");
	    		 frmFree.Tel_Home.focus();
	    		 frmFree.email.select();
			 return false;
			 }
                         if (document.frmFree.Birth_Year[0].selected) {
                         alert("Please indicate year of birth in Step 1.")
	    		 frmFree.Birth_Year.focus();
                         return false
                         }
                         if (document.frmFree.BirthMonth[0].selected) {
                         alert("Please indicate month of birth in Step 1.")
	    		 frmFree.BirthMonth.focus();
                         return false
                         }
                         if (document.frmFree.Birth_Date[0].selected) {
                         alert("Please indicate date of birth in Step 1.")
	    		 frmFree.Birth_Date.focus();
                         return false
                         }
//added Oct04 - make marital status compulsory (for use in husband/wife in first)
                         if (document.frmFree.MariStatus[0].selected) {
                         alert("Please indicate your Marital Status in Step 1.")
	    		 frmFree.MariStatus.focus();
                         return false
                         }
//added Oct04 - make primary and secondary years compulsory
	    if (document.frmFree.pmy.value == "0" ) {
	    alert("Enter number of years at primary school, including years at creche or kindergarten.");
	    frmFree.pmy.focus();
	    frmFree.pmy.select();
	    return false;
	  }
	    if (document.frmFree.high.value == "0" ) {
	    alert("Enter number of years spent at secondary school/high school.");
	    frmFree.high.focus();
	    frmFree.high.select();
	    return false;
	  }
                         if (document.frmFree.Highest_Level[0].selected) {
                         alert("Please indicate the highest level of Education you have completed in Step 2.")
	    		 frmFree.Highest_Level.focus();
                         return false
                         }
			//check if second degree but no first degree entered
                         if (document.frmFree.deg2y.value != "0" && document.frmFree.deg1y.value == "0") {
                         alert("You must enter your First Degree details in Step 2, in order to receive credit for your Second and Further Degrees.")
	    		 frmFree.deg1y.focus();
                         return false
                         }
			//check if masters but no first degree entered
                         if (document.frmFree.mastery.value != "0" && document.frmFree.deg1y.value == "0") {
                         alert("You must enter your First Degree details in Step 2, in order to receive credit for your Masters.")
	    		 frmFree.deg1y.focus();
                         return false
                         }
			//check if phd but no first degree entered
                         if (document.frmFree.phdy.value != "0" && document.frmFree.deg1y.value == "0") {
                         alert("You must enter your First Degree details in Step 2, in order to receive credit for your PhD.")
	    		 frmFree.deg1y.focus();
                         return false
                         }
//Xtra checks added Oct04 - no of years in boxes must match Highest_Level selected

	if (document.frmFree.Highest_Level.value == "18" && document.frmFree.phdy.value == "0") {
	alert("You have indicated that you have a PhD. Please enter the number of years of study in the appropriate box.")
	frmFree.phdy.focus();
	frmFree.phdy.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "17" && document.frmFree.mastery.value == "0") {
	alert("You have indicated that you have a Masters Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.mastery.focus();
	frmFree.mastery.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "16" && document.frmFree.deg2y.value == "0") {
	alert("You have indicated that you have a Second Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.deg2y.focus();
	frmFree.deg2y.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "15" && document.frmFree.deg2y.value == "0") {
	alert("You have indicated that you have a Second Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.deg2y.focus();
	frmFree.deg2y.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "14" && document.frmFree.deg2y.value == "0") {
	alert("You have indicated that you have a Second Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.deg2y.focus();
	frmFree.deg2y.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "13" && document.frmFree.deg1y.value == "0") {
	alert("You have indicated that you have a Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.deg1y.focus();
	frmFree.deg1y.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "12" && document.frmFree.deg1y.value == "0") {
	alert("You have indicated that you have a Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.deg1y.focus();
	frmFree.deg1y.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "11" && document.frmFree.deg1y.value == "0") {
	alert("You have indicated that you have a Degree. Please enter the number of years of study in the appropriate box.")
	frmFree.deg1y.focus();
	frmFree.deg1y.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "10" && document.frmFree.diply.value == "0") {
	alert("You have indicated that you have a Diploma. Please enter the number of years of study in the appropriate box.")
	frmFree.diply.focus();
	frmFree.diply.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "9" && document.frmFree.diply.value == "0") {
	alert("You have indicated that you have a Diploma. Please enter the number of years of study in the appropriate box.")
	frmFree.diply.focus();
	frmFree.diply.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "8" && document.frmFree.diply.value == "0") {
	alert("You have indicated that you have a Diploma. Please enter the number of years of study in the appropriate box.")
	frmFree.diply.focus();
	frmFree.diply.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "7" && document.frmFree.diply.value == "0") {
	alert("You have indicated that you have a Diploma. Please enter the number of years of study in the appropriate box.")
	frmFree.diply.focus();
	frmFree.diply.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "6" && document.frmFree.certy.value == "0") {
	alert("You have indicated that you have a Certificate. Please enter the number of years of study in the appropriate box.")
	frmFree.certy.focus();
	frmFree.certy.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "5" && document.frmFree.certy.value == "0") {
	alert("You have indicated that you have a Certificate. Please enter the number of years of study in the appropriate box.")
	frmFree.certy.focus();
	frmFree.certy.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "4" && document.frmFree.certy.value == "0") {
	alert("You have indicated that you have a Certificate. Please enter the number of years of study in the appropriate box.")
	frmFree.certy.focus();
	frmFree.certy.select();
	return false
	}
	if (document.frmFree.Highest_Level.value == "3" && document.frmFree.appy.value == "0") {
	alert("You have indicated that you have served an Apprenticeship. Please enter the number of years in the appropriate box.")
	frmFree.appy.focus();
	frmFree.appy.select();
	return false
	}

//Xtra check added Oct04 - they must provide job details !!
if (document.frmFree.job1.value=="") {
	    		alert("Please provide your employment details in Step 3.")
	    		frmFree.tipbox3.focus();
	    		frmFree.job1.select();
                        return false
                        }
//job section - check that they have entered a numeric code
		if (document.frmFree.job1.value!="") {
	  		var getjob1 = (frmFree.job1.value);
	  		var subjob1 = getjob1.substring(getjob1.lastIndexOf(" ") + 1);
			 var chkjob1 = parseInt(subjob1);
	  		if (isNaN(chkjob1)) {
	    		alert("Please Click the 'Select' button in Step 3 to choose job title and code for your present job from the alphabetical lists which will pop up for this purpose.")
	    		 frmFree.tipbox3.focus();
	    		 frmFree.job1.select();
                         return false
                         }
		}

		if (document.frmFree.job2.value!="") {
	  		var getjob2 = (frmFree.job2.value);
	  		var subjob2 = getjob2.substring(getjob2.lastIndexOf(" ") + 1);
			 var chkjob2 = parseInt(subjob2);
	  		if (isNaN(chkjob2)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox3.focus();
	    		 frmFree.job2.select();
                         return false
                         }
		}

		if (document.frmFree.job3.value!="") {
	  		var getjob3 = (frmFree.job3.value);
	  		var subjob3 = getjob3.substring(getjob3.lastIndexOf(" ") + 1);
			 var chkjob3 = parseInt(subjob3);
	  		if (isNaN(chkjob3)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox3.focus();
	    		 frmFree.job3.select();
                         return false
                         }
		}

		if (document.frmFree.job4.value!="") {
	  		var getjob4 = (frmFree.job4.value);
	  		var subjob4 = getjob4.substring(getjob4.lastIndexOf(" ") + 1);
			 var chkjob4 = parseInt(subjob4);
	  		if (isNaN(chkjob4)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox3.focus();
	    		 frmFree.job4.select();
                         return false
                         }
		}

		if (document.frmFree.job5.value!="") {
	  		var getjob5 = (frmFree.job5.value);
	  		var subjob5 = getjob5.substring(getjob5.lastIndexOf(" ") + 1);
			 var chkjob5 = parseInt(subjob5);
	  		if (isNaN(chkjob5)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox3.focus();
	    		 frmFree.job5.select();
                         return false
                         }
		}


//quick check that if years entered in present job, months are also entered
			if (document.frmFree.fy1.value !=0) {
				if (document.frmFree.fm1.value==0) {
                         alert("Please enter start month for Present Job.")
	    		 frmFree.tipbox3.focus();
                         return false
				}
			}

			if (document.frmFree.fy1.value !=0) {
				if (document.frmFree.ty1.value==0) {
                         alert("Please enter current month and current year in Step 3 if you are still working in your Present Job.")
	    		 frmFree.ty1.focus();
                         return false
				}
			}
			if (document.frmFree.ty1.value !=0) {
				if (document.frmFree.tm1.value==0) {
                         alert("Please enter current month in Step 3.")
	    		 frmFree.tm1.focus();
                         return false
				}
			}
//now check that if they have entered a date they have entered a code and vice versa
		if (frmFree.job1.value!="" && document.frmFree.ty1.value==0){
			alert("Please enter dates for your present job.")
			frmFree.fm1.focus();
			return false
			}
		if (frmFree.job1.value=="" && document.frmFree.ty1.value!=0){
			alert("Please enter your present job description and code.")
			frmFree.job1.focus();
			frmFree.job1.select();
			return false
			}
	
//work details - check years worked are not negative
			if (document.frmFree.ty1.value < document.frmFree.fy1.value) {
                         alert("Something is wrong with the dates entered for Present Job. Please check and re-enter.")
	    		 frmFree.fy1.focus();
                         return false
                         }

//check added 3/6/03 to 2nd last job that if they have entered date they have entered code
		if (document.frmFree.job2.value!="" && document.frmFree.ty2.value==0){
			alert("Please enter dates for your 2nd Last Job.")
			frmFree.fm2.focus();
			return false
			}
		if (document.frmFree.job2.value=="" && document.frmFree.ty2.value!=0){
			alert("Please enter your 2nd Last Job description and code.")
			frmFree.job2.focus();
			frmFree.job2.select();
			return false
			}

			if (document.frmFree.ty2.value < document.frmFree.fy2.value) {
                         alert("Something wrong with the dates entered for 2nd Last Job. Please check and re-enter.")
	    		 frmFree.fy2.focus();
                         return false
                         }

			if (document.frmFree.ty3.value < document.frmFree.fy3.value) {
                         alert("Something wrong with the dates entered for 3rd Last Job. Please check re-enter.")
	    		 frmFree.fy3.focus();
                         return false
                         }

			if (document.frmFree.ty4.value < document.frmFree.fy4.value) {
                         alert("Something wrong with the dates entered for 4th Last Job. Please check and re-enter.")
	    		 frmFree.fy4.focus();
                         return false
                         }

			if (document.frmFree.ty5.value < document.frmFree.fy5.value) {
                         alert("Something wrong with the dates entered for previous employment. Please check and re-enter.")
	    		 frmFree.fy5.focus();
                         return false
                         }

//language ability-applicant-english - all compulsory			 
                         if (document.frmFree.engs[0].selected) { 
                         alert("Please indicate your proficiency in speaking English in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }
                         if (document.frmFree.engw[0].selected) {
                         alert("Please indicate your proficiency in writing English in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }
                         if (document.frmFree.engr[0].selected) {
                         alert("Please indicate your proficiency in reading English in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }
                         if (document.frmFree.engu[0].selected) {
                         alert("Please indicate your proficiency in understanding English in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }

//language ability - aplicant - french - also compulsory	
                         if (document.frmFree.fres[0].selected) { 
                         alert("Please indicate your proficiency in speaking French in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }
                         if (document.frmFree.frew[0].selected) {
                         alert("Please indicate your proficiency in writing French in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }
                         if (document.frmFree.frer[0].selected) {
                         alert("Please indicate your proficiency in reading French in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }
                         if (document.frmFree.freu[0].selected) {
                         alert("Please indicate your proficiency in understanding French in Step 4.")
	    		 frmFree.tipbox4.focus();
                         return false
                         }

//check net worth
                         if (document.frmFree.Total_Net_Worth.value == "") {
                         alert("You have not indicated your Total Net Worth in Step 5. This information is required for assessment for Immigration to Canada. Please enter your Total Net Worth in number of US Dollars - DO NOT use commas, letters or any currency signs i.e. enter numbers only.")
	    		 frmFree.tipbox5.focus();
	    		 frmFree.Total_Net_Worth.select();
                         return false
                         }
	  		var tnw1 = parseFloat(frmFree.Total_Net_Worth.value);
	  		if (isNaN(tnw1)) {
	    		alert("You have not entered a valid number for your Total Net Worth. Please enter a whole number of US Dollars only with no currency symbols, commas, spaces or decimal points.")
	    		 frmFree.tipbox5.focus();
	    		 frmFree.Total_Net_Worth.select();
                         return false
                         }

                         if (document.frmFree.Spouse[0].checked) {
                         alert("Please indicate by selecting Yes/No in Step 5 whether or not you have a Spouse or Partner to be included and considered under this application.")
	    		 frmFree.tipbox6.focus();
                         return false
                         }
//xxxxxxxxxxx
//spouse routine here - if spouse indicated, all mandatory fields must be completed for spouse
	if (document.frmFree.Spouse[1].checked) {
                         if (document.frmFree.splastname.value == "") {
                         alert("Please enter your Spouse/Partner's Last Name or Surname.")
	    		 frmFree.tipbox6.focus();
	    		 frmFree.splastname.select();
                         return false
                         }
                         if (document.frmFree.spfirstname.value == "") {
                         alert("Please enter your Spouse/Partner's First Name.")
	    		 frmFree.tipbox6.focus();
	    		 frmFree.spfirstname.select();
                         return false
                         }
                         if (document.frmFree.sptitle[0].selected) {
                         alert("Please enter your Spouse/Partner's Title.")
	    		 frmFree.sptitle.focus();
                         return false
                         }
                         if (document.frmFree.spgender[0].selected) {
                         alert("Please indicate if your Spouse/Partner is Male or Female.")
	    		 frmFree.spgender.focus();
                         return false
                         }
                         if (document.frmFree.spbirthy[0].selected) {
                         alert("Please indicate year of Spouse/Partner's birth.")
	    		 frmFree.spbirthy.focus();
                         return false
                         }
                         if (document.frmFree.spbirthm[0].selected) {
                         alert("Please indicate month of Spouse/Partner's birth.")
	    		 frmFree.spbirthm.focus();
                         return false
                         }
                         if (document.frmFree.spbirthd[0].selected) {
                         alert("Please indicate day of Spouse/Partner's birth.")
	    		 frmFree.spbirthd.focus();
                         return false
                         }
                         if (document.frmFree.SpHighest_Level[0].selected) {
                         alert("Please indicate the highest level of Education your Spouse/Partner has completed.")
	    		 frmFree.SpHighest_Level.focus();
                         return false
                         }
			//check if second degree but no first degree entered
                         if (document.frmFree.spdeg2y.value != "0" && document.frmFree.spdeg1y.value == "0") {
                         alert("You must enter your Spouse/Partner's First Degree details, in order to receive credit for their Second and Further Degrees.")
	    		 frmFree.spdeg1y.focus();
                         return false
                         }
			//check if masters but no first degree entered
                         if (document.frmFree.spmastery.value != "0" && document.frmFree.spdeg1y.value == "0") {
                         alert("You must enter your Spouse/Partner's First Degree details, in order to receive credit for their Masters.")
	    		 frmFree.spdeg1y.focus();
                         return false
                         }
			//check if phd but no first degree entered
                         if (document.frmFree.spphdy.value != "0" && document.frmFree.spdeg1y.value == "0") {
                         alert("You must enter your Spouse/Partner's First Degree details, in order to receive credit for their PhD.")
	    		 frmFree.spdeg1y.focus();
                         return false
                         }
//Xtra check added Oct04 - they must provide job details !!
if (document.frmFree.spjob1.value=="") {
	    		alert("Please provide your Spouse/Partner's employment details in Step 8.")
	    		frmFree.spjob1.focus();
	    		frmFree.spjob1.select();
                        return false
                        }
//spouse job section - check that they have entered a numeric code
		if (document.frmFree.spjob1.value!="") {
	  		var getspjob1 = (frmFree.spjob1.value);
	  		var subspjob1 = getspjob1.substring(getspjob1.lastIndexOf(" ") + 1);
			 var chkspjob1 = parseInt(subspjob1);
	  		if (isNaN(chkspjob1)) {
	    		alert("Please Click the 'Select' button in Step 8 to choose job title and code for your present job from the alphabetical lists which will pop up for this purpose.")
	    		 frmFree.tipbox8.focus();
	    		 frmFree.spjob1.select();
                         return false
                         }
		}

		if (document.frmFree.spjob2.value!="") {
	  		var getspjob2 = (frmFree.spjob2.value);
	  		var subspjob2 = getspjob2.substring(getspjob2.lastIndexOf(" ") + 1);
			 var chkspjob2 = parseInt(subspjob2);
	  		if (isNaN(chkspjob2)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox8.focus();
	    		 frmFree.spjob2.select();
                         return false
                         }
		}

		if (document.frmFree.spjob3.value!="") {
	  		var getspjob3 = (frmFree.spjob3.value);
	  		var subspjob3 = getspjob3.substring(getspjob3.lastIndexOf(" ") + 1);
			 var chkspjob3 = parseInt(subspjob3);
	  		if (isNaN(chkspjob3)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox8.focus();
	    		 frmFree.spjob3.select();
                         return false
                         }
		}

		if (document.frmFree.spjob4.value!="") {
	  		var getspjob4 = (frmFree.spjob4.value);
	  		var subspjob4 = getspjob4.substring(getspjob4.lastIndexOf(" ") + 1);
			 var chkspjob4 = parseInt(subspjob4);
	  		if (isNaN(chkspjob4)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox8.focus();
	    		 frmFree.spjob4.select();
                         return false
                         }
		}

		if (document.frmFree.spjob5.value!="") {
	  		var getspjob5 = (frmFree.spjob5.value);
	  		var subspjob5 = getspjob5.substring(getspjob5.lastIndexOf(" ") + 1);
			 var chkspjob5 = parseInt(subspjob5);
	  		if (isNaN(chkspjob5)) {
	    		alert("Please click the 'Select' button to choose job title and code.")
	    		 frmFree.tipbox8.focus();
	    		 frmFree.spjob5.select();
                         return false
                         }
		}

 //spouse work details - check years worked are not negative
			if (document.frmFree.spty1.value < document.frmFree.spfy1.value) {
                         alert("Something is wrong with the dates entered for Spouse/Partner's Present Job. Please check and re-enter.")
	    		 frmFree.spfy1.focus();
                         return false
                         }

			if (document.frmFree.spty2.value < document.frmFree.spfy2.value) {
                         alert("Something wrong with the dates entered for Spouse/Partner's 2nd Last Job. Please check and re-enter.")
	    		 frmFree.spfy2.focus();
                         return false
                         }

			if (document.frmFree.spty3.value < document.frmFree.spfy3.value) {
                         alert("Something wrong with the dates entered for Spouse/Partner's 3rd Last Job. Please check and re-enter.")
	    		 frmFree.spfy3.focus();
                         return false
                         }

			if (document.frmFree.spty4.value < document.frmFree.spfy4.value) {
                         alert("Something wrong with the dates entered for Spouse/Partner's 4th Last Job. Please check and re-enter.")
	    		 frmFree.spfy4.focus();
                         return false
                         }

			if (document.frmFree.spty5.value < document.frmFree.spfy5.value) {
                         alert("Something wrong with the dates entered for Spouse/Partner's previous employment. Please check and re-enter.")
	    		 frmFree.spfy5.focus();
                         return false
                         }

//language ability-Spouse/Partner-english - all compulsory			 
                         if (document.frmFree.spengs[0].selected) { 
                         alert("Please indicate your Spouse/Partner's proficiency in speaking English.")
	    		 frmFree.spengs.focus();
                         return false
                         }
                         if (document.frmFree.spengw[0].selected) {
                         alert("Please indicate your Spouse/Partner's proficiency in writing English.")
	    		 frmFree.spengw.focus();
                         return false
                         }
                         if (document.frmFree.spengr[0].selected) {
                         alert("Please indicate your Spouse/Partner's proficiency in reading English.")
	    		 frmFree.spengr.focus();
                         return false
                         }
                         if (document.frmFree.spengu[0].selected) {
                         alert("Please indicate your Spouse/Partner's proficiency in understanding English.")
	    		 frmFree.spengu.focus();
                         return false
                         }

//language ability - Spouse/Partner - french - also compulsory	
                         if (document.frmFree.spfres[0].selected) { 
                         alert("Please indicate your Spouse/Partner's proficiency in speaking French.")
	    		 frmFree.spfres.focus();
                         return false
                         }
                         if (document.frmFree.spfrew[0].selected) {
                         alert("Please indicate your Spouse/Partner's proficiency in writing French.")
	    		 frmFree.spfrew.focus();
                         return false
                         }
                         if (document.frmFree.spfrer[0].selected) {
                         alert("Please indicate your Spouse/Partner's proficiency in reading French.")
	    		 frmFree.spfrer.focus();
                         return false
                         }
                         if (document.frmFree.spfreu[0].selected) {
                         alert("Please indicate your Spouse/Partner's proficiency in understanding French.")
	    		 frmFree.spfreu.focus();
                         return false
                         }
//end spouse section
	}

//check that all of Step 10 is answered
                         if (document.frmFree.cjob[0].selected) { 
                         alert("Please answer all questions in Step 10.")
	    		 frmFree.cjob.focus();
                         return false
                         }
                         if (document.frmFree.coffer[0].selected) { 
                         alert("Please answer all questions in Step 10.")
	    		 frmFree.coffer.focus();
                         return false
                         }
                         if (document.frmFree.cwork[0].selected) { 
                         alert("Please answer all questions in Step 10.")
	    		 frmFree.cwork.focus();
                         return false
                         }
                         if (document.frmFree.cstudy[0].selected) { 
                         alert("Please answer all questions in Step 10.")
	    		 frmFree.cstudy.focus();
                         return false
                         }
//and Step 11
                         if (document.frmFree.disease[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.disease.focus();
                         return false
                         }
                         if (document.frmFree.convicted[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.convicted.focus();
                         return false
                         }
                         if (document.frmFree.prevtemp[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.prevtemp.focus();
                         return false
                         }
                         if (document.frmFree.refused[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.refused.focus();
                         return false
                         }
                         if (document.frmFree.ordered[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.ordered.focus();
                         return false
                         }
                         if (document.frmFree.warcrime[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.warcrime.focus();
                         return false
                         }
                         if (document.frmFree.prevperm[0].selected) { 
                         alert("Please answer all questions in Step 11.")
	    		 frmFree.prevperm.focus();
                         return false
                         }

                         if (document.frmFree.Details__if_Yes.value == "") {

				if (document.frmFree.cjob.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 10. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.coffer.value=="10") { 
                         alert("You have answered 'Yes' to one of the questions in Step 10. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.cwork.value=="5") { 
                         alert("You have answered 'Yes' to one of the questions in Step 10. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.cstudy.value=="5") { 
                         alert("You have answered 'Yes' to one of the questions in Step 10. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.disease.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.convicted.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.prevtemp.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.refused.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.ordered.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.warcrime.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
				if (document.frmFree.prevperm.value=="Yes") { 
                         alert("You have answered 'Yes' to one of the questions in Step 11. Please provide details in the box provided.")
	    		 frmFree.tipbox11.focus();
                         return false
				}
                         }
//current application question removed Oct04
//                         if (document.frmFree.CurrentApplication.value == "0") {
//                         alert("Please indicate in Step 11 whether you currently have an //Application for Permanent Residence in process.")
//	    		 frmFree.CurrentApplication.focus();
//                         return false
//                         }
                         if (document.frmFree.email.value != document.frmFree.econfirm.value) {
                         alert("IMPORTANT - You have not confirmed your E-mail address - the address you have given at the bottom of the form does not match that supplied by you in Step 1. A valid E-mail address is required in order to send you your FREE assessment. Please enter the confirmed E-mail address in both boxes. Thank you.")
	    		 frmFree.econfirm.focus();
	    		 frmFree.econfirm.select();
                         return false
                         }

                         if (document.frmFree.Declaration[0].checked) {
                         alert("Please click Yes in Step 12 at the bottom of the Questionnaire to indicate your acceptance of the Declaration and allow us to furnish your FREE assessment. Thank you.")
                         return false
                         }
                         else {
                         return true
                         }
                         }