	var BROWSER_N6 = (document.getElementById && !document.all) ? true : false;
	var BROWSER_IE = (document.all) ? true : false;
	var BROWSER_Opera = (navigator.userAgent.indexOf("Opera")!=-1);
	var BROWSER_Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);
	var BROWSER_NS4 = (document.layers) ? true : false;

	function bIEVersion() 
	{
	  msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
	  return(parseFloat(navigator.appVersion.substr(msieIndex,3)));
	}
	
	// functions for handling tabs added by M Bilock
	function inactiveLinks() 
	{
		if(typeof(Tab1) != 'undefined') { Tab1.className='inactive'; }
		if(typeof(Tab2) != 'undefined') { Tab2.className='inactive'; }
		if(typeof(Tab3) != 'undefined') { Tab3.className='inactive'; }
		if(typeof(Tab4) != 'undefined') { Tab4.className='inactive'; }
	}
	
	function handleClickByName(oLinkName) {
		var oLink;
		inactiveLinks();
		// and activate the clicked link.
		oLink = eval(oLinkName);
		oLink.className = 'marked';
		return true;
	}
	function handleClick(oLink) {
		var ret = true;
		inactiveLinks();
		// and activate the clicked link.
		oLink.className = 'marked';
		//setTabcontent(sURL);
		return ret;
	}

	function handleMIn(oLink) {
		if(oLink.className != 'marked') { oLink.className='active';}
	}

	var x_oLink = null
	function handleMOut(oLink) {
		x_oLink = oLink;
		setTimeout(handleMOut2,300);
	}
	function handleMOut2() {
		if (x_oLink)
		if(x_oLink.className != 'marked') { 
		x_oLink.className='inactive';
		}
	}

	function setTabcontent(sURL){

		var myElement = document.getElementById("datalist")
		myElement.setAttribute('src', sURL+'?<%=request.querystring%>');
	} 

	function clearValue(o) {
	o.select();
	o.style.backgroundColor='FFCC00';
	}	
	
	function WinPopUp(URL)
	{
			window.open('/applications/qo/selqrytype.asp?' + URL ,'apinter','height=700,width=680,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
			return false;
	}

	//Moved from js_functions.js / pfa
	function footnote(theURL,theWindow,pos) {
		var w=670
		var h=600
		if(pos=="center"){LeftPosition=(screen.availWidth)?(screen.availWidth-w-10)/2:1;TopPosition=(screen.availHeight)?(screen.availHeight-h-25)/2:1;}
		if(pos=="default"){LeftPosition=100;TopPosition=100}
		else if((pos!="center" && pos!="default") || pos==null){LeftPosition=(screen.availWidth)?(screen.availWidth-w)/2:1;TopPosition=(screen.availHeight)?(screen.availHeight-h)/2:1;}
		window.open(theURL,theWindow,'top='+TopPosition+',left='+LeftPosition+',width='+w+',height='+h+',resizable=yes,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no');
	}

	function clearBgColour(o){
		o.style.backgroundColor='FFFFFF';
	}

	function jumpMenu(id)
	{ 
		var Link
		var Data

		Link = document.getElementById(id).value;
		Data = Link.split(";");
		
		if (Data[0] == 1) {
		window.open(Data[1])
		}
		else
		{
			if(Data[0] == 0)
			{
				window.location=Data[1];
			}
			else
			{
				if(Data[0] == 2)
				{
					WinPopUp(Data[1]);
				}
			}
		}
	}
	
	
	//End move /pfa



	//Used by TopMenu and Group Wide Navigation
	function OpenNewWindow(url) 
	{ 
	var newWin = window.open(url, 'newWin'); 
	} 

	//Used by page footer
	function OpenLocationWindow(url) 
	{ 
			var wheight =  "600";
			var wwidth =  "750";
			opts = "width=" + wwidth + ",height=" + wheight+ ",left=50,top=50,scrollbars=yes,resizable=no";

			EntryWin = window.open( url ,"Locations", opts);
			EntryWin.focus();  	
	} 

	function PrintPage(returnUrl)
	{
		window.print();
		document.location.href = returnUrl;
	}

	function changeBGColor(sender)
	{
	}

	function clearBGColor(sender)
	{
	}
		
	//Returns TRUE if page is viewed in Edit-mode
	function IsPageInEditMode()
	{
		var frame;
		var wnd = this.window;
		
		while (wnd != null)
		{
			if(wnd.commandEvent && wnd.latestNavigate!=null && wnd.latestNavigate!='')
				return true;
			if (wnd == wnd.parent)
				break;
			wnd = wnd.parent;
		}
		return false;
	}

	
	// Add a query string to the url
	function AddParameter(url, parameter, value)
	{
		if (url.indexOf('?') > -1)
			url += '&';
		else
			url += '?';
		
		return url + parameter + '=' + value;
	}
	
	function ChangeLocation(obj)
	{
		window.location.href = obj.value;
	}
