// Fenster Popup zentriert
// Aufruf über href="javascript:centerWindow('shop2.htm','Shop',790,575);"

function centerWindow(url,name,wwidth,wheight) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;

    var xOffset = (xMax - wwidth)/2, yOffset = (yMax - wheight)/2;
    window.open(url,name,'width='+wwidth+',height='+wheight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}


// Anweisungen für den Layerwechsel
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

// Layerwechsel
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
  layerStyleRef="layer.";
  layerRef="document.layers";
  styleSwitch="";
  }else{
  layerStyleRef="layer.style.";
  layerRef="document.all";
  styleSwitch=".style";
 }
}

// Zeige Layer
var onLayer = ""
function showLayer(layerName){
if (NS4 || IE4) {

    hideLayer(onLayer)
 }
 if (NS4 || IE4) {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
 }  else {
  window.location.hash = layerName + "H"
 }
 onLayer = layerName 
}

// Verstecke Layer
function hideLayer(layerName){
 if (layerName != "") {
   if (NS4 || IE4) {
   eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
  }
 } 
}
