var requestObject=null;
var onStateChangeFunction=null;
var Ajax={initialized:false,requests:0,getRequestObject:function(){http_request=null;
if(window.XMLHttpRequest){http_request=new XMLHttpRequest();
if(http_request.overrideMimeType){http_request.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP")
}catch(A){try{http_request=new ActiveXObject("Microsoft.XMLHTTP")
}catch(A){}}}}return http_request||false
},setOptions:function(A){this.method=A.method||this.method;
this.asynchronous=A.asynchronous||this.asynchronous;
this.contentType=A.contentType||this.contentType;
this.encoding=A.encoding||this.encoding;
if(typeof (A.parameters)=="object"){this.parameters="?";
for(var B in A.parameters){if(typeof (A.parameters[B])=="string"){this.parameters+=B+"="+A.parameters[B]+"&"
}}this.parameters=this.parameters.substring(0,(this.parameters.length-1))
}else{if(typeof (A.parameters)=="string"){this.parameters="?"+A.parameters
}else{this.parameters=""
}}},_initialize:function(){if(!this.initialized){this.method="get";
this.asynchronous=true;
this.contentType="application/x-www-form-urlencoded";
this.encoding="UTF-8";
this.parameters="";
this.initialized=true
}},request:function(C,A,B){if(typeof (C)!="string"||C==""){return false
}requestObject=this.getRequestObject();
if(!requestObject){return false
}onStateChangeFunction=function(){if(requestObject.readyState==4){A(requestObject.responseText)
}};
if(B){this.setOptions(B)
}if(this.parameters!=""){C+=this.parameters
}try{requestObject.open(this.method.toUpperCase(),C,this.asynchronous);
requestObject.onreadystatechange=onStateChangeFunction;
this.setRequestHeaders();
requestObject.send(null)
}catch(D){return false
}this.requests++
},setRequestHeaders:function(){var B={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){B["Content-type"]=this.contentType+(this.encoding?"; charset="+this.encoding:"");
if(requestObject.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){B.Connection="close"
}}for(var A in B){requestObject.setRequestHeader(A,B[A])
}}};
Ajax._initialize();
var stopFormSending=false;
function sendForm(){if(stopFormSending){stopFormSending=false;
return false
}return true
}function AutoSuggestControl(B,A){this.cur=-1;
this.layer=null;
this.provider=A;
this.textbox=B;
this.init()
}AutoSuggestControl.prototype.autosuggest=function(B,A){if(B.length>0){if(A){this.typeAhead(B[0])
}this.showSuggestions(B);
this.textbox.style.color="#000"
}else{this.textbox.style.color="#F00";
this.hideSuggestions()
}};
AutoSuggestControl.prototype.createDropDown=function(){var A=this;
this.layer=document.createElement("div");
this.layer.className="suggestions";
this.layer.style.visibility="hidden";
this.layer.style.width=this.textbox.offsetWidth;
this.layer.onmousedown=this.layer.onmouseup=this.layer.onmouseover=function(B){B=B||window.event;
oTarget=B.target||B.srcElement;
if(B.type=="mousedown"){A.textbox.value=oTarget.firstChild.nodeValue;
A.hideSuggestions()
}else{if(B.type=="mouseover"){A.highlightSuggestion(oTarget)
}else{A.textbox.focus()
}}};
document.body.appendChild(this.layer)
};
AutoSuggestControl.prototype.getLeft=function(){var B=this.textbox;
var A=0;
while(B.tagName!="BODY"&&B.tagName!="HTML"){A+=B.offsetLeft;
B=B.offsetParent
}return A
};
AutoSuggestControl.prototype.getTop=function(){var B=this.textbox;
var A=0;
while(B.tagName!="BODY"&&B.tagName!="HTML"){A+=B.offsetTop;
B=B.offsetParent
}return A
};
AutoSuggestControl.prototype.handleKeyDown=function(A){if(A.keyCode==13||A.keyCode==38||A.keyCode==40){switch(A.keyCode){case 38:this.previousSuggestion();
break;
case 40:this.nextSuggestion();
break;
case 13:if(this.layer.style.visibility=="visible"){stopFormSending=true
}this.hideSuggestions();
break
}}};
AutoSuggestControl.prototype.handleKeyUp=function(A){var B=A.keyCode;
if(B==8||B==46){this.provider.requestSuggestions(this,false)
}else{if(B<32||(B>=33&&B<46)||(B>=112&&B<=123)){}else{this.provider.requestSuggestions(this,true)
}}};
AutoSuggestControl.prototype.hideSuggestions=function(){this.layer.style.visibility="hidden";
this.afterHideSuggestions()
};
AutoSuggestControl.prototype.highlightSuggestion=function(A){for(var B=0;
B<this.layer.childNodes.length;
B++){var C=this.layer.childNodes[B];
if(C==A){C.className="current"
}else{if(C.className=="current"){C.className=""
}}}};
AutoSuggestControl.prototype.init=function(){var A=this;
this.textbox.onkeyup=function(B){if(!B){B=window.event
}A.handleKeyUp(B)
};
this.textbox.onkeydown=function(B){if(!B){B=window.event
}A.handleKeyDown(B)
};
this.textbox.onblur=function(){A.hideSuggestions()
};
this.createDropDown()
};
AutoSuggestControl.prototype.nextSuggestion=function(){var B=this.layer.childNodes;
if(B.length>0&&this.cur<B.length-1){var A=B[++this.cur];
this.highlightSuggestion(A);
this.textbox.value=A.firstChild.nodeValue
}};
AutoSuggestControl.prototype.previousSuggestion=function(){var B=this.layer.childNodes;
if(B.length>0&&this.cur>0){var A=B[--this.cur];
this.highlightSuggestion(A);
this.textbox.value=A.firstChild.nodeValue
}};
AutoSuggestControl.prototype.selectRange=function(A,B){if(this.textbox.createTextRange){var C=this.textbox.createTextRange();
C.moveStart("character",A);
C.moveEnd("character",B-this.textbox.value.length);
C.select()
}else{if(this.textbox.setSelectionRange){this.textbox.setSelectionRange(A,B)
}}this.textbox.focus()
};
AutoSuggestControl.prototype.showSuggestions=function(C){var A=null;
this.layer.innerHTML="";
for(var B=0;
B<C.length;
B++){A=document.createElement("div");
A.appendChild(document.createTextNode(C[B]));
this.layer.appendChild(A)
}this.layer.style.left=this.getLeft()+"px";
this.layer.style.top=(this.getTop()+this.textbox.offsetHeight)+"px";
this.layer.style.visibility="visible";
if(C.length>0){this.textbox.style.color="#000"
}};
AutoSuggestControl.prototype.typeAhead=function(B){if(this.textbox.createTextRange||this.textbox.setSelectionRange){var A=this.textbox.value.length;
this.textbox.value=B;
this.selectRange(A,B.length)
}};
AutoSuggestControl.prototype.afterHideSuggestions=function(){};
var font_size=13;
var tooltip_manager={actualElement:null,actualElementPosX:null,actualElementPosY:null,div:null,overLinkElement:false,overDivElement:false,timer:null,isCalledHideDiv:null};
function toggle_box(B,A){if(A==""||A==undefined){return true
}if(document.getElementById("box_"+B).className=="click_open"){document.getElementById("box_"+B).className="click_close";
document.getElementById("img_"+B).src=A+"expand.gif";
return false
}else{document.getElementById("box_"+B).className="click_open";
document.getElementById("img_"+B).src=A+"collapse.gif";
return false
}}function show_layer(A){document.getElementById(A).style.display="block"
}function hide_layer(A){document.getElementById(A).style.display="none"
}function toggle_layer(A){str=document.getElementById(A).style.display;
if(str==""){str="none"
}if(str=="none"){show_layer(A)
}else{hide_layer(A)
}}function toggle_functions_box(F){var B="mehr..";
var A="weniger..";
var D=document.getElementById("link_"+F);
var C=document.getElementById("linkbox_"+F);
if(!D||!C){return false
}if(D.firstChild.data==B){for(var E=C.firstChild;
E!=null;
E=E.nextSibling){if(E.className=="moreless"){E.firstChild.data=A;
show_layer("box_"+F)
}}}else{if(D.firstChild.data==A){for(var E=C.firstChild;
E!=null;
E=E.nextSibling){if(E.className=="moreless"){E.firstChild.data=B;
hide_layer("box_"+F)
}}}}}function clear_loading(){if(document.schnellsuche){document.schnellsuche.searchTerm.className=""
}}function toggle_loading(A){document.schnellsuche.searchTerm.className="loading_suche";
return true
}function change_font_size(A){change_factor=1;
if(A=="+"&&font_size<=17){font_size=font_size+change_factor
}else{if(A=="-"){font_size=font_size-change_factor
}else{if(A=="1"){font_size=13
}}}document.body.style.fontSize=font_size+"px"
}function cursor_sandclock_activate(){document.body.className="cursor_show_sandclock";
return true
}function cursor_sandclock_deactivate(){document.body.className="cursor_hide_sandclock";
return true
}function ajaxLoadAutoSuggestion(B,A){this.jobID=ajaxAutosuggestionJobmanager.registerNewJob();
ajaxAutosuggestionJobmanager.setJobValue(this.jobID,"uri",B);
ajaxAutosuggestionJobmanager.setJobValue(this.jobID,"params",A)
}var ajaxAutosuggestionJobmanager={jobs:[{controller:null,typeAhead:null,params:null,uri:null,sending:false,process:1,lastSearchterm:"",registerNewProcess:function(){return ++this.process
},clone:function(){var B={};
for(var A in this){B[A]=this[A]
}return B
},getValue:function(A){return this[A]||false
},setValue:function(A,B){return this[A]=B
}}],jobCounter:0,registerNewJob:function(){this.setJob(++this.jobCounter,this.getJob(0).clone());
return this.jobCounter
},getJob:function(A){return this.jobs[A]||this.jobs[0]
},setJob:function(B,A){return this.jobs[B]=A
},setJobValue:function(C,A,B){try{return this.jobs[C][A]=B
}catch(D){return false
}},getJobValue:function(B,A){try{return this.jobs[B][A]
}catch(C){return false
}}};
ajaxLoadAutoSuggestion.prototype.requestSuggestions=function(oAutoSuggestControl,bTypeAhead,recursiveValue,forcedJobID,forcedProcessID){var timeToWait=0.5*1000;
var jobID=forcedJobID||this.jobID;
if(!jobID||jobID<=0){return false
}if(ajaxAutosuggestionJobmanager.getJobValue(jobID,"process")==1){ajaxAutosuggestionJobmanager.setJobValue(jobID,"controller",oAutoSuggestControl);
ajaxAutosuggestionJobmanager.setJobValue(jobID,"typeAhead",bTypeAhead);
ajaxAutosuggestionJobmanager.setJobValue(jobID,"sending",false)
}var processID=forcedProcessID||ajaxAutosuggestionJobmanager.getJobValue(jobID,"process");
if(!processID||processID<=0){return false
}var sTextboxValue=ajaxAutosuggestionJobmanager.getJobValue(jobID,"controller").textbox.value.toLowerCase();
if(sTextboxValue!=recursiveValue){var newProcessID=ajaxAutosuggestionJobmanager.getJob(jobID).registerNewProcess();
setTimeout("ajaxLoadAutoSuggestion.prototype.requestSuggestions(null,null,'"+sTextboxValue+"','"+jobID+"','"+newProcessID+"')",timeToWait)
}else{if(sTextboxValue!=ajaxAutosuggestionJobmanager.getJobValue(jobID,"lastSearchterm")){if((processID>=ajaxAutosuggestionJobmanager.getJobValue(jobID,"process"))&&!ajaxAutosuggestionJobmanager.getJobValue(jobID,"sending")){ajaxAutosuggestionJobmanager.getJob(jobID)["params"]["searchterm"]=sTextboxValue;
ajaxAutosuggestionJobmanager.setJobValue(jobID,"sending",true);
ajaxAutosuggestionJobmanager.setJobValue(jobID,"lastSearchterm",sTextboxValue);
Ajax.request(ajaxAutosuggestionJobmanager.getJobValue(jobID,"uri"),function(response){var aSuggestions=[];
eval("tmpArray = "+response.replace(/<!--.*-->/g,""));
for(var i in tmpArray){if(tmpArray[i].length>0){aSuggestions.push(tmpArray[i])
}}ajaxAutosuggestionJobmanager.getJob(jobID).getValue("controller").autosuggest(aSuggestions,false);
ajaxAutosuggestionJobmanager.setJobValue(jobID,"sending",false)
},{parameters:ajaxAutosuggestionJobmanager.getJobValue(jobID,"params")})
}}}};
function ajaxLoadSelectionbox(selectionbox,requestURI,params,selected,prefix){Ajax.request(requestURI,function(response){prefix=prefix||"";
eval("var tmpArray = "+response.replace(/<!--.*-->/g,""));
var newOptions={};
var counter=0;
for(var i in tmpArray){if(i.length>0){newOptions[i]=tmpArray[i];
counter++
}}selectionbox.length=1;
if(counter<=0){selectionbox.options[1]=new Option("Keine vorhanden","",true,true);
selectionbox.disabled=true;
return 
}for(var i in newOptions){selectionbox.options[selectionbox.length]=new Option(prefix+newOptions[i],i,false,(i==selected))
}selectionbox.style.display="block";
selectionbox.disabled=false
},{parameters:params})
}function decode_utf8(A){var C="";
var B=0;
var D=c1=c2=0;
while(B<A.length){D=A.charCodeAt(B);
if(D<128){C+=String.fromCharCode(D);
B++
}else{if((D>191)&&(D<224)){c2=A.charCodeAt(B+1);
C+=String.fromCharCode(((D&31)<<6)|(c2&63));
B+=2
}else{c2=A.charCodeAt(B+1);
c3=A.charCodeAt(B+2);
C+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));
B+=3
}}}return C
}jQuery(document).ready(function(){var D="";
var B="";
var C=window.location.href;
var A=C.match(/xid=([0-9,]*)/);
var E=C.match(/task=([a-z,0-9_]*)/);
if(A){B=A[1].split(",")
}if(E){D=E[1]
}if(A&&D!="chose_fliesstext"){jQuery("#link_zitierung_tooltip").tooltip("zitierungen_tooltip","zitierung");
jQuery("span.fnr").tooltip("fussnoten_tooltip","fussnote");
if(B[1]!="1"){jQuery("a.doklink").tooltip("gesetze_tooltip","gesetz")
}}});
function text_zitierung(div_id){var result=null;
var searchString=window.location.href;
var searchResult=searchString.match(/sessionID=([0-9]*).*xid=([0-9,]*)/);
var sessionId=searchResult[1];
var xid=searchResult[2];
searchResult=searchString.match(/\S+[?]/);
var url_start=searchResult[0];
var func_response=function(response){eval(response.replace(/<!--.*-->/g,""));
if(hits_count>5){var showMaxDocument=5
}else{var showMaxDocument=hits_count
}var text="<strong>1 - "+showMaxDocument+"</strong> von <strong>"+hits_count+"</strong><br/><br/>";
for(i=0;
i<zitierungen.length&&i<5;
i++){text+=(i+1)+". <a href="+url_start+"sessionID="+sessionId+"&amp;source=js_zitierung&amp;templateID=document&amp;xid="+zitierungen[i].xid+">"+zitierungen[i].title_short+"</a><br/>"
}jQuery(div_id).html(text);
jQuery(div_id).fadeIn()
};
var request_values={templateID:"ajax_load_zitierung_zu_document",activeSearchAdvFilter:"",xid:xid,expertSearch:"zitierung",sessionID:sessionId};
return jQuery.get(get_server_address(searchString),request_values,func_response)
}function text_zu_gesetz_abkuerzung(F){var I=null;
var H=tooltip_manager.actualElement.href;
var E=H.match(/sessionID=([0-9]*).*xid=([0-9,]*)/);
var D=E[1];
var B=E[2];
E=H.match(/\S+[?]/);
var G=E[0];
var A=function(J){var K=J;
var L="<a href="+G+"sessionID="+D+"&amp;source=js_law&amp;templateID=document&amp;xid="+B+">"+K+"</a><br/>";
jQuery(F).html(L);
jQuery(F).fadeIn()
};
var C={templateID:"ajax_load_information_for_gesetz",activeSearchAdvFilter:"",xid:B,sessionID:D};
return jQuery.get(get_server_address(H),C,A)
}(function(A){A.fn.extend({tooltip:function(E,C){var D=false;
E="#"+E;
var B=E.substring(1,E.length);
if(!document.getElementById(B)){insertElementIntoDOM("div",document.body,{id:B,className:B},B)
}A(this).mouseover(function(F){if(this!=tooltip_manager.actualElement&&tooltip_manager.isCalledHideDiv||null==tooltip_manager.actualElement||null==tooltip_manager.isCalledHideDiv){A(E).css({position:"absolute",top:F.pageY,left:F.pageX});
tooltip_manager.overLinkElement=true;
tooltip_manager.actualElement=this;
tooltip_manager.isCalledHideDiv=false;
tooltip_manager.timer=setTimeout("showDivFadeIn('"+E+"','"+C+"')",1000)
}}).mouseout(function(){tooltip_manager.overLinkElement=false;
setTimeout("hide_div('"+E+"')",100)
});
A(E).mouseover(function(){tooltip_manager.overDivElement=true
}).mouseout(function(){tooltip_manager.overDivElement=false;
if(D==false){setTimeout("hide_div('"+E+"')",100)
}D=false
});
A(E).children().mouseover(function(){tooltip_manager.overDivElement=true;
D=true;
A(E).show()
}).mouseout(function(){D=true;
A(E).show()
})
}})
})(jQuery);
function set_text_for_tooltip(A,B){if(A=="zitierung"){text_zitierung(B)
}else{if(A=="fussnote"){var C=jQuery(tooltip_manager.actualElement).children("sup").children("a:first").attr("href");
jQuery(B).html(jQuery(C).text());
jQuery(B).fadeIn()
}else{if(A=="gesetz"){if(null!=tooltip_manager.actualElement){text_zu_gesetz_abkuerzung(B,tooltip_manager.actualElement)
}}}}}function showDivFadeIn(B,A){set_text_for_tooltip(A,B)
}function hide_div(A){tooltip_manager.isCalledHideDiv=true;
tooltip_manager.actualElement=null;
if(!tooltip_manager.overLinkElement&&!tooltip_manager.overDivElement){if(tooltip_manager.timer!=null){clearTimeout(tooltip_manager.timer)
}jQuery(A).hide();
jQuery(A).html("")
}}get_server_address=function(A){var B=A.match(/.*[?]/);
B=B[0].substring(0,B[0].length-1);
return B
};
insertElementIntoDOM=function(F,E,D,A){var C=null,B;
C=document.createElement(F);
C.setAttribute("class",A);
if(E){E.appendChild(C)
}if(D){for(B in D){C[B]=D[B]
}}return C
};
function setSichtbar(B){var C=document.getElementById("openpath").innerHTML;
if(B==""&&C==""){B="0"
}if(B==""&&C!=""){var A=C.split(",");
for(i=0;
i<A.length;
i++){treeNode=document.getElementById(A[i]);
treeNode.style.display="block"
}}else{treeNode=document.getElementById(B);
if(treeNode.style.display=="block"){treeNode.style.display="none"
}else{treeNode.style.display="block"
}}return false
}function setSichtbarAll(){var B=document.getElementById("maxID").innerHTML;
var C=parseInt(B);
if(C>0){var A="";
for(i=0;
i<=C;
i++){A=i.toString();
treeNode=document.getElementById(A);
treeNode.style.display="block"
}}return false
}function openTreeLawDocument(A){A=A+"&templateID=document";
document.location.href=A;
return false
}function printGesetzgliederung(){setSichtbarAll();
parent.frame_tree_gesetz.focus();
parent.frame_tree_gesetz.print();
return false
}function openTreeGesetz(B,A){fTreeGesetz=window.open(B,A,"width=620,height=400,left=10,top=10,location=no,menubar=no,resizable=yes,dependent=yes,status=no,scrollbars=yes");
fTreeGesetz.focus();
return false
}if(typeof vd=="undefined"){function vd(){return true
}}if(typeof stretchSessionLifeTime=="undefined"){function stretchSessionLifeTime(){return true
}};
