
	var activeModule = "Default";
	var activeLevel1InactiveSrc = "";
	var activeLevel1Img;
	var activeLevel2InactiveSrc = "";
	var activeLevel2Img;

	function setVisibility(element, value) {
	  if (element.style) {
	    element.style.visibility = value;
	  } else {
	    element.visibility = value;
		}
	}

	function getLayerById(name) {
		var elem = null;
	  if (document.all) {
	    elem = document.all[name];
	  } else {
	    elem = document[name];
	    if(document.getElementById)
	    	elem = document.getElementById(name);
	  }	  
	  return elem;
	}

	function getFullPath(imgPrefix, newSrc) {
	    if (imgPrefix.lastIndexOf("/")!=-1) {
              imgPrefix = imgPrefix.substring(0, imgPrefix.lastIndexOf("/"));
            }
	    if (imgPrefix.lastIndexOf("/")!=-1) {
	      return imgPrefix.substring(0, imgPrefix.lastIndexOf("/")) + "/" + newSrc;
	    } else {
	      return newSrc;
	    }
        }

	function activateLevel2Navigation(image, newSrc) {
	   if (image) {
	      activeLevel2Img = image;
	      activeLevel2InactiveSrc = image.src;
	      image.src = getFullPath(image.src, newSrc);
	   }
	}
	
	function deactivateLevel2Navigation() {
	  if (activeLevel2Img) {
	    activeLevel2Img.src = activeLevel2InactiveSrc;
	  }
	}
	
	function activateLevel1Navigation(newModule, newLevel1Img, newSrc) {		
	  // if the new module is already active, do nothing
	  if (newModule == activeModule) return;

	  // deactivate the currently active module,
	  // and activate the new one.
	  var activeLevel2Layer =
	      getLayerById("NavigationLevel2Layer"+activeModule);
	  var newLevel2Layer =
	      getLayerById("NavigationLevel2Layer"+newModule);
	  if (newLevel2Layer) {
	    setVisibility(newLevel2Layer, "visible");
	  }
	  if (activeLevel2Layer) {
	    setVisibility(activeLevel2Layer, "hidden");
	  }
	  if (activeLevel1Img) {
	    activeLevel1Img.src = activeLevel1InactiveSrc;
	  }
	  if (newLevel1Img) {
	    activeLevel1Img = newLevel1Img;
	    activeLevel1InactiveSrc = newLevel1Img.src;
	    if (newSrc) {
	      newLevel1Img.src = getFullPath(newLevel1Img.src, newSrc);
	    }
	  }
	  activeModule = newModule;
	  setVisibility(getLayerById("NavigationResetLayer"), "visible");
	}

	function resetNavigation() {
	  activateLevel1Navigation('Default', '');
	  setVisibility(getLayerById("NavigationResetLayer"), "hidden");
	}

function naviAfterBodyLoad() {
	imageCount=document.images.length;
	preloadCount=0;
	preloadArray=new Array();
	for(i=0;i<imageCount;i++) {
		imageSrc=document.images[i].src;
		if(imageSrc.indexOf('navi1st_')>0 && imageSrc.indexOf('inact.gif')>0){
			preloadArray[preloadCount]=new Image();
			preloadArray[preloadCount].src=imageSrc.substring(0,imageSrc.length-9)+'act.gif';
			preloadCount++;
		}
		if(imageSrc.indexOf('navi2nd_')>0 && imageSrc.indexOf('inact.')>0){
			preloadArray[preloadCount]=new Image();
			preloadArray[preloadCount].src=imageSrc.substring(0,imageSrc.length-9)+'act.gif';
			preloadCount++;
		}
	}
	//window.status='Preloading: '+preloadCount+' Navi-Hilite-Bilder werden vorausgeladen.';
	//window.setTimeout('setStatus("'+tempvar+'")',5000);
}

function setStatus(aText) {
	window.status=aText;
}  
	
function naviInitPreload() {
	//tempvar++;
	if (document.images) {		
		tempCount=document.images.length;
		tempvar=tempvar+' counter:'+tempCount;
		if((tempCount>imageCount)||(tempCount<20)) {
			imageCount=tempCount;
			window.setTimeout('naviInitPreload()',1000);
		}		
		else {
			naviAfterBodyLoad();
		}		
	}
	else {
		window.setTimeout("naviInitPreload()",1000);
	}
}
var tempvar='';
var imageCount=-1;
naviInitPreload();