/** This method gets a list of all links inside the module navigation and checks the link url against the windows location */
var highlightNavigation = function(){
var currentHighlightLinks = moduleNavigationList.getElementsByTagName('a');
var linksMain = [];
for (var i = 0; i < currentHighlightLinks.length; i++) {
if (currentHighlightLinks[i].href.indexOf('javascript:') == -1 && currentHighlightLinks[i].href.indexOf('http://') == -1) {
linksMain[i] = 'http://' + window.location.hostname + '' + currentHighlightLinks[i].href;
} else {
linksMain[i] = currentHighlightLinks[i].href;
}
}
var evaluatedLinks = evaluateHighlighting(window.location.href, linksMain);
var highlightedIndex = -1;
var bestmatch = 999;
for (var j = 0; j < evaluatedLinks.length; j++) {
if (evaluatedLinks[j] < bestmatch) {
bestmatch = evaluatedLinks[j];
highlightedIndex = j;
if (evaluatedLinks[j] == -2) {
break;
}
}
}
if (highlightedIndex != -1) {
if( currentHighlightLinks[highlightedIndex].getAttribute('teasermode') == "true" ){
setTeaserMode( true );
}
self.highlightCurrentLink(currentHighlightLinks[highlightedIndex]);
}
|