var aktiv = 0;
var aktivDiv = 0;
var pos1X;
var pos1Y;
var mainX;
var mainY;
var mainWidth;
var mainHeight;
var tx;
var ty;
var zuWert;
var zuA;
var i = 0;

function goHome(){window.location.href = "default.html";}

function fixBGimg()
{
 mainX = ((document.body.clientWidth - 1000) / 2);
 mainY = 122;
 mainWidth = 1000;
 mainHeight = (document.body.clientHeight - 152);
 setBGimg = document.getElementById?document.getElementById("divBGimg"):document.all["divBGimg"];
 setBGimg.style.top = (document.body.clientHeight - (510 + 36 + 130)) / 2 + 130;
}

function posDiv(wert,a){
 zuWert = wert; zuA = a;
 document.body.focus();
 if (aktivDiv == 0){
    aktivDiv = document.getElementById?document.getElementById(wert):document.all[wert];
    pos1X = aktivDiv.offsetLeft;
    pos1Y = aktivDiv.offsetTop;
    aktivDiv.style.margin = 0 + "px";
    aktiv = wert + a;  tx = 0;  ty = pos1Y;  Raus();}

 else {
    test = document.getElementById?document.getElementById(wert):document.all[wert];
    if (aktivDiv != test){
    aktivDiv.style.width = 150 + "px";
    aktivDiv.style.height = 20 + "px";
    /*aktivDiv.style.overflow = "hidden";*/
    ty = mainY; window.setTimeout('Rein()',50);}
    }
 document.body.focus();
}

function Rein(){
 if (ty >= pos1Y){
    tx = pos1X + ((mainX - pos1X) * (ty - pos1Y)) / (mainY - pos1Y);
    aktivDiv.style.top = ty + "px";
    aktivDiv.style.left = tx + "px";
    ty = ty - 1;
    i++;
    window.setTimeout('Rein()',20);}
 if (i == 28){i = 0; Repos();}
}

function Repos(){
 aktivDiv.style.top = pos1Y + "px";
 aktivDiv.style.left = pos1X + "px";
 aktivDiv.style.cursor = "pointer";
 PostRepos(zuWert,zuA);
}

function PostRepos(zuWert,zuA){
 aktivDiv = 0; aktiv = 0;
 window.setTimeout('posDiv(zuWert,zuA)',50);
}

function Raus(){
 if (ty <= mainY){
    tx = pos1X + ((mainX - pos1X) * (ty - pos1Y)) / (mainY - pos1Y);
    aktivDiv.style.top = ty + "px";
    aktivDiv.style.left = tx + "px";
    ty = ty + 1;
    i++;
    window.setTimeout('Raus()',20);}
 if (i == 28){i = 0; Fest();}
}

function Fest(){
 aktivDiv.style.top = mainY + "px";
 aktivDiv.style.left = mainX + "px";
 aktivDiv.style.width = mainWidth + "px";
 aktivDiv.style.height = mainHeight + "px";
 aktivDiv.style.cursor = "auto";
 document.body.focus();

 setFrm = document.getElementById?document.getElementById(aktiv):document.all[aktiv];
 setFrm.style.width = mainWidth + "px";
 setFrm.style.height = (mainHeight - 20) + "px";

 if (aktiv == "divSchool1"){
    setFrm.style.scrollbarHighlightColor = "#003F00";
    setFrm.style.scrollbar3dlightColor = "#003F00";
    setFrm.style.scrollbarShadowColor = "#003F00";
    setFrm.style.scrollbarArrowColor = "#003F00";
    setFrm.style.scrollbarBaseCcolor = "#003F00";}
 else if (aktiv == "divAU1"){
    setFrm.style.scrollbarHighlightColor = "#3F0000";
    setFrm.style.scrollbar3dlightColor = "#3F0000";
    setFrm.style.scrollbarShadowColor = "#3F0000";
    setFrm.style.scrollbarArrowColor = "#3F0000";
    setFrm.style.scrollbarBaseCcolor = "#3F0000";}
 else if (aktiv == "divRSbb1"){
    setFrm.style.scrollbarHighlightColor = "#003030";
    setFrm.style.scrollbar3dlightColor = "#003030";
    setFrm.style.scrollbarShadowColor = "#003030";
    setFrm.style.scrollbarArrowColor = "#003030";
    setFrm.style.scrollbarBaseCcolor = "#003030";}
 /*else if (aktiv == "divSoR1"){
    setFrm.style.scrollbarHighlightColor = "#3F0000";
    setFrm.style.scrollbar3dlightColor = "#3F0000";
    setFrm.style.scrollbarShadowColor = "#3F0000";
    setFrm.style.scrollbarArrowColor = "#3F0000";
    setFrm.style.scrollbarBaseCcolor = "#3F0000";}*/
 else if (aktiv == "divAktiv1"){
    setFrm.style.scrollbarHighlightColor = "#330033";
    setFrm.style.scrollbar3dlightColor = "#330033";
    setFrm.style.scrollbarShadowColor = "#330033";
    setFrm.style.scrollbarArrowColor = "#330033";
    setFrm.style.scrollbarBaseCcolor = "#330033";}
 else if (aktiv == "divGast1"){
    setFrm.style.scrollbarHighlightColor = "#412121";
    setFrm.style.scrollbar3dlightColor = "#412121";
    setFrm.style.scrollbarShadowColor = "#412121";
    setFrm.style.scrollbarArrowColor = "#412121";
    setFrm.style.scrollbarBaseCcolor = "#412121";}
}


/* für Musikschule */
var istAktiv;

function posMSdiv(wert,a){
 for (var i = 1; i <= 11; i++){
     varist = "divMS" + i;
     test = document.getElementById?document.getElementById(varist):document.all[varist];
     test.style.height = 16 + "px";
     test = ""; }

 if (istAktiv == wert){ wert = 0; location.href = "#divMS1"; }

 else if (wert == "divMS1"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 590 + "px"; location.href = "#divMS1"; }

 else if (wert == "divMS2"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 745 + "px"; location.href = "#divMS2"; }

 else if (wert == "divMS3"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 800 + "px"; location.href = "#divMS3"; }

 else if (wert == "divMS4"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 640 + "px"; location.href = "#divMS4"; }

 else if (wert == "divMS5"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 665 + "px"; location.href = "#divMS5"; }

 else if (wert == "divMS6"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 590 + "px"; location.href = "#divMS6"; }

 else if (wert == "divMS7"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 910 + "px"; location.href = "#divMS7"; }

 else if (wert == "divMS8"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 480 + "px"; location.href = "#divMS8"; }

 else if (wert == "divMS9"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 500 + "px"; location.href = "#divMS9"; }

 else if (wert == "divMS10"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 520 + "px"; location.href = "#divMS10"; }

 else if (wert == "divMS11"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 190 + "px"; location.href = "#divMS11"; }

 /*else if (wert == "divMS12"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 530 + "px"; }

 /*else if (wert == "divMS13"){ istAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    istAktiv.style.height = 530 + "px"; }*/

 istAktiv = wert;
}

/* für Alleinunterhalter */
var estAktiv;

function posAUdiv(wert,a){
 for (var i = 1; i <= 5; i++){
     varist = "divALLU" + i;
     test = document.getElementById?document.getElementById(varist):document.all[varist];
     test.style.height = 16 + "px";
     test = ""; }

 if (estAktiv == wert) { wert = 0; location.href = "#divALLU1"; }

 else if (wert == "divALLU1"){ estAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    estAktiv.style.height = 450 + "px"; location.href = "#divALLU1"; }

 else if (wert == "divALLU2"){ estAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    estAktiv.style.height = 190 + "px"; location.href = "#divALLU2"; }

 else if (wert == "divALLU3"){ estAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    estAktiv.style.height = 190 + "px"; location.href = "#divALLU3"; }

 else if (wert == "divALLU4"){ estAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    estAktiv.style.height = 250 + "px"; location.href = "#divALLU4"; }

 else if (wert == "divALLU5"){ estAktiv = document.getElementById?document.getElementById(wert):document.all[wert];
    estAktiv.style.height = 190 + "px"; location.href = "#divALLU5"; }

 estAktiv = wert;
}

/* für AktivitätenGalerie */
function fixInhaltDiv()
{
 setInhaltDiv = document.getElementById?document.getElementById("divInhalt"):document.all["divInhalt"];
 /*setAktivDiv.style.top = (document.body.clientHeight - (510 + 36 + 130)) / 2 + 130;*/
 setInhaltDiv.style.height = (document.body.clientHeight - 134)  + "px";
 /*setAktivDiv.style.width = 100 + "px";*/
}
