// // Template: Internet 00_8_1 navigation functions // URL for the Portal page var strPortalURL = 'http://hartmannintra'; // load images var imgJumperExpand = new Image(); var imgJumperCollapse = new Image(); var testx = 1; var strData = ''; var strHead = ''; function initNavigation() { // imgJumperExpand.src = strNavigationImagePath + 'jumper_expand.gif'; // imgJumperCollapse.src = strNavigationImagePath + 'jumper_collapse.gif'; } // helper function function getE(obj) { return document.getElementById(obj); } // change folder state (open, close) function changeFolder(strIDImg, strIDDiv) { if(getE(strIDDiv).style.display == 'none') { openFolder(strIDImg, strIDDiv); }else{ closeFolder(strIDImg, strIDDiv); } } // get background color for level function getLevelColor(intLevel) { switch(intLevel) { case -1: return 'BCD1FC'; case 0: return 'CDDDFF'; case 1: return 'DCE7FF'; } } // open folder function openFolder(strIDImg, strIDDiv,intID) { // 2005-10-11: mark all sub-nodes as active. if(intID != null) { try { var intItems = arrNavigation.length; var intLvl = arrNavigation[intID][0]; for(k=intID;k intLvl) { var oElem = document.getElementById('ntd_' + k); if(oElem && oElem.className == 'textnavid') { oElem.className = 'textnavi'; } } else { //break; } } } catch(e){ alert(e.message); } } try { getE(strIDImg).src = imgJumperCollapse.src; }catch(e) {} getE(strIDDiv).style.display = ''; } // close folder function closeFolder(strIDImg, strIDDiv) { try{ getE(strIDImg).src = imgJumperExpand.src; } catch(e) {} getE(strIDDiv).style.display = 'none'; } function openIntranetPortal() { try { if(window.opener) { // load portal page in window opener. window.opener.top.location = strPortalURL; window.opener.top.focus(); // close current window. window.close(); } else { // load portal page in current window window.location = strPortalURL; } } catch(e){} } var bActive = 0; function showNavi() { document.getElementById('divNavi').style.display = ''; document.onmousedown = hideNavi; bActive = 1; } function hideNavi(e) { if(bActive == 1) { setTimeout("hideNavi2();",200); } } function hideNavi2() { document.getElementById('divNavi').style.display = 'none'; bActive = 0; } // get the current page URL function getThisURL() { return window.location.href; } // ends with string function like in C# function endsWith(str1,str2) { var intLen1 = str1.length; var intLen2 = str2.length; var intIndex = str1.lastIndexOf(str2); if(intIndex == -1) return false; else return intIndex + intLen2 == intLen1; } // compare URLs function compareURL(strURL1,strURL2,bRedDotMode) { // in RD SmartEdit mode compare with &pageguid=.. in URL if(bRedDotMode) { strURL1 = strURL1.toLowerCase(); // Page GUID strURL2 = strURL2.toLowerCase(); // URL of the currently loaded page if( strURL2.indexOf("&pageguid=" + strURL1) > -1 ) { //alert(strURL2 + "\n\n" + "&pageguid=" + strURL1); return true; } else { return false; } } if(!strURL1 || !strURL2 || strURL1 == '' || strURL2 == '') return false; if(strURL2 != '' && strURL2.indexOf('/') != 0) { strURL2 = '/' + strURL2; } if(strURL1 != '' && strURL1.indexOf('/') != 0) { strURL1 = '/' + strURL1; } return endsWith(strURL1,strURL2); } // remove GET params and anchors from an URL function cutURLParams(strURL) { // check for GET parameters (?) var intQuestMark = strURL.lastIndexOf('?'); // if there is a '?', remove the params. if(intQuestMark != -1) { strURL = strURL.substring(0,intQuestMark); } // check for anchors (#) var intAnchor = strURL.lastIndexOf('#'); if(intAnchor != -1) { strURL = strURL.substring(0,intAnchor); } return strURL; } // create HTML code for the navigation function renderNavigation(strHead) { // get the span. var oNaviSpan = getE('spanNavigation'); // get the url var strTheURL = getThisURL(); /* if(typeof bLoadedNaviItems == 'undefined' || !oNaviSpan) { setTimeout("renderNavigation();"); return; } */ initNavigation(); // if no force URL, use current URL if(typeof strSelectedPagePath != 'undefined') { strTheURL = strSelectedPagePath; } // store wheter the last item caused a new DIV. var bDivDrawn = false; // stack for DIVs var arrDIVStack = new Array(); // variables for navigation var intLastLevel = -1; var bFoundActive = false; // store HTML code in this variable. //var strHTML = '
'; var strHTML = ''; // number of items in navigation var intItems = arrNavigation.length; document.write('
'); var intCurr0 = -1; var intLast0 = -1; var strCurr0 = ''; var intActiveID = -1; // iterate over the items. for(i=0;i
'; // write closing DIV tag document.write(''); } } var intMarginL = intMarginLeft + 3; if(i==0) { document.write('
'); } if(i>0) { var bFirst = false; var intTmp1; if(intLastLevel < intLevel) { intTmp1 = intLastLevel; bFirst = true; } else { intTmp1 = intLevel; } var intMarginLeftBorder = 11 + (intTmp1 * 10); document.write('
'); } // append HTML code for this link. document.write(''); // if we start another level here, add distance. //if(intLastLevel < intLevel) if(i==0) { document.write(''); } // add TR document.write(''); // check if the next item is deeper than this one. if(i intLevel) { // this is a folder, so append HTML code with plus button. //document.write(''; bMustDrawDIV = true; } else { //document.write(''; } // append the link. document.write('' +'
' + strLabel /* + ',' + intLevel */ +'
'); if(bMustDrawDIV) { // render a DIV for this item. document.write('
'); if(bFoundActive) { for(k=0;k