function popupOpen() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=popupOpen.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win=window.open(url,'win_front','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win.focus();
}
function popupopen() {
	popupOpen(popupopen.arguments[0], popupopen.arguments[1], popupopen.arguments[2]);
}
function openPicture() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=openPicture.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {	w=a[1]; h=a[2];	}
	else {	w=500; h=400 }
	win_pic=window.open(url,'win_pic','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win_pic.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win_pic.focus();
}

gal_history=new Array();
function changeGalleryPic(l,g,url) {
	if (typeof gal_history[g] == "undefined")
		var old_g_link="g_"+g+"_0";
	else
		var old_g_link=gal_history[g];
	if (old_g_link==l.id) return true;
	document.getElementById(old_g_link).className="gal";
	l.className="gal_sel";
	gal_history[g]=l.id;
	document.getElementById("gallery_"+g).src=url;
}
//////// Navigationsvergrößerer //////////////

function scaleNavigation() {
	var content=document.getElementById('content_box');
	var navi=document.getElementById('navi_box');
	var navi_h=navi.clientHeight;
	var h=content.scrollHeight;
	h=Math.max(h,navi_h);
	if (h > content.parentNode.clientHeight) {
		navi.style.height=h+"px";
		content.style.height=h+"px";
		if (navigator.userAgent.indexOf('Gecko') != -1) h+=7;
		document.getElementById('content_frame').style.height=(14+h)+"px";
	}
}

///// DEBUG //////
function trace(o) {
	var out="";
	for (z in o) {
		if (o[z]!="" && o[z]!=null)	out+=z+" = "+o[z]+"; <br>";
	}
	debug(out)
}
function debug(msg) {
	if (typeof w == "undefined" || w.closed ) {
		w=window.open('','w','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=600');
	}
	w.document.write(msg+"<br>");
}
