function L7Namespace(){this.gibLaut=function(nachricht){window.alert(nachricht);}
this.changeImgSrc=function(element,newsrc){element=$(element);element.src=newsrc;}
this.toggleBlindElement=function(element){blind_target=$(element);if(blind_target.style.display){new Effect.BlindDown(blind_target,{duration:0.25});}else{new Effect.BlindUp(blind_target,{duration:0.25});}}
this.showFulltextBox=function(){box=$("intro-fulltext-box");if(box.style.display=="none"){new Effect.BlindDown(box,{duration:0.50});}}
this.hideFulltextBox=function(){box=$("intro-fulltext-box");new Effect.BlindUp(box,{duration:0.50});}
this.showSearchBox=function(){box=$("search-container");show_button=$("bt-show-search");hide_button=$("bt-hide-search");new Effect.BlindDown(box,{duration:0.50});show_button.style.display="none";hide_button.style.display="block";}
this.hideSearchBox=function(){box=$("search-container");show_button=$("bt-show-search");hide_button=$("bt-hide-search");new Effect.BlindUp(box,{duration:0.50});show_button.style.display="block";hide_button.style.display="none";}
this.showAllObjects=function(){button_alle=$("bt-alle-objekte");button_freie=$("bt-freie-objekte");results_alle=$("result-box-alle");results_freie=$("result-box-freie");if(results_alle.style.display="none"){button_alle.className="image-replacement alle-objekte-aktiv";button_freie.className="image-replacement freie-objekte-inaktiv";results_alle.style.display="block";results_freie.style.display="none";}}
this.showFreeObjects=function(){button_alle=$("bt-alle-objekte");button_freie=$("bt-freie-objekte");results_alle=$("result-box-alle");results_freie=$("result-box-freie");if(results_freie.style.display="none"){button_alle.className="image-replacement alle-objekte-inaktiv";button_freie.className="image-replacement freie-objekte-aktiv";results_alle.style.display="none";results_freie.style.display="block";}}
this.changeBoxStatus=function(element){op_target=$(element);if(op_target){if(op_target.style.display!="none"){new Effect.BlindUp(op_target,{duration:0.25});}}}
this.blindUp=function(element){blind_target=$(element);if(blind_target.style.display!="none"){new Effect.BlindUp(blind_target,{duration:0.25});}}
this.blindDown=function(element){blind_target=$(element);if(blind_target.style.display!="block"){new Effect.BlindDown(blind_target,{duration:0.25});}}
this.showTab=function(tab){var panel=$(tab);panel.style.display="block";}
this.hideTab=function(tab){var panel=$(tab);panel.style.display="none";}
this.req="";this.XHRCall=function(url){lineacore.req=false;if(window.XMLHttpRequest&&!(window.ActiveXObject)){try{lineacore.req=new XMLHttpRequest();}catch(e){lineacore.req=false;}}else if(window.ActiveXObject){try{lineacore.req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{lineacore.req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){lineacore.req=false;}}}
if(lineacore.req){lineacore.req.onreadystatechange=lineacore.processReqChange;lineacore.req.open("GET",url,true);lineacore.req.send("");}}
this.showAlert=function(){var alert_background=$('alert-background');var alert_container=$('alert-container');alert_background.style.display="block";alert_container.style.display="block";}
this.closeAlert=function(){var alert_background=$('alert-background');var alert_container=$('alert-container');alert_background.style.display="none";alert_container.style.display="none";}
this.processReqChange=function(){var alertDate=$('alert-date');var alertText=$('alert-text');var weiterclick=$('weiter-click');var closeclick=$('close-click');var myXHRFeedback;if(lineacore.req.readyState==4){myXHRFeddback=lineacore.req.responseText;if(myXHRFeedback=="yes"){alertDate.innerHTML="irgendein Datum";alertText.innerHTML="dieses Objekt ist frei";closeclick.style.display="none";weiterclick.style.display="block";lineacore.showAlert();}else{alertDate.innerHTML="irgendein Datum";alertText.innerHTML="dieses Objekt ist NICHT frei";weiterclick.style.display="none";closeclick.style.display="block";lineacore.showAlert();}
if(lineacore.req.status==200){}else{alert("There was a problem retrieving the XML data:\n"+
lineacore.req.statusText);}}}
this.checkFreiGebucht=function(objectID,vonDate,bisDate){var myObjectID=objectID;var myVonDate=vonDate;var myBisDate=bisDate;lineacore.XHRCall('frei_gebucht-XHR.php?id='+myObjectID+'&von='+myVonDate+'&bis='+myBisDate);}
this.updateInnerHTML=function(elementID,neuerInhalt){$(elementID).innerHTML=neuerInhalt;}
this.appendToAttribute=function(elementID,attributName,neuerInhalt){$(elementID).attributName=$(elementID).attributName+neuerInhalt;}
this.showElement=function(elementID){$(elementID).style.display="block";}
this.hideElement=function(elementID){$(elementID).style.display="none";}
this.onFocusValue=function(id,value)
{var e=$(id);if(e.value==value)e.value="";}
this.onBlurValue=function(id,value)
{var e=$(id);if(e.value=="")e.value=value;}}
var lineacore=new L7Namespace;function resizeContainer(div_id,div_height)
{var div=document.getElementById(div_id);if(div.offsetHeight<div_height){var h=div.offsetHeight+15;if(h<div_height){div.style.height=h+'px';window.setTimeout("resizeContainer('"+div_id+"',"+div_height+");",5);}else{div.style.height=div_height+'px';}}else if(div.offsetHeight>div_height){var h=div.offsetHeight-15;if(h>div_height){div.style.height=h+'px';window.setTimeout("resizeContainer('"+div_id+"',"+div_height+");",5);}else{div.style.height=div_height+'px';}}}
function hide_popup(){var popup_box=document.getElementById("popup_box");var popup_background=document.getElementById("popup_background");popup_box.style.display="none";popup_background.style.display="none";popup_box.style.top="0px";popup_box.style.left="0px";popup_background.style.top="0px";popup_background.style.left="0px";popup_box.style.width="0px";popup_box.style.height="0px";popup_background.style.width="0px";popup_background.style.height="0px";window.onscroll="";window.onresize="";}
function show_popup(url,width,height){var popup_box=document.getElementById("popup_box");var popup_background=document.getElementById("popup_background");popup_box.style.width=width+"px";popup_box.style.height=height+"px";var screen_size=new getPageSize();popup_background.style.width=screen_size.width+"px";popup_background.style.height=screen_size.height+"px";popup_background.style.opacity=".2";popup_background.style.filter='alpha(opacity='+'20'+')';popup_box.style.display="block";popup_background.style.display="block";maintPos();docClickLoader.loadInto(url,'popup_content');window.onscroll=maintPos;window.onresize=maintPos;}
posToCenter=function(elem){var scrollPos=new getScrollPos();var pageSize=new getPageSize();var emSize=new getElementSize(elem);var x=Math.round(pageSize.width/2)-(emSize.width/2)+scrollPos.scrollX;var y=Math.round(pageSize.height/2)-(emSize.height/2)+scrollPos.scrollY;elem.style.left=x+'px';elem.style.top=y+'px';}
getScrollPos=function(){var docElem=document.documentElement;this.scrollX=self.pageXOffset||(docElem&&docElem.scrollLeft)||document.body.scrollLeft;this.scrollY=self.pageYOffset||(docElem&&docElem.scrollTop)||document.body.scrollTop;}
getPageSize=function(){var docElem=document.documentElement
this.width=self.innerWidth||(docElem&&docElem.clientWidth)||document.body.clientWidth;this.height=self.innerHeight||(docElem&&docElem.clientHeight)||document.body.clientHeight;}
getElementSize=function(elem){this.width=elem.offsetWidth||elem.style.pixelWidth;this.height=elem.offsetHeight||elem.style.pixelHeight;}
maintPos=function(){var popup_box=document.getElementById("popup_box");posToCenter(popup_box);var popup_background=document.getElementById('popup_background');var pagesize=new getPageSize();var scrollPos=new getScrollPos();var ua=navigator.userAgent;if(ua.indexOf("MSIE ")!=-1){popup_background.style.width=pagesize.width+'px';}
else{popup_background.style.width=pagesize.width+'px';}
if(ua.indexOf("Opera/9")!=-1){popup_background.style.height=document.body.scrollHeight+'px';}
else{popup_background.style.height=pagesize.height+scrollPos.scrollY+'px';}}
