var fix = 0;
var maxheight = 0;
var maxwidth = 0;
var zoomalt = 1;

zoomfaktor = new Array(4);

function zoom(faktor){

    var zoomneu;
    var nav=navigator.appName;

    zoomfaktor[1] = 1;
    zoomfaktor[2] = 0.75;
    zoomfaktor[3] = 0.5;
    zoomfaktor[4] = 0.25;

    if( fix == 0 ) {

        maxheight = parent.frames[1].modellbild.height;
        maxwidth = parent.frames[1].modellbild.width;
        fix=1;

    }

    parent.frames[1].modellbild.height = maxheight * zoomfaktor[faktor];
    parent.frames[1].modellbild.width = maxwidth * zoomfaktor[faktor];

    if (nav.indexOf('Microsoft')>=0) {

            zoomneu = faktor;

            if (zoomneu == 1) window.document.all.z1.className = "rot";
            if (zoomneu == 2) window.document.all.z2.className = "rot";
            if (zoomneu == 3) window.document.all.z3.className = "rot";
            if (zoomneu == 4) window.document.all.z4.className = "rot";
            if (zoomalt == 1) window.document.all.z1.className = "dublau";
            if (zoomalt == 2) window.document.all.z2.className = "dublau";
            if (zoomalt == 3) window.document.all.z3.className = "dublau";
            if (zoomalt == 4) window.document.all.z4.className = "dublau";

            zoomalt = faktor;

    }

}

function setPos(){

    var nav=navigator.appName;
    var version=navigator.appVersion;
    var agent=navigator.userAgent;

    var x = 0;
    var y = 0;

    //Breite und Höhe des Thumbnails
    var thumbX = document.getElementById("thumb").width;
    var thumbY = document.getElementById("thumb").height;

    //var thumbX = window.thumb.width;
    //var thumbY = window.thumb.height;

    //Breite und Höhe des Bildes
    var vollX = parent.bild.modellbild.width;
    var vollY = parent.bild.modellbild.height;

    var iX = (screen.availWidth - 250)/2;       // 150 = Breite des Navigationsframes navigation.asp
    var iY = (screen.availHeight)/2;      // 120 = Höhe des oberen Frames in vollbildframe.asp

    if (nav.indexOf('Microsoft')>=0) {

       x = window.event.x - 55;  // 15 entspricht der Breite der 1.Spalte im Frame navigation.asp
       y = window.event.y - 134;   // 50 entspricht der Höhe der 1.Zeile im Frame navigation.asp

       x = x / thumbX * vollX - iX;
       y = y / thumbY * vollY - iY;
       //var xx = window.event.x / thumbX;

      // alert("ex = " + window.event.x + " tx = " + thumbX + "/ voll = " + vollX);

        //alert("window.event.x= " + window.event.x+ " window.event.y= " + window.event.y+ "");
       parent.bild.scrollTo(x,y);

       }
    else {
        PopFenster=window.document.open(ziel, text, fenster);
        PopFenster.focus();

        }
}


function showhidelayer(id){
    if($(id).style.visibility == 'hidden'){
        $(id).style.visibility = 'visible';
        $(id).style.display = 'block';

    }else{
        $(id).style.visibility = 'hidden';
        $(id).style.display = 'none';

    }
}

function showlayer(id){
        $(id).style.visibility = 'visible';
        $(id).style.display = 'block';
}

function hidelayer(id){
        $(id).style.visibility = 'hidden';
        $(id).style.display = 'none';
}

function bildwechsel(nr,z){
    var i;
    
    showlayer('img'+nr);
    $('link'+nr).style.backgroundColor = '#ffffff';
    $('link'+nr).style.color = '#004D8C';
    
    for(i=1;i<=z;i++){
    
        if(i != nr){
            hidelayer('img'+i);
            $('link'+i).style.backgroundColor = '#004D8C';
            $('link'+i).style.color = '#ffffff';
        }
    
    }
}
