// Menu Structure

tm2 = [
["root",                       // parent
150,                           // menu width
20,                            // menu height
87,                            // top position
"tm_center()-110",							// left position
"#303030",                     // font color
"#ffffff",                     // background color
"#870000",                     // background color hover
"#000000",                     // border color
"#000000",                     // separator color
"scripts/arrow_right.gif",             // submenu image
100],			       // opacity
["Promotion Wear","index.php?page=Produkte&bereich=Promotion",1],
["Gastronomie","index.php?page=Produkte&bereich=Gastronomie",2],
["Handwerk & Industrie","index.php?page=Produkte&bereich=Handwerk",0],
["Medizin","index.php?page=Produkte&bereich=Medizin",0],
["Corporate Wear","index.php?page=Produkte&bereich=Corporate",0],
["Antistatik","index.php?page=Produkte&bereich=Antistatik",0],
["Tischwäsche","index.php?page=Produkte&bereich=Tischwaesche",0],
["Schutzschuhe","index.php?page=Produkte&bereich=Schutzschuhe",0],
["Arbeitsschutz","index.php?page=Produkte&bereich=Arbeitsschutz",0]
];

tm2_1 = [
["tm2"],                        // parent
["Polohemden","index.php?page=Produkte&sparte=Polohemd&bereich=Promotion",0],
["Polohemden Damen","index.php?page=Produkte&sparte=Polohemd&bereich=Promotion&damen=1",0],
["Hemden","index.php?page=Produkte&sparte=Hemd&bereich=Promotion",0],
["Blusen","index.php?page=Produkte&sparte=Bluse&bereich=Promotion",0],
["T-Shirts","index.php?page=Produkte&sparte=T-Shirt&bereich=Promotion",0],
["T-Shirts Damen","index.php?page=Produkte&sparte=T-Shirt&bereich=Promotion&damen=1",0],
["Trägershirts","index.php?page=Produkte&sparte=Traegershirt&bereich=Promotion",0],
["Jacken","index.php?page=Produkte&sparte=Jacke&bereich=Promotion",0],
["Fleece","index.php?page=Produkte&sparte=Fleece&bereich=Promotion",0],
["Westen","index.php?page=Produkte&sparte=Weste&bereich=Promotion",0],
["Pullover","index.php?page=Produkte&sparte=Pullover&bereich=Promotion",0],
["Pullunder","inindex.php?page=Produkte&sparte=Pullunder&bereich=promodex.php?page=Produkte&sparte=Polo&bereich=Promotion",0],
["Sweatshirts","index.php?page=Produkte&sparte=Sweatshirt&bereich=Promotion",0],
["Caps/Mützen","index.php?page=Produkte&sparte=Cap&bereich=Promotion",0],
["Kinderbekleidung","index.php?page=Produkte&bereich=Promotion&kinder=1",0]
];

tm2_2 = [
["tm2"],                        // parent
["Service - Blusen","index.php?page=Produkte&sparte=Bluse&kategorie=Service&bereich=Gastronomie",0],
["Service - Hemden","index.php?page=Produkte&sparte=Hemd&kategorie=Service&bereich=Gastronomie",0],
["Service - Fliegen etc.","index.php?page=Produkte&sparte=Halsschmuck&kategorie=Service&bereich=Gastronomie",0],
["Service - Westen","index.php?page=Produkte&sparte=Westen&kategorie=Service&bereich=Gastronomie",0],
["Service - Zubehör","index.php?page=Produkte&sparte=Zubehoer&kategorie=Service&bereich=Gastronomie",0],
["Küche - Kochjacken","index.php?page=Produkte&sparte=Kochjacke&kategorie=Kueche&bereich=Gastronomie",0],
["Küche - Kochhosen","index.php?page=Produkte&sparte=Kochhose&kategorie=Kueche&bereich=Gastronomie",0],
["Küche - Mützen","index.php?page=Produkte&sparte=Caps&kategorie=Kueche&bereich=Gastronomie",0],
["Küche - Accessoires","index.php?page=Produkte&sparte=Accessoires&kategorie=Kueche&bereich=Gastronomie",0],
["Latzschürzen","index.php?page=Produkte&sparte=Latzschuerze&kategorie=Vorbinder&bereich=Gastronomie",0],
["Vorbinder","index.php?page=Produkte&sparte=Vorbinder&kategorie=Vorbinder&bereich=Gastronomie",0],
["Kittel","index.php?page=Produkte&kategorie=Kittel&bereich=Gastronomie",0]
];

// Vars
var style_border_width = 1;
var style_separator_height = 1;

var style_width                  = "0";
var style_height                 = "0";
var style_top                    = "0";
var style_left                   = "0";
var style_font_color             = "0";
var style_background_color       = "0";
var style_background_color_hover = "0";
var style_border_color           = "0";
var style_separator_color        = "0";
var style_submenu_image          = "0";
var style_opacity                = "0";

var layerRef="null";
var styleSwitch="null";
var styleSwitch2="null";
var nn4=false;
var ie=false;
var dom=false;

var akt_menu=0;
var akt_menu_off=0;
var akt_field=0;
var mouse=0;

// Code

  // css
  document.write("<style>\n");
  document.write(".tm_field { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: "+style_font_color+"; text-decoration:none;}\n");
  document.write(".tm_field:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: "+style_font_color+"; text-decoration:none; }\n");
  document.write("</style>\n");

function browserinit() 
{
  if ((document.getElementById))
  {
    dom = true;
    nn4 = false;
    layerRef="document.getElementById('";
    layerRef2="')";
    styleSwitch="').style";
		styleSwitch2="').style.backgroundColor";
  }
  
  if ((document.layers))
  {
    dom = false;
    nn4 = true;
    layerRef="document.layers.";
    layerRef2="";
    styleSwitch="";
		styleSwitch2=".bgColor";
  }

  if ((document.all))
  {
    ie = true;
    dom = false;
    layerRef="document.all.";
    layerRef2="";
    styleSwitch=".style";
		styleSwitch2=".style.backgroundColor";
  }

}

function tm_center()
{
  var window_width = ie ? document.body.clientWidth : window.innerWidth;
  return (window_width / 2)
}

function split_string(splitstring)
{ 
  var splitstring_array=splitstring.split("_");
  return(splitstring_array[0]);
}

function tm_generate_sub(tm_menu_sub,x,y)
{
  if (dom)
  {

    // parent layer
  
    var obj=document.createElement('DIV');
    obj.setAttribute("style","width:"+style_width+";position: absolute; left:"+x+"; top:"+y+"; visibility:hidden;");
    obj.setAttribute("id",tm_menu_sub+'_main');
    obj.setAttribute("align",'center');
    obj.setAttribute("onmouseover",'mouse="'+tm_menu_sub+'";');
    obj.setAttribute("onmouseout",'mouse=0;tm_off("'+tm_menu_sub+'","0");');
    obj.innerHTML='';
    document.getElementsByTagName("body").item(0).appendChild(obj);
  
    eval("this."+tm_menu_sub+"_main=document.getElementById(tm_menu_sub+'_main')");
     
    // child layer
    
    // top border
  
    var obj=document.createElement('DIV');
    obj.setAttribute("style","background-color:"+style_border_color+";width:"+style_width+";height:"+style_border_width+";filter:alpha(opacity="+style_opacity+");");
    obj.setAttribute("id",tm_menu_sub+'_border');
    obj.innerHTML='<IMG SRC="" WIDTH=1 HEIGHT=1>';
    eval("this."+tm_menu_sub+"_main.appendChild(obj)");
    
    var i = 1;
    var j = eval(tm_menu_sub+'.length')
  
    
    while (i < j)
    {
      if (i > 1)
      {
        // separator
  
        var obj=document.createElement('DIV');
        obj.setAttribute("style","background-color:"+style_separator_color+";width:"+style_width+";height:"+style_separator_height+";filter:alpha(opacity="+style_opacity+");");
        obj.setAttribute("id",tm_menu_sub+'_separator');
        obj.innerHTML='<TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH='+style_border_width+' BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width-(2*style_border_width))+' HEIGHT='+style_separator_height+' BGCOLOR='+style_separator_color+'></TD><TD WIDTH='+style_border_width+' BGCOLOR='+style_border_color+'></TR></TABLE>';
        eval("this."+tm_menu_sub+"_main.appendChild(obj)");
      }
  
      var obj=document.createElement('DIV');
      obj.setAttribute("style","cursor: hand; background-color:"+style_background_color+";width:"+style_width+";filter:alpha(opacity="+style_opacity+");");
      obj.setAttribute("id",tm_menu_sub+'_field'+i);
      obj.setAttribute("align",'center');
      if (eval(tm_menu_sub+'['+i+'][2]') == 0)
      {
        obj.innerHTML='<A HREF="'+eval(tm_menu_sub+'['+i+'][1]')+'" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu_sub+'\',\''+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu_sub+'\',\''+i+'\');"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 2)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu_sub+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A>';
      }
      else
      {
        obj.innerHTML='<A HREF="'+eval(tm_menu_sub+'['+i+'][1]')+'" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu_sub+'\',\''+i+'\',\''+tm_menu_sub+'_'+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu_sub+'\',\''+i+'\',\''+tm_menu_sub+'_'+i+'\');"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 10)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu_sub+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=8><IMG SRC="'+style_submenu_image+'" BORDER=0></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A>';
      }
      eval("this."+tm_menu_sub+"_main.appendChild(obj)");
    
      i = i + 1;
    }

    // bottom border

    var obj=document.createElement('DIV');
    obj.setAttribute("style","background-color:"+style_border_color+";width:"+style_width+";height:"+style_border_width+";filter:alpha(opacity="+style_opacity+");");
    obj.setAttribute("id",tm_menu_sub+'_border');
    obj.innerHTML='<IMG SRC="" WIDTH=1 HEIGHT=1>';
    eval("this."+tm_menu_sub+"_main.appendChild(obj)");
  }

  else if (ie)
  {

    // parent layer

    document.body.insertAdjacentHTML('BeforeEnd','<div id="'+tm_menu_sub+'_main" STYLE="width:'+style_width+';position: absolute; left: '+x+'; top: '+y+'; visibility:hidden;" ALIGN=CENTER onmouseover="mouse=\''+tm_menu_sub+'\';" onmouseout="mouse=0;tm_off(\''+tm_menu_sub+'\');"></div>');
 
    // child layer
  
    // top border

    this[tm_menu_sub+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu_sub+'_border STYLE="background-color:'+style_border_color+';width:'+style_width+';height:'+style_border_width+';filter:alpha(opacity='+style_opacity+');"><IMG SRC="" WIDTH=1 HEIGHT=1></div>');

    var i = 1;
    var j = eval(tm_menu_sub+'.length')

  
    while (i < j)
    {
      if (i > 1)
      {
        // separator
        this[tm_menu_sub+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu_sub+'_separator STYLE="background-color:'+style_separator_color+';width:'+style_width+';height:'+style_separator_height+';filter:alpha(opacity='+style_opacity+');"><IMG SRC="" WIDTH=1 HEIGHT=1></div>');
      }

      if (eval(tm_menu_sub+'['+i+'][2]') == 0)
      {
        this[tm_menu_sub+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu_sub+'_field'+i+' STYLE="background-color:'+style_background_color+';width:'+style_width+';filter:alpha(opacity='+style_opacity+');" align=center><A HREF="'+eval(tm_menu_sub+'['+i+'][1]')+'" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu_sub+'\',\''+i+'\');" onClick="location.href=\''+eval(tm_menu_sub+'['+i+'][1]')+'\';" onmouseout="tm_menu_inactive(\''+tm_menu_sub+'\',\''+i+'\');" style="cursor:hand;"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 2)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu_sub+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A></div>');
      }
      else
      {
        this[tm_menu_sub+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu_sub+'_field'+i+' STYLE="background-color:'+style_background_color+';width:'+style_width+';filter:alpha(opacity='+style_opacity+');" align=center><A HREF="'+eval(tm_menu_sub+'['+i+'][1]')+'" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu_sub+'\',\''+i+'\',\''+tm_menu_sub+'_'+i+'\');" onClick="location.href=\''+eval(tm_menu_sub+'['+i+'][1]')+'\';" onmouseout="tm_menu_inactive(\''+tm_menu_sub+'\',\''+i+'\',\''+tm_menu_sub+'_'+i+'\');" style="cursor:hand;"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 10)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu_sub+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=8><IMG SRC="'+style_submenu_image+'" BORDER=0></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A>');

        x=style_left+(style_width-10);
        y= style_top+eval("document.all.tm1_field"+i+".offsetTop");
        y= Math.abs(y)+Math.abs(style_height/2);
        eval('tm_generate_sub("'+tm_menu_sub+'_'+i+'","'+x+'",'+y+')');
      }
    
      i = i + 1;
    }

    this[tm_menu_sub+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu_sub+'_border STYLE="background-color:'+style_border_color+';width:'+style_width+';height:'+style_border_width+';filter:alpha(opacity='+style_opacity+');"><IMG SRC="" WIDTH=1 HEIGHT=1></div>');
  }

  else if (nn4)
  {
    // parent layer
    
    document.layers[tm_menu_sub+'_main']=new Layer(style_width);

    document.layers[tm_menu_sub+'_main'].name=tm_menu_sub+'_main';
		document.layers[tm_menu_sub+'_main'].onMouseOver="mouse='1';";
    document.layers[tm_menu_sub+'_main'].onmouseout="mouse='0';tm_off(tm_menu_sub);";
    document.layers[tm_menu_sub+'_main'].width=style_width;
    document.layers[tm_menu_sub+'_main'].position='absolute';
    document.layers[tm_menu_sub+'_main'].left=x;
    document.layers[tm_menu_sub+'_main'].top=y;
    document.layers[tm_menu_sub+'_main'].visibility="hide";
    document.layers[tm_menu_sub+'_main'].layers=new Array();
    document.layers[tm_menu_sub+'_main'].document.open();

//		document.layers[tm_menu_sub+'_main'].document.write("<style>\n");
//  	document.layers[tm_menu_sub+'_main'].document.write("td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: "+style_font_color+"; text-decoration:none;}\n");
//		document.layers[tm_menu_sub+'_main'].document.write("td:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: "+style_font_color+"; text-decoration:none; }\n");
//  	document.layers[tm_menu_sub+'_main'].document.write("</style>\n");

		var toppos = 0;

		document.layers[tm_menu_sub+'_main'].document.write('<layer id='+tm_menu_sub+'_border top='+toppos+'><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=3 height=1 width='+style_width+' bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
		toppos = toppos +1;

    var i = 1;
    var j = eval(tm_menu_sub+'.length')

    while (i < j)
    {
      if (i > 1)
      {
        // separator
        document.layers[tm_menu_sub+'_main'].document.write('<layer id='+tm_menu_sub+'_border top='+toppos+'><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=3 height=1 width='+style_width+' bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
				toppos = toppos +1;
      }

      if (eval(tm_menu_sub+'['+i+'][2]') == 0)
      {
        document.layers[tm_menu_sub+'_main'].document.write('<layer id='+tm_menu_sub+'_field'+i+' top='+toppos+'; bgcolor='+style_background_color+' onclick="location.href=\''+eval(tm_menu_sub+'['+i+'][1]')+'\';" onmouseover="mouse=\''+tm_menu_sub+'\';akt_field='+i+';tm_menu_active(\''+tm_menu_sub+'\',\''+i+'\');" onmouseout="mouse=\'0\';tm_off(\''+tm_menu_sub+'\');tm_menu_inactive(\''+tm_menu_sub+'\',\''+i+'\');"><table cellspacing=0 cellpadding=0 border=0><tr><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td><td width='+eval(style_width - 2)+' HEIGHT=20><a href="javascript:location.href=\''+eval(tm_menu_sub+'['+i+'][1]')+'\';">&nbsp;'+eval(tm_menu_sub+'['+i+'][0]')+'</a></td><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
				toppos = toppos +20;
      }
      else
      {
        document.layers[tm_menu_sub+'_main'].document.write('<layer id='+tm_menu_sub+'_field'+i+' top='+toppos+'; bgcolor='+style_background_color+'><a href="'+eval(tm_menu_sub+'['+i+'][1]')+'" onClick="location.href=\''+eval(tm_menu_sub+'['+i+'][1]')+'\';" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu_sub+'\',\''+i+'\',\''+tm_menu_sub+'_'+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu_sub+'\',\''+i+'\',\''+tm_menu_sub+'_'+i+'\');"><table cellspacing=0 cellpadding=0 border=0><tr><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td><td width='+eval(style_width -10)+' HEIGHT=20>&nbsp;'+eval(tm_menu_sub+'['+i+'][0]')+'</td><TD WIDTH=8><IMG SRC="'+style_submenu_image+'" BORDER=0><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></a></layer>');
				toppos = toppos +20;
      }
    
      i = i + 1;
    }

    document.layers[tm_menu_sub+'_main'].document.write('<layer id='+tm_menu_sub+'_border top='+toppos+'><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=3 height=1 width='+style_width+' bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
    document.layers[tm_menu_sub+'_main'].document.close();

		var toppos = 1;
    var i = 1;
    var j = eval(tm_menu_sub+'.length')

    while (i < j)
    {
      if (i > 1)
      {
        // separator
				toppos = toppos +1;
      }

      if (eval(tm_menu_sub+'['+i+'][2]') == 0)
      {
				toppos = toppos +20;
      }
      else
      {
				toppos = toppos +20;

        x=style_left+(style_width-10);
        y= style_top+eval("document.layers."+tm_menu_sub+"_field"+i+".offsetTop");
        y= Math.abs(y)+Math.abs(style_height/2);
        eval('tm_generate_sub("'+tm_menu_sub+'_'+i+'","'+x+'",'+y+')');
      }
    
      i = i + 1;
    }
	    
  }

  
}

function tm_generate(tm_menu)
{
  style_width                  = eval(tm_menu+'[0][1]');
  style_height                 = eval(tm_menu+'[0][2]');
  style_top                    = eval(tm_menu+'[0][3]');
  style_left                   = eval(tm_menu+'[0][4]');
  style_left= eval(style_left);
  style_font_color             = eval(tm_menu+'[0][5]');
  style_background_color       = eval(tm_menu+'[0][6]');
  style_background_color_hover = eval(tm_menu+'[0][7]');
  style_border_color           = eval(tm_menu+'[0][8]');
  style_separator_color        = eval(tm_menu+'[0][9]');
  style_submenu_image          = eval(tm_menu+'[0][10]');
  style_opacity                = eval(tm_menu+'[0][11]');


  if (dom)
  {

    // parent layer

    var obj=document.createElement('DIV');
    obj.setAttribute("style","width:"+style_width+";position: absolute; left:"+style_left+"; top:"+style_top+"; visibility:hidden;");
    obj.setAttribute("id",tm_menu+'_main');
    obj.setAttribute("align",'center');
    obj.setAttribute("onmouseover",'mouse="'+tm_menu+'";');
    obj.setAttribute("onmouseout",'mouse=0;tm_off("'+tm_menu+'","0");');
    obj.innerHTML='';
    document.getElementsByTagName("body").item(0).appendChild(obj);

    eval("this."+tm_menu+"_main=document.getElementById(tm_menu+'_main')");
 
    // child layer
  
    // top border

    var obj=document.createElement('DIV');
    obj.setAttribute("style","background-color:"+style_border_color+";width:"+style_width+";height:"+style_border_width+";filter:alpha(opacity="+style_opacity+");");
    obj.setAttribute("id",tm_menu+'_border');
    obj.innerHTML='<IMG SRC="" WIDTH=1 HEIGHT=1>';
    eval("this."+tm_menu+"_main.appendChild(obj)");
  
    var i = 1;
    var j = eval(tm_menu+'.length')

    while (i < j)
    {
      if (i > 1)
      {
        // separator

        var obj=document.createElement('DIV');
        obj.setAttribute("style","background-color:"+style_separator_color+";width:"+style_width+";height:"+style_separator_height+";filter:alpha(opacity="+style_opacity+");");
        obj.setAttribute("id",tm_menu+'_separator');
        obj.innerHTML='<TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH='+style_border_width+' BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width-(2*style_border_width))+' HEIGHT='+style_separator_height+' BGCOLOR='+style_separator_color+'></TD><TD WIDTH='+style_border_width+' BGCOLOR='+style_border_color+'></TR></TABLE>';
        eval("this."+tm_menu+"_main.appendChild(obj)");
      }

      var obj=document.createElement('DIV');
      obj.setAttribute("style","cursor:hand;background-color:"+style_background_color+";position: relative;left:0px;top:0px;width:"+style_width+";filter:alpha(opacity="+style_opacity+");");
      obj.setAttribute("id",tm_menu+'_field'+i);
      obj.setAttribute("align",'center');
      if (eval(tm_menu+'['+i+'][2]') == 0)
      {
        obj.innerHTML='<A HREF="'+eval(tm_menu+'['+i+'][1]')+'" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu+'\',\''+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu+'\',\''+i+'\');"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 2)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A>';
      }
      else
      {
        obj.innerHTML='<A HREF="'+eval(tm_menu+'['+i+'][1]')+'" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu+'\',\''+i+'\',\''+tm_menu+'_'+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu+'\',\''+i+'\',\''+tm_menu+'_'+i+'\');"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 10)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=8><IMG SRC="'+style_submenu_image+'" BORDER=0></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A>';
      }
      eval("this."+tm_menu+"_main.appendChild(obj)");
    
      if (eval(tm_menu+'['+i+'][2]') == 1)
      {
        x=style_left+(style_width-10);
        y= style_top+eval("document.getElementById('"+tm_menu+"_field"+i+"').offsetTop");
        y= Math.abs(y)+Math.abs(style_height/2);
        eval('tm_generate_sub("'+tm_menu+'_'+i+'","'+x+'",'+y+')');
      }

      i = i + 1;

    }

    // bottom border

    var obj=document.createElement('DIV');
    obj.setAttribute("style","background-color:"+style_border_color+";width:"+style_width+";height:"+style_border_width+";filter:alpha(opacity="+style_opacity+");");
    obj.setAttribute("id",tm_menu+'_border');
    obj.innerHTML='<IMG SRC="" WIDTH=1 HEIGHT=1>';
    eval("this."+tm_menu+"_main.appendChild(obj)");

  }

  else if (ie)
  {

    // parent layer

    document.body.insertAdjacentHTML('BeforeEnd','<div id="'+tm_menu+'_main" STYLE="width:'+style_width+';position: absolute; left: '+style_left+'; top: '+style_top+'; visibility:hidden;" ALIGN=CENTER onmouseover="mouse=\''+tm_menu+'\';" onmouseout="mouse=0;tm_off(\''+tm_menu+'\');"></div>');
 
    // child layer
  
    // top border

    this[tm_menu+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu+'_border STYLE="background-color:'+style_border_color+';width:'+style_width+';height:'+style_border_width+';filter:alpha(opacity='+style_opacity+');"><IMG SRC="" WIDTH=1 HEIGHT=1></div>');

    var i = 1;
    var j = eval(tm_menu+'.length')

  
    while (i < j)
    {
      if (i > 1)
      {
        // separator
        this[tm_menu+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu+'_separator STYLE="background-color:'+style_separator_color+';width:'+style_width+';height:'+style_separator_height+';filter:alpha(opacity='+style_opacity+');"><IMG SRC="" WIDTH=1 HEIGHT=1></div>');
      }


      if (eval(tm_menu+'['+i+'][2]') == 0)
      {
        this[tm_menu+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu+'_field'+i+' STYLE="background-color:'+style_background_color+';width:'+style_width+';filter:alpha(opacity='+style_opacity+');" align=center><A HREF="'+eval(tm_menu+'['+i+'][1]')+'" onClick="location.href=\''+eval(tm_menu+'['+i+'][1]')+'\';" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu+'\',\''+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu+'\',\''+i+'\');" style="cursor:hand;"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 2)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A></div>'); 
      }
      else
      {
        this[tm_menu+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu+'_field'+i+' STYLE="background-color:'+style_background_color+';width:'+style_width+';filter:alpha(opacity='+style_opacity+');" align=center><A HREF="'+eval(tm_menu+'['+i+'][1]')+'" onClick="location.href=\''+eval(tm_menu+'['+i+'][1]')+'\';" onmouseover="akt_field='+i+';tm_menu_active(\''+tm_menu+'\',\''+i+'\',\''+tm_menu+'_'+i+'\');" onmouseout="tm_menu_inactive(\''+tm_menu+'\',\''+i+'\',\''+tm_menu+'_'+i+'\');" style="cursor:hand;"><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD><TD WIDTH='+eval(style_width - 10)+' HEIGHT=20><span class=tm_field>&nbsp;'+eval(tm_menu+'['+i+'][0]')+'&nbsp;</span></TD><TD WIDTH=8><IMG SRC="'+style_submenu_image+'" BORDER=0></TD><TD WIDTH=1 BGCOLOR='+style_border_color+'></TD></TR></TABLE></A>');

        x=style_left+(style_width-10);
        y= style_top+eval("document.all."+tm_menu+"_field"+i+".offsetTop");
        y= Math.abs(y)+Math.abs(style_height/2);
        eval('tm_generate_sub("'+tm_menu+'_'+i+'","'+x+'",'+y+')');
      }
    
      i = i + 1;
    }

    this[tm_menu+'_main'].insertAdjacentHTML("BeforeEnd",'<div id='+tm_menu+'_border STYLE="background-color:'+style_border_color+';width:'+style_width+';height:'+style_border_width+';filter:alpha(opacity='+style_opacity+');"><IMG SRC="" WIDTH=1 HEIGHT=1></div>');
  }

  else if (nn4)
  {

    // parent layer
    
    document.layers[tm_menu+'_main']=new Layer(style_width);

    document.layers[tm_menu+'_main'].name=tm_menu+'_main';
		document.layers[tm_menu+'_main'].onMouseOver="mouse='1';";
    document.layers[tm_menu+'_main'].onmouseout="mouse='0';tm_off(tm_menu);";
    document.layers[tm_menu+'_main'].width=style_width;
    document.layers[tm_menu+'_main'].position='absolute';
    document.layers[tm_menu+'_main'].left=style_left;
    document.layers[tm_menu+'_main'].top=style_top;
    document.layers[tm_menu+'_main'].visibility="hide";
    document.layers[tm_menu+'_main'].layers=new Array();
    document.layers[tm_menu+'_main'].document.open();

//		document.layers[tm_menu+'_main'].document.write("<style>\n");
//  	document.layers[tm_menu+'_main'].document.write("td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: "+style_font_color+"; text-decoration:none;}\n");
//		document.layers[tm_menu+'_main'].document.write("td:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-style: normal; color: "+style_font_color+"; text-decoration:none; }\n");
//  	document.layers[tm_menu+'_main'].document.write("</style>\n");

		var toppos = 0;

		document.layers[tm_menu+'_main'].document.write('<layer id='+tm_menu+'_border top='+toppos+'><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=3 height=1 width='+style_width+' bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
		toppos = toppos +1;

    var i = 1;
    var j = eval(tm_menu+'.length')

    
  
    while (i < j)
    {
      if (i > 1)
      {
        // separator
        document.layers[tm_menu+'_main'].document.write('<layer id='+tm_menu+'_border top='+toppos+'><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=3 height=1 width='+style_width+' bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
				toppos = toppos +1;
      }

      if (eval(tm_menu+'['+i+'][2]') == 0)
      {
        document.layers[tm_menu+'_main'].document.write('<layer id='+tm_menu+'_field'+i+' top='+toppos+'; bgcolor='+style_background_color+' onmouseover="mouse=\''+tm_menu+'\';akt_field='+i+';tm_menu_active(\''+tm_menu+'\',\''+i+'\');" onmouseout="mouse=\'0\';tm_off(\''+tm_menu+'\');tm_menu_inactive(\''+tm_menu+'\',\''+i+'\');"><table cellspacing=0 cellpadding=0 border=0><tr><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td><td width='+eval(style_width - 2)+' HEIGHT=20><a href="javascript:location.href=\''+eval(tm_menu+'['+i+'][1]')+'\';">&nbsp;'+eval(tm_menu+'['+i+'][0]')+'</a></td><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
				toppos = toppos +20;
      }
      else
      {
        document.layers[tm_menu+'_main'].document.write('<layer id='+tm_menu+'_field'+i+' top='+toppos+'; bgcolor='+style_background_color+' onmouseover="mouse=\''+tm_menu+'\';akt_field='+i+';tm_menu_active(\''+tm_menu+'\',\''+i+'\',\''+tm_menu+'_'+i+'\');" onmouseout="mouse=\'0\';tm_off(\''+tm_menu+'\');tm_menu_inactive(\''+tm_menu+'\',\''+i+'\',\''+tm_menu+'_'+i+'\');"><table cellspacing=0 cellpadding=0 border=0><tr><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td><td width='+eval(style_width - 10)+' HEIGHT=20><a href="javascript:location.href=\''+eval(tm_menu+'['+i+'][1]')+'\';">&nbsp;'+eval(tm_menu+'['+i+'][0]')+'</a></td><TD WIDTH=8><IMG SRC="'+style_submenu_image+'" BORDER=0><td width=1 bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
				toppos = toppos +20;
      }
    
      i = i + 1;
    }



    document.layers[tm_menu+'_main'].document.write('<layer id='+tm_menu+'_border top='+toppos+'><table cellspacing=0 cellpadding=0 border=0><tr><td colspan=3 height=1 width='+style_width+' bgcolor='+style_border_color+'><img src="images/tab.gif"></td></tr></table></layer>');
	
    document.layers[tm_menu+'_main'].document.close();

		toppos = 1;
    i = 1;
    j = eval(tm_menu+'.length')

    while (i < j)
    {
      if (i > 1)
      {
				toppos = toppos +1;
      }

      if (eval(tm_menu+'['+i+'][2]') == 0)
      {
				toppos = toppos +20;
      }
      else
      {
        x= style_left+(style_width-10);
        y= style_top+toppos;
        y= Math.abs(y)+Math.abs(style_height/2);

        eval('tm_generate_sub("'+tm_menu+'_'+i+'","'+x+'",'+y+')');

				toppos = toppos +20;
      }
    
      i = i + 1;
    }

  }

}

function tm_on(tm_menu)
{
  var mouse_bak=mouse;
  mouse=0;
  if (akt_menu != "0")
    tm_off2(akt_menu);

  akt_menu_off=tm_menu;

  if (!eval(layerRef+tm_menu+"_main"+layerRef2))
    tm_generate(tm_menu);

  eval(layerRef+tm_menu+"_main"+styleSwitch+".visibility='visible'");
  akt_menu=tm_menu;
  mouse=mouse_bak;
}

function tm_off2(tm_menu,field)
{
  if (akt_menu_off != 0)
    return
  if (mouse == '0')
  {
    eval(layerRef+tm_menu+"_main"+styleSwitch+".visibility='hidden'");
    if (eval(tm_menu+'[0][0]') != "root")
      tm_off2(eval(tm_menu+'[0][0]'))
  }
  else if (mouse != tm_menu)
  {
    if (eval(akt_field) != eval(field))
    {
      if (eval(mouse+'[0]') != tm_menu)
      {
        eval(layerRef+tm_menu+"_main"+styleSwitch+".visibility='hidden'");
        if (eval(tm_menu+'[0][0]') != "root")
          tm_off2(eval(tm_menu+'[0][0]'))
      }
    }
  }
}

function tm_sub_off2(tm_menu,field)
{
  if (mouse == '0')
  {
    eval(layerRef+tm_menu+"_main"+styleSwitch+".visibility='hidden'");
    if (eval(tm_menu+'[0][0]') != "root")
      tm_off2(eval(tm_menu+'[0][0]'))
  }
  else if (mouse != tm_menu)
  {
    if (eval(akt_field) != eval(field))
    {
      if (eval(mouse+'[0]') != tm_menu)
      {
        eval(layerRef+tm_menu+"_main"+styleSwitch+".visibility='hidden'");
        if (eval(tm_menu+'[0][0]') != "root")
          tm_off2(eval(tm_menu+'[0][0]'))
      }
    }
  }
}

function tm_off(tm_menu,field)
{
//  eval ('test'+mouse+'()');
	akt_menu_off = 0;
	
  if (!tm_menu)
  {
    return;
  }
	if (mouse != 0)
	{
 	 if (eval('tm'+mouse) != tm_menu)
  	{
    	setTimeout("tm_off2('"+tm_menu+"','"+field+"')",300);
  	}
	}
	if (mouse == 0)
 	{
   	setTimeout("tm_off2('"+tm_menu+"','"+field+"')",300);
 	}
}

function tm_sub_off(tm_menu,field)
{
//  eval ('test'+mouse+'()');
	akt_menu_off = 0;
	
  if (!tm_menu)
  {
    return;
  }
  if (mouse != tm_menu)
  {
    setTimeout("tm_sub_off2('"+tm_menu+"','"+field+"')",50);
  }
}

function tm_sub_on(tm_submenu)
{
  eval(layerRef+tm_submenu+"_main"+styleSwitch+".visibility='visible'");
}

function tm_menu_active(tm_menu,field,sub_menu)
{
	var pre = "";
	if (nn4)
	{
		pre = "document.layers."+tm_menu+"_main."
	}
  bgcolor=tm_get_bgcolor_hover(tm_menu);
  if (sub_menu)
  {
    tm_sub_on(sub_menu)
  }
  eval(pre+layerRef+tm_menu+"_field"+field+styleSwitch2+"='"+bgcolor+"'");
}

function tm_get_bgcolor_hover(tm_menu)
{
  if (eval(tm_menu+'[0][0]') == "root")
    return(eval(tm_menu+'[0][7]'));
  else
    return(tm_get_bgcolor_hover(eval(tm_menu+'[0][0]')));
}

function tm_menu_inactive(tm_menu,field,sub_menu)
{
	var pre = "";
	if (nn4)
	{
		pre = "document.layers."+tm_menu+"_main."
	}
  bgcolor=tm_get_bgcolor(tm_menu);
  eval(pre+layerRef+tm_menu+"_field"+field+styleSwitch2+"='"+bgcolor+"'");
  tm_sub_off(sub_menu,field);
}

function tm_get_bgcolor(tm_menu)
{
  if (eval(tm_menu+'[0][0]') == "root")
    return(eval(tm_menu+'[0][6]'));
  else
    return(tm_get_bgcolor(eval(tm_menu+'[0][0]')));
}

function inhaltbild(welches)
{
		document.images[welches].src = "images/nav_"+welches+"2.gif";
}
           
function inhaltbildaus(welches)
{
		document.images[welches].src = "images/nav_"+welches+"1.gif";
}

function printpage(page,id)
{
	fenster=open("printpage.php?page="+page+"&id="+id,"Print", "width=640,height=480","hotkeys=NO","locationbar=NO","menubar=NO","resizable=NO","status=NO");
	fenster.focus("Yes");
}

function zufall(von)
{
	zahl = Math.ceil(von*Math.random());
	return zahl;
}

function rotate()
{
	blah=zufall(2);
	if (blah==2)
	{
		blah=zufall(50);
		document.images["topline1"].src = "images/bild_"+blah+".jpg";
	}
	blah=zufall(2);
	if (blah==2)
	{
		blah=zufall(50);
		document.images["topline2"].src = "images/bild_"+blah+".jpg";
	}
	blah=zufall(2);
	if (blah==2)
	{
		blah=zufall(50);
		document.images["topline3"].src = "images/bild_"+blah+".jpg";
	}
	blah=zufall(2);
	if (blah==2)
	{
		blah=zufall(50);
		document.images["topline4"].src = "images/bild_"+blah+".jpg";
	}
	setTimeout("rotate()",5000);
}

function popupPromo(referenz)
{
	fenster=open("popupPromo.php?id="+referenz,referenz, "width=700,height=575","hotkeys=NO","locationbar=NO","menubar=NO","resizable=NO","status=NO");
	fenster.focus("Yes");
}

function popupGastro(referenz)
{
	fenster=open("popupGastro.php?id="+referenz,referenz, "width=700,height=575","hotkeys=NO","locationbar=NO","menubar=NO","resizable=NO","status=NO");
	fenster.focus("Yes");
}

function popupStick(referenz)
{
	fenster=open("popupStick.php?id="+referenz,referenz, "width=500,height=375","hotkeys=NO","locationbar=NO","menubar=NO","resizable=NO","status=NO");
	fenster.focus("Yes");
}

// thanks to:
// markus kunkel, marcus winter
