var pageType="home";
var menuActive=new Image();
menuActive.src="images/"+pageType+"/nav_filler.gif";
var menuInactive=new Image();
menuInactive.src="images/blank.gif";

function init() {
	divObjectInit() ;
	menuInit();
}

function menuInit() {  // makes dropdown menus transparent for IE
	if (ie)
		{
		var i=1;
		while (eval("typeof topmenu"+i+"=='object'")){
			eval('topmenu'+i+'.css.filter="alpha(opacity=95)"');
			i++;
		}
	}
	if(!isMac) document.onmousemove=getMouseX;
	else document.onmouseover = getMouseX;
	if(ns)document.captureEvents(Event.MOUSEMOVE)
}


var curX;
var topNavElm;

function getMouseX(e){
	curX=parseInt(ns ? e.pageX : event.clientX);
	if(topNavElm){
		var i=1;
		while (eval("typeof topmenu"+i+"=='object'")){
			var curObj=eval("topmenu"+i);
			if(curObj.css.visibility=="inherit"){
				if(!isMac) curObj.easeTo(curX-25,null,1,30);
				else curObj.moveTo(curX-25,null,1,30);
			}
			i++;
		}
	}
}

function hideDetector() {
	upperdetector.hide();
	lowerdetector.hide();
	var i=1;
	while ((eval("typeof topmenu"+i+"=='object'"))&&('topmenu'+i+'.css.visibility=="inherit"')){
		eval("topmenu"+i+".fadeOut()");
		i++;
	}
}

divObject.prototype.fadeOut=divObjectFade;

function divObjectFade(){
	if(ie5&&!isMac){
		this.css.filter='blendTrans(duration=0.2)';
		this.ref.filters.blendTrans.apply();
		this.hide();
		this.ref.filters.blendTrans.play();
	}
	else this.hide();
}

function showDropdown(navNo){
	var i=1;
	while (eval("typeof topmenu"+i+"=='object'")){
		var curObj=eval("topmenu"+i)
		if(i==navNo){
			curObj.css.zIndex=6;
			curObj.css.filter="alpha(opacity=90)";
			curObj.inherit();
		}
		else {
			curObj.css.zIndex=5;
			curObj.fadeOut();
		}
		i++;
	}
	if (!ie4)
		{
			if (eval("typeof topmenu"+navNo+"=='object'")){
				eval('topmenu'+navNo+'.moveTo(curX-25,null,1,10)');
			}
		}
	upperdetector.inherit();
	lowerdetector.inherit();
}

function moveDropdown(navNo,e){
	eval('topmenu'+navNo+'.easeTo(curX-20,null,1,50)');
}

function changeBackground(navNo) {
	if (ie){
		var i=1;
		while(typeof document.images["navcolour" + navNo + i]=="object"){
		 	document.images["navcolour" + navNo + i].src = menuActive.src;
			i++;
		}
	}
	topNavElm=navNo;
}

function undoBackground(navNo) {
	if (ie){
		var i=1;
		while(typeof document.images["navcolour" + navNo + i]=="object"){
		 	document.images["navcolour" + navNo + i].src = menuInactive.src;
			i++;
		}
	}
	topNavElm=false;
}
//----------------------------------------------------------------------------------------------
function colourOn(whichcell) {
	if (ie)
	{
		whichcell.className='tableOn'
	}
}
//----------------------------------------------------------------------------------------------
function colourOff(whichcell) {
	if (ie)
		{
			whichcell.className='tableOff'
		}
}
	