function duk_checkBrowser(){
	this.ver=navigator.appVersion; this.dom=document.getElementById?1:0;
	this.mac=(this.ver.indexOf("PPC")!= -1)?1:0;	this.win=(this.ver.indexOf("Win")!= -1)?1:0;
	this.ie5up=(this.ver.indexOf("MSIE") && this.dom && parseInt(this.ver) >= 4) ?1:0;
	this.ie4=(document.all && !this.dom)?1:0; this.ie=(this.ie5up || this.ie4);
	this.ns5up=(this.ver.indexOf("MOZILLA") && this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0; this.ns=(this.ns4 || this.ns5up);
	this.duk=(this.ie || this.ns);
	return this;
}
duk=new duk_checkBrowser();

function doLinks()
{
//strURL = "http://dev.designuk.com/oe2005/main/index.cfm?page=1008";
var strURL = location.href;
var strPageNum = "";
if (strURL!="")
{
	//Get rid of the bug where the landingpage URL encoded variable is mistaken for page by the regedit
	strURL = strURL.replace(/landingpage/,"landing").toString();
	if (strURL.indexOf("page=")!=-1) strPageNum = strURL.match(/page=\d+/).toString();
	if (strPageNum=="") if (strURL.indexOf("channel=")!=-1) strPageNum = strURL.match(/channel=\d+/).toString();
}

if (strPageNum!="")
{
	numPageNum = parseInt(strPageNum.match(/\d+/).toString());
	//arrPageAs = document.body.getElementsByTagName("A");
	arrPageAs = document.links;
	pageID = getPageByChannelID(numPageNum)
	do {
		//alert('searching for page '+pageID.ChannelID)
		for (count=0;count<arrPageAs.length;count++)
			{
				/*Check to see whether page=NNNN appears in HREF
				This means that page is above this page in site hierarchy
				*/
				//alert("page="+pageID.ChannelID);
				if (arrPageAs[count].id  != "cont"){
				if (arrPageAs[count].href.indexOf("page="+pageID.ChannelID) != -1) if (arrPageAs[count].className == "") arrPageAs[count].className="selected";
				}			}
		if (pageID.Parent != null) pageID = pageID.Parent
	} while (pageID.Parent != null)
}
}

//if (!(duk.ie && duk.mac)) window.onload = doLinks;
window.onload = doLinks;