//die seite auf der man ist wird als variable zur verfügung gestellt
var pfad_arr = window.location.pathname.split("/");
pfad_arr.reverse();
var akt = pfad_arr[0].substr(0,4);

function go_to(){
    //alert("go_to");
    if(navigator.appName.indexOf("Microsoft") != -1) {
        if(navigator.browserLanguage.indexOf("en") != -1) {
            window.location.href="en/uebe_trio.html";
        } else {
	    window.location.href="de/uebe_trio.html";
        }
	
    } else {
	if(navigator.language.indexOf("en") != -1) {
            window.location.href="en/uebe_trio.html";
        } else {
	    window.location.href="de/uebe_trio.html";
        }
    }
}
// menu aus
function all_off(men) {
    //alert(akt);
    
    if(akt != "uebe" && men != "uebe") document.getElementById('uebe').style.visibility = "hidden";  
    if(akt != "komp" && men != "komp") document.getElementById('komp').style.visibility = "hidden";  
    if(akt != "arch" && men != "arch") document.getElementById('arch').style.visibility = "hidden";  
}

// menu anzeigen
function zeige(m) {
    //alert(m);
    all_off();
    document.getElementById(m).style.visibility = "visible";    
}
// richtigen menüpunkt grün machen
function hl() {
    //alert("hl");
    if(pfad_arr[0] != "index.html" && pfad_arr[0] != "impressum.html") {
        var mid = pfad_arr[0];
	if(akt == "arch" || akt == "komp" || akt == "uebe") {
	    //alert(akt);
	    document.getElementById(akt).style.visibility = "visible"; 
	    mid = mid.substr(5);
	}
	var lid = mid.substr(0,4);
	//alert(lid);
	document.getElementById(lid).style.color = "#85bd31"; 
	var pfad_teile = pfad_arr[0].split("_");
	
	if(pfad_teile.length == 3) {
	    //alert ("sn");
	    var snid = "sn_"+pfad_teile[2].substr(0,4);
	    
	    document.getElementById(snid).style.color = "#85bd31";
	}
	
    }
    
}
// sprache ändern
function ansp(sp) {
    var np = "../"+sp+"/"+pfad_arr[0];
    document.location.href = np;
}

// content scroll resize
window.onresize = versch;

function versch(Ereignis) {
    //alert("v");
    var endcont;
    if(akt == "popu") return;
    
    if (self.innerHeight) // all except Explorer
    {
	endcont = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
    {
	endcont = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
	endcont = document.body.clientHeight;
    }
    //alert(endcont);
    document.getElementById('content').style.height = endcont-205;
    document.getElementById('ende_cont').style.top = (endcont-50);
}

function pop(url,win) {
    // öffnet ein fenster für bild
    var bild_a = url.split("=");
    //var ma =  bild_a[1].split("&");
    //alert(bild_a.join(","));
    if(bild_a[2] == "hoch") window.open(url,win,'width=350,height=550,status=yes');
    else window.open(url,win,'width=550,height=350,status=yes');
}
function bild() {
    var bild_a = window.location.search.split("=");
    //alert(window.location.search);
    return bild_a[1];
}

    
