var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/kohana/';var alertText='Please enter the text you want to format.\nIt will be appended to the end of the document.';var notSavedYet='Unsaved changes will be lost.\nReally continue?';var reallyDel='Really delete selected item(s)?';LANG={"keepopen":"Keep window open on selection","hidedetails":"Hide Details","plugins":[]};function isUndefined(prop){return(typeof prop=='undefined');}function isFunction(prop){return(typeof prop=='function');}function isString(prop){return(typeof prop=='string');}function isNumber(prop){return(typeof prop=='number');}function isNumeric(prop){return isNumber(prop)&&!isNaN(prop)&&isFinite(prop);}function isArray(prop){return(prop instanceof Array);}function isRegExp(prop){return(prop instanceof RegExp);}function isBoolean(prop){return('boolean'==typeof prop);}function isScalar(prop){return isNumeric(prop)||isString(prop);}function isEmpty(prop){if(isBoolean(prop))return false;if(isRegExp(prop)&&new RegExp("").toString()==prop.toString())return true;if(isString(prop)||isNumber(prop))return!prop;if(Boolean(prop)&&false!=prop){for(var i in prop)if(prop.hasOwnProperty(i))return false}return true;}if('undefined'==typeof Object.hasOwnProperty){Object.prototype.hasOwnProperty=function(prop){return!('undefined'==typeof this[prop]||this.constructor&&this.constructor.prototype[prop]&&this[prop]===this.constructor.prototype[prop]);}}function addEvent(element,type,handler){if(!handler.$$guid)handler.$$guid=addEvent.guid++;if(!element.events)element.events={};var handlers=element.events[type];if(!handlers){handlers=element.events[type]={};if(element["on"+type]){handlers[0]=element["on"+type];}}handlers[handler.$$guid]=handler;element["on"+type]=handleEvent;};addEvent.guid=1;function removeEvent(element,type,handler){if(element.events&&element.events[type]){delete element.events[type][handler.$$guid];}};function handleEvent(event){var returnValue=true;event=event||fixEvent(window.event);var handlers=this.events[event.type];for(var i in handlers){if(!handlers.hasOwnProperty(i))continue;this.$$handleEvent=handlers[i];if(this.$$handleEvent(event)===false){returnValue=false;}}return returnValue;};function fixEvent(event){event.preventDefault=fixEvent.preventDefault;event.stopPropagation=fixEvent.stopPropagation;event.target=event.srcElement;return event;};fixEvent.preventDefault=function(){this.returnValue=false;};fixEvent.stopPropagation=function(){this.cancelBubble=true;};window.fireoninit=function(){if(arguments.callee.done)return;arguments.callee.done=true;if(_timer){clearInterval(_timer);_timer=null;}if(typeof window.oninit=='function'){window.oninit();}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",window.fireoninit,null);}/*@cc_on @*//*@if(@_win32)document.write("<\/script>");var script=document.getElementById("__ie_init");script.onreadystatechange=function(){if(this.readyState=="complete"){window.fireoninit();}};/*@end @*/if(/WebKit/i.test(navigator.userAgent)){var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){window.fireoninit();}},10);}window.onload=window.fireoninit;window.oninit=function(){};function addInitEvent(func){var oldoninit=window.oninit;if(typeof window.oninit!='function'){window.oninit=func;}else{window.oninit=function(){oldoninit();func();};}}DokuCookie={data:Array(),name:'DOKU_PREFS',setValue:function(key,val){DokuCookie.init();DokuCookie.data[key]=val;var now=new Date();DokuCookie.fixDate(now);now.setTime(now.getTime()+365*24*60*60*1000);var text='';for(var key in DokuCookie.data){if(!DokuCookie.data.hasOwnProperty(key))continue;text+='#'+escape(key)+'#'+DokuCookie.data[key];}DokuCookie.setCookie(DokuCookie.name,text.substr(1),now,DOKU_BASE);},getValue:function(key){DokuCookie.init();return DokuCookie.data[key];},init:function(){if(DokuCookie.data.length)return;var text=DokuCookie.getCookie(DokuCookie.name);if(text){var parts=text.split('#');for(var i=0;i0){date.setTime(date.getTime()-skew);}}};var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('AppleWebKit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}var toolbar='';function updateAccessKeyTooltip(){var tip='ALT+';if(is_macos){tip='CTRL+';}if(is_opera){tip='SHIFT+ESC ';}if(tip=='ALT+'){return;}var exp=/\[ALT\+/i;var rep='['+tip;var elements=document.getElementsByTagName('a');for(var i=0;i0){elements[i].title=elements[i].title.replace(exp,rep);}}elements=document.getElementsByTagName('input');for(var i=0;i0){elements[i].title=elements[i].title.replace(exp,rep);}}elements=document.getElementsByTagName('button');for(var i=0;i0){elements[i].title=elements[i].title.replace(exp,rep);}}}function $(){var elements=new Array();for(var i=0;i');}function hideLoadBar(id){obj=$(id);if(obj)obj.style.display="none";}function addTocToggle(){if(!document.getElementById)return;var header=$('toc__header');if(!header)return;var obj=document.createElement('span');obj.id='toc__toggle';obj.innerHTML='';obj.className='toc_close';obj.style.cursor='pointer';prependChild(header,obj);obj.parentNode.onclick=toggleToc;try{obj.parentNode.style.cursor='pointer';obj.parentNode.style.cursor='hand';}catch(e){}}function toggleToc(){var toc=$('toc__inside');var obj=$('toc__toggle');if(toc.style.display=='none'){toc.style.display='';obj.innerHTML='';obj.className='toc_close';}else{toc.style.display='none';obj.innerHTML='+';obj.className='toc_open';}}function checkAclLevel(){if(document.getElementById){var scope=$('acl_scope').value;if((scope.indexOf(":*")>0)||(scope=="*")){document.getElementsByName('acl_checkbox[4]')[0].disabled=false;document.getElementsByName('acl_checkbox[8]')[0].disabled=false;}else{document.getElementsByName('acl_checkbox[4]')[0].checked=false;document.getElementsByName('acl_checkbox[8]')[0].checked=false;document.getElementsByName('acl_checkbox[4]')[0].disabled=true;document.getElementsByName('acl_checkbox[8]')[0].disabled=true;}}}function footnote(e){var obj=e.target;var id=obj.id.substr(5);var fndiv=$('insitu__fn');if(!fndiv){fndiv=document.createElement('div');fndiv.id='insitu__fn';fndiv.className='insitu-footnote JSpopup dokuwiki';addEvent(fndiv,'mouseout',function(e){if(e.target!=fndiv){e.stopPropagation();return;}if(e.pageX){var bx1=findPosX(fndiv);var bx2=bx1+fndiv.offsetWidth;var by1=findPosY(fndiv);var by2=by1+fndiv.offsetHeight;var x=e.pageX;var y=e.pageY;if(x>bx1&&xby1&&y0&&e.offsetX0&&e.offsetY/gi,'');content=content.replace(/^\s+(,\s+)+/,'');content=content.replace(/\bid=\"(.*?)\"/gi,'id="insitu__$1');fndiv.innerHTML=content;var x;var y;if(e.pageX){x=e.pageX;y=e.pageY;}else{x=e.offsetX;y=e.offsetY;}fndiv.style.position='absolute';fndiv.style.left=(x+2)+'px';fndiv.style.top=(y+2)+'px';fndiv.style.display='';}addInitEvent(function(){var elems=getElementsByClass('fn_top',null,'a');for(var i=0;iloading...';listitem.appendChild(ul);listitem.className='open';},this.throbber_delay);ajax.elementObj=ul;ajax.afterCompletion=function(){window.clearTimeout(timeout);index.treeattach(ul);if(listitem.className!='open'){listitem.appendChild(ul);listitem.className='open';}};ajax.runAJAX(clicky.search.substr(1)+'&call=index');e.preventDefault();return false;}};addInitEvent(function(){index.treeattach($('index__tree'));});addInitEvent(function(){ajax_qsearch.init('qsearch__in','qsearch__out');});addInitEvent(function(){addEvent(document,'click',closePopups);});addInitEvent(function(){addTocToggle();});acl={init:function(){this.ctl=$('acl_manager');if(!this.ctl)return;var sel=$('acl__user').getElementsByTagName('select')[0];addEvent(sel,'change',acl.userselhandler);addEvent($('acl__tree'),'click',acl.treehandler);addEvent($('acl__user').getElementsByTagName('input')[1],'click',acl.loadinfo);addEvent($('acl__user').getElementsByTagName('input')[1],'keypress',acl.loadinfo);},userselhandler:function(e){if(this.value=='__g__'||this.value=='__u__'){$('acl__user').getElementsByTagName('input')[0].style.display='';$('acl__user').getElementsByTagName('input')[1].style.display='';}else{$('acl__user').getElementsByTagName('input')[0].style.display='none';$('acl__user').getElementsByTagName('input')[1].style.display='none';}acl.loadinfo();},loadinfo:function(){var frm=$('acl__detail').getElementsByTagName('form')[0];var ajax=new sack(DOKU_BASE+'lib/plugins/acl/ajax.php');ajax.AjaxFailedAlert='';ajax.encodeURIString=false;if(ajax.failed)return true;var data=Array();data[0]=ajax.encVar('ns',frm.elements['ns'].value);data[1]=ajax.encVar('id',frm.elements['id'].value);data[2]=ajax.encVar('acl_t',frm.elements['acl_t'].value);data[3]=ajax.encVar('acl_w',frm.elements['acl_w'].value);data[4]=ajax.encVar('ajax','info');ajax.elementObj=$('acl__info');ajax.runAJAX(data.join('&'));return false;},parseatt:function(str){if(str[0]=='?')str=str.substr(1);var attributes={};var all=str.split('&');for(var i=0;i/g,">");return str;},treetoggle:function(clicky){var listitem=clicky.parentNode.parentNode;var sublists=listitem.getElementsByTagName('ul');if(sublists.length){listitem.removeChild(sublists[0]);clicky.src=DOKU_BASE+'lib/images/plus.gif';clicky.alt='+';return false;}var link=listitem.getElementsByTagName('a')[0];var ajax=new sack(DOKU_BASE+'lib/plugins/acl/ajax.php');ajax.AjaxFailedAlert='';ajax.encodeURIString=false;if(ajax.failed)return true;var ul=document.createElement('ul');listitem.appendChild(ul);ajax.elementObj=ul;ajax.runAJAX(link.search.substr(1)+'&ajax=tree');clicky.src=DOKU_BASE+'lib/images/minus.gif';return false;},treehandler:function(e){if(e.target.src){acl.treetoggle(e.target);}else if(e.target.href){var obj=getElementsByClass('cur',$('acl__tree'),'a')[0];if(obj)obj.className=obj.className.replace(/ cur/,'');e.target.className+=' cur';var frm=$('acl__detail').getElementsByTagName('form')[0];if(e.target.className.search(/wikilink1/)>-1){frm.elements['ns'].value='';frm.elements['id'].value=acl.hsc(acl.parseatt(e.target.search)['id']);}else if(e.target.className.search(/idx_dir/)>-1){frm.elements['ns'].value=acl.hsc(acl.parseatt(e.target.search)['ns']);frm.elements['id'].value='';}acl.loadinfo();}e.stopPropagation();e.preventDefault();return false;}};addInitEvent(acl.init);function plugin_dokukiwix_class(){this.pages=null;this.page=null;this.sack=null;this.done=1;this.count=0;this.play=0;this.timeoutid=0;}var pl_dokukiwix=new plugin_dokukiwix_class();pl_dokukiwix.sack=new sack(DOKU_BASE+'lib/plugins/dokukiwix/ajax.php');pl_dokukiwix.sack.AjaxFailedAlert='';pl_dokukiwix.sack.encodeURIString=false;function plugin_dokukiwix_showThrobber(on){obj=document.getElementById('pl_dokukiwix_throbber');if(on){obj.style.visibility='visible';obj.style.display='inline';}else{obj.style.visibility='hidden';obj.style.display='none';}}function plugin_dokukiwix_showStopButton(on){obj=document.getElementById('pl_dokukiwix_stop');if(on){obj.style.visibility='visible';}else{obj.style.visibility='hidden';}}function plugin_dokukiwix_status(text){obj=document.getElementById('pl_dokukiwix_out');obj.innerHTML=text;}function plugin_dokukiwix_reinit(){window.clearTimeout(pl_dokukiwix.timeoutid);plugin_dokukiwix_showThrobber(false);pl_dokukiwix.pages=null;pl_dokukiwix.page=null;pl_dokukiwix.done=1;pl_dokukiwix.count=0;pl_dokukiwix.play=0;pl_dokukiwix.timeoutid=0;plugin_dokukiwix_showStopButton(false);plugin_dokukiwix_showThrobber(false);obj=document.getElementById('pl_dokukiwix_toggle_startpause');obj.src="lib/plugins/dokukiwix/images/play.png";}function plugin_dokukiwix_cb_pages(){data=this.response;pl_dokukiwix.pages=data.split("\n");pl_dokukiwix.count=pl_dokukiwix.pages.length;plugin_dokukiwix_status(pl_dokukiwix.pages.length+" pages found");plugin_dokukiwix_log('Found '+pl_dokukiwix.pages.length+' pages.');pl_dokukiwix.page=pl_dokukiwix.pages.shift();pl_dokukiwix.timeoutid=window.setTimeout("plugin_dokukiwix_index()",1000);}function plugin_dokukiwix_pause(){pl_dokukiwix.play=0;obj=document.getElementById('pl_dokukiwix_toggle_startpause');obj.src="lib/plugins/dokukiwix/images/play.png";plugin_dokukiwix_showThrobber(false);window.clearTimeout(pl_dokukiwix.timeoutid);plugin_dokukiwix_log('Generation paused.');}function plugin_dokukiwix_start(){pl_dokukiwix.play=1;obj=document.getElementById('pl_dokukiwix_toggle_startpause');obj.src="lib/plugins/dokukiwix/images/pause.png";plugin_dokukiwix_showThrobber(true);if(pl_dokukiwix.done>1){pl_dokukiwix.timeoutid=window.setTimeout("plugin_dokukiwix_index()",1000);plugin_dokukiwix_log('Generation resumed.');}else plugin_dokukiwix_go();}function plugin_dokukiwix_toggle_startpause(){if(pl_dokukiwix.play==0)plugin_dokukiwix_start();else plugin_dokukiwix_pause();}function plugin_dokukiwix_stop(){plugin_dokukiwix_pause();if(confirm("Warning: You won't be able to resume if you stop now. Are you sure you want to stop?")){pl_dokukiwix.sack.onCompletion=';';pl_dokukiwix.sack.URLString='';pl_dokukiwix.sack.runAJAX('call=removeLock&page='+encodeURI(pl_dokukiwix.page));plugin_dokukiwix_reinit();plugin_dokukiwix_status('Genereration stopped.');plugin_dokukiwix_log('Generation stopped.');}else plugin_dokukiwix_start();}function plugin_dokukiwix_cb_index(){ok=this.response;if(pl_dokukiwix.play==1){if(ok==1){plugin_dokukiwix_log('Generated: '+pl_dokukiwix.page);pl_dokukiwix.page=pl_dokukiwix.pages.shift();pl_dokukiwix.done++;pl_dokukiwix.timeoutid=window.setTimeout("plugin_dokukiwix_index()",500);}else{plugin_dokukiwix_status(ok);pl_dokukiwix.timeoutid=window.setTimeout("plugin_dokukiwix_index()",2000);}}}function plugin_dokukiwix_index(){if(pl_dokukiwix.page){plugin_dokukiwix_status('Generating '+pl_dokukiwix.page+' ('+pl_dokukiwix.done+'/'+pl_dokukiwix.count+')');pl_dokukiwix.sack.onCompletion=plugin_dokukiwix_cb_index;pl_dokukiwix.sack.URLString='';pl_dokukiwix.sack.runAJAX('call=buildOfflinePage&page='+encodeURI(pl_dokukiwix.page));}else{plugin_dokukiwix_status('finished');plugin_dokukiwix_showThrobber(false);pl_dokukiwix.sack.onCompletion=';';pl_dokukiwix.sack.URLString='';pl_dokukiwix.sack.runAJAX('call=removeLock&page='+encodeURI(pl_dokukiwix.page));plugin_dokukiwix_log('Task finished.');}}function plugin_dokukiwix_find_pages(){plugin_dokukiwix_showThrobber(true);plugin_dokukiwix_showStopButton(true);plugin_dokukiwix_status('Finding all pages...');pl_dokukiwix.sack.onCompletion=plugin_dokukiwix_cb_pages;pl_dokukiwix.sack.URLString='';pl_dokukiwix.sack.runAJAX('call=pagelist');plugin_dokukiwix_log('Finding pages...');}function plugin_dokukiwix_startup(){data=this.response;if(data==1){if(!confirm("Warning: Dokukiwix is locked. This may mean that another instance is already running. Proceed anyway? (this will stop the other instance if any)")){plugin_dokukiwix_reinit();plugin_dokukiwix_status('Generation canceled.');return;}}else if(data==2){alert("Error while creating the lock file: check the permissions of data/locks. Stopping.");plugin_dokukiwix_stop();return;}plugin_dokukiwix_status('Initialising...');pl_dokukiwix.sack.onCompletion=plugin_dokukiwix_find_pages;pl_dokukiwix.sack.URLString='';pl_dokukiwix.sack.runAJAX('call=dokukiwix_start');plugin_dokukiwix_log('Plugin initialised.');}function plugin_dokukiwix_go(){plugin_dokukiwix_status('Creating lock...');pl_dokukiwix.sack.onCompletion=plugin_dokukiwix_startup;pl_dokukiwix.sack.URLString='';pl_dokukiwix.sack.runAJAX('call=createLock');plugin_dokukiwix_log('Created Lock');}function plugin_dokukiwix_log(logstring){var currentDateTime=new Date();var currentHours,currentMinutes,currentSeconds;if(currentDateTime.getHours()<10)currentHours="0"+currentDateTime.getHours();else currentHours=currentDateTime.getHours();if(currentDateTime.getMinutes()<10)currentMinutes="0"+currentDateTime.getMinutes();else currentMinutes=currentDateTime.getMinutes();if(currentDateTime.getSeconds()<10)currentSeconds="0"+currentDateTime.getSeconds();else currentSeconds=currentDateTime.getSeconds();}var syntax_plugin_code=function(){var _cH=' codeHidden',_cS=' codeShown',_reH=/\s*\bcodeHidden\b/gi,_reS=/\s*\bcodeShown\b/gi,_B='',_ini='syntax_plugin_code.js()',_DW,_Divs=function(){var d,l,r=[];try{if((d=window.document.getElementsByTagName('div'))&&(l=d.length)){var e,re=/\bcode\b/i;do{if((e=d[--l])&&(e.className)&&re.test(e.className)){r[r.length]=e;}}while(0