﻿function urlcutter(theurl)
{
        p1=theurl.lastIndexOf("/");
        p3=theurl.slice(p1,theurl.length);
        /* string immer glech von li nach rechts gezaehlt 13 */
        p4=p3.length-13;
        p5=p3.slice(0,p4);
        return p5
}






function switch_subnav ()
{
	
	breadinsert3 = "";
	breadpath3 = ""; 
	breadinsert4 = "";
	breadpath4 = ""; 
	hauptpath = "";
	haupttext ="";
	hauptpath2 = "";
	haupttext2 ="";
	nosubnav = 0;
	ersteEbeneAnchors = document.getElementById('nav').getElementsByTagName('A');
	ersteSubEbeneAnchors = document.getElementById('nav2').getElementsByTagName('A');
	
	for(i = 0;i<ersteEbeneAnchors.length;i++)
	{
	         if (ersteEbeneAnchors[i].className.indexOf("on") != -1)
	         {
	         hauptpath = ersteEbeneAnchors[i].pathname;	
			 haupttext = ersteEbeneAnchors[i].title;	
	         }
		
	 }
	 
	 for(i = 0;i<ersteSubEbeneAnchors.length;i++)
	{
	         if (ersteSubEbeneAnchors[i].className.indexOf("on") != -1)
	         {
	         hauptpath = ersteSubEbeneAnchors[i].pathname;	
			 haupttext = ersteSubEbeneAnchors[i].title;	
	         }
		
	 }
	
	
        if (document.getElementById('navlist'))
        {
         flag=0;
         firstlink=0;
         cutting=0;
	ulists=document.getElementById('navlist').getElementsByTagName('UL');
	/* alle 4 ebenen ausblenden */
	for(i = 0;i<ulists.length;i++){
	ulists[i].style.display = "none";
	}
	/* alle anchors der subnav sammeln */
	theanchors=document.getElementById('navlist').getElementsByTagName('A');
	page=document.location.href;
	if (page.lastIndexOf("?") != -1)
	{
	pos=page.lastIndexOf("?");
	page=page.slice(0,pos);
	
	
	}
	
	
	
	if (document.getElementById('page_aufruf'))
         {
	indexer = document.getElementById('page_aufruf').innerHTML;
	indexer = urlcutter(indexer);

	
	     /* schalter für 5.Ebene URL vortaeuschen,auslesen */
	     if (indexer.lastIndexOf("_") != -1)
	     {
	     page = indexer;
	     cutting = 1;
             }
         
             
	}
   
       /* url bis zum letzten slash beschneiden */
        if (cutting == 0 )
        {
        page=urlcutter(page);
        }
        
        
        /* pageurl vom klappmenue, dann erster Link links = Target*/
        if (page.lastIndexOf("_") == -1)
	{
	firstlink=1;
	}
        
        
    
	
    /* 3 und 4 ebene anchors durchgehen */
for(i = 0;i<theanchors.length;i++){
	   
	         /* anchor bis zum letzten slash beschneiden */
                anchorteil = theanchors[i].href;
                anchorteil=urlcutter(anchorteil);
                /* erster Link = Target */
                if (firstlink == 1)
                {
                anchorteil=page;
                }
                
                
                if ((page == anchorteil) && (flag!="1"))
		       {           
		
		              flag=1; /*nur einmal ausführen */
		              theanchors[i].className="current";   /* anchor auf current setzen */
                      /* es gibt keine 4 ebene */
					  if (theanchors[i].nextSibling)
		              {
					       if (theanchors[i].nextSibling.nodeType == "3") nosubnav=1;
	                   /* gilt für ie */
					   }
					   if ((!theanchors[i].nextSibling) && (theanchors[i].parentNode.parentNode.parentNode.nodeName == "DIV"))
					   {
					
					   nosubnav=1;
					   /* gilt für mozie */
					   }
					
					   if (nosubnav ==1)
					   {
						  
						breadinsert3 = theanchors[i].firstChild.nodeValue;
		                breadpath3 = theanchors[i].pathname;  
					   }
				
					
					/* END es gibt keine 4 ebene */


                  

			          /* von der 4 ebene anchor auf die 3 ul block setzen */
		             if ((theanchors[i].parentNode.parentNode.nodeName == "UL") && (!theanchors[i].nextSibling) && (nosubnav ==0))
		             {
					 breadinsert3 = theanchors[i].parentNode.parentNode.previousSibling.firstChild.nodeValue;	 
	                 breadpath3 = theanchors[i].parentNode.parentNode.previousSibling.href; 
		             theanchors[i].parentNode.parentNode.style.display = "block";
		             theanchors[i].parentNode.parentNode.previousSibling.className="nocurrent";
		             breadinsert4 = theanchors[i].firstChild.nodeValue;
		             breadpath4 = theanchors[i].pathname;
		             }
		             /* von  der 3 ebene anchor 4 einschalten */
		              if (theanchors[i].nextSibling )
		            {
		                 if (theanchors[i].nextSibling.nodeName == "UL")
		                 {
		                 theanchors[i].className="nolinecurrent";
		                 theanchors[i].nextSibling.style.display = "block";
					      breadinsert3 = theanchors[i].firstChild.nodeValue;
		                   breadpath3 = theanchors[i].pathname; 
		                 }
		            }
				
		 }
		
		 
	 } 
	 
	 /*link der 5ebene markieren */
	if (document.getElementById('nav5'))
	{
	/* page neu abfragen da oben überschrieben*/
	page=document.location.href;
	pageteil = page;
	eb5links = document.getElementById('nav5').getElementsByTagName('A');
	for(i = 0;i<eb5links.length;i++){
	thlinks = eb5links[i].href;
	lnkteil = thlinks;
	if (lnkteil == pageteil) {
	eb5links[i].className="current";
	}
	}
	}
    

  }
    
   
    breadcrumbo = document.getElementById('breadcrumb');
    breadcrumboul = breadcrumbo.childNodes[1];/* wegen text whitespace bei mozilla */
    if (navigator.userAgent.indexOf("MSIE") != -1)
    {
		/* path problem ie */
		hauptpath = "/" + hauptpath;
		if ((breadpath3 != "") && (breadpath4 != "")) breadpath4 = "/" + breadpath4;
		if ((breadpath3 != "") && (breadpath4 == "")) breadpath3 = "/" + breadpath3;
	
        breadcrumboul = breadcrumbo.firstChild;
    }
	 if (haupttext != "")
	    {
	     optli = document.createElement("li");
         opta  = document.createElement("a")
         opta.setAttribute("href",hauptpath);
         opta.appendChild(document.createTextNode(haupttext));
         optli.appendChild(opta);
         breadcrumboul.appendChild(optli);
	
	
		}
     if (breadinsert3 != "")
         {
         optli = document.createElement("li");
         opta  = document.createElement("a")
         opta.setAttribute("href",breadpath3);
         opta.appendChild(document.createTextNode(breadinsert3));
         optli.appendChild(opta);
         breadcrumboul.appendChild(optli);	
      }

      if (breadinsert4 != "")
     {
   
     optli = document.createElement("li");
     opta  = document.createElement("a")
     opta.setAttribute("href",breadpath4);
     opta.appendChild(document.createTextNode(breadinsert4));
     optli.appendChild(opta);
     breadcrumboul.appendChild(optli);	
}


}




sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);






getElementsByClassName = function (c,idnum) {
    var ret = new Array();
    var j = 0;
    if (document.getElementById(idnum).getElementsByTagName('DIV'))
    {
    var objs = document.getElementById(idnum).getElementsByTagName("DIV");
    for(i = 0;i<objs.length;i++){
        if(objs[i].className == c){
            ret[j] = objs[i];
            j++;
        } // if
    } // for
    return ret;
    }
   } // getElementsByClassName






function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


/* image scroller on homepage */

var sliderwidth="454px";
var sliderheight="110px";
var slidespeed=1;
var unitwidth=152;
actualwidth='';
var copyspeed=0;
var cross_slide, ns_slide;
var runright = 0;
var runleft = 0;


function slideleft(){

if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+"px"
if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+"px"

}

function slideright(){
if (parseInt(cross_slide.style.left)<(actualwidth*(1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)-actualwidth+"px"
if (parseInt(cross_slide2.style.left)<(actualwidth*(1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)-actualwidth+"px"


}


function fillup(){
cross_slide=document.getElementById("slider1");
cross_slide2=document.getElementById("slider2");
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide;
actualwidth=document.getElementById("temp").offsetWidth;
cross_slide2.style.left=actualwidth+"px";
taste1 = document.getElementById("dscroll1");
taste2 = document.getElementById("dscroll2");
var righttime;
var lefttime;
cross_slide.onmouseover = function (evt) { copyspeed=0 }
cross_slide.onmouseout = function (evt) { copyspeed=slidespeed }	
cross_slide2.onmouseover = function (evt) { copyspeed=0 }
cross_slide2.onmouseout = function (evt) { copyspeed=slidespeed }	                                  
taste1.onmousedown = function(evt) {
	                               
	                                if (righttime != "undefined") {clearInterval(righttime)};
	                                copyspeed=slidespeed;
									lefttime=setInterval('slideleft()',30);
	                                }

									
taste2.onmousedown = function(evt) {
	                               if (lefttime != "undefined") {clearInterval(lefttime)};
	                               copyspeed=slidespeed;
								   righttime=setInterval('slideright()',30)
	                                }
								
}



