// Allgemeine sammlung an JS Funktionen

function fixPNG(myImage) // correctly handle PNG transparency in Win IE 5.5 or higher.
{
   // onload="fixPNG(this)" -> Das muss bei im <img> Tag mit eingefŸhrt werden
         alert("drin");

   if (navigator.appName == "Microsoft Internet Explorer")
   {
      var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
      var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
      var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
      var imgStyle = "display:inline-block;" + myImage.style.cssText 
      var strNewHTML = "<span " + imgID + imgClass + imgTitle
      strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
      strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
      strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>" 
      alert(strNewHTML);
      myImage.outerHTML = strNewHTML
   }
}



function replaceIt(string,suchen,ersetzen) 
{
   ausgabe = "" + string;
   while (ausgabe.indexOf(suchen)>-1)
   {
      pos= ausgabe.indexOf(suchen);
      ausgabe = "" + (ausgabe.substring(0, pos) + ersetzen +
      ausgabe.substring((pos + suchen.length), ausgabe.length));
   }
  return ausgabe;
}


function getBrowserWidth()
{
   if (navigator.appName == "Microsoft Internet Explorer")
      return "1000";
   else
      return window.innerWidth;
}


function preloadPictures()
{
    document.Vorladen = new Array();

    if(document.images)
    {
        for(var i = 0; i < preloadPictures.arguments.length; i++)
        {
            document.Vorladen[i] = new Image();
            document.Vorladen[i].src = preloadPictures.arguments[i];
        }
    }
}
