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 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();
}
/// AJAX
var http_request = false;
var reload_url = location.href;

function BrowserIsCompatible() {
	if (!window.RegExp) return false;
	var AGENTS = ["opera","msie","safari","firefox","netscape","mozilla"];
	var agent = navigator.userAgent.toLowerCase();
	for (var i = 0; i < AGENTS.length; i++) {
		var agentStr = AGENTS[i];
		if (agent.indexOf(agentStr) != -1) {
			var versionExpr = new RegExp(agentStr + "[ \/]?([0-9]+(\.[0-9]+)?)");
			var version = 0;
			if (versionExpr.exec(agent) != null) {
				version = parseFloat(RegExp.$1);
			}
			if (agentStr == "opera") return version >= 9;

			if (agentStr == "safari") return version >= 125;
			if (agentStr == "msie") return (version >= 5.5 &&agent.indexOf("powerpc") == -1);
			if (agentStr == "netscape") return version > 7;
		}
	}
	return document.getElementById;
}
function requestObject(){
	try{
		if(typeof ActiveXObject!="undefined"){
			return new ActiveXObject("Microsoft.XMLHTTP")
		}
		else if (window.XMLHttpRequest){
			var out=new XMLHttpRequest();
			out.overrideMimeType('text/xml');
			return out;
		}
	}
	catch(a){ }return null
}
function makeGetRequest(url) {
	http_request = requestObject();
	http_request.onreadystatechange = alertContents;
	http_request.open('GET', url, true);
	http_request.send(null);
}
function alertContents() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			var alert_box=false;
			/*try {
				debug(http_request.responseText);
			}
			catch(e) {
				alert("fehler: "+e);
			}
			*/
			if (alert_box) {
				debug(alert_box);
			}
			location.href = reload_url;
			//document.getElementById('container').innerHTML = http_request.responseText;
		}
		else if (http_request.status == 0) {
			// IE: abfangen
		}
		else {
			alert('Anforderung konnte nicht verarbeitet werden, HTTP-Fehler '+http_request.status);
		}
	}
}

function debug(msg) {
	if (typeof w == "undefined") {
		w=window.open('','w','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=640,height=400');
	}
	w.document.write(msg+"<br>");
}
function trace(o) {
	var out="";
	for (z in o) {
		try {
		if (o[z]!="" && o[z]!=null)
			if (z=="innerHTML" || z=="outerHTML") out+=z+" = [..HTML-Code..]; <br>\n";
			else out+=z+" = "+o[z]+"; <br>";
		}
		catch (e) {
			out+= z+" = ERROR: "+e+"; <br>";
		}
	}
	debug(out)
}