

   ulLiMenu = function(elemId) {
    if ( document.getElementById(elemId)) { // nur für IE, MacIE, Opera
      var navroot = document.getElementById(elemId);
      var lis=navroot.getElementsByTagName("LI"); 

      for (i=0; i<lis.length; i++) { 
        for (j=0; j<lis[i].getElementsByTagName("UL").length; j++){ 

          lis[i].onmouseover=function() {
		  	                  this.getElementsByTagName("UL")[j].style.visibility = 'visible'; 
							   if ( this.id == "n1" || this.id == "n2"  ) {
									replSelectBox( 'selBox1', 'hidden' );	
									replSelectBox( 'selBox2', 'hidden' );										
									replSelectBox( 'selBox3', 'hidden' );										
							   }
                             } 

          lis[i].onmouseout= function() { 
                               this.getElementsByTagName("UL")[j].style.visibility = 'hidden'; 
							   if ( this.id == "n1" || this.id == "n2"  ) {
									replSelectBox( 'selBox1', 'visible' );	
									replSelectBox( 'selBox2', 'visible' );	
									replSelectBox( 'selBox3', 'visible' );										
							   }
                             }
							 
          }
       }
         
      for (i=0; i<lis.length; i++) { // loop LIs 
          for (j=0; j<lis[i].getElementsByTagName("UL").length; j++){ // Loop  in LIs

           lis[i].getElementsByTagName("UL")[j].onmouseover=function(){
                                                               this.parentNode.getElementsByTagName("A")[0].className ="over";
                                                             } 

           lis[i].getElementsByTagName("UL")[j].onmouseout=function(){
                                                             if (this.parentNode.getElementsByTagName("A")[0].id!="aktiv") // Bug(?)fix IE: zurücksetzen von class überschreibt ID-Eigenschaft
                                                               this.parentNode.getElementsByTagName("A")[0].className ="out";
                                                               //alert("mouseouse auf UL")
                                                           } 

        } // ENDE loop in LIs
      }// ENDE loop  LI           

   } // ENDE IE only  

  } // ENDE function  
  

function moreShopMenuLayer( temp ) {
    if (temp == "visible"){
        setTimeout("document.getElementById('moreshopslayer').style.visibility = 'visible'", 200);
    }
    else{
        setTimeout("document.getElementById('moreshopslayer').style.visibility = 'hidden'", 200);
        //document.getElementById("moreshopslayer").style.visibility = temp;
    }    
	if ( temp == "visible" ) document.getElementById("topnavi").className = 'topnavi';
	else document.getElementById("topnavi").className = '';	
}

moreShopMenu = function(elemId) {
	if ( document.getElementById(elemId) && document.getElementById(elemId + "layer") ) { 
   	var reiter = document.getElementById(elemId);
   	var layer  = document.getElementById(elemId + "layer");		
 		// beim Mouseover ueber MoreShop-Reiter, Layer einblenden
		reiter.onmouseover= function() { moreShopMenuLayer( 'visible' ); } 		
		reiter.onmouseout = function() { moreShopMenuLayer( 'hidden' );  } 			
 		// beim Mouseover ueber Layer, Layer weiterhin einblenden		
		layer.onmouseover= function() { 	moreShopMenuLayer( 'visible' ); } 		 		
		layer.onmouseout = function() { 	moreShopMenuLayer( 'hidden' );  } 			
 		// beim Mouseover ueber Icon, Layer weiterhin einblenden		
		if ( document.getElementById(elemId + "icon") ) {
   		var icon = document.getElementById(elemId + "icon");			
			icon.onmouseover= function()  { 	moreShopMenuLayer( 'visible' ); }														
			icon.onmouseout = function()  { 	moreShopMenuLayer( 'hidden' );  } 		
		}
  } // 
} // ENDE function    
  
  
// Ruecksetzen der Formatierung von 'open opensel' auf 'open' - siehe inc/inc_catalog
function checkCatalogNav() {
	if ( document.getElementById("catalogNav") ) {
		if ( setCat && document.getElementById("setCat") ) {
			document.getElementById("setCat").className = "open opensel";
		}
	}
} // ENDE function

function dropper_init(){
	for (i=1; i<=10; i++){
		if (document.getElementById('div_'+i)){
			dropper_check('div_'+i, 'div_'+1+'_menu', 'div_'+i+'_dropdown');
		}
	}
}
   
function init(){
	ulLiMenu("metaNav");
	ulLiMenu("navTop");
	checkCatalogNav(); // beeinflussen der linken Navigation
	moreShopMenu("moreshops"); // merhVielfalt mehrShops - Layer
	dropper_init();
}

























//ed ereh saw serinat dur man to lira

//config
var dropper_open_delay=100; //Oeffner Verzoegerung in ms 
var dropper_close_delay=350; //Schliess Verzoegerung in ms
var dropper_width=180; //wie hoch soll das Menu
var dropper_height=230; //wie breit soll das Menu
var dropper_max_right=1000;  //ab dieser breite gehen die Menus nach links auf

//(1000ms = 1s)

//sonstige globale variablen
var dropperstop=0;
var dropperstop_menu=0;
var dropperstop_downmenu=0;
var dropperstop_next=0;
var dropperstop_id=0;
var old_dropper_point=0;
var old_dropper_point_class='';
var old_dropper_menu_class='';
var dropper_text='';
var dropper_top='';
var dropper_start=0;

function dropper_delayin(id,menu_id,dropdown_id,num) //oeffnet das menu nach dem der counter abgelaufen ist
{
	//alert(document.getElementById(id).offsetTop);
	if (dropperstop==num)
	if (document.getElementById(menu_id).className!='dropper_menu_over')
	{
		if (dropperstop_id) 
				if (dropperstop_id!=id) 
					{
						window.setTimeout("document.getElementById('"+dropperstop_id+"').style.display='none';",1);
						document.getElementById(dropperstop_menu).className=old_dropper_menu_class;
						if (old_dropper_point) old_dropper_point.className=old_dropper_point_class;//setzt den menupunkt effekt zurueck
					}
		document.getElementById(id).style.display='inline';
		document.getElementById(dropdown_id).scrollTop=0;
		old_dropper_menu_class=document.getElementById(menu_id).className;
		document.getElementById(menu_id).className='dropper_menu_over';
		dropperstop_menu=menu_id;
		dropperstop_downmenu=dropdown_id;
		dropperstop_id=id;
		dropper_stopper();
	}
	
}

function dropper_delayout(num) //schliest das menu nach dem der counter abgelaufen ist
{
	if (dropperstop_id)
	if (dropperstop==num)
		{
			window.setTimeout("document.getElementById('"+dropperstop_id+"').style.display='none';",1);
			document.getElementById(dropperstop_menu).className=old_dropper_menu_class;
			if (old_dropper_point) old_dropper_point.className=old_dropper_point_class;
			old_dropper_point=0;
			dropperstop_id=0;
		}
}

function dropper_over(id,menu_id,dropdown_id) //startet oeffner counter
{
	if (dropper_start)//erst wenn das menu schon gecheckt wurde
	{
		dropperstop++;
		dropperstop_next=dropperstop;
		window.setTimeout('dropper_delayin("'+id+'","'+menu_id+'","'+dropdown_id+'",'+dropperstop+');',dropper_open_delay);
	}
}

function dropper_out() //startet schlies counter
{
	dropperstop++;
	dropperstop_next=dropperstop;
	window.setTimeout('dropper_delayout('+dropperstop+');',dropper_close_delay); //zeit bis zur Schliessung 100 schnell bis 1000+ langsam
}

function dropper_check(id,menu_id,dropdown_id) //startet check counter
{
	window.setTimeout("dropper_delaycheck('"+id+"','"+menu_id+"','"+dropdown_id+"');",1); //verzoegerter aufbau damit alle sachen positioniert sind befor das menu angeordnet werden kann (safari macht sonst probleme)
}

function dropper_delaycheck(id,menu_id,dropdown_id) //passt das menu an width,height,top,left,scrollbar,kein scrollbar e.t.c.
{
	document.getElementById(dropdown_id).style.width=dropper_width+'px';
	if (document.getElementById(dropdown_id).offsetHeight>=dropper_height)
	{
		document.getElementById(dropdown_id).style.overflow='auto';
		document.getElementById(dropdown_id).style.height=dropper_height+'px';
	}
	document.getElementById(id).style.top=(document.getElementById(id).offsetTop-1)+'px';
	if (document.getElementById(id).offsetLeft+dropper_width>dropper_max_right) document.getElementById(id).style.left=(document.getElementById(id).offsetLeft-(dropper_width-document.getElementById(menu_id).offsetWidth+2))+'px';
	document.getElementById(id).style.left=(document.getElementById(id).offsetLeft-0)+'px';
	document.getElementById(id).style.display='none';
	document.getElementById(id).style.visibility='visible';
	dropper_start=1;// sobald der hier auf 1 ist kann das menu benutzt werden
}



function dropper_point(id) //menupunkt over effekt
{
	if (old_dropper_point) 
	{
		old_dropper_point.className=old_dropper_point_class;
	}
	if (id.className=='dropper_point')
	{
		id.className='dropper_point_over';
		old_dropper_point=id;
		old_dropper_point_class='dropper_point';
	}
	else
	{
		id.className='dropper_point_inactiv_over';
		old_dropper_point=id;
		old_dropper_point_class='dropper_point_inactiv';
	}
	dropper_stopper();
}

function dropper_stopper() {dropperstop++;}

