// ************************************
// Initialise Top Navigation
// ************************************
function initTopNavigation(){
	if(eval('self.document.' + strStrandCode + '_block')) {
		eval('self.document.' + strStrandCode + '_block.src=\"' + imgblock_on_full + '\";');
	}
}
// ************************************
// Toggle Section Block
// ************************************
function toggleBlock(strImageName, strValue){    
	if(strImageName != (strStrandCode + "_block")){ 
		if(strValue == "on"){ 
			eval('self.document.' + strImageName + '.src = imgBlockOn.src;');
		} else { 
			eval('self.document.' + strImageName + '.src = imgBlockOff.src;');
		} 
	}
}
// ************************************
// TOP NAVIGATION mouse functions
// ************************************
function mouseOnTopNav(obj, doccode, strandnum){
	toggleBlock(doccode + '_block', 'on');
}
function mouseOffTopNav(obj, doccode, strandnum){
	toggleBlock(doccode + '_block', 'off');
}
// ************************************
// TOP NAVIGATION - new style - build
// ************************************
function ow_loadTopNavigation( strList, strAlias ){
	arrList = new Array();
	arrList = unescape(strList).split('~~');
	intNavNum = arrList.length;
	intNavTop = parseInt(intNavNum / 2);
	if(intNavNum % 2 == 1){
		intNavTop = intNavTop + 1;
	}
	intNavBot = intNavNum - intNavTop;
 
	strBuff = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-left:auto;\"><tr>";
	intNavCount=0;
	for(al = 0 ; al < arrList.length; al++){
		if(arrList[al] != ""){
			strBuff = strBuff + "<td>" + ow_buildLink(arrList[al], strAlias) + "</td>";
			intNavCount = intNavCount + 1;
			if(intNavCount == intNavTop){
				strBuff = strBuff + "<td rowspan=\"2\" width=\"10\" style=\"background-color:#E0E0E0;\"><img src=\"/icons/ecblank.gif\" width=\"10\" height=\"1\" /></td></tr><tr>";
			}
		}
	}
	if(intNavTop != intNavBot){
		strBuff = strBuff + "<td></td>";
	}
	strBuff = strBuff + "</tr></table>";
	document.write(strBuff);
}
// ************************************
// TOP NAVIGATION - new style - create links
// ************************************
function ow_buildLink(strEle, strUseAlias){
	strLink = "";
	arrEle = new Array();
	arrEle = strEle.split('#');
	if(strUseAlias == "1"){
		strURL = doReplace(doReplace(arrEle[5],'*DATECODE*', strDateCode), '*SID*', strSessionID) ;
	}else{
		strURL = doReplace(doReplace(arrEle[8],'*DATECODE*', strDateCode), '*SID*', strSessionID) ;
	}
	if(arrEle[1] == thisUNID || arrEle[1] == parentUNID || arrEle[2] == strStrandCode){
		strLink = strLink + "<a href=\"" + strURL + "\" alt=\"" + arrEle[0] + "\" tabindex=\"" + arrEle[6] + "\" accesskey=\"" + arrEle[7] + "\">";
		strLink = strLink + "<img src=\"" + arrEle[3] + "\" alt=\"" + arrEle[0] + "\" border=\"0\">";
		strLink = strLink + "</a>";
	}else{
		strLink = strLink + "<a href=\"" + strURL + "\" alt=\"" + arrEle[0] + "\" tabindex=\"" + arrEle[6] + "\" accesskey=\"" + arrEle[7] + "\">";
		strLink = strLink + "<img src=\"" + arrEle[4] + "\" alt=\"" + arrEle[0] + "\" border=\"0\" onmouseover=\"ow_swapImage(this, '" + arrEle[3] + "');\"  onmouseout=\"ow_swapImage(this, '" + arrEle[4] + "');\">";
		strLink = strLink + "</a>";
	}
	return strLink;
}
// ************************************
// TOP NAVIGATION - new style - rollovers
// ************************************
function ow_swapImage(objImg, strSource){
	objImg.src = strSource;
}
