userAgent = navigator.userAgent.toLowerCase();
nn4       = document.layers;
ie        = document.all
ieWin     = (document.all && userAgent.indexOf("mac")<0);
ieMac     = (document.all && !ieWin&&userAgent.indexOf("icab")<0);
w3c       = document.documentElement;
aol       = (userAgent.indexOf("aol")>-1);

var GrossBild=null;
var oldLoad = null;
var obj = null;
var tmpLayer = null;
var CssKlasse = 'hover';

if (self.onLoad)
  oldLoad = self.onLoad;

self.onLoad = HoverInit;



function HoverInit()
// Hover-Funktionalität für Netscape-Browser
{
  if (oldLoad) oldLoad();

  if (document.layers) {
    tmpLayer = new Layer(1);
    /*tmpLayer.bgColor = document.bgColor;*/
    document.captureEvents(Event.MOUSEOVER);
    document.onmouseover = Hover;
  }
}

function Hover(evt)
// Hover-Funktionalität für Netscape-Browser
{
  document.routeEvent(evt);

  if (tmpLayer && tmpLayer.visibility == 'hide' && evt.target.text) {

    obj = evt.target;

    tmpLayer.left = obj.x;
    tmpLayer.top  = obj.y;
    tmpLayer.width = 1;

    with (tmpLayer.document) {
      open();
      write('<nobr><a href="'+obj.href+'" class="' + CssKlasse + '"' + (obj.target ? ' target="' + obj.target + '"' : '') + '>'+obj.text+'</a></nobr>');
      CssKlasse='hover';
      close();
    }
    tmpLayer.visibility = 'show';

    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = Hoveroff;
  }
}

function Hoveroff(evt)
// Hover-Funktionalität für Netscape-Browser
{
  if (tmpLayer && evt.target != tmpLayer.document.links[0] && evt.target != obj) {
    tmpLayer.visibility = 'hide';
    document.releaseEvents(Event.MOUSEMOVE);
  }
}



function FensterAuf(url, breite, hoehe)
{
var Win=window.open(url,"FensterOffen","width=" + breite + ", height=" + hoehe + ",top=50,left=175,resizable=1,scrollbars=yes,menubar=no,status=no");
}




function oeffneGrossBild(url, breite, hoehe){
//grosses Produktbild in Popup öffnen
//klappt bei AOL NICHT. Wird daher nur bei IE und Netscape zugelassen.

// (*1) Fehlerquelle: Bild über Produktseite laden und dann über
//      Warenkorbseite laden. Bild hat dann keinen Focus und falsche Masse
 hoehe += 55;                              //Offset zum Rand
 breite += 35;
 if (ie){
    if (GrossBild==null||GrossBild.closed==true)
     {
     GrossBild=window.open(url,"GrossBild","width="+ breite + ",height=" + hoehe +    // ",window.innerWidth=" + breite + ",window.innerHeight=" + hoehe +
",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,screenX=10,screenY=10,left=10,top=10");
     //(*1)
     GrossBild.resizeTo(breite,hoehe);
     GrossBild.focus();
     }
   else {
     GrossBild.resizeTo(breite,hoehe);
     GrossBild.location=url;
     GrossBild.focus();
   };
 }
 else if (nn4 || w3c) {
   if (GrossBild != null){             //wenn schon Fenster verwendet
     if (!GrossBild.closed)           //und nicht geschlossen
          GrossBild.close();          //dann schliessen
   }; GrossBild=window.open(url,"GrossBild","width="+ breite + ",height=" + hoehe +    ",window.innerWidth=" + breite + ",window.innerHeight=" + hoehe + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,screenX=10,screenY=10,left=10,top=10");
     //(*1)
     GrossBild.resizeTo(breite,hoehe);
     GrossBild.focus();
 };
 // else return;  Der Befehl haut das gesamte Script platt
 };

function Page2Kopf()
// Speichert die CGI-Variable "PAGE", die die letzte verwendete web_store-page-Seite
// enthält im Kopf- sowie im Fussframe zwischen.
// Ansonsten wird bei der Drucktaste "Einkauf fortsetzen" ggf. eine falsche Folgeseite
// geladen.
{
HoverInit();
if (document.forms[0].page.value != null)
  {
  parent.RahmenKopf.document.KopfFrame.page.value=document.forms[0].page.value
  parent.RahmenFuss.document.FussFrame.page.value=document.forms[0].page.value
  }
}

function Page2KopfWK(){
// Ähnlich wie Page2Kopf. Page2KopfWK wird jedoch von der Warenkorb-Seite geladen.
// Die "Seitenart"(page,product oder keywords), die zum Laden des Warenkorbes führte,
// wird gespeichert.
      var e;
      var f;
      var tmpchar;
      f = parent.RahmenRechts.document.forms.length - 1;
      e = parent.RahmenRechts.document.forms[f].elements.length - 1;
      for (var i = 0; i <= e; i++)
        {
        tmpchar = parent.RahmenRechts.document.forms[f].elements[i].name.substring(0,5);
        if (tmpchar = "item-")
            parent.RahmenRechts.document.forms[f].elements[i].selectedIndex = 0;
        }

      if (document.forms[0].product)
      {
          parent.RahmenKopf.document.KopfFrame.product.value=document.forms[0].product.value
          parent.RahmenKopf.document.KopfFrame.page.value=""
          parent.RahmenKopf.document.KopfFrame.keywords.value=""
          parent.RahmenFuss.document.FussFrame.product.value=document.forms[0].product.value
          parent.RahmenFuss.document.FussFrame.page.value=""
          parent.RahmenFuss.document.FussFrame.keywords.value=""
      }
      else if (document.forms[0].keywords)
      {
          parent.RahmenKopf.document.KopfFrame.keywords.value=document.forms[0].keywords.value
          parent.RahmenKopf.document.KopfFrame.page.value=""
          parent.RahmenKopf.document.KopfFrame.product.value=""
          parent.RahmenFuss.document.FussFrame.keywords.value=document.forms[0].keywords.value
          parent.RahmenFuss.document.FussFrame.page.value=""
          parent.RahmenFuss.document.FussFrame.product.value=""
      }
   }




function openSmallPlan (url)
// Laden des Stadtplans
{
url = 'http://www.wuppertal-forum.de/stadtplan/plan/' + url + '-h.htm';
detailPlanWin = window.open(url,'WFDetailPlan','scrollbars,menubar,resizable,width=770');
}


function runde(x, n) {
  if (n < 1 || n > 14) return false;
  var e = Math.pow(10, n);
  var k = (Math.round(x * e) / e).toString();
  if (k.indexOf('.') == -1) k += '.';
    k += e.toString().substring(1);
    return k.substring(0, k.indexOf('.') + n+1);
}

//Drop-Down-Box ausloesen. form.submit() kann nicht verwendet werden, da > 3 Submit-Taste im Form
//und somit die falsche-Submit-Taste ausgeloesst wird.
function WarenkorbSubmit()
{ parent.RahmenRechts.document.StandardForm.submit_change_quantity_button.click();
  return true;
}
        