// (c) Thomas D. for Zoo Fäth
// any use of this file or parts
// are forbidden

var oldmen= "";
var oldmnu=0;
var oldsub = "";
var oldsmn=0;
var oldcolor="";
var oldsubsub = "";
var oldsmnsub = 0;
var float_x = -200;
var float_y = -200;
var seen = 0;
var bubbX = 0;
var bubbY = 0;
var bubbC = 1;
var bubbT = 800;

function showprod(proT,xmenu,xsubs,xbutt)
{ var allo=0;

 //hide the old sub
  for(allo=1;allo <= oldsmn; allo++)
  { document.getElementById(oldsub + "_" + allo).style.display = "none";
  }
  //hide the old subsub
  for(allo=1;allo <= oldsmnsub; allo++)
  { document.getElementById(oldsubsub + "_" + allo).style.display = "none";
  }

  // hide the old
  for(allo=1;allo <= oldmnu; allo++)
  { document.getElementById(oldmen + allo).style.display="none";
  }

  // show the new
  for(allo=1;allo <= xsubs; allo++)
  { document.getElementById(xmenu + allo).style.display="inline";
  }

  if(xbutt != "")
  { rloadpage(xbutt);
  }

  oldmen = xmenu;
  oldmnu = xsubs;
  oldsubsub = "";
  oldsmnsub = 0;
  oldsub = "";
  oldsmn = 0;
}

function showsub(xmen,amo)
{ var allo=0;

  //document.getElementById("float").style.visibility = "hidden";

  //hide the old sub
  for(allo=1;allo <= oldsmn; allo++)
  { document.getElementById(oldsub + "_" + allo).style.display = "none";
  }
  //hide the old subsub
  for(allo=1;allo <= oldsmnsub; allo++)
  { document.getElementById(oldsubsub + "_" + allo).style.display = "none";
  }
  
  //show the new
  for(allo=1;allo <= amo; allo++)
  { document.getElementById(xmen + "_" + allo).style.display = "inline";
  }

 oldsub = xmen;
 oldsmn = amo;
 oldsubsub = "";
 oldsmnsub = 0;
}

function showsubsub(xmen,amo)
{ var allo=0;

  //hide the old
  for(allo=1;allo <= oldsmnsub; allo++)
  { document.getElementById(oldsubsub + "_" + allo).style.display = "none";
  }
  //show the new
  for(allo=1;allo <= amo; allo++)
  { document.getElementById(xmen + "_" + allo).style.display = "inline";
  }

oldsubsub = xmen;
oldsmnsub = amo;
}

function loadpage(xpage, jbl_sub)
{ document.getElementById("products").style.visibility="visible";
  if(xpage.length >= 3)
   { wgNew = xpage.substring(0,1) + "." + xpage.substring(1,50).replace(".","_");
     if(jbl_sub == "1")
      { document.getElementById("prod_frame").src = "http://www.zoofaeth.de/dbase.php?ARG=" + wgNew + "&allow=unset" + "&upa=1"; }
     else
      { document.getElementById("prod_frame").src = "http://www.zoofaeth.de/dbase.php?ARG=" + wgNew + "&allow=unset" + "&upa=0"; }
   }
  else
   { document.getElementById("prod_frame").src = "./products/" + xpage + ".htm";
   }
}

function infpage(xpage)
{ document.getElementById("products").style.visibility="visible";
  document.getElementById("prod_frame").src = xpage;
}

function rloadpage(xpage, menoff)
{ if(menoff == 1)
  { showprod("Produkte",0,0,"");
  }
 document.getElementById("products").style.visibility="visible";
 //document.getElementById("float").style.visibility="hidden";
 document.getElementById("prod_frame").src = "./" + xpage + ".htm";
}

function highlight(xfield, mode)
{ if(mode == 0)
   { document.getElementById(xfield + "t").style.color = oldcolor;
   }
  else
   { oldcolor = document.getElementById(xfield + "t").style.color;
     document.getElementById(xfield + "t").style.color = "#FFFFFF";
   }
}

// START ALL THE FUNCTIONS FOR ENTER DOC
function startALL()
{ //floatTimer();
  //window.setTimeout("hideXmas();",5000);
  //showbubbles();
}

/* JUST FOR XMAS */
function hideXmas()
{ document.getElementById("xmas").style.visibility = "hidden";
}
/**/

/*function showbubbles()
{
  bubbY+=30;
  if(bubbY > bubbT-50)
  { bubbX = Math.floor((900)*Math.random());
    bubbY = 0;
  }

  document.getElementById("bubbles1").style.posTop = bubbY;
  document.getElementById("bubbles1").style.posLeft = bubbX;
  //raiser water level
  bubbC = bubbC + .1;
  bubbT = bubbT - .1;
  document.getElementById("waterlvl_f").style.posTop = bubbT;
  document.getElementById("water").style.height = bubbC;

  window.setTimeout("showbubbles();",1);

}
*/

function floatTimer()
{ if(seen == 0)
  { //float_x = float_x + 2;
    float_y = float_y + 1;

    //document.getElementById("float").style.posLeft = float_x;
    document.getElementById("float").style.posTop = float_y;

    if(float_y <= 30)
     { //floatTimer();
       window.setTimeout("floatTimer();",1);
     }
    else
     { seen = 1;
     }
  }
}
/********************************************/
