	function openPopup(link, name, width, height) {
		var maxWidth = screen.availWidth-20;
		var maxHeight = screen.availHeight-20;
		i = link.indexOf('?')+1;
		if(i > 0)
			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 sizeIframe(height) {
    var f = document.getElementById('iframe');
    f.style.height = height+'px';
	
}	

function printpage() {
	window.print();
}

function initClearSearchField(field, defaultValue){
	var val = new String(field.value);
	if(val == defaultValue){
		field.value = '';
	}
}

// Aendert aus einem Popup heraus den
// Wert eines Formularelements im Hauptfensters 
function setElemValueFromPopup(elemId, value) {
	window.opener.document.getElementById(elemId).value = value;
	window.close();
}	

