	function openPopup(link, name, width, height) {
		i = link.indexOf('?')+1;
		link = link.substring(0, i)+'p=true&'+link.substring(i);
		if(width == '')
			width = 320;
		if(height == '')	
			height = 440;
		newwin = window.open(link, name, "scrollbars=yes,resizable=yes,width="+width+",height="+height+"");
		newwin.focus();
	}	
	
	function openFenster(link, name, width, height) {
		if(width == '')
			width = 320;
		if(height == '')		
			height = 440;
		newwin = window.open(link, name, "scrollbars=yes,resizable=yes,width="+width+",height="+height+"");
		newwin.focus();
	}	
	
	function submitForm(form, name, value) {
		document.forms[form][name].value = value;
		document.forms[form].submit();
	}

	
	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 = '';
	}	
	
	// Bestimmt die Position eines Elementes
	function getPosition(obj) {
	  var pos = { x:0, y:0 };
	
	  do {
	    pos.x += obj.offsetLeft;
	    pos.y += obj.offsetTop;
	  } while (obj = obj.offsetParent);
	
	  return pos;
	}	
	
	// Aendert aus einem Popup heraus den
	// Wert eines Formularelements im Hauptfensters 
	function setElemValueFromPopup(elemId, value) {
		window.opener.document.getElementById(elemId).value = value;
		window.close();
	}		
	
	function sendPilotLink(href) {
		obj = document.getElementById('pilot_navigation');
		scrollPilot = obj.scrollTop;
		if(href.indexOf('?') < 0)
			href = href + '?'
		location.href = href+'&scrollPilot='+scrollPilot;
	}
	
	function scrollPilot(yPos) {
		yPos += 0;
		obj = document.getElementById('pilot_navigation');
		obj.scrollTop = yPos;
	}


