// <![CDATA[

   // 27.10.2008 12:15

   var main = "";

   function initPage( was )
      {

      var w  = document.getElementById(was);
      var ws = document.getElementById( "subcontainer" );
      var l  = ((document.body.clientWidth - 980)/2);
      var t  = 255;

      if ( w != null )
         {
         if ( l < 0 )
            { l = 0; }
         l += w.offsetLeft + 215;
         t += w.offsetTop;
         main = was;
         }
      else
         {
         main = "";
         }

      if ( ws != null )
         {
         ws.style.left = l + "px";
         ws.style.top  = t + "px";
         ws.style.zIndex = 10;
         }

      }

   function doResize()
      {
      if ( main != "" )
         {
         initPage( main );
         }
      }

   function handleNaviIn( was, snd )
      {

      if ( was.substr(0,3) != "sub" )
         { // main

         var w  = document.getElementById(was);

         if ( w != null )
            {
            w.style.backgroundImage  = "url(gfx/" + was + "_1.gif)";
            }

         } // main
      else
         { // submenu

         var w  = document.getElementById(was);

         if ( w != null )
            {
            // alert(w);
            w.style.backgroundImage  = "url(gfx/ebene_eins_1.gif)";
            w.style.color = "#835919";
            }

         } // submenu

      if ( ( window.playsound ) && ( snd ) )
         {
         if ( window.console )
            {
            console.log( snd + " play" );
            }
         playsound( snd );
         }
      else
         {
         if ( window.console )
            {
            console.log( "playsound oder nicht vorhanden" );
            }
         }

      } // function handleNavi


   function handleNaviOut( was )
      {

      if ( was.substr(0,3) != "sub" )
         { // main

         var w  = document.getElementById(was);
         var ws = document.getElementById( "sub" + was );

         if ( w != null )
            {
            w.style.backgroundImage  = "url(gfx/" + was + "_0.gif)";
            }

         if ( ws != null )
            {
            // ws.style.borderRightColor = "#ffffff";
            // ws.style.display = "none";
            }

         } // main
      else
         { // submenu

         var w  = document.getElementById(was);

         if ( w != null )
            {
            // alert(w);
            w.style.backgroundImage  = "url(gfx/ebene_eins_0.gif)";
            w.style.color = "#000000";
            }

         } // submenu

      } // function handleNavi



   function doOpen( lnk )
      {
      if ( lnk != "" )
         {
         window.location.href = lnk;
         }
      }

   function doOpenWindow( lnk )
      {
      if ( lnk != "" )
         {
         var charsv = "abcdefghijklmnopqrstuvwxyz";
         var l = charsv.length;
         var name = "";

         for ( i = 0; i < 6; i++ )
            {
            name += charsv.substr( Math.round( Math.random() * l ), 1 );
            }
         window.open( lnk, name, "resizable=no,left=20,top=10,width=720,height=600,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0");
         }
      }

   function doOpenWindowQT( lnk )
      {
      if ( lnk != "" )
         {
         var charsv = "abcdefghijklmnopqrstuvwxyz";
         var l = charsv.length;
         var name = "";

         for ( i = 0; i < 6; i++ )
            {
            name += charsv.substr( Math.round( Math.random() * l ), 1 );
            }
         window.open( lnk, name, "resizable=no,left=20,top=10,width=900,height=700,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0");
         }
      }

// ]]>
