function Fensterhoehe() {
	if (window.innerHeight) return window.innerHeight;
	else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
	else return 0;
}

function GetBrowserHeight() {
	var BrowserName = navigator.appName;
	
	if (BrowserName == 'Netscape') {
		return parent.innerHeight+5;
	} else {
		return parent.document.body.offsetHeight;
	}	
}

function GetBrowserWidth() {
	var BrowserName = navigator.appName;
		
	if (BrowserName == 'Netscape') {
		return parent.innerWidth;
	} else {
		return parent.document.body.offsetWidth;
	}	
}

function GetMapHeight(){
	var divHeight;
	
	divHeight = GetHeight('divSearchResultDocking');
	return GetBrowserHeight() - divHeight - 55;	
}

function GetMapWidth(){
	var mctlOverImg = GetOverviewImg();
	var width;
	width = GetBrowserWidth() - mctlOverImg.width;
	if (BrowserType() == IE) {
		width -= 23;
	}
	return width;
}

function SetSizeOnMouseOver(){
	if (BrowserType() == IE) {
		if (GetVisibility('processing') == "hidden") {
			SetSize();
		}
	}
}

function SetSizeOnResize(){	
	if (BrowserType() == NS) {
		SetSize();		
	}
}

function SetSize(){
	var height = GetMapHeight();
	var width = GetMapWidth();
	var mctlMainImg = GetMainImage();
	
	if (!mctlMainImg.mapAlias) mctlMainImg.mapAlias = mctlMainImg.attributes["mapAlias"].value;
	if (!mctlMainImg.exportFormat) mctlMainImg.exportFormat = mctlMainImg.attributes["exportFormat"].value;
	if ((height != mctlMainImg.height) || (width != mctlMainImg.width)) {
		showProcessing();
		var url = "MapCommand.aspx?Command=Reload"+ 
			"&Width=" + width +
			"&Height=" + height +
			"&ExportFormat=" + mctlMainImg.exportFormat +
			"&Ran=" + Math.random() + 
			"&MapAlias=" + mctlMainImg.mapAlias;		
		mctlMainImg.src = url;

		SetGroupControlSize();

		var resultCtrl = GetControl('divSearchResultDocking');
		if (resultCtrl.style.visibility == "visible"){
		if(navigator.appName == 'Netscape') {
			resultCtrl.style.width = width-3+"px";
			resultCtrl.style.height= "287px";
		} else {
			resultCtrl.style.width = width+"px";
			resultCtrl.style.height= "280px";
		}		
		}
	}	
}

function SetGroupControlSize() {
	var height = 0;
	var searchCtrl = GetControl('quickSearchHeight');
	if (searchCtrl != undefined) {
		height =  searchCtrl.value;
	}
		
	var grpCtrl = GetControl('divGroupControl');
	grpCtrl.style.height = GetBrowserHeight() - 175 - height;	//175 = Hoehe Overview + Hoehe Kopfzeile + Platz
}

function SetMapImgSize() {
	var height = GetMapHeight();
	var width = GetMapWidth();
	var mctlMainImg = GetMainImage();
	
	if ((height != mctlMainImg.height) || (width != mctlMainImg.width)) {
		mctlMainImg.height = height;
		mctlMainImg.width = width;
		var mctlMainView = FindElement("mctlMainView");
		mctlMainView.style.height=height;
		mctlMainView.style.width=width;
	}
}

function SetElementSize(id, width, height) {
	var ctl = GetControl(id);
	ctl.style.width = width + "px";
	ctl.style.height = height + "px";
}

