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(ns)document.captureEvents(Event.MOUSEMOVE)

	if(!(isMac && ie)) document.onmousemove=getMouseX;
	else document.onmouseover = getMouseX;
		

	
}

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();
	if(window.rightdetector) rightdetector.hide();
	if(window.leftdetector) leftdetector.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.15)';
		this.ref.filters[0].apply();
		this.hide();
		this.ref.filters[0].play();
		
	}
	else this.hide();
	
	if(ns4 && typeof(textarea)=='object') {textarea.show();textarea.moveTo(0,0)}
}


function showDropdown(navNo){
	var i=1;
	while (eval("typeof topmenu"+i+"=='object'")){
		var curObj=eval("topmenu"+i)
		if(i==navNo){
			curObj.css.zIndex=6;
			if (ie) curObj.css.filter[0]="alpha(opacity=90)";
			curObj.inherit();
			if(ns4 && typeof(textarea)=='object' ) {textarea.hide();textarea.moveTo(-1000,0)}
		}
		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)');
			}
		}
	
	if(typeof upperdetector=='object'){
		upperdetector.inherit();
	}
	
	if(typeof lowerdetector=='object'){
		lowerdetector.inherit();
	}
	
	//changeBackground(navNo);	// this line fixes the scrollbar position on mac IE5
	
}

function moveDropdown(navNo,e){
	eval('topmenu'+navNo+'.easeTo(curX-20,null,1,50)');
}


function changeBackground(navNo) {

	if (ie || ns5){
		var i=1;
		while(typeof document.images["navcolour" + navNo + i]=="object"){
		 	document.images["navcolour" + navNo + i].src = menuActive.src;
			i++;
		}
	}
	if (!ie4)
		{
			topNavElm=navNo;
		}
}

function undoBackground(navNo) {
	
	if (ie || ns5){
		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'
		}
}
//---------------------------------------------------------------------------------------------
function openWin(filename, winname, width, height) {
	if(!winname) winname = ""
	if(!width) width = 500
	if((!height)&&(screen.height==600)) height = 562
	if(!height) height = 600
	return window.open(filename, winname, "width="+width+",height="+height+",scrollbars=yes,resizable=yes")
}
//---------------------------------------------------------------------------------------------
//do nothing function - use on links to get onclick in netscape
function z(){}

//----------------------------------------------------------------------------------------------
/*
//for opening up pdf's in a new window
*/
	function getPdf(FormType){
		
				FilePath = document.pdfform.pdf.value;
			var PDF_Form = OpenRegFormWindow("/reg/index.asp?related_service_link=" + FilePath,480,580);
	}

	function OpenRegFormWindow(on_page, X, Y) {

			OpenRegFormWindow_nme = window.open(on_page,"OpenRegFormWindow_nme","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + X + ",height=" + Y );
	        
			if (OpenRegFormWindow_nme.opener == null){
					OpenRegFormWindow_nme.opener = self;
					this.OpenRegFormWindow_nme = OpenRegFormWindow_nme;
			}
			return this;
	}


	var blnRegistering = true
/*
	function getPdf(formName){
	
		var sFromPage = document.location.href
		var queryStr="";
		var formObj=document[formName];
		
		var winWidth = 500
		var winHeight = 600
		
		if (screen.width==800||screen.height==600){
			winHeight = 562
			}
		else if (screen.width<=1024||screen.height<=768){
			winHeight = 600
			}			
			
			
			
		
		if (formObj){
				if (formObj.from){
					formObj.from.value = sFromPage
				}
		
			// generate querystring from hidden form
			for(i=0;i<formObj.elements.length;i++){
				queryStr+="&"+formObj.elements[i].name+"="+escape(formObj.elements[i].value);
			}
	
			var page="/pdfstream.asp?regSite=uk"+queryStr+"&dummy=.pdf";
		
			newWin = openWin(page,"newWin",winWidth,winHeight)
			setTimeout("focusWin(newWin)",20)
		}



	}
*/	
	
	function registering(){
		blnRegistering = true
	}
	
	
	function closeWinIfLoadedPDF(oWin){
		var sPageName = oWin.document

		if(!blnRegistering){
			oWin.document.location.href = "/closewin.asp"
		}else{
			focusWin(oWin)
		}
	}

	
//----------------------------------------------------------------------------------------------

var newWin

	function focusWin(oWin){
		if (oWin){
			oWin.focus()
		}
	}

	function closeWin(oWin){
		if (oWin){
			oWin.close()
		}
	}
