<!--
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_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_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_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

function ClearContactForm()
{
document.forms['frmContacts'].reset();
}

function FocusContact()
{
	
	if (document.frmContacts.txtComments.value=='Add your comments here'){	
		document.frmContacts.txtComments.value="";
	}
}

function ContactForm()
{
	strRemail=/^[\x09\]+[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@*.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/ ;
	strEvalue=document.frmContacts.txtContactEmail.value;
   	strIndex=strEvalue.indexOf("@");
   	
	if (document.frmContacts.txtContactEmail.value=="") {
		alert("The form is incomplete. Kindly enter in the Email Address.");
		document.frmContacts.txtContactEmail.focus();		
	}
	else if(document.frmContacts.txtContactEmail.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmContacts.txtContactEmail.focus();
	}
	else if((!strRemail.test(strEvalue)) || strIndex==-1)
   	{
      		alert ("Please enter in a valid Email Address.");
      		document.frmContacts.txtContactEmail.focus();
   	}
   	else if (document.frmContacts.txtContactNo.value=="") {
		alert("The form is incomplete. Kindly enter in the Contact No.");
		document.frmContacts.txtContactNo.focus();		
	}
	else if(document.frmContacts.txtContactNo.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmContacts.txtContactNo.focus();
	}
   	else if (document.frmContacts.txtComments.value=="") {
		alert("The form is incomplete. Kindly enter in the Comments.");
		document.frmContacts.txtComments.focus();		
	}
	else
	{
		document.frmContacts.submit();
	}

}




function ClearSchoolContactForm()
{
document.forms['frmSchoolContacts'].reset();
}


function SchoolContactForm()
{
	
	
	strRemail=/^[\x09\]+[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@*.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/ ;
	strEvalue=document.frmSchoolContacts.txtSchoolContactEmail.value;
   	strIndex=strEvalue.indexOf("@");
   	
	if (document.frmSchoolContacts.txtSchoolName.value=="") {
		alert("The form is incomplete. Kindly enter in the School Name.");
		document.frmSchoolContacts.txtSchoolName.focus();		
	}
	else if(document.frmSchoolContacts.txtSchoolName.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmSchoolContacts.txtSchoolName.focus();
	}
	else if (document.frmSchoolContacts.txtSchoolContactName.value=="") {
		alert("The form is incomplete. Kindly enter in the Contact Name.");
		document.frmSchoolContacts.txtSchoolContactName.focus();		
	}
	else if(document.frmSchoolContacts.txtSchoolContactName.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmSchoolContacts.txtSchoolContactName.focus();
	}
	else if (document.frmSchoolContacts.txtSchoolAddress.value=="") {
		alert("The form is incomplete. Kindly enter in the School Address.");
		document.frmSchoolContacts.txtSchoolAddress.focus();		
	}
	else if(document.frmSchoolContacts.txtSchoolAddress.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmSchoolContacts.txtSchoolAddress.focus();
	}
	else if (document.frmSchoolContacts.txtSchoolPostcode.value=="") {
		alert("The form is incomplete. Kindly enter in the School Post Code.");
		document.frmSchoolContacts.txtSchoolPostcode.focus();		
	}
	else if(document.frmSchoolContacts.txtSchoolPostcode.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmSchoolContacts.txtSchoolPostcode.focus();
	}
	else if (document.frmSchoolContacts.txtSchoolTelephone.value=="") {
		alert("The form is incomplete. Kindly enter in the School Telephone.");
		document.frmSchoolContacts.txtSchoolTelephone.focus();		
	}
	else if(document.frmSchoolContacts.txtSchoolTelephone.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmSchoolContacts.txtSchoolTelephone.focus();
	}
	
	else if((!strRemail.test(strEvalue)) || strIndex==-1)
   	{
      		alert ("Please enter in a valid Email Address.");
      		document.frmSchoolContacts.txtSchoolContactEmail.focus();
   	}
   	else if(document.frmSchoolContacts.cboJobType.value =="0")	
	{	
		alert("Please select Teachers Preferred.");
		document.frmSchoolContacts.cboJobType.focus();
	}
   	else
	{
		document.frmSchoolContacts.submit();
	}

}


function ChkRegisterForm()
{
	strRemail=/^[\x09\]+[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@*.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/ ;
	strEvalue=document.frmRegister.txtEmail.value;
   	strIndex=strEvalue.indexOf("@");
   	
	
   	if(document.frmRegister.txtTitle.value =="")	
	{	
		alert("Please enter Title.");
		document.frmRegister.txtTitle.focus();
	}
	else if(document.frmRegister.txtTitle.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtTitle.focus();
	}
	else if(document.frmRegister.txtFirstname.value=="")	
	{	
		alert("Please enter Firstname.");
		document.frmRegister.txtFirstname.focus();
	}
	else if(document.frmRegister.txtFirstname.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtFirstname.focus();
	}
	else if(document.frmRegister.txtSurname.value =="")	
	{	
		alert("Please enter Surname.");
		document.frmRegister.txtSurname.focus();
	}
	else if(document.frmRegister.txtSurname.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtSurname.focus();
	}
	else if(document.frmRegister.txtAddress.value == "")	
	{	
		alert("Please enter Address.");
		document.frmRegister.txtAddress.focus();
	}
	else if(document.frmRegister.txtAddress.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtAddress.focus();
	}
	else if(document.frmRegister.txtAddress.value.length > 100 )	
	{	
		alert("Address Cannot Exceed 100 characters.");
		document.frmRegister.txtAddress.focus();
	}
	else if(document.frmRegister.txtPostcode.value == "")	
	{	
		alert("Please enter Postcode.");
		document.frmRegister.txtPostcode.focus();
	}
	else if(document.frmRegister.txtPostcode.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtPostcode.focus();
	}
	else if(document.frmRegister.txtTelephone.value == "")	
	{	
		alert("Please enter Telephone.");
		document.frmRegister.txtTelephone.focus();
	}
	else if(document.frmRegister.txtTelephone.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtTelephone.focus();
	}
	else if(document.frmRegister.txtEmail.value=="")
	{
		alert("Please enter Email Address.");
		document.frmRegister.txtEmail.focus();
	}
	else if(document.frmRegister.txtEmail.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtEmail.focus();
	}
	else if((!strRemail.test(strEvalue)) || strIndex==-1)
   	{
      		alert ("Please enter email in proper format\n for e.g. yourname@xyz.com");
      		document.frmRegister.txtEmail.focus();
	}
	else if(document.frmRegister.cboJobType.value =="0")	
	{	
		alert("Please select Work Type Preferred.");
		document.frmRegister.cboJobType.focus();
	}
	else if(document.frmRegister.txtOther.value.length > 500 )	
	{	
		alert("Information required Cannot Exceed 500 characters.");
		document.frmRegister.txtAddress.focus();
	}
	else
	{
		var w = document.frmRegister.cboJobType.selectedIndex;
		var selected_text = document.frmRegister.cboJobType.options[w].text;
		document.frmRegister.hdnJobText.value = selected_text;
		
		
		if(document.frmRegister.attachment.value != "" ){	
			fullName = document.frmRegister.attachment.value;
			shortName = fullName.match(/[^\/\\]+$/);
			splitName = fullName.split(".");
			fileType = splitName[splitName.length-1];

			fileType = fileType.toLowerCase();
			if (fileType != 'doc' && fileType != 'txt' && fileType != 'pdf')
			{
				alert("You must select a doc/txt/pdf file!");
				document.frmRegister.attachment.focus();
			}
			else{
				document.frmRegister.submit();
			}
		}
		else{
			document.frmRegister.submit();
		}
		
	
		
		
	}

}




function ChkEnglishRegisterForm()
{
	strRemail=/^[\x09\]+[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@*.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/ ;
	strEvalue=document.frmRegister.txtEmail.value;
   	strIndex=strEvalue.indexOf("@");
   	
   	if(document.frmRegister.txtTitle.value =="")	
	{	
		alert("Please enter Title.");
		document.frmRegister.txtTitle.focus();
	}
	else if(document.frmRegister.txtTitle.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtTitle.focus();
	}
	else if(document.frmRegister.txtFirstname.value=="")	
	{	
		alert("Please enter Firstname.");
		document.frmRegister.txtFirstname.focus();
	}
	else if(document.frmRegister.txtFirstname.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtFirstname.focus();
	}
	else if(document.frmRegister.txtSurname.value =="")	
	{	
		alert("Please enter Surname.");
		document.frmRegister.txtSurname.focus();
	}
	else if(document.frmRegister.txtSurname.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtSurname.focus();
	}
	else if(document.frmRegister.txtAddress.value == "")	
	{	
		alert("Please enter Address.");
		document.frmRegister.txtAddress.focus();
	}
	else if(document.frmRegister.txtAddress.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtAddress.focus();
	}
	else if(document.frmRegister.txtAddress.value.length > 100 )	
	{	
		alert("Address Cannot Exceed 100 characters.");
		document.frmRegister.txtAddress.focus();
	}
	else if(document.frmRegister.txtPostcode.value == "")	
	{	
		alert("Please enter Postcode.");
		document.frmRegister.txtPostcode.focus();
	}
	else if(document.frmRegister.txtPostcode.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtPostcode.focus();
	}
	else if(document.frmRegister.txtTelephone.value == "")	
	{	
		alert("Please enter Telephone.");
		document.frmRegister.txtTelephone.focus();
	}
	else if(document.frmRegister.txtTelephone.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtTelephone.focus();
	}
	else if(document.frmRegister.txtEmail.value=="")
	{
		alert("Please enter Email Address.");
		document.frmRegister.txtEmail.focus();
	}
	else if(document.frmRegister.txtEmail.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmRegister.txtEmail.focus();
	}
	else if((!strRemail.test(strEvalue)) || strIndex==-1)
   	{
      	alert ("Please enter email in proper format\n for e.g. yourname@xyz.com");
      	document.frmRegister.txtEmail.focus();
	}
	else if(document.frmRegister.txtOther.value.length > 500 )	
	{	
		alert("Information required Cannot Exceed 500 characters.");
		document.frmRegister.txtAddress.focus();
	}
	else
	{
		
		
		document.frmRegister.submit();
	}

}







function ClearRegisterForm()
{
document.forms['frmRegister'].reset();
}


function chkAdvancedSearch(){
	
	if(document.frmAdvancedSearch.txtSearch.value == "" && document.frmAdvancedSearch.cboJobType.value == "0" && document.frmAdvancedSearch.cboJobTerm.value == "0" && document.frmAdvancedSearch.cboRegion.value == "0" )
	{
		alert("The form is incomplete. Please enter in Search Text OR Location OR Job Type OR Job Term.");
		document.frmAdvancedSearch.txtSearch.focus();
	}
	else
	{
		document.frmAdvancedSearch.submit();
	}
}

function ClearSearchForm()
{
document.forms['frmAdvancedSearch'].reset();
}


function chkBlankJob()
{
	strRemail=/^[\x09\]+[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@*.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/ ;
	strEvalue=document.frmJobs.txtContactEmail.value;
   	strIndex=strEvalue.indexOf("@");
   	
   	
	if(document.frmJobs.txtJobTitle.value == "")
	{
		alert("The form is incomplete. Kindly enter in the Job Title.");
		document.frmJobs.txtJobTitle.focus();
		return false;
	}
	if(document.frmJobs.txtJobTitle.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmJobs.txtJobTitle.focus();
		return false;
	}
	if(document.frmJobs.cboJobTerm.value == '0') 
 	{
 		alert ("Please select Job Term.");
 		document.frmJobs.cboJobTerm.focus();
 		return false;
  	}
  	if(document.frmJobs.cboJobType.value == '0') 
 	{
 		alert ("Please select Job Type.");
 		document.frmJobs.cboJobType.focus();
 		return false;
  	}
  	if(document.frmJobs.cboRegion.value == '0') 
 	{
 		alert ("Please select Job Region.");
 		document.frmJobs.cboRegion.focus();
 		return false;
  	}
	if((isNaN(document.frmJobs.txtSalaryFrom.value) || document.frmJobs.txtSalaryFrom.value < 1) && document.frmJobs.txtSalaryFrom.value != ''){
			alert("Please ensure that only non zero numbers are entered in the Salary From textbox.");
			document.frmJobs.txtSalaryFrom.focus();
			return false;
		}
		if(checkForDecimals(document.frmJobs.txtSalaryFrom) != ''){
			alert("Please enter numbers upto 2 decimals only");
			document.frmJobs.txtSalaryFrom.focus();
			return false;
		}
	if((isNaN(document.frmJobs.txtSalaryTo.value) || document.frmJobs.txtSalaryTo.value < 1) && document.frmJobs.txtSalaryTo.value != ''){
			alert("Please ensure that only non zero numbers are entered in the Salary To textbox.");
			document.frmJobs.txtSalaryTo.focus();
			return false;
		}
		if(checkForDecimals(document.frmJobs.txtSalaryTo) != ''){
			alert("Please enter numbers upto 2 decimals only");
			document.frmJobs.txtSalaryTo.focus();
			return false;
		}
		if(parseFloat(document.frmJobs.txtSalaryTo.value) < parseFloat(document.frmJobs.txtSalaryFrom.value)){
			alert("Salary To Should Be More Than Salary From");
			document.frmJobs.txtSalaryTo.focus();
			return false;
		}
		
	if((document.frmJobs.txtSalaryFrom.value != '' || document.frmJobs.txtSalaryTo.value != '') && 	document.frmJobs.cboFrequency.value==''){
			alert("Please Select Salary Frequency.");
			document.frmJobs.cboFrequency.focus();
			return false;
		}
	
	
	if(document.frmJobs.txtJobDesc.value =='')	
	{	
		alert("The form is incomplete. Kindly enter in the Job Description.");
		document.frmJobs.txtJobDesc.focus();
		return false;
	}
	if(document.frmJobs.txtJobDesc.value.length > 3000)	
	{	
		alert("Job Description Should Not Exceed 3000 Chars.");
		document.frmJobs.txtJobDesc.focus();
		return false;
	}
	if(document.frmJobs.txtContactPerson.value =='')	
	{	
		alert("The form is incomplete. Kindly enter in the Contact Person.");
		document.frmJobs.txtContactPerson.focus();
		return false;
	}
	if(document.frmJobs.txtContactEmail.value =='')	
	{	
		alert("The form is incomplete. Kindly enter in the Contact Email.");
		document.frmJobs.txtContactEmail.focus();
		return false;
	}
	if(((!strRemail.test(strEvalue)) || strIndex==-1))
   	{
      	alert ("Please enter email in proper format\n for e.g. yourname@xyz.com");
      	document.frmJobs.txtContactEmail.focus();
      		return false;
    	}
	if(document.frmJobs.btnSubmit.value=="Add Job"){
		document.frmJobs.hdnAction.value = 'add';
		return true;
	}
	else{
		document.frmJobs.hdnAction.value = 'update';
		return true;
	}
	
}

function checkForDecimals(txtcheck)
{
var strError="";
	if(txtcheck.value.indexOf(".")!= -1)
	{
		if (txtcheck.value.substr(txtcheck.value.indexOf(".")).length > 3)
		{
		strError = "Please enter in only 2 nos after decimal.";	
		}

	}
	return strError;
}


function ChkQuoteForm()
{
	strRemail=/^[\x09\]+[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@*.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/ ;
	strEvalue=document.frmQuote.txtEmail.value;
   	strIndex=strEvalue.indexOf("@");
   	
	 if(document.frmQuote.cboDesiredLang.value =="")	
	{	
		alert("Please select Desired Language.");
		document.frmQuote.cboDesiredLang.focus();
	}
   	else if(document.frmQuote.txtName.value =="")	
	{	
		alert("Please enter Name.");
		document.frmQuote.txtName.focus();
	}
	else if(document.frmQuote.txtName.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmQuote.txtName.focus();
	}
	
	
	else if(document.frmQuote.txtEmail.value=="")
	{
		alert("Please enter Email Address.");
		document.frmQuote.txtEmail.focus();
	}
	else if(document.frmQuote.txtEmail.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmQuote.txtEmail.focus();
	}
	else if((!strRemail.test(strEvalue)) || strIndex==-1)
   	{
	      	alert ("Please enter email in proper format\n for e.g. yourname@xyz.com");
	      	document.frmQuote.txtEmail.focus();
	}
	else if(document.frmQuote.txtTelephone.value == "")	
	{	
		alert("Please enter Telephone.");
		document.frmQuote.txtTelephone.focus();
	}
	else if(document.frmQuote.txtTelephone.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmQuote.txtTelephone.focus();
	}
	else if(document.frmQuote.txtWords.value == "")	
	{	
		alert("Please enter Words Count.");
		document.frmQuote.txtWords.focus();
	}
	else if(document.frmQuote.txtWords.value.charAt(0)==' ')	
	{	
		alert("You have not entered this field properly.\nPlease remove the leading spaces");
		document.frmQuote.txtWords.focus();
	}
	else if (isNaN(frmQuote.txtWords.value) != '' )
	{
		alert ("Please enter in only numbers.");
		frmQuote.txtWords.focus();
	}
	else if (checkForDecimals(frmQuote.txtWords) != '' )
	{
		alert ("Please enter  only numeric values.");
		frmQuote.txtWords.focus();
	}
	else if (frmQuote.txtWords.value < 250 )
	{
		alert ("If your document is less than 250 words please enter 250 in the word count as this is our minimum charge");
		frmQuote.txtWords.focus();
	}
	else
	{
		document.frmQuote.submit();
	}

}





function ChkInstantQuote()
{
 	
	 if(document.frmInstantQuote.cboDesiredLanguage.value =="")	
	{	
		alert("Please select Desired Language.");
		document.frmInstantQuote.cboDesiredLanguage.focus();
	}
  	else
	{
		document.frmInstantQuote.submit();
	}

}



function ClearQuoteForm()
{
	
document.forms['frmQuote'].reset();
}

function checkForDecimals(txtcheck)
{
	var strError="";
	if(txtcheck.value != ""){
		if (isNaN(txtcheck.value)){
			strError = "Please enter in only numbers.";
			txtcheck.focus();
			return strError;
		}
		else
		{
			if(txtcheck.value.indexOf(".")!= -1){
				
				strError = "Please enter  only numeric values.";
				txtcheck.focus();
				return strError;
				
			}
		}
	}
	return strError;
}