function bildVergroessern(url,breite, hoehe) {
	breite += 40;
	hoehe += 40;
	if(breite > 640) breite=640;
	if(hoehe > 480) hoehe=480;
	
	// IE hat ein Problem??
//		var win = window.open(url,"<%replace name=Allgemein.Vergroesserung format=escape%>Vergroesserung<%/replace%>","menubar=no,resizable=yes,scrollbars=yes,width="+breite+",height=" + hoehe);
	var win = window.open(url,"gross","menubar=no,resizable=yes,scrollbars=yes,width="+breite+",height=" + hoehe);
	win.focus();
}


function stdws_openDruck() {
	var url;
	if(location.search == "") {
		url = window.location.href + '?stdws_chtml=true&druckdarstellungVAR=true';
	}
	else  {
		url = window.location.href + '&stdws_chtml=true&druckdarstellungVAR=true';
	}
	var win = window.open(url,"Print","menubar=yes,resizable=yes,scrollbars=yes,width=600,height=700");
	win.focus();
}


function stdws_changeLocation(param,value,target) {
	var url;
	var query = param;
	if(value) {
		query = param + '=' + value;
	}
	
	if(window.location.search == "") {
		url = window.location.href + '?' + query;
	}
	else if(value) {
		// alten wert rauswerfen, wenn vorhanden
		var search = window.location.search;
		// TODO hier die einfachversion, d.h. funktioniert
		// nicht unter allen Umständen
		search = search.substring(1);
		// alert(search);
		sp = search.split('&');
		search = query;
		for(var i=0; i < sp.length; ++i) {
			if(sp[i].indexOf(param + '=') < 0) {
				search += '&' + sp[i];
			}
		}
		url = window.location.pathname + '?' + search;
	}	
	else  {
		url = window.location.href + '&' + query;
	}
	if(target) {
		target.location.href = url;
	}
	else {
		window.location.href = url;
	}
}

function stdws_makeLesezeichen(url,title) {

 	if(!title) {
		title = document.title; 
 	}
	if(!url) {
		url = window.location.href;
	}

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} 
	else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); 
	}
	else if(window.opera && window.print) { // Opera 
	    var elem = document.createElement('a');
    	elem.setAttribute('href',url);
    	elem.setAttribute('title',title);
    	elem.setAttribute('rel','sidebar');
    	elem.click();			
	} 
}

function stdws_canDoLesezeichen() {
	if( window.external 
			|| window.sidebar 
			// || (window.opera && window.print) 
			) {
		return true;
	}
	return false;
}

function fixFooterPadding() {
	//free some space
	var fheight = document.getElementById('footer').offsetHeight;
	document.getElementById('content').parentNode.style.paddingBottom = (fheight + 10) + 'px'; 
	
	//let footer float
	document.getElementById('footer').style.bottom = '0px';
	document.getElementById('footer').style.position = 'absolute';
}
