clickAllowed = 0; // es ist noch nichts geladen, der Benutzer kann keinesfalls zwischen den Tab-Pages wechseln

if(navigator.userAgent.match(/Android/i) ||  
	navigator.userAgent.match(/webOS/i) ||  
	navigator.userAgent.match(/IEMobile/i) ||  
	navigator.userAgent.match(/iPhone/i) ||  
	navigator.userAgent.match(/iPod/i)  )
	{  
		var cssLocation = "/php/css/mobil.css";  
		function getCss()
		{  
			document.getElementById('fgstyle').href = cssLocation; 
			allowClick;
		}  
		window.onload=getCss
	} 
else
{
	window.onload = allowClick;
}

if (top != self)
{
    // raus aus den fremden Frames
    top.location = self.location;
}

function loadDiv(privReq,privEx,itemHide,itemShow)
{
    // Wechsel in den Tab-Pages
	if (clickAllowed == 0)
	{
        // es ist noch nicht alles geladen
		return;
	}
	if (privReq == 0 || privReq == privEx)
	{
        // aktuelle Tab-Page verstecken
		objHide=document.getElementById(itemHide);
		objHide.style.visibility="hidden";
        // angeklickte Tab-Page anzweigen
		objShow=document.getElementById(itemShow);
		objShow.style.visibility="visible";
   	}
	else
	{
        // die Tab-Page ist nur für Administratoren
		alert("Sie sind nicht berechtigt, auf diese Daten zuzugreifen");
	}
}

function allowClick()
{
    // es ist alles geladen, der Benutzer kann ggf. zwischen den Tab-Pages wechseln
	clickAllowed = 1;
    var winHeight = screen.height;
    var winWidth = screen.width;
    //window.resizeTo(winWidth,winHeight);

    if (document.getElementById("nav"))
    {
        objNavi=document.getElementById("nav");
        if (document.getElementById("inhalt"))
        {
            objInhalt=document.getElementById("inhalt");
            var maxHeight = height() ;
            if (maxHeight > 0)
            {
                // Höhen der Divs für Navigation und Inhalt anpassen
                objInhalt.style.height = maxHeight + "px";
                objNavi.style.height = maxHeight + "px";
            }
        }
    }
    // Tab-Pages und Divs sichtbar machen, da nun alles geladen ist
	if(document.getElementById('inhalt'))
	{
		objShow=document.getElementById("inhalt");
		objShow.style.visibility="visible";
	}
	if(document.getElementById('Stamm'))
	{
		objShow=document.getElementById("Stamm");
		if (objShow != null)
		{
			objShow.style.visibility="visible";
		}
	}
}
function height()
{
    // Höhe berechnen für die Anpassung der Divs
    var textHeight = 0;

    // Texthöhe ermitteln
    if(navigator.appName == "Microsoft Internet Explorer")
    {
        textHeight = document.body.clientHeight;
    }
    else
    {
        textHeight = window.innerHeight;
    }
    //alert('Document height = ' + textHeight + "  Window height " + winHeight + " Screen height " + screen.height);
    textHeight = textHeight - 102; // 102 ist die Kopfhöhe
    textHeight = textHeight + 100; // 102 ist die Kopfhöhe
    //alert('Document height = ' + textHeight + "  Window height " + winHeight);
    return textHeight;
}


