if (document.layers) {//NN4
	document.write('<link href="/a/css/nsstyles.css" rel=STYLESHEET type="text/css">');
	document.write('<link href="/a/css/nsforms.css" rel=STYLESHEET type="text/css">');
} else {//IE4 and NN6  
	document.write('<link href="/a/css/styles.css" rel=STYLESHEET type="text/css">');
	document.write('<link href="/a/css/forms.css" rel=STYLESHEET type="text/css">');		
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function setMenu(w) { //Admin Level
	var imgsrc = new Array("","02","04","06","08","10","12","14");
	eval("MM_changeProp('n7" + imgsrc[w] + "','','src','../a/i/n/n7-" + imgsrc[w] + "o.gif','IMG')");
}

function setMarker() {
//	marker = "";
	location.href = "../default.asp";
}

function smlCWin(url) {
    if (document.getElementById || document.layers || document.all) {
        var window_width = 350;
		var window_height = 250;
	}
	var window_left = (screen.width - 350) / 2;
	var window_top = (screen.height - 250) / 2;
	window.open(url, "Password", "resizable=no,scrollbars=no,width=" + window_width + ",height=" + window_height + ",top=" + window_top + ",left=" + window_left + "");
}

function medCWin(url) {
//    if (document.getElementById || document.layers || document.all) {
        var window_width = 400;
		var window_height = 300;
//	}
	var window_left = (screen.width - 400) / 2;
	var window_top = (screen.height - 300) / 2;
	window.open(url, "policy", "resizable=yes,scrollbars=yes,width=" + window_width + ",height=" + window_height + ",top=" + window_top + ",left=" + window_left + "");
}

function lgeCWin(url) {
//    if (document.getElementById || document.layers || document.all) {
        var window_width = 640;
		var window_height = 480;
//	}
	var window_left = (screen.width - 640) / 2;
	var window_top = (screen.height - 480) / 2;
	window.open(url, "CV", "resizable=yes,scrollbars=yes,width=" + window_width + ",height=" + window_height + ",top=" + window_top + ",left=" + window_left + "");
}

function checkReg(form) {
	if (form.first_name.value == "" || form.first_name.length < 3) {
		alert("Please enter your first name in the field provided");
		form.first_name.focus();
		return false;
	}
	if (form.surname.value == "" || form.surname.length < 3) {
		alert("Please enter your surname in the field provided");
		form.surname.focus();
		return false;
	}
	var emailStr = new String(form.email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (form.telephone.value == "" || form.telephone.length < 3) {
		alert("Please enter your telephone number in the field provided.\n\nYou should include the area code and the international dialling code");
		form.telephone.select();
		form.telephone.focus();
		return false;
	}
	if (!form.gender[0].checked && !form.gender[1].checked) {
		alert("Please select your gender.");
		return false;
	}
	if (form.nationality.selectedIndex == -1) {
		alert("Please select your nationality from the list provided\n\nMultiple selections are permitted.");
		form.nationality.focus();
		return false;
	}
	if (form.age.selectedIndex == 0) {
		alert("Please select your age from the list provided.");
		form.age.focus();
		return false;
	}
	if (form.location.selectedIndex == 0) {
		alert("Please select your location from the list provided.");
		form.location.focus();
		return false;
	}
/*	if (form.work_areas.selectedIndex == -1) {
		alert("Please select those areas in which you would NOT consider working.");
		form.work_areas.focus();
		return false;
	}
*/	if (form.languages.selectedIndex == -1) {
		alert("Please select from the list any languages you speak.\n\nThese should be to a minimum of conversational level.");
		form.languages.focus();
		return false;
	}
	if (!form.marital_status[0].checked && !form.marital_status[1].checked && !form.marital_status[2].checked) {
		alert("Please select your marital status.");
		return false;
	}
	if (!form.smoker[0].checked && !form.smoker[1].checked) {
		alert("Please indicate whether you are a smoker or not.");
		return false;
	}
	if (form.crew_sector.selectedIndex == -1) {
		alert("Please select your preferred employment sector(s).");
		form.crew_sector.focus();
		return false;
	}
	if (form.position_reqd.selectedIndex == -1) {
		alert("Please select your position from the list provided.");
		form.position_reqd.focus();
		return false;
	}
	if (form.experience.selectedIndex == 0) {
		alert("Please select your level of experience from the list provided.");
		form.experience.focus();
		return false;
	}
	var pw = form.pword.value
	if (pw.length < 5 || pw.length > 10) {
		window.alert("You should choose a password which is between 5 and 10 alphanumeric characters long");
		form.pword.value == "";
		form.pword_confirm.value == "";
		form.pword.focus();
		return false;
	}
	if (form.pword.value != form.pword_confirm.value) {
		window.alert("The \"Password\" and the \"Confirm Password\" fields do not match.\nPlease re-enter this information.");
		form.pword.value == "";
		form.pword_confirm.value == "";
		form.pword.focus();
		return false;
	}
	if (!form.agreement.checked) {
		alert("Please review the Service Agreement and check the Service Agreement box");
		form.agreement.focus();
		return false;
	}
}

function checkUpdate(form) {
	if (form.first_name.value == "" || form.first_name.length < 3) {
		alert("Please enter your first name in the field provided");
		form.first_name.focus();
		return false;
	}
	if (form.surname.value == "" || form.surname.length < 3) {
		alert("Please enter your surname in the field provided");
		form.surname.focus();
		return false;
	}
	var emailStr = new String(form.email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (form.telephone.value == "" || form.telephone.length < 3) {
		alert("Please enter your telephone number in the field provided.\n\nYou should include the area code and the international dialling code");
		form.telephone.select();
		form.telephone.focus();
		return false;
	}
	if (!form.gender[0].checked && !form.gender[1].checked) {
		alert("Please select your gender.");
		return false;
	}
	if (form.nationality.selectedIndex == -1) {
		alert("Please select your nationality from the list provided\n\nMultiple selections are permitted.");
		form.nationality.focus();
		return false;
	}
	if (form.age.selectedIndex == 0) {
		alert("Please select your age from the list provided.");
		form.age.focus();
		return false;
	}
/*	if (form.location.selectedIndex == -1) {
		alert("Please select your location from the list provided.");
		form.location.focus();
		return false;
	}
	if (form.work_areas.selectedIndex == -1) {
		alert("Please select those areas in which you would NOT consider working.");
		form.work_areas.focus();
		return false;
	}
*/	if (form.languages.selectedIndex == -1) {
		alert("Please select from the list any languages you speak.\n\nThese should be to a minimum of conversational level.");
		form.languages.focus();
		return false;
	}
	if (!form.marital_status[0].checked && !form.marital_status[1].checked && !form.marital_status[2].checked) {
		alert("Please select your marital status.");
		return false;
	}
	if (!form.smoker[0].checked && !form.smoker[1].checked) {
		alert("Please indicate whether you are a smoker or not.");
		return false;
	}
	if (form.crew_sector.selectedIndex == -1) {
		alert("Please select your preferred employment sector(s).");
		form.crew_sector.focus();
		return false;
	}
	if (form.position_reqd.selectedIndex == -1) {
		alert("Please select your position from the list provided.");
		form.position_reqd.focus();
		return false;
	}
	var num = 0;
	for (var i=0; i<form.position_reqd.length; i++) {
		if (form.position_reqd.options[i].selected) {
			num++;
			if (num>3) {
				window.alert("Please choose a maximum of 3 preferred\npositions of employment from the list provided.");
				form.position_reqd.selectedIndex = -1;
				return false;
			}
		}
	}
	if (form.experience.selectedIndex == 0) {
		alert("Please select your level of experience from the list provided.");
		form.experience.focus();
		return false;
	}
}

function checkEmpReg(form) {
	if (!form.regType[0].checked && !form.regType[1].checked) {
		alert("You must choose your preferred Registration Type.\nSelect either \"Amateur\" or \"Full\"");
		return false;
	}
	if (form.paymentType.selectedIndex == 0) {
		window.alert("Please select your preferred method of payment");
		return false;
	}
        if (form.paymentType.value == "None" && form.regType[1].checked) {
		window.alert("You have selected Full Registration.\nPlease select your preferred method of payment");
		return false;
	}
	if (form.contact_name.value == "" || form.contact_name.length < 3) {
		alert("Please enter a Contact Name in the field provided");
		form.contact_name.focus();
		return false;
	}
	if (form.emp_name.value == "" || form.emp_name.length < 3) {
		alert("Please enter your Employers Name in the field provided");
		form.emp_name.focus();
		return false;
	}
	if (form.ship_co_name.value == "" || form.ship_co_name.length < 3) {
		alert("Please enter your Ship or Company Name in the field provided");
		form.ship_co_name.focus();
		return false;
	}
	var emailStr = new String(form.email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (!form.agreement.checked) {
		alert("Please review the Service Agreement and check the Service Agreement box");
		form.agreement.focus();
		return false;
	}
	var pw = form.pword.value
	if (pw.length < 5 || pw.length > 10) {
		window.alert("You should choose a password which is between 5 and 10 alphanumeric characters long");
		form.pword.value == "";
		form.pword_confirm.value == "";
		form.pword.focus();
		return false;
	}
	if (form.pword.value != form.pword_confirm.value) {
		window.alert("The \"Password\" and the \"Confirm Password\" fields do not match.\nPlease re-enter this information.");
		form.pword.value == "";
		form.pword_confirm.value == "";
		form.pword.focus();
		return false;
	}
}

function checkEmpUpd(form) {
	
	if (form.contact_name.value == "" || form.contact_name.length < 3) {
		alert("Please enter a Contact Name in the field provided");
		form.contact_name.focus();
		return false;
	}
	if (form.emp_name.value == "" || form.emp_name.length < 3) {
		alert("Please enter your Employers Name in the field provided");
		form.emp_name.focus();
		return false;
	}
	if (form.ship_co_name.value == "" || form.ship_co_name.length < 3) {
		alert("Please enter your Ship or Company Name in the field provided");
		form.ship_co_name.focus();
		return false;
	}
	var emailStr = new String(form.email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
}

function checkReReg(form) {
	if (!form.regType[0].checked && !form.regType[1].checked) {
		alert("You must choose your preferred Registration Type.\nSelect either \"Amateur\" or \"Full\"");
		return false;
	}
	if (form.paymentType.selectedIndex == 0) {
		window.alert("Please select your preferred method of payment");
		return false;
	}
        if (form.paymentType.value == "None" && form.regType[1].checked) {
		window.alert("You have selected Full Registration.\nPlease select your preferred method of payment");
		return false;
	}
	if (!form.agreement.checked) {
		alert("Please review the Service Agreement and check the Service Agreement box");
		form.agreement.focus();
		return false;
	}
}

function checkLogin(form) {
	var emailStr = new String(form.loginemail.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter your login Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter your login Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter your login Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pw = form.pword.value
	if (pw.length < 5 || pw.length > 10) {
		window.alert("Please enter your login Password");
		form.pword.value == "";
		form.pword.focus();
		return false;
	}
}

function checkLogin2(form) {
	var emailStr = new String(form.loginemail.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter your login Email Address");
		form.loginemail.select();
		form.loginemail.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter your login Email Address");
		form.loginemail.select();
		form.loginemail.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter your login Email Address");
		form.loginemail.select();
		form.loginemail.focus();
		return false;
	}
	var pw = form.pword.value
	if (pw.length < 5 || pw.length > 10) {
		window.alert("Please enter your login Password");
		form.pword.value == "";
		form.pword.focus();
		return false;
	}
}

function checkPassword(form) {
	var pw = form.pword.value
	if (pw.length < 5 || pw.length > 10) {
		window.alert("You should choose a new password which is between\n5 and 10 alphanumeric characters long");
		form.pword.value == "";
		form.pword_confirm.value == "";
		form.pword.focus();
		return false;
	}
	if (form.pword.value != form.pword_confirm.value) {
		window.alert("The \"New Password\" and the \"Confirm Password\" fields do not match.\nPlease re-enter this information.");
		form.pword.value == "";
		form.pword_confirm.value == "";
		form.pword.focus();
		return false;
	}
}

function checkCV(form) {
	if(form.cv.value == "") {
		alert("You must enter a valid CV file name!");
		return false;
	}
}

function checkCrewSearch(form) {
	/*if (!form.gender[0].checked && !form.gender[1].checked && !form.gender[2].checked) {
		alert("Please select which gender(s) you wish to include in this search.");
		return false;
	}
	if (!form.marital_status[0].checked && !form.marital_status[1].checked && !form.marital_status[2].checked && !form.marital_status[3].checked) {
		alert("Please indicate the required marital status for the crew search.\nAlternatively, select \"Any\".");
		return false;
	}
	if (!form.smoker[0].checked && !form.smoker[1].checked && !form.smoker[2].checked) {
		alert("Please indicate whether you want to search for smokers or non-smokers\nAlternatively, select \"Either\".");
		return false;
	}
	if (form.location.selectedIndex == -1) {
		alert("Please select the region you wish to recruit from.");
		form.location.focus();
		return false;
	}
	if (!form.crew_sector[0].checked && !form.crew_sector[1].checked && !form.crew_sector[2].checked) {
		alert("Please select your preferred employment sector(s).");
		return false;
	}*/
	if (form.position.selectedIndex == -1) {
		alert("Please select the employment position you wish to search for.");
		form.position.focus();
		return false;
	}
}

function checkCrewSearchAdmin(form) {
	if (form.position.selectedIndex == -1 && form.first_name.value == "" && form.surname.value == "") {
		alert("Please select the employment position you wish to search for\nor enter a first name or surname.");
		form.position.focus();
		return false;
	}
}

function checkMsg(form) {
	if (form.name.value == "" || form.name.length < 3) {
		alert("Please enter a Contact Name in the field provided");
		form.name.focus();
		return false;
	}
	if (form.name.length > 120) {
		alert("Please reduce the length of the Contact Name");
		form.name.focus();
		return false;
	}
	var emailStr = new String(form.email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (form.email.length > 90) {
		alert("The email address is too long");
		form.email.focus();
		return false;
	}
	if (form.title.value == "" || form.title.length < 3) {
		alert("Please enter a Message Title in the field provided");
		form.title.focus();
		return false;
	}
	if (form.title.length > 120) {
		alert("The title is too long");
		form.title.focus();
		return false;
	}
	if (form.message.value == "") {
		alert("Please enter the new message text in the field provided");
		form.message.focus();
		return false;
	}
	if (form.message.length > 1800) {
		alert("The message text is too long");
		form.message.focus();
		return false;
	}
}

function checkMsg2(form) {

	if (form.name2.value == "" || form.name2.length < 3) {
		alert("Please enter a Contact Name in the field provided");
		form.name2.focus();
		return false;
	}
	if (form.name2.length > 120) {
		alert("Please reduce the length of the Contact Name");
		form.name2.focus();
		return false;
	}
	var emailStr = new String(form.email.value);
	var posat = emailStr.indexOf("@");
	if (emailStr.length < 8) 	{
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	var pospoint = emailStr.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address");
		form.email.select();
		form.email.focus();
		return false;
	}
	if (form.email.length > 90) {
		alert("The email address is too long");
		form.email.focus();
		return false;
	}
	if (form.title.value == "" || form.title.length < 3) {
		alert("Please enter a Message Title in the field provided");
		form.title.focus();
		return false;
	}
	if (form.title.length > 120) {
		alert("The title is too long");
		form.title.focus();
		return false;
	}
        if (form.pos_location.value == "") {
		alert("Please enter the position location in the field provided");
		form.pos_location.focus();
		return false;
	}
        if (form.pos_location.length > 50) {
		alert("The location is too long");
		form.pos_location.focus();
		return false;
	}
        if (form.qual.value == "") {
		alert("Please enter the minimum qualifications in the field provided");
		form.qual.focus();
		return false;
	}
        if (form.qual.length > 100) {
		alert("The qualifications are too long");
		form.qual.focus();
		return false;
	}
	if (form.message.value == "") {
		alert("Please enter the new message text in the field provided");
		form.message.focus();
		return false;
	}
	if (form.message.length > 1800) {
		alert("The message text is too long");
		form.message.focus();
		return false;
	}
	    if (form.position_reqd.selectedIndex == -1) {
                alert("Please select one or more postions");
                return false;
        }
        if (form.autoemail.checked && form.crew_sector.selectedIndex == -1) {
                alert("To use our auto email feature you must select a market sector");
                return false;
        }
//        if (form.autoemail.checked && form.position_reqd.selectedIndex == -1) {
//                alert("To use our auto email feature you must select one or more postions");
//                return false;
//        }
        if (form.autoemail.checked && form.location.selectedIndex == -1) {
                alert("To use our auto email feature you must select one or more locations");
                return false;
        }
	if (form.display_time.value == "") {
		alert("Please enter the length of time to display the message in the field provided");
		form.display_time.focus();
		return false;
	}  
	if (isNaN(form.display_time.value)) {
		alert("Please enter the number of days to display the message in the field provided");
		form.display_time.focus();
		return false;
	}        
	if (form.display_time.value > 30) {
		alert("The maximum number of days to display the message is 30");
		form.display_time.focus();
		return false;
	}
//	if (form.category.value == "1") {
//		alert("Please select a category for your message");
//		form.category.focus();
//		return false;
//	}
}


function textLimit(field, maxlen) {
        if (field.value.length > maxlen + 1)
           alert("Your input has been truncated");
        if (field.value.length > maxlen)
           field.value = field.value.substring(0, maxlen);
}

function checkEmailOne(form) {
	if (!form.recipients[0].checked && !form.recipients[1].checked && !form.recipients[2].checked) {
		alert("Please select your preferred email list.");
		return false;
	}
}

function checkEmailTwo(form) {
	var emailStr = "";
	for (var i=0;i<form.elements.length;i++) {
		if (form.elements[i].name == "include" && form.elements[i].checked) {
			emailStr += form.elements[i].value;
			emailStr += ",";
		}
	}
	form.emailStr.value = emailStr;
}

function checkPositions(posfield) {
	var num = 0;
	for (var i=0; i<posfield.length; i++) {
		if (posfield.options[i].selected) {
			num++;
			if (num>3) {
				window.alert("Please choose a maximum of 3 preferred\npositions of employment from the list provided.");
				posfield.selectedIndex = -1;
			}
		}
	}
}

function checkLocations(locfield) {
	var num = 0;
	for (var i=0; i<locfield.length; i++) {
		if (locfield.options[i].selected) {
			num++;
			if (num>3) {
				window.alert("Please choose a maximum of 3 preferred\nlocations from the list provided.");
				locfield.selectedIndex = -1;
			}
		}
	}
}

function checkLocations5(locfield) {
	var num = 0;
	for (var i=0; i<locfield.length; i++) {
		if (locfield.options[i].selected) {
			num++;
			if (num>5) {
				window.alert("Please choose a maximum of 5 preferred\nlocations from the list provided.");
				locfield.selectedIndex = -1;
			}
		}
	}
}

function TrackCount(fieldObj,countFieldName,maxChars) {
	var countField = eval("fieldObj.form."+countFieldName);
	var diff = maxChars - fieldObj.value.length;
	
	// Need to check & enforce limit here also in case user pastes data
	if (diff < 0) {
		fieldObj.value = fieldObj.value.substring(0,maxChars);
		diff = maxChars - fieldObj.value.length;
	}
	countField.value = diff;
}

function LimitText(fieldObj,maxChars) {
	var result = true;
	if (fieldObj.value.length >= maxChars)
		result = false;
		if (window.event)
		window.event.returnValue = result;
		return result;
}

function changePage(strPage) {
	top.location.href = strPage;
}

function checkBuilder1(form) {
	if (!form.cvType[0].checked && !form.cvType[1].checked && !form.cvType[2].checked) {
		alert("Please indicate which type of CV you want to provide.");
		return false;
	}
}

function checkBuilder2(form) {
	if (form.cvdoc.value == "") {
		alert("Please locate your CV document.");
		return false;
	}
}

function checkBuilder3(form) {
	if (form.dobDay.value == "blank") {
		alert("Please check your Date of Birth entry");
		form.dobDay.focus();
		return false;
	}
	if (form.dobMonth.value == "blank") {
		alert("Please check your Date of Birth entry");
		form.dobMonth.focus();
		return false;
	}
	if (form.dobYear.value == "blank") {
		alert("Please check your Date of Birth entry");
		form.dobYear.focus();
		return false;
	}
}

function checkBuilder4(form) {
	if (form.dobDay.value == "blank") {
		alert("Please check your Date of Birth entry");
		form.dobDay.focus();
		return false;
	}
	if (form.dobMonth.value == "blank") {
		alert("Please check your Date of Birth entry");
		form.dobMonth.focus();
		return false;
	}
	if (form.dobYear.value == "blank") {
		alert("Please check your Date of Birth entry");
		form.dobYear.focus();
		return false;
	}
}

function checkBuilder5(form) {
	if (form.cvimg.value == "") {
		alert("Please locate your CV image file.");
		return false;
	}
}

function checkReferences(form) {
	// Validate Entry One
	if (form.refName1.value == "") {
		alert("Please provide a Referees Name at \"Entry One\".");
		form.refName1.focus();
		return false;
	}
	if (form.coName1.value == "") {
		alert("Please provide a Company or Ship Name at \"Entry One\".");
		form.coName1.focus();
		return false;
	}
	if (form.telephone1_1.value == "") {
		alert("Please provide a Contact Telephone No. at \"Entry One\".");
		form.telephone1_1.focus();
		return false;
	}
//	if (form.telephone2_1.value == "") {
//		alert("Please provide an Additional Contact No. at \"Entry One\".");
//		form.telephone2_1.focus();
//		return false;
//	}
	var emailStr1 = new String(form.email1.value);
        if (emailStr1 != "") {
	var posat = emailStr1.indexOf("@");
	if (emailStr1.length < 8) 	{
		window.alert("Please enter a valid contact Email Address at \"Entry One\".");
		form.email1.select();
		form.email1.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address at \"Entry One\".");
		form.email1.select();
		form.email1.focus();
		return false;
	}
	var pospoint = emailStr1.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address at \"Entry One\".");
		form.email1.select();
		form.email1.focus();
		return false;
	}
        }
	// Validate Entry Two
	if (form.refName2.value == "") {
		alert("Please provide a Referees Name at \"Entry Two\".");
		form.refName2.focus();
		return false;
	}
	if (form.coName2.value == "") {
		alert("Please provide a Company or Ship Name at \"Entry Two\".");
		form.coName2.focus();
		return false;
	}
	if (form.telephone1_2.value == "") {
		alert("Please provide a Contact Telephone No. at \"Entry Two\".");
		form.telephone1_2.focus();
		return false;
	}
//	if (form.telephone2_2.value == "") {
//		alert("Please provide an Additional Contact No. at \"Entry Two\".");
//		form.telephone2_2.focus();
//		return false;
//	}
	var emailStr2 = new String(form.email2.value);
        if (emailStr2 != "") {
	var posat = emailStr2.indexOf("@");
	if (emailStr2.length < 8) 	{
		window.alert("Please enter a valid contact Email Address at \"Entry Two\".");
		form.email2.select();
		form.email2.focus();
		return false;
	}
	if (posat < 2) {
		window.alert("Please enter a valid contact Email Address at \"Entry Two\".");
		form.email2.select();
		form.email2.focus();
		return false;
	}
	var pospoint = emailStr2.lastIndexOf(".");
	if (pospoint < 5) {
		window.alert("Please enter a valid contact Email Address at \"Entry Two\".");
		form.email2.select();
		form.email2.focus();
		return false;
	}
        }
}

function resetSkills(form) {
	//cycle thru elements and record value
	for (var i=0; i<form.elements.length; i++) {
		var e = form.elements[i];
		if (e.id == "NOT") {
			e.checked = true;
		}
	}
}

function skillsState(form) {
	// First Reset all markers
	form.deckState.value = "0";
	form.gallState.value = "0";
	form.inteState.value = "0";
	form.engiState.value = "0";
	// Now process form
	//window.alert("1")
	var i, e, gpName, groups;
	e = form.elements;
	groups = new Array("deck", "gall", "inte", "engi");
	for (i=0; i<e.length; i++) {
		//window.alert("2")
		if (e[i].id == "NOT") {
			//window.alert("3")
			if (!e[i].checked) {
				//window.alert("4")
				gpName = e[i].name;
				if (gpName.indexOf(groups[0]) != -1) {
					//window.alert("5")
					form.deckState.value = "1";
				}
				if (gpName.indexOf(groups[1]) != -1) {
					//window.alert("6")
					form.gallState.value = "1";
				}
				if (gpName.indexOf(groups[2]) != -1) {
					//window.alert("7")
					form.inteState.value = "1";
				}
				if (gpName.indexOf(groups[3]) != -1) {
					//window.alert("8")
					form.engiState.value = "1";
				}
			}
		}
	}
}

function setCost(form) {
    var idx = form.paymentType.selectedIndex;
	if (idx != 0) {
		form.theCost.value = form.paymentType[idx].value
	}
}

function checkCost(form) {
	if (!form.paymentType.selectedIndex == 0) {
		form.amount.value = form.paymentType[form.paymentType.selectedIndex].value;
		return true;
	} else {
		window.alert("Please select your preferred method of payment");
		return false;
	}
}
