Weite=Fensterweite();
Hoehe=Fensterhoehe();

function Fensterweite() {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe() {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

function getPageSize(){
	
	// Fenstergröße
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// alle außer IE
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // alle anderen IEs
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	return new Array(windowWidth,windowHeight);
}

function neuAufbau () {
	var PageSize = getPageSize();
	
	neuebreite=(Math.floor((PageSize[0]-900)/2)-2);
	if(neuebreite<0) neuebreite=0;
	
	neuehoehe=(Math.floor((PageSize[1]-520)/2)-2);
	if(neuehoehe<0) neuehoehe=0;
	
	document.getElementById("buehne").style.left=neuebreite+"px";
	document.getElementById("buehne").style.top=neuehoehe+"px";
	document.getElementById("buehne").style.visibility="visible";
}

window.onresize = neuAufbau;

var browser=null;
var popupWin=null;
var isMac=navigator.userAgent.toLowerCase().indexOf('mac')!=-1;
var isNav=navigator.appName=="Netscape";


function max(){
	var url = '';
	if ((isNav || isMac) && window.screen){
		var w=window.screen.availWidth;
		var h=window.screen.availHeight;

		if (isNav){
			w-=10;
			h-=30;
		}
		popupWin=window.open(url, 'maxwin', 'toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=0,top=0,left=0,width='+ w +',height=' + h ); 
	}else{
		popupWin=window.open(url, 'maxwin', 'fullscreen=1,scrollbars=0'); 
	}
	document.forms.login.submit();
}
