"use strict";var events={Callback:function(b,c){var a=this;this.param=c;this.func=b;this.invoke=function(d){a.func((d)?d:window.event,a.param)}},listen:function(d,c,b){var a;if(typeof d.addEventListener!="undefined"){d.addEventListener(c,b,false)}else{if(typeof d["on"+c]=="function"){a=d["on"+c];d["on"+c]=function(){a();b()}}else{d["on"+c]=b}}return true},preventDefault:function(a){if(a&&a.preventDefault){if(a.cancelable){a.preventDefault()}}if(window.event){window.event.returnValue=false}},stopPropagation:function(a){if(a&&a.stopPropagation){if(a.cancelable){a.stopPropagation()}}if(window.event){window.event.cancelBubble=true}}};var classObj={is:function(a,c){var b;b=new RegExp("(^|\\s)"+c+"(\\s|$)");return typeof a=="object"?a.className.search(b)>=0:false},add:function(a,b){if(typeof a=="object"){if(classObj.is(a,b)!=true){a.className=typeof a.className=="string"?b+" "+a.className:b}return true}else{return false}},remove:function(b,e){var a,d,c;d=new RegExp("(^|\\s)"+e+"(\\s|$)");c=/(^s+)|(s+$)/;if(typeof b=="object"){if(classObj.is(b,e)){a=b.className.replace(d,"$1$2");a=a.replace("  "," ");a=a.replace(c,"");b.className=a;return true}}return false},getElementsByTagAndClassName:function(a,d,e){var c,f,b;f=[];if(typeof a=="object"){c=a.getElementsByTagName(d);for(b=0;b<c.length;b++){if(classObj.is(c[b],e)){f.push(c[b])}}}return f}};function LoadDisplay(e){var d=this,c,b,a;this.pos=0;this.elements=new Array();this.stopme=false;this.father=createElementNS("div");for(b=0;b<5;b++){c=createElementNS("div");c.style.position="absolute";c.style.left=(b*9).toFixed()+"px";c.style.width="5px";c.style.height="5px";c.style.backgroundColor="rgb(255,255,255)";this.father.appendChild(c);this.elements.push(c)}this.father.style.position="absolute";this.father.style.top="50%";this.father.style.left="50%";this.father.style.marinTop="-2px";this.father.style.marginLeft="-20px";this.father.style.width="41px";this.father.style.height="5px";this.father.style.opacity="0";if(typeof this.father.style.webkitTransition!="undefined"){this.father.style.webkitTransition="opacity 0.5s ease-in-out"}e.appendChild(this.father);a=this.father;this._update();this.timer=setInterval(function(){d._update.call(d)},100);setTimeout(function(f){a.style.opacity="1"},0)}LoadDisplay.prototype._update=function(){var a,c,b;if(this.stopme){this.father.style.opacity="0";clearInterval(this.timer);b=this.father;setTimeout(function(d){if(b.parentNode){b.parentNode.removeChild(b)}},500)}else{for(c=0;c<this.elements.length;c++){a=(255*(0.5+Math.cos((this.pos+c)*0.5)*0.5)).toFixed(0);this.elements[c].style.backgroundColor="rgb("+a+","+a+","+a+")"}}this.pos+=1};LoadDisplay.prototype.disable=function(){this.stopme=true};var lightbox={init:function(){var b,j,o,h,m,p,n,r,f,q,l,d,a,g,c;b=document.getElementsByTagName("body");if(b.length<=0){return}else{j=b[0]}o=createElementNS("div");o.id="photo_lightbox";o.style.display="none";o.style.visibility="visible";o.style.position="fixed";o.style.top="0";o.style.left="0";o.style.width="100%";o.style.height="100%";o.style.backgroundColor="#303030";o.style.opacity="0";try{o.style.backgroundColor="rgba(0,0,0,0.8)"}catch(k){}o.style.cursor="pointer";if(typeof o.style.webkitTransition!="undefined"){o.style.webkitTransition="opacity 0.5s ease-in-out"}p=createElementNS("div");p.id="photo_lightbox_wrap";p.style.margin="-230px 0 0 -315px";p.style.width="600px";p.style.padding="15px";p.style.backgroundColor="white";p.style.position="absolute";p.style.top="50%";p.style.left="50%";m=createElementNS("img");m.id="photo_lightbox_img";m.style.width="600px";m.style.margin="0";l=createElementNS("div");l.id="photo_lightbox_links";l.style.position="absolute";l.style.top="15px";l.style.right="15px";l.style.left="15px";d=createElementNS("div");d.id="photo_lightbox_prev";classObj.add(d,"hovervisible");d.style.position="absolute";d.style.width="50%";d.style.top="0";d.style.height="100%";d.style.left="0";a=createElementNS("span");a.appendChild(document.createTextNode("<"));a.style.backgroundColor="white";a.style.position="absolute";a.style.top="10%";a.style.left="0";a.style.fontSize="2em";a.style.padding="2%";a.style.color="black";a.style.fontWeight="bolder";g=createElementNS("div");g.id="photo_lightbox_next";classObj.add(g,"hovervisible");g.style.position="absolute";g.style.width="50%";g.style.top="0";g.style.height="100%";g.style.right="0";c=createElementNS("span");c.appendChild(document.createTextNode(">"));c.style.backgroundColor="white";c.style.position="absolute";c.style.top="10%";c.style.right="0";c.style.fontSize="2em";c.style.padding="2%";c.style.color="black";c.style.fontWeight="bolder";h=createElementNS("span");h.id="photo_lightbox_title";n=document.createTextNode("");p.appendChild(m);d.appendChild(a);l.appendChild(d);g.appendChild(c);l.appendChild(g);p.appendChild(l);h.appendChild(n);p.appendChild(h);o.appendChild(p);j.appendChild(o);events.listen(o,"click",lightbox.hide);events.listen(d,"click",lightbox.prev);events.listen(g,"click",lightbox.next);events.listen(window,"resize",lightbox.resize);events.listen(document,"keydown",lightbox.keydown);r=document.getElementsByTagName("a");for(f=0;f<r.length;f++){if(lightbox.isPicture(r[f].href)){lightbox.urls.push(r[f].href);if(r[f].title){lightbox.titles.push(r[f].title)}else{lightbox.titles.push("")}q=new events.Callback(lightbox.show,lightbox.urls.length-1);events.listen(r[f],"click",q.invoke);r[f].style.cursor="-moz-zoom-in"}}},hide:function(){var b,a;b=document.getElementById("photo_lightbox");a=document.getElementById("photo_lightbox_wrap");if(!b||!a){return}b.style.opacity="0";b.style.display="none";a.style.visibility="hidden"},show:function(f,h){var j,g,k,c,i,a,b,d;j=document.getElementById("photo_lightbox");k=document.getElementById("photo_lightbox_wrap");g=document.getElementById("photo_lightbox_img");d=document.getElementById("photo_lightbox_links");a=document.getElementById("photo_lightbox_prev");b=document.getElementById("photo_lightbox_next");if(!j||!k||!g||!a||!b||!d){return}events.preventDefault(f);if(h<0){lightbox.pos=0}else{if(h>=lightbox.urls.length){lightbox.pos=lightbox.urls.length-1}else{lightbox.pos=h}}if(lightbox.existPrev()){a.style.display="block"}else{a.style.display="none"}if(lightbox.existNext()){b.style.display="block"}else{b.style.display="none"}d.style.display="none";j.style.display="block";if(lightbox.loading==null){lightbox.loading=new LoadDisplay(j)}g.src=lightbox.urls[lightbox.pos];lightbox.img=new Image();events.listen(lightbox.img,"load",lightbox.imgLoaded);lightbox.img.src=lightbox.urls[lightbox.pos];c=document.getElementById("photo_lightbox_title");if(!c){return}i=document.createTextNode(lightbox.titles[lightbox.pos]);c.replaceChild(i,c.firstChild);setTimeout(function(l){j.style.opacity="1"},0)},resize:function(){var d,e,b,c,f,h,a,g;d=document.getElementById("photo_lightbox_img");e=document.getElementById("photo_lightbox_wrap");h=document.getElementById("photo_lightbox_links");if(!d||!e||!h){return}f=100;b=lightbox.width;c=lightbox.height;if(window.innerWidth){a=window.innerWidth}else{if(document.body&&document.body.offsetWidth){a=document.body.offsetWidth}else{a=0}}if(window.innerHeight){g=window.innerHeight}else{if(document.body&&document.body.offsetHeight){g=document.body.offsetHeight}else{g=0}}if(a<f){b=1;c=1}else{if(a-f<b){b=(a-f);c=(lightbox.height*b)/lightbox.width}}if(g<f){b=1;c=1}else{if(g-f<c){c=(g-f);b=(lightbox.width*c)/lightbox.height}}e.style.marginTop=(-c/2-30).toFixed(3)+"px";e.style.marginLeft=(-b/2-15).toFixed(3)+"px";e.style.width=b.toFixed(3)+"px";d.style.width=b.toFixed(3)+"px";d.style.height=c.toFixed(3)+"px";h.style.height=c.toFixed(3)+"px"},isPicture:function(a){var d,b,c;b=[".jpg",".png",".gif"];if(a.length<=0){return false}c=a.lastIndexOf(".");if(c==-1){return false}d=a.substr(c,a.length).toLowerCase();if(b.indexOf(d)==-1){return false}return true},imgLoaded:function(){var a,b;lightbox.width=lightbox.img.width;lightbox.height=lightbox.img.height;lightbox.resize();a=document.getElementById("photo_lightbox_wrap");b=document.getElementById("photo_lightbox_links");if(!a||!b){return}if(lightbox.loading){lightbox.loading.disable();lightbox.loading=null}a.style.visibility="visible";b.style.display="block"},keydown:function(b){var a;b=b?b:window.event;a=document.getElementById("photo_lightbox_wrap");if(!a){return}if(a.style.visibility!="visible"||lightbox.loading){return}switch(b.keyCode){case 37:lightbox.prev(b);break;case 39:lightbox.next(b);break;case 27:lightbox.hide();break;case 13:events.preventDefault(b);break}},existNext:function(){return lightbox.pos<lightbox.urls.length-1},next:function(a){if(lightbox.existNext()){lightbox.show(a,lightbox.pos+1)}events.stopPropagation(a)},existPrev:function(){return lightbox.pos>0},prev:function(a){if(lightbox.existPrev()){lightbox.show(a,lightbox.pos-1)}events.stopPropagation(a)},img:new Image(),urls:new Array(),titles:new Array(),pos:0,width:10,height:10,loading:null};(function(){if(typeof window.addEventListener!="undefined"){events.listen(window,"DOMContentLoaded",earlyLoad)}events.listen(window,"load",earlyLoad);events.listen(window,"load",makeHeadsLinkable);events.listen(window,"load",generateReferences);events.listen(window,"load",annotateSecureLinks);if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d,c){var b,a;if(c==null){c=0}else{if(c<0){c=Math.max(0,this.length+c)}}for(b=c,a=this.length;b<a;b++){if(this[b]===d){return b}}return -1}}})();function earlyLoad(){if(typeof earlyLoad.alreadyLoaded=="undefined"){earlyLoad.alreadyLoaded=true;buildQuickNav();convertPreCode2ListCode();lightbox.init()}}function createElementNS(a){var b;if(typeof document.createElementNS!="undefined"){b=arguments.length<2?"http://www.w3.org/1999/xhtml":arguments[1];return document.createElementNS(b,a)}else{return typeof document.createElement!="undefined"?document.createElement(a):false}}function getText(c){var b,a="",d;d=c.childNodes;for(b=0;b<d.length;b++){a+=d[b].nodeType!=3?getText(d[b]):d[b].data}return a}function exchange_element(a,b){b.cur.parentNode.replaceChild(b.succ,b.cur)}function buildQuickNav(){var d,c,e,b,f,a,g;g=document.getElementsByTagName("h1");e=0;for(c=g.length-1;c>=0;c--){b=g[c];if(b.id&&b.firstChild&&b.firstChild.nodeValue){e++}}if(e>1){d=document.getElementById("qnav");if(d){f=createElementNS("span");f.id="sitenav";f.appendChild(document.createTextNode(" ( "));for(c=0;c<g.length;c++){b=g[c];if(b.id){a=createElementNS("a");a.href="#"+b.id;a.appendChild(document.createTextNode(getText(b)));f.appendChild(a);e--;if(e!=0){f.appendChild(document.createTextNode(" | "))}}}f.appendChild(document.createTextNode(" )"));d.appendChild(f)}}}function makeHeadsLinkable(){var e,d,b,c,a;for(d=6;d>0;d--){e=document.getElementsByTagName("h"+d);for(b=e.length-1;b>=0;b--){c=e[b];if(c.id){a=createElementNS("a");a.className="anchor";a.href="#"+c.id;a.appendChild(document.createTextNode("#"));c.appendChild(a)}}}}function convertPreCode2ListCode(){var e,f,a,h,c,l,d,n,g,k,b,m;e=document.getElementsByTagName("pre");for(f=e.length-1;f>=0;f--){a=!classObj.is(e[f],"nolisting")?e[f].getElementsByTagName("code"):[];if(a.length!=0){k=getText(e[f]);h=createElementNS("ol");h.className="codelist";c={};c.succ=e[f].cloneNode(true);c.cur=h;l=new events.Callback(exchange_element,c);events.listen(h,"click",l.invoke);k=k.replace(/\r\n|\r/g,"\n");b=k.split("\n");for(d=0;d<b.length;d++){m=b[d];n=createElementNS("li");g=createElementNS("code");if(m.length>0){m=m.replace(/\t/g,"        ");m=m.replace(/\s/g,"\u00A0");g.appendChild(document.createTextNode(m))}else{g.appendChild(document.createTextNode("\u00A0"))}n.appendChild(g);h.appendChild(n)}e[f].parentNode.replaceChild(h,e[f])}}}function generateReferences(){var g,f,k,n,d,b,m,h,e,c,l,o,a;g=classObj.getElementsByTagAndClassName(document,"div","entry-content");for(f=0;f<g.length;f++){k=[];n=g[f].getElementsByTagName("a");for(d=0;d<n.length;d++){m=n[d];if(m.href&&!classObj.is(m,"anchor")){h=k.indexOf(m.href);if(h==-1){k.push(m.href);h=k.length}else{h++}k[m.href]=m;e=createElementNS("sup");b=document.createTextNode(" ["+h+"]");e.appendChild(b);classObj.add(e,"reference_link");m.parentNode.insertBefore(e,m.nextSibling)}}if(k.length>0){c=createElementNS("div");l=createElementNS("ul");c.appendChild(l);for(d=0;d<k.length;d++){b=createElementNS("li");l.appendChild(b);o=k[d];a=document.createTextNode("["+(d+1)+"] "+o);b.appendChild(a)}classObj.add(c,"reference_list");g[f].appendChild(c)}}}function basename(a){a=a.replace(/\/+$/,"");a=a.replace(/^.*\//,"");return a}function href_allowed(c,a){var b;a=decodeURIComponent(basename(a));for(b=0;b<c.length;b++){if(c[b]==a){return true}}return false}function annotateSecureLinks_personal(c,a){var d,b;try{b=new XMLHttpRequest();b.open("GET",c+".access");b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){if(b.responseText.length>0){allowed=b.responseText.split("\n");for(d=0;d<a.length;d++){link=a[d];if(!href_allowed(allowed,link.href)){classObj.add(link,"secure_link_forbidden")}}}}}};b.send(null)}catch(f){}}function annotateSecureLinks(){var a,c,b;a=classObj.getElementsByTagAndClassName(document,"a","secure_link");if(a.length>0){try{b=new XMLHttpRequest();b.open("GET","user");b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){if(b.responseText.length>0){annotateSecureLinks_personal(b.responseText,a)}}}};b.send(null)}catch(d){}}};
