function openWin(winName, theWidth, theHeight) { 
    var x = Math.round((screen.availWidth-theWidth)/2);
    var y = Math.round((screen.availHeight-theHeight)/2);
    theWin = window.open('',winName,'scrollbars=no,toolbar=no,location=no,status=yes,resizable=no,width=' + theWidth + ',height=' + theHeight + ',screenX=' + x + ',left' + x + ',screenY=' + y + ',top=' + y + '');
    theWin.focus();


 }

function bdetection() {
	var nav = navigator.appName;                     
	var vers = navigator.appVersion;
	if (nav=="Microsoft Internet Explorer") this.nav = "ie"
	else if (nav=="Netscape") this.nav = "ns"
	else this.nav = nav
	this.version = parseInt(vers);
	this.mac = (navigator.userAgent.indexOf("Mac")!=-1) ||(navigator.userAgent.indexOf("Macintosh")!=-1);
	this.win = (navigator.userAgent.indexOf("Windows")!=-1) ||(navigator.userAgent.indexOf("Win")!=-1);
	this.ie = (this.nav == "ie" && this.version >= 4);
	this.ie4 = (vers.indexOf('MSIE 4')>0);
	this.ie5 = (vers.indexOf('MSIE 5')>0);
	this.ns = (this.nav == "ns" && this.version >= 4);
	this.ns4 = (this.nav == "ns" && this.version == 4);
	this.ns5 = (this.nav == "ns" && this.version == 5);
	this.gen4 = (this.ie || this.ns);
}


function getWindowSize(richtung)	{			// richtung: b oder h oder was anderes fuer beide werte...
	
	var breite, hoehe;
	var browser = new bdetection();
	
	if (browser.ie)	{
		breite = document.body.offsetWidth;
		hoehe = document.body.offsetHeight;
	}
	else	{
		breite = window.innerWidth;
		hoehe = window.innerHeight;
	}
	//window.alert('x:' + breite + ', y:' + hoehe);
	
	if (richtung == 'b') return breite; 
	if (richtung == 'h') return hoehe; 
	if (richtung != 'b' && richtung != 'h') return new Array(breite, hoehe);
}




