var cPath="/BigPic/";
var aktiv = 0;
var del_time = 5;
var status = false;
var nSetPic=5;
var isNS = ((navigator.userAgent.indexOf("MSIE") == -1)&&(parseInt(navigator.appVersion) >= 4)) ? true : false;
var PictureWin = null;

function zoomit(Pic)
        {
   var wf;
   if (PictureWin != null && !PictureWin.closed && 3 <= parseInt(navigator.appVersion)) {
                PictureWin.focus();
                return;
   }
	cUrl = "showpic.php?p="+Pic;
        wf = wf + "depend"
        wf = wf + ",width=300";
        wf = wf + ",height=300";
        wf = wf + ",resizable=no";
        wf = wf + ",scrollbars=no";
        wf = wf + ",menubar=no";
        wf = wf + ",toolbar=no";
        wf = wf + ",directories=no";
        wf = wf + ",location=no";
        wf = wf + ",status=no";
        PictureWin = window.open(cUrl,"Picture",wf);

        // dummy=window.open(zoom,'Picture',wf);
} // function-ende
// Konfiguration der ID's,
// welche auf eine Höhe gebracht werden sollen
rel_id = new Array();
rel_id[0] = 'con';


var max_hoehe = 0;
var nn = '' ;


function setDivHeight(pxOffset)
{
// return true;
    // Prfung, ob alle konfigurierten ID auch tatsächlich im HTML vorkommen
    // gleichzeitig ermitteln der Offset-Höhe,
    // um später die ID auf den gemeinsamen höchsten Wert stellen
    if (isNS)
	{
		max_hoehe = window.innerHeight - 135;
	} else {
		max_hoehe = document.documentElement.clientHeight-135;
	}
    for (var i = 0; i < rel_id . length; i++) {
        if (!document . getElementById(rel_id[i])) {
            return true;
        } else {
            var hoehevals = document . getElementById(rel_id[i]) . offsetHeight;
            nn = nn + ' ' + hoehevals;
//            if (hoehevals > max_hoehe) {
//                max_hoehe = hoehevals;
//            }
        }
    }
//    max_hoehe = '' + max_hoehe/10 + 'em';
    max_hoehe = '' + (max_hoehe ) + 'px';
    for (var i = 0; i < rel_id . length; i++) {
        setHeight(rel_id[i], max_hoehe);
    }
}

function setHeight(elem, hoehe)
{
    document . getElementById(elem) . style . height = hoehe;
}

function init(func)
{
    if (1) {
        var oldonload = window . onload;
        if (typeof window . onload != 'function') {
            window . onload = func;
        }
    }
}

init(
    function()
    {
		setDivHeight(0);
    }
    );

function goFlash()
{
	var intAvailWidth = window.screen.availWidth;
	var intAvailHeight = window.screen.availHeight;
	window.open('http://www.dolly-buster.at/test/start.html','popup'+Math.round(Math.random()*1000),'fullscreen=yes,height='+intAvailHeight+',width='+intAvailWidth+',status=no,toolbar=no,menubar=no,location=no,top=0,left=0,resizeable=no,scrollbars=no',true);
}			
/*
Abruf der Daten vom Server
*/
function getAction(shid,hmenu) {
	showLoader();
	new Ajax.Request('rpcContent.php',
         {
            method: 'post', 
            onComplete: hideLoader,
            onSuccess: contentHandler,
            parameters: {
            shid: shid,
	    hmenu: hmenu }
        }
    );

}

function contentHandler(xml_http) {
	$('plcContent').update(xml_http.responseText);
}

function showLoader() {
	var posX = (Fensterweite() / 2) - 90 + 'px';
	var posY = 200 + 'px';
	document.getElementById('loaderDiv').style.top = posY;
	document.getElementById('loaderDiv').style.left = posX;
	document.getElementById('loaderDiv').style.visibility = "visible";
}
	
function hideLoader(){
	document.getElementById('loaderDiv').style.visibility = "hidden";;
}

/*
* allgemeine Funktionen
*/
function Fensterweite () {
	if (window.innerWidth) {
		return window.innerWidth;
	} else if (document.body && document.body.offsetWidth) {
		return document.body.offsetWidth;
	} else {
		return 0;
	}
	return 0;
}

function Fensterhoehe () {
	if (window.innerHeight) {
		return window.innerHeight;
	} else if (document.body && document.body.offsetHeight) {
		var y = document.body.offsetHeight;
		//alert ("y=" + y + " - >" + (screen.height));
		if (y < (screen.height - 200)) {
			return  (screen.height - 200);
		} else {
			return y;
		}
	} else {
		return 0;
	}
	return 0;	
}