//<script>
function check() {
	alert("true");
}

var divIDOn = "";
var imgIDOn = 0;
var btnIDOn = 0;
var navIDOn = 0;

// Browser detection
	isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
	NS4 = (document.layers) ? true : false;
	IEmac = ((document.all)&&(isMac)) ? true : false;
	IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
	IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
	IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
	NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1) ? true : false;
	MOZ = (document.getElementById && navigator.appName == "Netscape" || navigator.appName == "Mozilla") ? true : false;
	OPERA = (navigator.userAgent.indexOf('Opera') != -1) ? true : false; 
	
//Open/Close Menu
function menuOC(divID,imgID,btnID,navID) {
	//alert("opening");
	if (MOZ || NS6)
	{
		if (document.getElementById(divID).style.display == 'block') {
			menuClose(divID,imgID,btnID,navID);
		} else {
			menuOpen(divID,imgID,btnID,navID);
			divIDOn = divID;
			imgIDOn = imgID;
			btnIDOn = btnID;
			navIDOn = navID;
		}
	} else {
		if (document.all[divID].style.display == 'block') {
			menuClose(divID,imgID,btnID,navID);
			
		} else {
			divShow(divID);
			menuOpen(divID,imgID,btnID,navID);
			divIDOn = divID;
			imgIDOn = imgID;
			btnIDOn = btnID;
			navIDOn = navID;
		}
	}
}

//Open Menu
function menuOpen(divID,imgID,btnID,navID) {
	
	//Close the menu if open
	if(divID!=divIDOn&&divIDOn!="") {
		menuClose(divIDOn,imgIDOn,btnIDOn,navIDOn);
	}
	
	if (MOZ || NS6)
	{
		divShow(divID);
		rollover(imgID,'Images/btn_nav_on.gif');
		classChange(document.getElementById(navID),'menuOn');
		classChange(document.getElementById(btnID),'buttonOn');
	} else {
		divShow(divID);
		rollover(imgID,'Images/btn_nav_on.gif');
		classChange(eval(document.getElementById(navID)),'menuOn');
		classChange(eval(document.getElementById(btnID)),'buttonOn');
	}
}

//Close Menu
function menuClose(divID,imgID,btnID,navID) {
	
	if (MOZ || NS6)
	{
		divHide(divID);
		rollover(imgID,'Images/btn_nav_off.gif');
		classChange(document.getElementById(navID),'menuOff');
		classChange(document.getElementById(btnID),'buttonOff');
	} else {
		divHide(divID);
		rollover(imgID,'Images/btn_nav_off.gif');
		classChange(eval(document.getElementById(navID)),'menuOff');
		classChange(eval(document.getElementById(btnID)),'buttonOff');
	}
}

//Function for showing div and hidding default
function divShow(divID) {
		
	if(MOZ || NS6)
	{
		document.getElementById(divID).style.visibility = "visible";
		document.getElementById(divID).style.display = 'block';
	} else {
		document.all[divID].style.visibility = "visible";
		document.all[divID].style.display = 'block';
	}
}

//Function for hiding div amd displaying default
function divHide(divID) {

	if(MOZ || NS6)
	{
		document.getElementById(divID).style.visibility = "hidden";
		document.getElementById(divID).style.display = 'none';
	} else {
		document.getElementById(divID).style.visibility = "hidden";
		document.getElementById(divID).style.display = 'none';
	}
}

//Image rollovers
function rollover(imgid,imgsrc) {
	eval("document.images['"+imgid+"'].src='"+imgsrc+"'")
}

//Function to class
function classChange(o,classX) {
	//alert("changing");
	o.className = classX;
}

//Function to class
function classChangeIn(o) {

	o.className = 'submenuOn';
}

//Function to class
function classChangeOut(o) {

	o.className = 'submenuOff';
}

//Function to action menu click
function goX(o,url) {
	menuClose('submenu1','im1','btnCell1','nav1');
	menuClose('submenu2','im2','btnCell2','nav2');
	menuClose('submenu3','im3','btnCell3','nav3');
	classChangeOut(o);
	winGo(url);
}

//Function to change window
function winGo(url) {
	window.location.href = url;
}

//Function to swop between News Updates
var NUSelectID = 1;
function NUSelect(id) {
	
	if (id != NUSelectID) 
	{
		var DivOn = "Cat" + id;
		var DivOff= "Cat" + NUSelectID;
		var DetOn = "Detail" + id;
		var DetOff= "Detail" + NUSelectID;
		
		
		//Deselect
		classChangeVal(DivOff,'CatOff');
		divHide(DetOff);
		
		//Select
		classChangeVal(DivOn,'CatOn');
		divShow(DetOn);
		
		//Change the id
		NUSelectID = id; 
	}
}

//SubCat select in content window
var SCSelectID = 0;
function SubCatClick(id) {
	if (id != SCSelectID) 
	{
		var DivOn = "Ind" + id;
		var DivOff= "Ind" + SCSelectID;
		var DetOn = "IndDetail" + id;
		var DetOff= "IndDetail" + SCSelectID;
		
		
		//Deselect
		classChangeVal(DivOff,'IndOff');
		divHide(DetOff);
		
		//Select
		classChangeVal(DivOn,'IndOn');
		divShow(DetOn);
		
		//Change the id
		SCSelectID = id; 
	}
}

//Function to change a class
function classChangeVal(Val,className) {
	o = document.getElementById(Val)
	classChangeObj(o,className)
}


//Function to change a class
function classChangeObj(obj,className) {
	
	obj.className = className;
}

frmValidated = false;

//Function to validate the contact us page
function ValidateContact() {
	o = document.Contact
	
	if(o.title.value == "") {
		alert("Please enter your title");
		o.title.focus();
		frmValidated = false;
	 } else if(o.name.value == "") {
		alert("Please enter your name");
		o.name.focus();
		frmValidated = false;
	 } else if(o.email.value == "") {
		alert("Please enter your email");
		o.email.focus();
		frmValidated = false;
	 } else if(o.country.value == "") {
		alert("Please enter your country");
		o.country.focus(); 
		frmValidated = false;
	 } else if(o.message.value == "") {
		alert("Please enter your message");
		o.message.focus();
		frmValidated = false;
	 } else {
		frmValidated = true;
	 }
}

function processFormCompany() {
	o = document.PermitWork;
	
	if (o.Company.value == "") {
		alert("Please enter your company name");
		o.Company.focus();
		frmValidated = false;
	}
	else if (o.Name.value == "") {
		alert("Please enter your name");
		o.Name.focus();
		frmValidated = false;
	}
	else if (o.Email.value == "") {
		alert("Please enter your email");
		o.Email.focus();
		frmValidated = false;
	}
	else if (o.Telephone.value == "") {
		alert("Please enter your telephone");
		o.Telephone.focus();
		frmValidated = false;
	}
	else if (o.Work_Permit_Type.value == "") {
		alert("Please select your type of work permit");
		o.Work_Permit_Type.focus();
		frmValidated = false;
	}
	else if (o.Work_Permit_Category.value == "") {
		alert("Please select your work permit category");
		o.Work_Permit_Category.focus();
		frmValidated = false;
	}
	else if (o.Nationality.value == "") {
		alert("Please select your nationality");
		o.Nationality.focus();
		frmValidated = false;
	}
	else if (o.Company_Size.value == "") {
		alert("Please state your company size");
		o.Company_Size.focus();
		frmValidated = false;
	}
	else if (o.Employ_Period.value == "") {
		alert("Please state your employment period");
		o.Employ_Period.focus();
		frmValidated = false;
	}
	else {
		frmValidated = true;
	}
}

function processFormIndividual() {
	o = document.PermitWork;
	
	if (o.First_Name.value == "") {
		alert("Please enter your first name");
		o.First_Name.focus();
		frmValidated = false;
	}
	else if (o.Last_Name.value == "") {
		alert("Please enter your last name");
		o.Last_Name.focus();
		frmValidated = false;
	}
	else if (o.Age.value == "") {
		alert("Please enter your age");
		o.Age.focus();
		frmValidated = false;
	}
	else if (o.Email.value == "") {
		alert("Please enter your email");
		o.Email.focus();
		frmValidated = false;
	}
	else if (o.Telephone.value == "") {
		alert("Please enter your telephone");
		o.Telephone.focus();
		frmValidated = false;
	}
	else if (o.Address_1.value == "") {
		alert("Please enter your address");
		o.Address_1.focus();
		frmValidated = false;
	}
	else if (o.Postal_Code.value == "") {
		alert("Please enter your postal code");
		o.Postal_Code.focus();
		frmValidated = false;
	}
	else if (o.Town_City.value == "") {
		alert("Please enter your town/city");
		o.Town_City.focus();
		frmValidated = false;
	}
	else if (o.Nationality.value == "") {
		alert("Please select your nationality");
		o.Nationality.focus();
		frmValidated = false;
	}
	else if (o.Current_Status.value == "") {
		alert("Please select your current status");
		o.Current_Status.focus();
		frmValidated = false;
	}
	else if (o.Qualifications.value == "") {
		alert("Please state your qualifications");
		o.Qualifications.focus();
		frmValidated = false;
	}
	else if (o.Employment_History.value == "") {
		alert("Please state your employment history");
		o.Employment_History.focus();
		frmValidated = false;
	}
	else {
		frmValidated = true;
	}
}

function ValidateRegistration() {
	o = document.Registration;
	
	if (o.Title.value == "") {
		alert("Please enter your title");
		o.Title.focus();
		frmValidated = false;
	}
	else if (o.First_Name.value == "") {
		alert("Please enter your first name");
		o.First_Name.focus();
		frmValidated = false;
	}
	else if (o.Last_Name.value == "") {
		alert("Please enter your last name");
		o.Last_Name.focus();
		frmValidated = false;
	}
	else if (o.Email.value == "") {
		alert("Please enter your email");
		o.Email.focus();
		frmValidated = false;
	}
	else if (o.Company.value == "") {
		alert("Please enter your company name");
		o.Company.focus();
		frmValidated = false;
	}
	else if (o.Telephone.value == "") {
		alert("Please enter your telephone");
		o.Telephone.focus();
		frmValidated = false;
	}
	else if (o.Address_1.value == "") {
		alert("Please enter your address");
		o.Address_1.focus();
		frmValidated = false;
	}
	else if (o.Postal_Code.value == "") {
		alert("Please enter your postal code");
		o.Postal_Code.focus();
		frmValidated = false;
	}
	else if (o.Town_City.value == "") {
		alert("Please enter your town/city");
		o.Town_City.focus();
		frmValidated = false;
	}
	else if (o.Company.value == "") {
		alert("Please select your country");
		o.Company.focus();
		frmValidated = false;
	}
	else {
		frmValidated = true;
	}
}

//New window Function for centering
function newWin(url,name,w,h,scroll) {
	var xPos = (screen.width - w) / 2; 
	var yPos = 20; 
	winprops = 'height=' + h + ',width=' + w + ',top=' + yPos + ',left=' + xPos + ',scrollbars=' + scroll + ',menubar=no,status=no,toolbar=no,resizable';

	win = window.open(url, name, winprops);
}

//</script>