// Written 2004 by Frank Blechschmitt, FBIS
//
var breite;
var aktiv;
var weiter;
var menueaktiv;

function hidealllayer(){
	document.getElementById("menu2").style.visibility="hidden";
	document.getElementById("menu3").style.visibility="hidden";
}

function show_layer(x) {
	weiter=x;
	menueaktiv=window.setTimeout("show_layer_start()",300);
}

function show_layer_start() {
	if(document.getElementById) {
		hidealllayer();
		
		off_left=document.getElementById("pos"+weiter).offsetLeft;
		parenttag=document.getElementById("pos"+weiter).offsetParent;
		do {
			off_left=off_left+parenttag.offsetLeft;
			parenttag=parenttag.offsetParent;
		} while(parenttag.tagName != 'BODY');
		breite = off_left;
		
		document.getElementById(weiter).style.left=breite+"px";
		document.getElementById(weiter).style.visibility="visible";
	}
}

function menuOut(s) {
	if(s==0) { aktiv=window.setTimeout("hidealllayer()",300); }
	if(s==1){ window.clearTimeout(aktiv); }
	if(s==2){ window.clearTimeout(menueaktiv); }
}


function OpenWindow(url, title, win_width, win_height) {
	var x,y;
	
	if(win_width==0) {
		win_width = 800;
	}
	if(win_height==0) {
		win_height = 600;
	}
	x = (screen.width / 2) - (win_width / 2);
	y = (screen.height / 2) - (win_height / 2);

	window.open(url,title,'resizable,width='+win_width+',height='+win_height+',top='+y+',left='+x+',toolbar=no,status=no');
}
function OpenWindowWithScrollbar(url, title, win_width, win_height) {
	var x,y;
	
	if(win_width==0) {
		win_width = 800;
	}
	if(win_height==0) {
		win_height = 600;
	}
	x = (screen.width / 2) - (win_width / 2);
	y = (screen.height / 2) - (win_height / 2);

	myWindow = window.open(url,title,"resizable,width="+win_width+",height="+win_height+",top="+y+",left="+x+",toolbars=no,scrollbars=yes,status=no");
}

