// Version: 1.0
// Anpassung für Mozilla 1.x und Netscape 7.x auf Mac und PC

function OpenWindow (href, name, width, height, parameter, xpos, ypos)
{
	var agt = navigator.userAgent.toLowerCase();
	var ie  = (navigator.appVersion.indexOf("MSIE") != -1);
	var mac = (agt.indexOf("mac") != -1);
	var v5  = !(navigator.appVersion.indexOf("4.") != -1) || (navigator.appVersion.indexOf("MSIE 5.") != -1);
	var w2  = (agt.indexOf("windows nt 5.0") != -1);
	var v501= (navigator.appVersion.indexOf("5.01") != -1);
	var w98 = (agt.indexOf("98") != -1);
	var aol = (navigator.appVersion.indexOf("AOL") != -1);
	var	ns  = (document.getElementById && !document.all) ? true : false; // auch Mozilla

	//alert( "IE:"+ie+" Mac:"+mac+" IE:5"+v5+" Windows2000:"+w2+" ie5.01"+v501+" win98:"+w98+" Aol:"+aol+" Netscape/Mozilla:"+ns );
	
	eval( "fenster = window.Fenster_"+name );

	if (fenster && !fenster.closed) {
		if (href)
			fenster.location.href = href;
		fenster.focus();
		return;
	}

	if (parameter != "")
		parameter = "," + parameter;

	if (!xpos)
		xpos = (screen.availWidth-(width+10))/2;
	if (!ypos)
		ypos = (screen.availHeight-(height+30))/2;

	if (((ie && !mac) || (!ie && v5)) && !aol) {
		width += 10;
		height+= 29;
		if (v501)
			height-=2;
		if (!ie) {
			height--;
			if (w2) {
				height-=3;
				width -=3; 
			}
			if (w98)
				width -= 4;
		}
	}
	if (mac && ns) {
		width  -=10;
		height -=32;
	}

	fenster = open ("", name, "height="+height+",width="+width+",toolbar=no,directories=0,copyhistory=0,location=no,status=no,scrollbars=no,resizable=no,screenX="+xpos+",screenY="+ypos+parameter);

	if (!(ie && mac && !v5) && !aol)
		fenster.moveTo (xpos, ypos);
		fenster.resizeTo (width, height);
		fenster.focus();
		fenster.location.href = href;

	if (href.indexOf(":")==-1){
		setTimeout ("window.Fenster_"+name+".WindowWidth = "+width, 1000);
		setTimeout ("window.Fenster_"+name+".WindowHeight = "+height, 1000);
	}
	eval ("window.Fenster_"+name+" = fenster");
}
