var windowopen = false;function open_window(url,width,height,scroll){if (windowopen) {if (hwin.closed) {hwin = window.open(url,"popup","alwaysRaised=yes,resizable=yes,scrollbars=no,width=" + width + ",height=" + height +","+ scroll);} else {hwin.location.href = url;hwin.resizeTo(width,height);hwin.focus();}} else {hwin = window.open(url,"popup","alwaysRaised=yes,resizable=yes,scrollbars=no,width=" + width + ",height=" + height +","+ scroll);windowopen = true;}}function close_window(){if (windowopen) {if (!hwin.closed)hwin.close();}}// create img tagfunction writeimage(picturename){document.write('<img src="' + imgpath + picturename + '" alt="" border="">')}// create img tag with title attributefunction writeimageTitle(picturename, titlename){document.write('<img src="' + imgpath + picturename + '" title="' + titlename + '" border="">')}// create img tag, set style in tagfunction writeimagestyle(picturename, style){document.write('<img src="' + imgpath + picturename + '" alt="" border="" ' + style + '>')}// form image submit buttonfunction writesubmitimage(picturename){   var onclickaction = 'submit()';   writesubmitimage2(picturename, onclickaction);}// form image submit button, with possibility to define onclick actionfunction writesubmitimage2(picturename, onclickaction){   document.write('<input type="image" src="' + imgpath + picturename + '" alt="" border="" OnClick="' + onclickaction +'">')}// ceate a link to a mediendb documentfunction writemediendblink(file, linktext){document.write('<a href="' + imgpath + file + '" alt="" target="_top">' + linktext + '</a>')}function getFileType(sFileName){		if(sFileName.indexOf(".") == -1){		return "";	}	var arrayFileType = new Array()	arrayFileType = sFileName.split(".")		if(arrayFileType.length > 0){		return arrayFileType[1].toUpperCase()	}else{		return ""	}}// creates a link to the Media DB, with AJAX calls to get the newest file attributesvar iUniqueId = 0function writeMediaLink(sText, sId, sFileName, sTarget, sDefaultSize, sDefaultDate,sHidden){	sFileType = getFileType(sFileName)		sUrl = basepathmedien + "fFileInfo?readform";	//from the contextId, the id for the <a> and <spans> are generated	sContextId = sId + sFileName + iUniqueId;	sParams = "id=" + sId + 		"&filename=" + sFileName +		"&contextid=" + sContextId;	var ajaxRequest = new Ajax.Request(sUrl,{method:'get',parameters:sParams,asynchronous: true,onComplete:showResponse});	sSizePart = ' (' + sFileType + ' ' + '<span id="container_' + sContextId + '">' + sDefaultSize + '</span>)'	sDefaultTitle = sDefaultSize + " / " + sDefaultDate	if(sHidden == "hidden") {		var tmpImgpath = imgpath.replace(/img/, "hid");	} else {		var tmpImgpath = imgpath;	}		//sLink = imgpath + sId + "/$file/" + sFileName;	sLink = tmpImgpath + sId + "/$file/" + sFileName; 		//write the <a> with the according ids	document.write('<a id="link_' + sContextId + '" href="' + sLink + '" title="' + sDefaultTitle + '" target=' + sTarget + '>' + sText + sSizePart + '</a>')			//increment the unique id with 1	iUniqueId += 1}function showResponse(xmlHttpRequest, responseHeader) {    // Process HTTP response	eval(xmlHttpRequest.responseText)	if(sSize==null||sSize==""){		return;	}		sLinkId = "link_" + sContextLink	sContainerId = "container_" + sContextLink	oLink = document.getElementById(sLinkId)	oContainer = document.getElementById(sContainerId)	oLink.setAttribute("title", sSize + " / " + sDate)	oContainer.innerHTML = sSize;}// ceate a link to a mediendb document - open link in a new windowfunction writemediendblink_newwindow(file, linktext, titleattributetext){document.write('<a href="' + imgpath + file + '" title="' + titleattributetext + '" target="_blank">' + linktext + '</a>');}// get link from string ANYLINK#LANGUAGEfunction getlinkfromstr(strText){intLangpos = strText.indexOf("#");if (intLangpos > 0) {return strText.substr(0,intLangpos);} else {return strText;}}// get language from string ANYSTRING#LANGUAGEfunction getlangfromstr(strText){intLangpos = strText.indexOf("#");if (intLangpos > 0) {return strText.substr(intLangpos + 1,2);} else {return "DE";}}// create text linkfunction writelink(linkid,linktext){document.write('<a href="' + basepath + 'PageID/' + linkid + '"  target="_top">' + linktext + '</a>')}// create image linkfunction writeimagelink(linkid,imagename){document.write('<ahref="' + basepath + 'PageID/' + linkid + '"  target="_top"><img src="' + imgpath + picturename + '" alt="" border=""></a>')}// create text linkfunction writefilelink(linkid,linktext,titleattributetext){   var titleattribute = '';   // add title attribute if the titleattribute text is set   if (titleattributetext != undefined && titleattributetext != '') {	titleattribute = ' title="' + titleattributetext + '" ';   } document.write('<a href="<Computed Value>' + '/' + linkid + '" target="_blank"' + titleattribute + ' >' + linktext + '</a>');}// create form linkfunction writeformlink(formid,linktext){var strFormLink;var strFormLanguage;strFormLink = getlinkfromstr(formid);strFormLanguage = getlangfromstr(formid);document.write('<a href="' + basepathformulare + strFormLink + '?ReadForm' + '&language=' + strFormLanguage + '"  target="_top">' + linktext + '</a>')}//---- Cookiefunction Bibliothek -----function Get_Cookie(name) {    var start = document.cookie.indexOf(name+"=");    var len = start+name.length+1;    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;    if (start == -1) return null;    var end = document.cookie.indexOf(";",len);    if (end == -1) end = document.cookie.length;    return unescape(document.cookie.substring(len,end));}function Set_Cookie(name,value) {    document.cookie = name + "=" +escape(value) + ";path=/;";}function submitSearch(oForm){	if (oForm.searchString.value==""){ 		return false;	}else{		return true;	}}function SetCookie (name,value) {  var separator = "; ";  var now = new Date();  var expires_org = new Date(now.getTime() + (1000*60*60*24*1));  var expires = new Date(now.getTime() + (1000*60*60*24*1));  var path = '/';  var cookievalue = name + "=" + escape(value) + separator +  ((expires) ? "expires=" + expires.toGMTString() : "") + separator +  ((path) ? "path=" + path : "") + separator;  document.cookie = cookievalue;  if(!document.cookie) {    //alert(":-(");  }}function openGame() {	openWindow('http://gewinnspiel.llb.li', 'Gewinnspiel', 800, 560);}function openPostcard()  {	parent.location.href = 'http://postkarte.llb.li';}function openPostcard_en()  {	parent.location.href = 'http://postcard.llb.li';}/** * Open a window with the given size and position */function openWindow(sURL, sName, iW, iH, bLeft) {    var winTop = 50;    var lPos = winTop;        var wstyle  = 'width='+ iW +',';        wstyle += 'height=' + iH +',';        wstyle += 'resizable=yes,';        wstyle += 'scrollbars=yes,menubar=no,toolbar=no,directories=no,';        wstyle += 'location=no,status=no';    if (navigator.appVersion.charAt(0) >=4) {        if (bLeft) lPos = screen.width-winTop-iW;        wstyle += ',left='+ lPos +',top='+ winTop;    }    // show the window    var winDetail = window.open(sURL, sName, wstyle);    winDetail.focus();        // move to the right upper corner    if (navigator.appVersion.charAt(0) >=4) {        // IE 6 gives an "access denied" on this        // on local URL (file://....)        try {            winDetail.resizeTo(iW, iH);            winDetail.moveTo(lPos, winTop);        }        catch (e) { /* who cares */ }    }}function right(str, n){    if (n <= 0)       return "";    else if (n > String(str).length)       return str;    else {       var iLen = String(str).length;       return String(str).substring(iLen, iLen - n);    }}function mail(n) {	// @llb.li	var pre = "&#64;&#108;&#108;&#98;&#46;&#108;&#105;";	if(n == "") {		n = "webmaster";	}  	document.write('<a href=\"mailto:'+n+pre+'\" onFocus=\"if(this.blur)this.blur()\";>'+n+pre+'</a>');}