// *******************************************
// Top Navigation Build
// *******************************************
function ow_loadTopNavigation(strList, strAlias){
// ************************************
// TOP NAVIGATION (2) - build
// ************************************
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 = "
";
intNavCount=0;
for(al=0 ; al" + ow_buildLink(arrList[al], strAlias) + "";
intNavCount=intNavCount+1;
if(intNavCount==intNavTop){
strBuff = strBuff + " |
";
}
}
}
if(intNavTop != intNavBot){
strBuff = strBuff + " | ";
}
strBuff = strBuff + "
";
document.write(strBuff);
}
// *******************************************
// Top Navigation Initialise
// *******************************************
function initTopNavigation(){
if(eval('self.document.'+strStrandCode+'_block')) {
eval('self.document.'+strStrandCode+'_block.src=\"'+imgblock_on_full+'\";');
}
}
// *******************************************
// Supporting Functions
// *******************************************
// ************************************
// TOP NAVIGATION mouse functions
// ************************************
function mouseOnTopNav(obj, doccode, strandnum){
toggleBlock(doccode+'_block', 'on');
}
function mouseOffTopNav(obj, doccode, strandnum){
toggleBlock(doccode+'_block', 'off');
}
// ************************************
// 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;');
}
}
}
// *******************************************
// LHN Builder
// *******************************************
function doLHN(list, deadlist){
var fulllist = unescape(list);
//alert(fulllist);
var listArray = fulllist.split(";");
var prevLevel = "";
var strBuffer = "";
var arrSC = initStrComp.split('_');
thisLevel = arrSC.length;
if(parentUNID == ""){
strMatchThisUNID = thisUNID;
}else{
if(thisLevel == 2){
strMatchThisUNID = thisUNID;
}else{
strMatchThisUNID = parentUNID;
}
}
for (i = 0; i < listArray.length; i++) {
var smallArray = listArray[i].split('#');
var secCat = 'sec' + smallArray[0];
var strIm = 'im' + smallArray[0];
var level = smallArray[1];
var link = smallArray[2];
var unid = smallArray[3];
if(unid == strMatchThisUNID){
//alert(i + ':' + secCat);
checkTopLevel = level;
checkTopSecCat = secCat;
if(checkTopSecCat.indexOf('_') > -1){
checkTopSecCatRemain = checkTopSecCat.substring(checkTopSecCat.indexOf('_')+1);
if(checkTopSecCatRemain.indexOf('_') > -1){
checkTopSecCatRemain = checkTopSecCatRemain.substring(0, checkTopSecCatRemain.indexOf('_'));
}
checkTopSecCat = checkTopSecCat.substring(0, checkTopSecCat.indexOf('_')) + '_' + checkTopSecCatRemain;
}
//alert(checkTopSecCat);
}
}
//alert(checkTopSecCat);
//alert(checkTopLevel);
for (i = 0; i < listArray.length; i++) {
var smallArray = listArray[i].split('#');
var secCat = 'sec' + smallArray[0];
var strIm = 'im' + smallArray[0];
var level = smallArray[1];
var link = smallArray[2];
var unid = smallArray[3];
if(level == "3"){
lastLevel2 = 1;
for(j = (i + 1); j < listArray.length; j++){
var checkLevel = listArray[j].split('#')[1];
if(checkLevel == "3"){ lastLevel2 = 0; }
}
}
if (checkLHNStatus(smallArray[0], deadlist) == "Enabled") {
if ((i + 1) < listArray.length) {
var nextLevel = listArray[i+1].split('#')[1];
} else {
var nextLevel = '0';
}
if (level == "1" || level == "2" || level == "6") {
//do nothing unless level 2
if(level == "2") {
//alert(secCat);
//alert(secCat.substring(0, checkTopSecCat.length));
//alert(checkTopSecCat);
if((secCat.substring(0, checkTopSecCat.length) == checkTopSecCat) && (checkTopLevel > 1)){
strBuffer = strBuffer + ' | ' + '' + link + ' ';
}else{
strBuffer = strBuffer + ' | ' + '' + link + ' ';
}
}
} else if (level == "3" && checkTopLevel > 1 && secCat.substring(0, checkTopSecCat.length) == checkTopSecCat) {
document.write('');
} else if (level == "4" && checkTopLevel > 1 && secCat.substring(0, checkTopSecCat.length) == checkTopSecCat) {
document.write('');
} else if (level == "5" && checkTopLevel > 1 && secCat.substring(0, checkTopSecCat.length) == checkTopSecCat) {
document.write('');
}
prevLevel = level;
} else { }
}
if(IE4){
objNav2=self.document.all('divLevel2Nav');
}else{
objNav2=self.document.getElementById('divLevel2Nav');
}
//alert('fin');
//alert(strBuffer);
objNav2.innerHTML = strBuffer;
}
// *******************************************
// LHN Initialise
// *******************************************
function initLeftNavigation(){
var validity = strValid;
if (validity == "No") { return;} else {}
if(IE4){
tempColl = document.all.tags("DIV");
}else{
tempColl = document.getElementsByTagName("DIV");
}
for (i=0; i < tempColl.length; i++) {
if(IE4){
if (tempColl[i].className == "level3") tempColl[i].style.display = "block";
if (tempColl[i].className == "level4") tempColl[i].style.display = "none";
if (tempColl[i].className == "level5") tempColl[i].style.display = "none";
if (tempColl[i].className == "level6") tempColl[i].style.display = "none";
}else{
whichEl = tempColl[i].getAttribute('class');
if (whichEl == "level3") tempColl[i].style.display = "block";
if (whichEl == "level4") tempColl[i].style.display = "none";
if (whichEl == "level5") tempColl[i].style.display = "none";
if (whichEl == "level6") tempColl[i].style.display = "none";
}
}
var strComp = initStrComp;
var strIm = strComp.replace("sec","im");
var sectionArr = strComp.split("_");
var strCat = "";
for (j = 1; j < sectionArr.length; j++) {
strCat = strCat + "_" + sectionArr[j];
if (doesDivExist(sectionArr[0] + strCat) == 'True') {
expandItInit(sectionArr[0] + strCat, sectionArr[0].replace("sec","im") + strCat);
}
}
}
// *******************************************
// Supporting Functions
// *******************************************
// ************************************
// Check LHN Status
// ************************************
function checkLHNStatus(CatLevel, deadlist) {
var Status = "Enabled";
if (deadlist == "") { } else {
var deadArray = deadlist.split(";");
for (j = 0; j < deadArray.length; j++) {
var check = deadArray[j];
var slength = check.length;
var level = CatLevel.slice(0, slength);
if (check == level) {
Status = "Disabled";
break;
} else { }
}
}
return Status;
}
// ************************************
// Expand from Navigation
// ************************************
function expandIt(el, strArgs2, imID) {
//alert('expandit');
if (!ver4) return;
expandItInit(el,imID);
collapseOthers(el,strArgs2,imID);
}
// ************************************
// Expand It Init
// ************************************
function expandItInit(el,imID) {
if(IE4){
whichEl = eval(el);
}else{
whichEl = document.getElementById(el);
}
SwapImage(imID);
if (whichEl.style.display == "none") {
switchSubLevel(el, "block",imID);
}else{
switchSubLevel(el, "none",imID);
}
}
// ************************************
// Collapse It Init
// ************************************
function collapseItInit(el, imID) {
var LevelArray = el.split("_");
var Level;
if(strLHNType == "FULL"){
Level = LevelArray.length;
LevelCheck = "1";
}else{
LevelArray.length == 2 ? Level = "2": Level = "x";
LevelCheck = "2";
}
collapseImage(imID);
if(IE4){
if (Level == LevelCheck) {
document.all[el].style.display = "block";
}else{
document.all[el].style.display = "none";
}
}else{
if (Level == LevelCheck) {
document.getElementById(el).style.display = "block";
}else{
document.getElementById(el).style.display = "none";
}
}
}
// ************************************
// Collapse Others
// ************************************
function collapseOthers(el,level,imID) {
var strComp;
var newType;
var newLevelArray;
var newLevel;
if(strLHNType == "FULL"){}else{
var levelArray = el.split("_");
var match = levelArray[0] + "_" + levelArray[1];
}
if(IE4){
tempColl = document.all.tags("DIV");
}else{
tempColl = document.getElementsByTagName("DIV");
}
for (i = 0; i < tempColl.length; i++) {
if(IE4){
strComp = new String(tempColl[i].id);
}else{
strComp = new String(tempColl[i].getAttribute("id"));
}
newType = strComp.substring(0,3);
if(strLHNType == "FULL"){
if(strComp.length > el.length){
if(newType == "sec"){
if(strComp.substring(0, el.length) != el){
collapseItInit(strComp,"im" + strComp.substring(3));
}
}
}
if(strComp.length == el.length){
if(newType == "sec"){
if(strComp.substring(0, el.length) != el){
collapseImage("im" + strComp.substring(3));
}
}
}
}else{
newLevelArray = strComp.split("_");
newLevel = newLevelArray[0] + "_" + newLevelArray[1];
if (newType == "sec") {
if(newLevel != match) {
collapseItInit(strComp,"im" + strComp.substring(3));
}
}
}
}
}
// ************************************
// Switch Sub Level
// ************************************
function switchSubLevel(level, mode, imID) {
//seeks out sub levels below this menu option and either expands them or collapses them
var strComp;
var toplevel = level;
level = level + "_";
var levelArr;
var toplevelArr;
if(IE4){
tempColl = document.all.tags("DIV");
}else{
tempColl = document.getElementsByTagName("DIV");
}
for (i = 0; i < tempColl.length; i++) {
if(IE4){
strComp = new String(tempColl[i].id);
}else{
strComp = new String(tempColl[i].getAttribute("id"));
}
levelArr = strComp.split("_");
toplevelArr = toplevel.split("_");
if (strComp.indexOf(level) != -1) {
// Then key matches
whichEl = eval(strComp);
if(IE4){
if ( (document.all[strComp].style.display == "none") && (levelArr.length - toplevelArr.length == 1) ){
document.all[strComp].style.display = "block";
}else{
document.all[strComp].style.display = "none";
}
}else{
if ( (document.getElementById(strComp).style.display == "none") && (levelArr.length - toplevelArr.length == 1) ){
document.getElementById(strComp).style.display = "block";
}else{
document.getElementById(strComp).style.display = "none";
}
}
}
}
}
// ************************************
// Collapse Image
// ************************************
function collapseImage(imID) {
eval('var strImg = document.' + imID + '.src;');
var arrImg = strImg.split('/');
var imgFile = arrImg[arrImg.length-1];
if (imgFile == 'SI_10.gif') {
eval('document.' + imID + '.src = strImg.replace(imgFile,\'SI_9.gif\');');
} else if (imgFile == 'SI_7.gif') {
eval('document.' + imID + '.src = strImg.replace(imgFile,\'SI_6.gif\');');
}
}
// ************************************
// Swap Image
// ************************************
function SwapImage(imID) {
eval('var strImg = document.' + imID + '.src;');
var arrImg = strImg.split('/');
var imgFile = arrImg[arrImg.length-1];
if (imgFile == 'SI_9.gif') {
eval('document.' + imID + '.src = strImg.replace(imgFile,\'SI_10.gif\');');
} else if (imgFile == 'SI_6.gif') {
eval('document.' + imID + '.src = strImg.replace(imgFile,\'SI_7.gif\');');
} else if (imgFile == 'SI_10.gif') {
eval('document.' + imID + '.src = strImg.replace(imgFile,\'SI_9.gif\');');
} else if (imgFile == 'SI_7.gif') {
eval('document.' + imID + '.src = strImg.replace(imgFile,\'SI_6.gif\');');
}
}