var closing, subclosing, menuenr, submenuenr, part, currentShown;

function menu() {
  document.all.eins.style.left=22;
  document.all.zwei.style.left=174;
  document.all.drei.style.left=326;
  document.all.vier.style.left=478;
  document.all.fuenf.style.left=630;
}

function openmenue(menue) {
  if (closing) { shutdown(); clearTimeout(closing); }
  MM_changeProp(menue,'','style.visibility','visible','LAYER');
  menu();
}

function closemenue(menue) {
  menuenr = menue;
  closing = setTimeout('shutdown()', 1750);
}

function closesubmenue(submenue) {
  submenuenr = submenue;
  subclosing = setTimeout('shutdown(submenuenr)', 1250);
}

function shutdown(sub) {
  if (sub) part = sub; else part = menuenr;
  MM_changeProp(part,'','style.visibility','hidden','LAYER');
}

function startup(menue) {
  if (subclosing) { shutdown(submenuenr); clearTimeout(subclosing); }
  submenuenr = menue;
  MM_changeProp(menue,'','style.visibility','visible','LAYER');
}

function MM_changeProp(objName,x,theProp,theValue) {
  var obj = MM_findObj(objName), thenewValue;
  if (theValue == "hidden") thenewValue = "none"; else thenewValue = "";
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) {
    eval("obj."+theProp+"='"+theValue+"'");
    eval("obj.style.display='"+thenewValue+"'"); }
}

function MM_findObj(n, d) {
  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 && document.getElementById) x=document.getElementById(n);
  return x;
}

function showImage(picture) {
  if (currentShown != picture) {
    document.Image500.src="images/Strand/"+picture+"_500.jpg";
    document.all.Head500.innerText=head[picture];
    document.all.Text500.innerText=text[picture];
  }
  currentShown = picture;
}

function showBigImage(bild) {
  var pfadimg = "images/Strand/";
  var showimg = pfadimg+currentShown+"_1024.jpg";
  window.open(showimg,"_blank","width=1064,height=808,left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
}

function printPage(pageid) {
  window.open("print.php?pageid="+pageid,"_blank","left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no")
}

function MM_preloadImages() {
  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];
      }
    }
  }
}