"use strict";if(!window){throw new Error('No object "window" found, maybe non browser environment?')}else{if(window.webma){throw new Error('Object "webma" already defined')}}var webma={};webma.analytics={};webma.dojo={};webma.sitesearch={};webma.util={};webma.widgets={};webma.analytics.links=(function(){var A,D,C=document.getElementsByTagName("a"),B=[],E=/\btrack\b/;if(typeof pageTracker==="undefined"){return B}for(D=0;D<C.length;D++){A=C[D].className||"";if(C[D].href&&E.test(A)){B[B.length]=C[D]}}return B}());webma.analytics.getLinks=function(B){if(!B){return this}var C,A=this.links.length,D=new RegExp("\\b"+B+"\\b"),E=Object.create(webma.analytics);E.links=[];for(C=0;C<A;C++){if(D.test(this.links[C].className)){E.links[E.links.length]=this.links[C]}}return E};webma.analytics.trackLinks=function(C){var B,A=this.links.length;for(B=0;B<A;B++){webma.util.addEvent(this.links[B],"click",function(D){return function(E){C(D)}}(this.links[B].href))}return this};webma.analytics.trackPdfs=function(){return webma.analytics.getLinks("pdf").trackLinks(function(A){pageTracker._trackEvent("Downloads","PDF",A)})};webma.analytics.trackEmails=function(){return webma.analytics.getLinks("email").trackLinks(function(A){pageTracker._trackEvent("Exit","Email",A.replace(/mailto:/,""))})};webma.util.productionize=(function(){var A=/(\.wma$)|(^tesz?t)/,C=/wmaDebugMode/,D=A.test(window.location.host)||C.test(window.location.hash),B=function(E){};if(D===true){return function(E){return function(){return E.apply(this,arguments)}}}else{return function(E){return function(){try{return E.apply(this,arguments)}catch(F){B(F.message)}}}}}());webma.util.filter_maker=function(B,A){return function(){var D=0,C=B.value.length;while(B.value[D]&&B.value[D].match(new RegExp(A[D]))){D+=1}if(D!=C){B.value=B.value.substring(0,D)}}};webma.util.addEvent=window.addEvent||function(C,B,A){if(C.addEventListener){C.addEventListener(B,A,false);return true}else{if(C.attachEvent){return C.attachEvent("on"+B,A)}}return false};if(typeof Object.create!=="function"){Object.create=function(B){var A=function(){};A.prototype=B;return new A()}}webma.util.highlightParentMenu=function(){var F,B,A,D,C=document.getElementsByTagName("li"),E=/sdoc/i;for(D=0;D<C.length;D++){A=C[D].className||"";if(E.test(A)){F=C[D]}}if(F){B=F.parentNode.parentNode;if(B.nodeName==="LI"){B.className="sdoc"}}};webma.util.openExternalLinksInBlank=function(){var A,C,B=document.getElementsByTagName("a"),D=/\bexternal\b/i;for(C=0;C<B.length;C++){A=B[C].rel||"";if(D.test(A)){B[C].target="_blank"}}};webma.util.hashManager=function(C,A){var B="";window.setInterval(function(){if(B!==window.location.hash){B=window.location.hash;C.apply(A)}},100)};webma.sitesearch=(function(){var A=function(F){var G=document.getElementById("content"),L,C="utf",J,K,B,D;F=F||window.event;if(F.preventDefault){F.preventDefault()}B=F.srcElement||F.target;if(B.elements){K=B.elements[0]}else{K=document.getElementById(B.id.replace("button","field"))}if(K.value===""){return false}L=K.id.split(/-/).pop();G.innerHTML='<p><img src="/images/data/loading.gif" alt="" /></p>';scrollTo(0,0);try{J=new XMLHttpRequest()}catch(I){try{J=new ActiveXObject("Microsoft.XMLHTTP")}catch(H){}}try{D=window.location.protocol+"//"+window.location.host+"/images/data/search.php?encoding="+C+"&keyword="+encodeURIComponent(K.value.toLowerCase())+"&idb="+L+".idb";J.open("GET",D);J.onreadystatechange=function(){if(J.readyState==4){if((J.status===200)||(J.status===0)){G.innerHTML=J.responseText}return true}return true};J.send(null);if(typeof pageTracker!=="undefined"){pageTracker._trackPageview("/sitesearch/?q="+K.value);pageTracker._setVar("sitesearch")}}catch(E){}return false};return function(){var G,H=document.location.hash,D,C=document.getElementsByTagName("form"),F,B=C.length,E=/\bwebma-search\b/;for(D=0;D<B;D++){G=C[D];if(E.test(G.className)){webma.util.addEvent(G,"submit",A);webma.util.addEvent(G.elements.item(1),"click",A)}}if(H.indexOf("sitesearch")>0){if(H.indexOf("utm_source")&&typeof pageTracker!=="undefined"){pageTracker._setAllowAnchor(true)}G=C[0];F=H.match(/sitesearch=([^&]+)/);if(typeof F!=="undefined"){F=decodeURIComponent(F[1]);G.elements[0].value=F;G.elements[1].click()}else{throw new Error("webma.sitesearch(): no external keyword given, "+H)}}}}());webma.sitesearch=webma.util.productionize(webma.sitesearch);webma.dojo.loadLightbox=function(){if(typeof dojo==="undefined"){throw new Error("webma.dojo.loadLightbox(): Dojo is not loaded")}else{try{dojo.require("dojox.image.Lightbox")}catch(E){throw new Error("webma.dojo.loadLightbox(): "+E.message())}}var D,G,C=document.getElementsByTagName("A"),A=C.length,H,F=/\blightbox/,B=/\blightbox\[(.*?)\]/;for(D=0;D<A;D++){G=C[D];if(F.test(G.rel)){G.setAttribute("dojoType","dojox.image.Lightbox");H=G.rel.match(B);if(H){G.setAttribute("group",H[1])}}}dojo.addOnLoad(function(){dojo.parser.parse()})};webma.dojo.loadLightbox=webma.util.productionize(webma.dojo.loadLightbox);webma.widgets.blogWidget=function(B,A,G){if(!B){return }var D,E=G||3;var F=function(M,N){return M.contentSnippet};var H=function(){if(C){var M=new google.feeds.Feed(A);M.setResultFormat(google.feeds.Feed.MIXED_FORMAT);M.setNumEntries(E);M.load(L)}else{window.setTimeout(H,100)}};var L=function(Y){if(typeof Y.error!=="undefined"){throw new Error("webma.widgets.blogWidget::createWidget(): "+Y.error.message)}if(!Y.feed||!Y.feed.entries){throw new Error("webma.widgets.blogWidget::createWidget(): no feed item returned")}var T,N,O,M,V,P,W=google.feeds.getElementsByTagNameNS(Y.xmlDocument,"http://www.w3.org/2005/Atom","entry"),X,R,Q,S=Y.feed.entries.length,U;for(R=0;R<S;R++){V=Y.feed.entries[R];M=document.createElement("div");B.appendChild(M);U=document.createElement("a");U.appendChild(document.createTextNode(V.title));U.href=V.link;U.setAttribute("rel","external");X=document.createElement("h3");X.appendChild(U);M.appendChild(X);O=document.createElement("p");O.className="date";O.innerHTML=(function(a){var c=new Date(a),b=c.getMonth()+1,Z=c.getDate();if(b<10){b="0"+b}if(Z<10){Z="0"+Z}return c.getFullYear()+"."+b+"."+Z+"."}(V.publishedDate));M.appendChild(O);P=W[R];for(Q=0;R<P.childNodes.length;Q++){if(P.childNodes[Q].nodeName==="content"){T=P.childNodes[Q].firstChild.data;break}}if(!T){throw new Error("No content found in feed")}N=document.createElement("p");N.className="post";N.innerHTML=F(V,T);M.appendChild(N)}};L=webma.util.productionize(L);var I=function(M){F=M};var J=function(M){D=M};var K=function(N,O){var M;if(!D){throw new Error("No snippet delimiter defined")}M=O.split(D);if(M.length>0){M="<em>"+M[0].replace(/<[^>]*>/g,"")+"&hellip;</em>"}return M};var C=(function(){if(typeof google==="undefined"){throw new Error('Module "google" not loaded, maybe missing API call?')}if(typeof google.feeds==="undefined"){google.load("feeds","1");google.setOnLoadCallback(function(){C=true;return false});return false}return true}());return{getContainer:function(){return B},getUrl:function(){return A},getNumber:function(){return E},setSnippetFn:I,setSnippetDelimiter:J,showSnippetUntilDelimiter:K,showWidget:H}};webma.widgets.frameWidget=function(B){var A={};A.frame=B;A.adjustHeight=function(){A.frame.style.height=A.frame.contentWindow.document.body.scrollHeight+"px"};return A};webma.widgets.TocWidget=function(C,B,F){if(!C||!B){return }var D=B.getElementsByTagName("div"),E,A=D.length,G=/\bchapter\b/;this.chapters=[];this.controller=C.getElementsByTagName("a");for(E=0;E<A;E++){if(G.test(D[E].className)){D[E].style.display="none";this.chapters[this.chapters.length]=D[E]}}webma.util.hashManager(this.displayChapterByHash,this);if(F===true){this.enableAutoLinking()}};webma.widgets.TocWidget.prototype.displayChapterByHash=function(){var F=window.location.hash.replace(/#/,""),E=document.getElementById(F),C,A=this.controller.length,B=this.controller,D=new RegExp("#"+F+"$");for(C=0;C<A;C++){if(D.test(B[C].href)){this.toggleChapter(C);if(typeof E.scrollIntoView!=="undefined"){E.scrollIntoView(true)}else{window.scrollTo(0,0)}break}}};webma.widgets.TocWidget.prototype.enableAutoLinking=function(){var C,A=this.controller.length,B=this.controller,D=this;for(C=0;C<A;C++){B[C].onclick=(function(E){return function(F){D.toggleChapter(E)}}(C))}};webma.widgets.TocWidget.prototype.toggleChapter=function(C){var B,A=this.chapters.length;for(B=0;B<A;B++){if(C===B){this.chapters[B].style.display="block"}else{this.chapters[B].style.display="none"}}}
