var str_show = (document.layers) ? ".visibility='show';" : ".style.visibility='visible';";
var str_hide = (document.layers) ? ".visibility='hide';" : ".style.visibility='hidden';";

function getLO(Name) { 
  var i,LO;
  if(document.all) LO=document.all[Name];
  if(document.layers) LO = document.layers[Name];
  if(!LO && document.getElementById) LO=document.getElementById(Name);
  if(!LO && document.getElementByName) LO = document.getElementsByName(Name);
  return LO;
}

// menu funktionen------------------------------------
function getImg(Name,d) { 
  var i,IO;
  if(!d) d=document; 
  if(!(IO=d[Name])&&document.images) LO=document.images[Name];
  for(i=0;!IO&&d.layers&&i<d.layers.length;i++) IO=getImg(Name,d.layers[i].document);
  return IO;
}

function MenuImgInit() {
  for (i=1;i<=5;i++) {
    eval("menu"+i+"_lo = new Image();");
    eval("menu"+i+"_hi = new Image();"); }

  menu1_lo.src = "img/men_gaertner_low.gif";
  menu1_hi.src = "img/men_gaertner_hi.gif";
  menu2_lo.src = "img/men_pflanzen_low.gif";
  menu2_hi.src = "img/men_pflanzen_hi.gif";
  menu3_lo.src = "img/men_stamm_low.gif";
  menu3_hi.src = "img/men_stamm_hi.gif";
  menu4_lo.src = "img/men_bluete_low.gif";
  menu4_hi.src = "img/men_bluete_hi.gif";
  menu5_lo.src = "img/men_gewaechs_low.gif";
  menu5_hi.src = "img/men_gewaechs_hi.gif";
  
}  MenuImgInit();

function RollHi(imgName){
  var bild = getImg(imgName);
  eval("bild.src = "+imgName+"_hi.src;");
}

function RollLo(imgName){
  var bild = getImg(imgName);
  eval("bild.src = "+imgName+"_lo.src;");
}


// Popup----------------------------------------------
function openPopup(url,breite,hoehe) {
  var x = (screen.availWidth-breite)/2;
  var y = (screen.availHeight-hoehe)/2;
  var extPopup = window.open(url,"extPopup","width="+breite+",height="+hoehe+",left="+x+",screenX="+x+",top="+y+",screenY="+y);
  extPopup.focus();
}

function writePicPopup(url,breite,hoehe) {
  var x = (screen.availWidth-breite)/2;
  var y = (screen.availHeight-hoehe)/2;
  var cont = '<html><head><title>Gaertners</title></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
  cont += '<a href="javascript:self.close()"><img border="0" src="img/pflanzen/'+url+'"></a></body></html>';
  var extPopupPic = window.open("","extPopup","width="+breite+",height="+hoehe+",left="+x+",screenX="+x+",top="+y+",screenY="+y);
  extPopupPic.document.open("text/html");
  extPopupPic.document.write(cont);
  extPopupPic.document.close();
  extPopupPic.focus();
}



// NS4 reloader-------------------------------------
function MM_reloadPage(init) {
  if (init==true) with (navigator) {
    if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
      document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
  location.reload();
} MM_reloadPage(true);
