function show(top,left,typ) {
 	document.getElementById(typ).style.top = top + 'px';
 	document.getElementById(typ).style.left = left + 'px';
 	document.getElementById(typ).style.display = 'block';
}


function hide(typ) {
 	document.getElementById(typ).style.display = 'none';
}


Math.randomMax = function(maxVal,asFloat){
	var val = Math.random()*maxVal;
	return asFloat?val:Math.round(val);
}


function glitzer(pos,typ) {
	var posit = pos.split(",");
	var wn = Math.randomMax(posit.length - 1);
	var positions = posit[wn].split("/");
	var time = Math.round(Math.random() * 10000 / posit.length);
	setTimeout("show(" + positions[0] + "," + positions[1] + ",'" + typ + "1')", time);
	setTimeout("show(" + positions[0] + "," + positions[1] + ",'" + typ + "2')", time + 90);
	setTimeout("hide('" + typ + "1')", time + 200);
	setTimeout("hide('" + typ + "2')", time + 300);
	setTimeout("glitzer('" + pos + "','" + typ + "')", time + 2000);
}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}








  var height = 25; // height of the menu headers
  var iheight = 20; // height of the menu_items

  
  var speed = 1;
  var timerID = "";
  var N = (document.all) ? 0 : 1;
  var width = 152;
  var loca = location.href;


  var self_menu = new Array();
function write_menu()
{
  smc = 0; // count the position of the self_menu
  document.write("<div style='position:absolute'; border:1px; vertical-align:top>");
  mn = 0;
  mni = 1;
  start = -1;
  
  
  for(i=0;i<Link.length;i++)
  {
   la = Link[i].split("|");

   if (la[0] == "0") 
   {
    if(start == 0) 
     {
      document.write("</div>");
      h =  csmc * iheight;
      tmn = mn; //-h
      self_menu[smc] = new Array(tmn,h,0,-2);
      smc++;
      mn--;
     }
     csmc = 0;
     
     if (la[2] == "#") {
    document.write("<div style='position:absolute; top:"+mn+";height:"+height+"' id='down"+smc+"' onclick='pull_down("+smc+","+mni+",0);'><img src='/images/uspacer.gif' border='0' height='5' width='1' /><br>");
    if (loca.indexOf(la[1]) != -1)
    document.write("<a href='"+ la[2] +"'><font color='#815F4C'>"+ la[1] + "</font></a></div>");
    else
    document.write("<a href='"+ la[2] +"'>"+ la[1] + "</a></div>");
}else
	{
    document.write("<div style='position:absolute; top:"+mn+";height:"+height+"' id='down"+smc+"'><img src='/images/uspacer.gif' border='0' height='5' width='1' /><br><a href='"+ la[2] +"'>");
    if (loca.indexOf(la[1]) != -1)
    document.write("<a href='"+ la[2] +"'><font color='#815F4C'>"+ la[1] + "</font></a></div>");
    else    
    document.write(la[1] + "</a></div>");
}
    self_menu[smc] = new Array(mn,height,0,mni);
    smc++;
    mni++;
    mn+=height;
    start = 1;
   }
   else
   {
    if(start == 1) 
     {
      if(N)mn+=2;
       document.write("<div id='down"+smc+"' style='width:150; clip:rect(0,150,0,0); position:absolute; top:"+mn+"'>");
       start = 0;
     }
    
    document.write("<div id='d"+i+"' style='height:"+iheight);
    if (N) document.write(";width:150");
    document.write("'><a href='"+la[2]+"'");
    if (la[3] != "") document.write(" target='" + la[3] + "' ");   
    var strl = la[2].length - 2;
    if (loca.indexOf(la[2].substr(0,strl)) != -1)
    document.write("><font color='#815F4C'>&nbsp;&nbsp;&nbsp;"+ la[1] + "</font></a></div>");
else
document.write(">&nbsp;&nbsp;&nbsp;"+ la[1] + "</a></div>");
    csmc++;
   }
  }
  if (start == 0) 
   {
     document.write("</div>");
     h =  csmc * iheight;
     tmn = mn + 5; //-h
     self_menu[smc] = new Array(tmn,h,0);
     name = "down" + (self_menu.length-1);
   }
  document.write("</div>");
}



function pull_down(nr,c,wowv)
{
 if (timerID == "")
 {
 to = self_menu[nr+1][1]
 begin = nr + 2;
 if (timerID != "") clearTimeout(timerID);
 if (self_menu[nr+1][2] == 0)
 {
  self_menu[nr+1][2] = 1;
  if(nr == self_menu.length-2) {to++;} {
//  if (wlin == 1)
  epull_down(begin,to,wowv);
//else	
//  epull_down(begin,to,-1);
  }
 }
 else
 {
  to = 0;
  self_menu[nr+1][2] = 0;
  name = "down"+(nr+2);
  open_item = 0;
  for(i=0;i<nr;i++)
  {
   if(self_menu[i][2] == 1) 
    {open_item += self_menu[i][1];
    }
  }
  if (N == false) {open_item-= (c*1)};
  if (nr== self_menu.length-2) {val = self_menu[self_menu.length-1][1];to=-1;}
  else  val = parseInt(document.getElementById(name).style.top) -(open_item)-(c*height);
  epull_up(begin,to,val);
 }
}
}

function epull_down(nr,to,nowv)
{
	jmp = 1;
	if(nowv == -1) jmp=to;
 name = "down" + (nr-1);
 obj = document.getElementById(name).style.clip = "rect(0,"+width+","+(nowv+jmp)+",0)";
 for (i=nr;i<self_menu.length;i++)
 {
  name = "down" + i;
  obj = document.getElementById(name);
  obj.style.top = parseInt(obj.style.top)+jmp;
 }
 nowv++;
 if((nowv != 0) && (nowv < to)) timerID = setTimeout("epull_down("+nr+","+to+","+nowv+")",speed);
else timerID = "";

}

function epull_up(nr,to,nowv)
{
 name = "down" + (nr-1);
 obj = document.getElementById(name).style.clip = "rect(0,"+width+","+nowv+",0)";
 for (i=nr;i<self_menu.length;i++)
 {
  name = "down" + i;
  obj = document.getElementById(name);
  obj.style.top = parseInt(obj.style.top)-1;
 }
 nowv--;
 if(nowv > to) timerID = setTimeout("epull_up("+nr+","+to+","+nowv+")",speed);
 else timerID = "";
}

function startup(nr)
{
 write_menu();
 if (nr != 0)
 {
 for(i=0;i<self_menu.length;i++)
 {
  if(self_menu[i][3] == nr) {
  	if(location.href.indexOf("fl.html") == -1)
  	 pull_down(i,nr,-1)
  	else
  	pull_down(i,nr,0)
  	 }
  i==self_menu.length;
 }
 }
} 


// Fensterhoehe und Breite auslesen

function Fensterweite()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

function Fensterhoehe()
{
 if (window.innerHeight) return window.innerHeight;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;
}


function neuAufbau()
{
 if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
 window.history.go(0);
}

// Ueberwachung von Netscape initialisieren
if(!window.Weite && window.innerWidth)
  {
   window.onresize = neuAufbau;
   Weite = Fensterweite();
   Hoehe = Fensterhoehe();
  }