var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
var fix = 0;
if (BrowserDetect.browser == "Explorer") {
	fix = 1;
}

function resetMenu(cobj){
	if (cobj.id == "a0"){
		xrc = cobj.src.substring(0,(cobj.src.lastIndexOf("/")+1));
		document.getElementById("a1").src = xrc+"m_02.jpg";
		document.getElementById("a2").src = xrc+"m_03.jpg";
	}
	if (cobj.id == "a1"){
		xrc = cobj.src.substring(0,(cobj.src.lastIndexOf("/")+1));
		document.getElementById("a0").src = xrc+"m_01.jpg";
		document.getElementById("a2").src = xrc+"m_03.jpg";
	}
	if (cobj.id == "a2"){
		xrc = cobj.src.substring(0,(cobj.src.lastIndexOf("/")+1));
		document.getElementById("a1").src = xrc+"m_02.jpg";
		document.getElementById("a0").src = xrc+"m_01.jpg";
	}
	if (cobj.id == "a3"){
		xrc = cobj.src.substring(0,(cobj.src.lastIndexOf("/")+1));
		document.getElementById("a1").src = xrc+"m_02.jpg";
		document.getElementById("a2").src = xrc+"m_03.jpg";
		document.getElementById("a0").src = xrc+"m_01.jpg";
	}
}

function setAll(){
	
	xrc = document.getElementById("a0").src.substring(0,(document.getElementById("a0").src.lastIndexOf("/")+1));
	document.getElementById("a0").src = xrc+"m_01.jpg";
	document.getElementById("a1").src = xrc+"m_02.jpg";
	document.getElementById("a2").src = xrc+"m_03.jpg";
}
//Contents for menu 1
var menu1=new Array()
menu1[0]='<ul>'; //do not remove this line
menu1[1]='<li><a href="CompanyInformation.asp">Company Information</a></li>'
//menu1[2]='<li><a href="Customers.asp">Customers</a></li>'
menu1[2]='<li><a href="BoardofDirectors.asp">Board of Directors</a></li>'
menu1[3]='<li><a href="EFC_Environment.asp">The Environment</a></li>'
menu1[4]='<li><a href="Awards_Accreditations.asp">Awards & Accreditations</a></li>'
menu1[5]='</ul>'; //do not remove this line

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<ul>'; //do not remove this line
menu2[1]='<li><a href="AirportTerminalServices.asp">F&B Services (Airport)</a></li>'
menu2[2]='<li><a href="Events.asp">Event Catering</a></li>'
menu2[3]='<li><a href="VIP_Private_Jet_Catering.asp">VIP and Private Jet Catering</a></li>'
//menu2[4]='<li><a href="Inflight_Catering.asp">Inflight Catering</a></li>'
menu2[4]='<li><a href="Linencraft.asp">Linencraft</a></li>'
menu2[5]='<li><a href="FoodPoint.asp">Food Point</a></li>'
menu2[6]='</ul>'; //do not remove this line

//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<ul>'; //do not remove this line
menu3[1]='<li><a href="CareerOpportunities.asp">Career Opportunities</a></li>'
menu3[2]='</ul>'; //do not remove this line

//Contents for menu 4, and so on

var menuwidth='165px' //default menu width
var menubgcolor=''  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
//alert(what);
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
resetMenu(obj);// reset all menu images to normal
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+fix+"px"
//dropmenuobj.style.left=dropmenuobj.x+175+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
//dropmenuobj.style.top=dropmenuobj.y+31+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
	if (typeof dropmenuobj!="undefined"){
		if (ie4||ns6)
		dropmenuobj.style.visibility="hidden"
	}
	setAll();
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu