





/* automatisch erstes text-input auf der seite focussieren.. (Lennart) 
	noch eintrag in body-onload packen..
*/

	function doAutofocus(eID) {
		if (eID!=null && eID!='' && document.getElementById(eID)!=null) {
			document.getElementById(eID).focus();
			return;
		}
		var fs = document.forms;
		if(fs.length==0) return;
		for (var i=0; i<fs.length; i++) {
			var f = fs[i];
			//alert(f.elements.length);
			for (var e=0; e<f.elements.length; e++) {
				var elem = f.elements[e];
				if (	(elem.nodeName.match(/^input$/i) && !elem.type.match(/(?:hidden|button|reset|submit)/i)) ||
						elem.nodeName.match(/^select$/i) || 
						elem.nodeName.match(/^textarea$/i) ) {
							elem.focus();
							// elem.style.backgroundColor='red';
							// alert(elem);
							return;
				}
			}
		}
	}

	function keepFocused(obj) {
		if (obj.id==null || obj.id=='') return;
		var x = document.createElement("INPUT");
		x.type="hidden";
		x.name="lastElem";
		x.value=obj.id;
		obj.parentNode.appendChild(x);
		//obj.parentNode.innerHTML += '<input type="hidden" name="lastElem" value="'+ obj.id +'"/>';
	}
	
	
	function openDetails(idKey,idValue,selLoc) {
		var title = "";
		var pURL = "/dizk/details.htm?idKey="+idKey;

		if( idValue == null || idValue == undefined )
			var pURL = "/dizk/details.htm?idKey="+idKey+"&selectedLocale="+selLoc;
		else
			var pURL = "/dizk/details.htm?idKey="+idKey+"&idValue="+idValue+"&selectedLocale="+selLoc;
		var x = window.open( pURL,"detailsWin","width=700,height=550,scrollbars=yes,resizable=yes");
		if (x!=null) x.focus();
	}

	function openHelp(filename) {
		var posX = screen.availWidth - 520;
		var posY = 10;
		
		var x = window.open(filename,"helpWin","width=500,height=550,scrollbars=yes,resizeable=no,left="+posX+",top="+posY);
		if (x!=null) x.focus();
	}	
	
	function openRecommend(urlOne,urlTwo) {
		var x = window.open(urlOne+"?url="+urlTwo,"RecommWin","width=460,height=380,scrollbars=yes");
		if (x!=null) x.focus();
	}

	function openPMDetails(atag) {
		var title = (atag!=null && atag.innerHTML.length>0)? atag.innerHTML : "Titel%20unbekannt";
		var x = window.open("projektmarkt_popup.php?who="+title,"detailsWin","width=700,height=550,scrollbars=yes,resizable=yes");
		if (x!=null) x.focus();
	}

	function printCurrentPage( contentID , headlineID, selectedLocale ){
		var windowURI =  '/printwindow.html' + '?contentID='+contentID+'&headlineID='+headlineID+'&selectedLocale='+selectedLocale;
		var win = window.open( windowURI, 'printWindow', 'width=640,height=400,toolbar=no, menubar=yes, status=no, scrollbars=yes');
		win.focus();
	}

