(function(){if(window.XMLHttpRequest){return }var F=null,D,A=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(var C=0,B=A.length;C<B;C++){D=A[C];try{if((F=new ActiveXObject(D))){break}}catch(E){}}window.XMLHttpRequest=F?function(){return new ActiveXObject(D)}:null;F=null})();function askServer(A,C,B){_oHttp=new XMLHttpRequest();_oHttp.open("POST",A,true);_oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(B){_oHttp.onreadystatechange=function(){B(_oHttp)}}_oHttp.send(C)}function mycb(A){if(A.readyState<4){return }A=null}function yOffset(A){var B=0;if(A&&A.offsetParent){do{B+=A.offsetTop}while((A=A.offsetParent))}return B}function winHeight(){if(typeof (window.innerHeight)=="number"){return window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){return document.body.clientHeight}else{return 500}}}}function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function eraseCookie(A){createCookie(A,"",-1)}var oldRowColor;function mouseOverRow(A){oldRowColor=A.style.background;A.style.background="#ffffff"}function mouseOutRow(A){A.style.background=oldRowColor}function mouseOverTab(A){A.style.color="#000000"}function mouseOutTab(A){A.style.color="#000000"}function mouseClickTab(A,B){window.location.search="month="+B+"&menuitem=2"}function editNote(A,B){window.location.search="menuitem=2&itemid="+B+"&editnote=1"}function plantSearch(A){var B=A.value;if(B!=""){window.location.search="menuitem=3&search="+escape(B)}}function keyUp(B,A){if(A.keyCode==13){plantSearch(B)}}function advSearch(){window.location.search="menuitem=3&advsearch=1"}function newPlant(A,B){window.location.search="menuitem=3&eltid="+B+"&new=1"}function editPlant(A,B){window.location.search="menuitem=3&eltid="+B+"&edit=1"}function remPlant(A,B){if(confirm("Vil du slette dette haveelement?")){window.location.search="menuitem=3&eltid="+B+"&remove=1"}}function newItem(A,B){window.location.search="menuitem=3&eltid="+B+"&newtodo=1"}function listTodo(A,B){window.location.search="menuitem=3&eltid="+B+"&listtodo=1"}function cancelEdit(A){window.location.search="menuitem=3&eltid="+A}function editItem(A,B){window.location.search="menuitem=3&eltid="+B+"&edittodo=1"}function aqEventTarget(B){var A;if(B.target){A=B.target}else{if(B.srcElement){A=B.srcElement}}if(A.nodeType==3){A=A.parentNode}return A}function setSubCB(A){if(A.readyState<4){return }}function onEltChange(B,A){askServer("setCheckbox.php","eltid="+A+"&checked="+B.checked,setSubCB);createCookie("xrefreshlist",1,0.2)}function onSubChange(A){var C=A||window.event;var B=aqEventTarget(C);onEltChange(B,B.eltid)}function showElement(F,I){function E(O){var P={};while(O>=0){var N=[];if((O in eltlist)&&("c" in eltlist[O])){N=eltlist[O].c;for(var M in N){if(!(N[M] in P)){P[N[M]]=eltlist[N[M]]}}}P[O]={n:eltlist[O].n,l:eltlist[O].l,h:eltlist[O].h,cs:N};O=eltlist[O].p;P.roots={n:"root",cs:N}}return P}var B=E(F);var D=F;function L(N,M){if(M<0||N<0){return -1}return B[N].n.localeCompare(B[M].n)}function G(N,M){if(M<0||N<0){return -1}if(B[N].l==""&&B[M].l==""){return B[N].n.localeCompare(B[M].n)}return B[N].l.localeCompare(B[M].l)}function A(N,M){if(M<0||N<0){return -1}return B[N].h-B[M].h}function C(P,O){if(!(P in B)){return }var R=O;if(P!="roots"){R=document.createElement("DIV");R.className="c";O.appendChild(R);var S=document.createElement("LABEL");S.title="Check de planter af der skal med i din kalender";R.appendChild(S);var T=document.createElement("INPUT");T.type="checkbox";T.checked=((P in subs)&&subs[P]);T.eltid=P;T.onchange=onSubChange;S.appendChild(T);var Q=document.createElement("A");Q.className="eltlink";Q.target="_top";var V=B[P].n.replace("..","");Q.href=siteroot+"index.php/menuitem/3/v/"+V+"/eltid/"+P;Q.eltid=P;Q.title="Klik her for at få information om planten";if(D==P){Q.className="eltlink_selected";Q.id="sellink"}if(B[P].n==""){B[P].n="[blank]"}if(I=="latin"){Q.innerHTML=(B[P].l?("<em>"+B[P].l+"</em>, "):"")+B[P].n}else{if(I=="height"){if(B[P].h>0){Q.innerHTML=B[P].n+", "+B[P].h+" cm"}else{Q.innerHTML=B[P].n}}else{Q.innerHTML=B[P].n}}R.appendChild(Q)}if("cs" in B[P]){var N=document.createElement("DIV");N.className="clist";var M=B[P].cs;M.sort((I=="latin")?G:(I=="height"?A:L));for(var U=0;U<M.length;++U){if(M[U]>0){C(M[U],N)}}R.appendChild(N)}}C("roots",document.getElementById("elttree"));function K(M){if(M.readyState<4){return }window.location.reload(true)}var J=$(".eltlink,#sellink");if(J.draggable){$(".eltlink,#sellink").draggable({helper:"clone"});$(".eltlink,#sellink").droppable({tolerance:"pointer",drop:function(M,N){askServer("setCheckbox.php","eltid="+N.draggable.attr("eltid")+"&moveto="+$(this).attr("eltid"),K)}})}var H=document.getElementById("sellink");if(H&&H.offsetTop>50){window.scrollTo(0,H.offsetTop-50)}}function reloadElementList(A){var B=document.getElementById("i_iframe");if(B.contentDocument){B.contentDocument.location.reload(A)}else{var C=window.frames[0];if(C.window){C.window.location.reload(A)}}}function setButtonStyle(){$(".sortbutton").css("background-color","#ddffdd");$("#i_by"+readCookie("xsortby")+"button").css("background-color","#dddd88")}function sortByName(){createCookie("xsortby","name",1);reloadElementList(false);setButtonStyle()}function sortByLatin(){createCookie("xsortby","latin",1);reloadElementList(false);setButtonStyle()}function sortByHeight(){createCookie("xsortby","height",1);reloadElementList(false);setButtonStyle()}function editUC(B,A){window.location.search="menuitem=3&editUC="+A}function remUC(B,A){if(confirm("Er du sikker på du vil slette notatet?")){window.location.search="menuitem=3&remUC="+A}}function addToList(A,B){window.location.search="menuitem=3&addToList="+B};
