/* ************************************************************************ */
function openwin(url, xsize, ysize, xpos, ypos, style){
/* Popupfunktion für neues Fenster */
/* Autor: Christian Krusch (chk@fit-in-bit.de) /25.01.1999 / 3.5.2001 / 13.7.2002*/
   switch(style){
      case "slim":
         var newwin = window.open(url, "PopUp","width="+xsize+",height="+ysize+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos+", resizable=no, scrollbars=no, toolbar=no, status=no, directories=no, menubar=no, location=no");
         break;
      case "mager":
         var newwin = window.open(url, "PopUp","width="+xsize+",height="+ysize+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos+", resizable=yes, scrollbars=yes, toolbar=no, status=no, directories=no, menubar=no, location=no");
         break;
      default: // "fett"
         var newwin = window.open(url, "PopUp","width="+xsize+",height="+ysize+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos+", resizable=yes, scrollbars=yes, toolbar=yes, status=yes, directories=no, menubar=yes, location=yes");
         break;
      }
   if (newwin.opener == null) newwin.opener = self;
}

/* ************************************************************************ */
function zeit(){
   zeitobjekt = new Date();
   with (zeitobjekt){
      var std = nullen(getHours());
      var min = nullen(getMinutes());
      var sek = nullen(getSeconds());
      var tag = getDay(); //zur Anzeige im Kalender
   }
   var zeittext = std + ":" + min + ":" + sek;
   //var zeittext = std + ":" + min;
   // document.forms["uhr1"].elements["anzeige"].value = zeittext;
   Timer = setTimeout("zeit()", 10000);
}
function nullen(zeitwert){
   if (zeitwert < 10) zeitwert = "0" + zeitwert;
   return zeitwert;
}

/* Objekte in Layertechnik anzeigen (ergänzt "DIV"- und "Style"-Definitionen auf der entsprechenden Webseite)*/
//      Written & created by Shivaji Basu
//      Copyright www.shivbasu.com
//      Use this script at your own risk
//      For further info, contact info@shivbasu.com
//      To use his script, you MUST leave this disclaimer & credit as it is

//      Sniffer Explanation
//      document.layer for NS4
//      document.getElementById for IE5 & NS6
//      document.all && !(document.getElementById) for IE4


function changein(id)
{
   if (document.layers) document.layers[id].visibility = "show";
   else if (document.getElementById) document.getElementById(id).style.visibility = "visible";
   else if (document.all && !(document.getElementById)) document.all(id).style.visibility = "visible";
}

function changeout(id)
{
   if (document.layers) document.layers[id].visibility = "hide";
   else if (document.getElementById) document.getElementById(id).style.visibility = "hidden";
   else if (document.all && !(document.getElementById)) document.all(id).style.visibility = "hidden";
}

/* ###################################################################
   #
   # Bilder vor Anzeige der Seite laden
   #
   ###################################################################
 */
function prePics()
{
   var arrPics = new Array();
   arrPics[0]='images/home_grafik_1.jpg';
   arrPics[1]='images/home_grafik_2.jpg';
   arrPics[2]='images/home_grafik_3.jpg';
   arrPics[3]='images/home_logo_links.jpg';
   arrPics[4]='images/home_logo_rechts.jpg';
   arrPics[5]='images/logo_referenz.jpg';
   arrPics[6]='flash/boden/picsxml/01.jpg';
   arrPics[7]='flash/boden/picsxml/02.jpg';
   arrPics[8]='flash/boden/picsxml/03.jpg';
   arrPics[9]='flash/boden/picsxml/04.jpg';
   arrPics[10]='flash/deko/picsxml/01.jpg';
   arrPics[11]='flash/deko/picsxml/02.jpg';
   arrPics[12]='flash/deko/picsxml/03.jpg';
   arrPics[13]='flash/deko/picsxml/04.jpg';
   arrPics[14]='flash/deko/picsxml/05.jpg';
   arrPics[15]='flash/deko/picsxml/06.jpg';
   arrPics[16]='flash/sonne/picsxml/01.jpg';
   arrPics[17]='flash/sonne/picsxml/02.jpg';
   arrPics[18]='flash/sonne/picsxml/03.jpg';
   arrPics[19]='flash/sonne/picsxml/04.jpg';
   arrPics[20]='flash/sonne/picsxml/05.jpg';

   preloadPics('Array', arrPics);
}
function preloadPics()
{
//Aufrufmöglichkeiten:
//1.) preloadPics('Array', arrPics) - wobei 'arrPics' Array mit Pic-Urls
//2.) preloadPics('test/.../test1.jpg', 'test/.../test2.jpg', ...)

   var objDoc = document; //das Dokumentobjekt
   if(objDoc.images)
   {//wenn Bilder im Dokument eingebettet sind
      //die Argumente der Funktion auslesen
      var arrPicUrls = preloadPics.arguments;
      if(!objDoc.pics) objDoc.pics = new Array();
      var i;
      if (arrPicUrls[0]=='Array')
      {//1.) -> wenn folgendes Argument Array mit Bild-Urls ist
         for(i=0; i<arrPicUrls[1].length; i++)
         {//Array mit Bild-Urls auslesen
            objDoc.pics[i] = new Image;
            objDoc.pics[i].src = arrPicUrls[1][i];
            //DEBUG-> alert(objDoc.pics[i].src);
         }
      }
      else
      {//2.)
         for(i=0; i<arrPicUrls.length; i++)
         {
            objDoc.pics[i] = new Image;
            objDoc.pics[i].src = arrPicUrls[i];
            //DEBUG-> alert(objDoc.pics[i].src);
         }
      }
   }
}

// ###### Wartefunktion; innerhalb einer Prozedur zu verwenden
//        (sonst gibt es ja "setTimeout('Funktion', ms"))             ######
function wait(intMs)
{
   var dteTimestamp = new Date();
   lngStartTime = dteTimestamp.getTime();
   lngNow = lngStartTime;
   while (lngNow<(lngStartTime+intMs))
   {
      var dteTimestamp = new Date();
      lngNow = dteTimestamp.getTime();
      //DEBUG status=i;
      i++;
      if (i>intMs*100) break;
   }
}
