	function openPopup(link, name, width, height) {
		var maxWidth = screen.availWidth-20;
		var maxHeight = screen.availHeight-20;
		i = link.indexOf('?')+1;
		link = link.substring(0, i)+'p=true&'+link.substring(i);
		if(width == '')
			width = 500;
		if(height == '')	
			height = 600;
		if(width > maxWidth)
			width = maxWidth;
		if(height > maxHeight)
			width = maxHeight;
	    leftpos = (screen.width/2)-(width/2);
	    obenpos = (screen.height/2)-(height/2);	
		newwin = window.open(link, name, "scrollbars=yes,resizable=yes,width="+width+",height="+height+",top="+obenpos+",left="+leftpos);
		newwin.focus();
	}		
	
	function submitForm(form, name, value) {
		document.forms[form][name].value = value;
		document.forms[form].submit();
	}

	function submitWithScroll(form, name, value){
	// Haengt die aktuellen (x,y)-Koordinaten an die action
	// des Formulars sForm
		if (document.all) {
			x = document.documentElement.scrollLeft;
			y = document.documentElement.scrollTop;
		} else {
			x = window.pageXOffset;
			y = window.pageYOffset;
		}
		if(document.forms[form]['action'].indexOf('?') < 0)
			document.forms[form]['action'] = document.forms[form]['action'] + '?';
	
		document.forms[form][name].value = value;
		document.forms[form]['action'] = document.forms[form]['action']+'&scrollX='+x+'&scrollY='+y;
		document.forms[form].submit();
	}

	function scrollWindow(x, y) {
		window.scrollTo(x,y);
	}		
	
	function printpage() {
		window.print();
	}
	
	function initClearSearchField(field, defaultValue){
		var val = new String(field.value);
		if(val == defaultValue){
			field.value = '';
		}
	}
	
	function checkCheckbox(checkId, hiddenId) {
		if(document.getElementById(checkId).checked)
			document.getElementById(hiddenId).value = 'on';
		else	
			document.getElementById(hiddenId).value = '';
	}		