fontbase=13    //z.B. ergibt 12 Punkt bei 1024 vert. Auflösung

function setfont(par)
{
  resolution=screen.width;
  breite=resolution-30;    //- 25;
  if (document.body.offsetWidth)
  {
     breite=document.body.offsetWidth;
     browser="IE"
  }
  if (window.innerWidth)
  {
     breite=window.innerWidth;
     browser="Netscape"
  }
     p=parseInt(resolution*fontbase/1024);
  if (par=="var")
  {
     p=parseInt(p*(breite+25)/resolution);
     if(p<8) {p=8};
     if (p>12) {p=12};
  }
  document.getElementsByTagName("body")[0].style.fontSize = p+"pt";
}

function neu(){
           window.setTimeout("history.go(0)",500);
}

function change(nr,datei){
         document.images[nr].src=datei;
}

function navigate(ziel){
          var navibar_1="navigation.htm";
          var navibar_2="navigation_referenzen.htm";
          parent.main.location.href=ziel;

               if (ziel.substring(0,10)=="referenzen")
               {
                   parent.Navigation.location.href=navibar_2
               }
               else 
               {
                    parent.Navigation.location.href=navibar_1
               }
               document.getElementsByTagName("a")[0].blur();       //entfernt den Focus vom Totenkopf
               document.getElementsByTagName("a")[1].blur();
}


function getButtons() {
       if (window==top) top.location.href="index.php?"+top.location.href;
}


function getNavi()   {
	if (window==top) top.location.href="index.php?"+top.location.href;
}

function getframes() {
         if (window.name!="Navigation") 
         {
            window.location.href="index.php";
         }
}



function position()
{
   bild.style.display = "block"
   if (bild.width > 100)
   {
       pos = String(((breite - bild.width) / 2)+"px");
       bild.style.left= pos;
       bild.style.display="block";
       clearInterval(wait);
   }
   else bild.style.display="none";
}


function show(datei,ansicht)
{
        bild = document.getElementById("foto");
        closePlayer();
        close();
        imagecell = document.getElementsByTagName("td")[0];

        if (imagecell.firstChild.nodeName == "A")
            linkClose = imagecell.firstChild;
        else
        {
            if (imagecell.firstChild.nextSibling.nodeName == "A")
            	linkClose = imagecell.firstChild.nextSibling;
        }
        
        if  (typeof(ersatzbild) == "undefined")
                ersatzbild = linkClose.appendChild(document.createElement("img"));
  
         ersatzbild.src = "Thumbs/loading.gif";
         ersatzbild.style.position = "absolute";
         ersatzbild.style.left = String((breite - 308) / 2) + "px";         // Breite des Ersatzbildes ist 308 px
         ersatzbild.style.zIndex = 2;
         ersatzbild.style.border="solid 1px #444444";
         ersatzbild.style.display = "block";
         bild.src=datei;
         bild.style.position = "absolute";

         if (typeof(pos)=="undefined")
            bild.style.left=String((breite-640)/2) + "px";
         else
            bild.style.left=pos;

         bild.style.zIndex = 4;
         bild.style.border = "solid 1px #444444";
         window.setTimeout("bild.style.display='block'",10);
         wait = window.setInterval("position()",500) ;
}

function close()
{
	
	if (typeof(bild) != "undefined")
        {
               bild.style.display = "none";
               bild.src = "";
        }
        if (typeof(ersatzbild)!="undefined")
               ersatzbild.style.display = "none";
        if (typeof(wait) != "undefined")
               clearInterval(wait);
}

function showVideo(url)  {
      close();
      document.getElementById("playerbox").style.display="none";
      document.getElementById("bridge").value = "videoURL="+url;
      document.piratesplayer.setAttribute("flashvars" , "videoURL="+url);
      window.setTimeout("document.getElementById('playerbox').style.display='block';",10);
      document.getElementById("playerbox").style.left = String((breite-500)/2) + "px";
      return false;
}

function closePlayer()  {
      p=document.getElementById("playerbox");

      if (p)
          p.style.display="none";
}
