var DOKU_BASE='/dokuwiki/';var DOKU_TPL='/dokuwiki/lib/tpl/monobook/';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":{"spellcheck":{"start":"Check Spelling","stop":"Resume Editing","wait":"Please wait...","noerr":"No Mistakes found","nosug":"No Suggestions","change":"Change"}}};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("<scr"+"ipt id=\"__ie_init\" defer=\"true\" src=\"//:\"><\/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;i<parts.length;i+=2){DokuCookie.data[unescape(parts[i])]=unescape(parts[i+1]);}}},setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;},getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!==0){return null;}}else{begin+=2;}var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}return unescape(dc.substring(begin+prefix.length,end));},fixDate:function(date){var base=new Date(0);var skew=base.getTime();if(skew>0){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;i<elements.length;i++){if(elements[i].accessKey.length==1&&elements[i].title.length>0){elements[i].title=elements[i].title.replace(exp,rep);}}elements=document.getElementsByTagName('input');for(var i=0;i<elements.length;i++){if(elements[i].accessKey.length==1&&elements[i].title.length>0){elements[i].title=elements[i].title.replace(exp,rep);}}elements=document.getElementsByTagName('button');for(var i=0;i<elements.length;i++){if(elements[i].accessKey.length==1&&elements[i].title.length>0){elements[i].title=elements[i].title.replace(exp,rep);}}}function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')element=document.getElementById(element);if(arguments.length==1)return element;elements.push(element);}return elements;}function isset(varname){return(typeof(window[varname])!='undefined');}function getElementsByClass(searchClass,node,tag){var classElements=new Array();if(node==null)node=document;if(tag==null)tag='*';var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");for(i=0,j=0;i<elsLen;i++){if(pattern.test(els[i].className)){classElements[j]=els[i];j++;}}return classElements;}function findPosX(object){var curleft=0;var obj=$(object);if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}else if(obj.x){curleft+=obj.x;}return curleft;}function findPosY(object){var curtop=0;var obj=$(object);if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}else if(obj.y){curtop+=obj.y;}return curtop;}function jsEscape(text){var re=new RegExp("\\\\","g");text=text.replace(re,"\\\\");re=new RegExp("'","g");text=text.replace(re,"\\'");re=new RegExp('"',"g");text=text.replace(re,'&quot;');re=new RegExp("\\\\\\\\n","g");text=text.replace(re,"\\n");return text;}function escapeQuotes(text){var re=new RegExp("'","g");text=text.replace(re,"\\'");re=new RegExp('"',"g");text=text.replace(re,'&quot;');re=new RegExp("\\n","g");text=text.replace(re,"\\n");return text;}function prependChild(parent,element){if(!parent.firstChild){parent.appendChild(element);}else{parent.insertBefore(element,parent.firstChild);}}function showLoadBar(){document.write('<img src="'+DOKU_BASE+'lib/images/loading.gif" '+'width="150" height="12" alt="..." />');}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='<span>&minus;</span>';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='<span>&minus;</span>';obj.className='toc_close';}else{toc.style.display='none';obj.innerHTML='<span>+</span>';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&&x<bx2&&y>by1&&y<by2){e.stopPropagation();return;}}else{if(e.offsetX>0&&e.offsetX<fndiv.offsetWidth-1&&e.offsetY>0&&e.offsetY<fndiv.offsetHeight-1){e.stopPropagation();return;}}fndiv.style.display='none';});document.body.appendChild(fndiv);}var a=$("fn__"+id);if(!a){return;}var content=new String(a.parentNode.parentNode.innerHTML);content=content.replace(/<a\s.*?href=\".*\#fnt__\d+\".*?<\/a>/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;i<elems.length;i++){addEvent(elems[i],'mouseover',function(e){footnote(e);});}});function initSizeCtl(ctlid,edid){if(!document.getElementById){return;}var ctl=$(ctlid);var textarea=$(edid);if(!ctl||!textarea)return;var hgt=DokuCookie.getValue('sizeCtl');if(hgt){textarea.style.height=hgt;}else{textarea.style.height='300px';}var l=document.createElement('img');var s=document.createElement('img');var w=document.createElement('img');l.src=DOKU_BASE+'lib/images/larger.gif';s.src=DOKU_BASE+'lib/images/smaller.gif';w.src=DOKU_BASE+'lib/images/wrap.gif';addEvent(l,'click',function(){sizeCtl(edid,100);});addEvent(s,'click',function(){sizeCtl(edid,-100);});addEvent(w,'click',function(){toggleWrap(edid);});ctl.appendChild(l);ctl.appendChild(s);ctl.appendChild(w);}function sizeCtl(edid,val){var textarea=$(edid);var height=parseInt(textarea.style.height.substr(0,textarea.style.height.length-2));height+=val;textarea.style.height=height+'px';DokuCookie.setValue('sizeCtl',textarea.style.height);}function toggleWrap(edid){var txtarea=$(edid);var wrap=txtarea.getAttribute('wrap');if(wrap&&wrap.toLowerCase()=='off'){txtarea.setAttribute('wrap','soft');}else{txtarea.setAttribute('wrap','off');}var parNod=txtarea.parentNode;var nxtSib=txtarea.nextSibling;parNod.removeChild(txtarea);parNod.insertBefore(txtarea,nxtSib);}function closePopups(){if(!document.getElementById){return;}var divs=document.getElementsByTagName('div');for(var i=0;i<divs.length;i++){if(divs[i].className.indexOf('JSpopup')!=-1){divs[i].style.display='none';}}}function scrollToMarker(){var obj=$('scroll__here');if(obj)obj.scrollIntoView();}function focusMarker(){var obj=$('focus__this');if(obj)obj.focus();}function cleanMsgArea(){var elems=getElementsByClass('(success|info|error)',document,'div');if(elems){for(var i=0;i<elems.length;i++){elems[i].style.display='none';}}}function sack(file){this.AjaxFailedAlert="Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";this.requestFile=file;this.method="POST";this.URLString="";this.encodeURIString=true;this.execute=false;this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.afterCompletion=function(){};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(err){this.xmlhttp=null;}}if(!this.xmlhttp&&typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest();}if(!this.xmlhttp){this.failed=true;}};this.setVar=function(name,value){if(this.URLString.length<3){this.URLString=name+"="+value;}else{this.URLString+="&"+name+"="+value;}};this.encVar=function(name,value){var varString=encodeURIComponent(name)+"="+encodeURIComponent(value);return varString;};this.encodeURLString=function(string){varArray=string.split('&');for(i=0;i<varArray.length;i++){urlVars=varArray[i].split('=');if(urlVars[0].indexOf('amp;')!=-1){urlVars[0]=urlVars[0].substring(4);}varArray[i]=this.encVar(urlVars[0],urlVars[1]);}return varArray.join('&');};this.runResponse=function(){eval(this.response);};this.runAJAX=function(urlstring){this.responseStatus=new Array(2);if(this.failed&&this.AjaxFailedAlert){alert(this.AjaxFailedAlert);}else{if(urlstring){if(this.URLString.length){this.URLString=this.URLString+"&"+urlstring;}else{this.URLString=urlstring;}}if(this.encodeURIString){var timeval=new Date().getTime();this.URLString=this.encodeURLString(this.URLString);this.setVar("rndval",timeval);}if(this.element){this.elementObj=document.getElementById(this.element);}if(this.xmlhttp){var self=this;if(this.method=="GET"){var totalurlstring=this.requestFile+"?"+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true);}else{this.xmlhttp.open(this.method,this.requestFile,true);}if(this.method=="POST"){try{this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');}catch(e){}}this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;self.onCompletion();if(self.execute){self.runResponse();}if(self.elementObj){var elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response;}else{self.elementObj.innerHTML=self.response;}}self.afterCompletion();self.URLString="";break;}};this.xmlhttp.send(this.URLString);}}};this.createAJAX();}function ajax_qsearch_class(){this.sack=null;this.inObj=null;this.outObj=null;this.timer=null;}var ajax_qsearch=new ajax_qsearch_class();ajax_qsearch.sack=new sack(DOKU_BASE+'lib/exe/ajax.php');ajax_qsearch.sack.AjaxFailedAlert='';ajax_qsearch.sack.encodeURIString=false;ajax_qsearch.init=function(inID,outID){ajax_qsearch.inObj=document.getElementById(inID);ajax_qsearch.outObj=document.getElementById(outID);if(ajax_qsearch.inObj===null){return;}if(ajax_qsearch.outObj===null){return;}addEvent(ajax_qsearch.inObj,'keyup',ajax_qsearch.call);addEvent(ajax_qsearch.outObj,'click',function(){ajax_qsearch.outObj.style.display='none';});};ajax_qsearch.clear=function(){ajax_qsearch.outObj.style.display='none';ajax_qsearch.outObj.innerHTML='';if(ajax_qsearch.timer!==null){window.clearTimeout(ajax_qsearch.timer);ajax_qsearch.timer=null;}};ajax_qsearch.exec=function(){ajax_qsearch.clear();var value=ajax_qsearch.inObj.value;if(value===''){return;}ajax_qsearch.sack.runAJAX('call=qsearch&q='+encodeURI(value));};ajax_qsearch.sack.onCompletion=function(){var data=ajax_qsearch.sack.response;if(data===''){return;}ajax_qsearch.outObj.innerHTML=data;ajax_qsearch.outObj.style.display='block';};ajax_qsearch.call=function(){ajax_qsearch.clear();ajax_qsearch.timer=window.setTimeout("ajax_qsearch.exec()",500);};index={throbber_delay:500,treeattach:function(obj){if(!obj)return;var items=getElementsByClass('idx_dir',obj,'a');for(var i=0;i<items.length;i++){var elem=items[i];addEvent(elem,'click',function(e){return index.toggle(e,this);});}},toggle:function(e,clicky){var listitem=clicky.parentNode.parentNode;var sublists=listitem.getElementsByTagName('ul');if(sublists.length&&listitem.className=='open'){sublists[0].style.display='none';listitem.className='closed';e.preventDefault();return false;}if(sublists.length&&listitem.className=='closed'){sublists[0].style.display='';listitem.className='open';e.preventDefault();return false;}var ajax=new sack(DOKU_BASE+'lib/exe/ajax.php');ajax.AjaxFailedAlert='';ajax.encodeURIString=false;if(ajax.failed)return true;var ul=document.createElement('ul');ul.className='idx';timeout=window.setTimeout(function(){ul.innerHTML='<li><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>';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();});function isBlank(s){if((s==null)||(s.length==0))return true;for(var i=0;i<s.length;i++){var c=s.charAt(i);if((c!=' ')&&(c!='\n')&&(c!='\t'))return false;}return true;}function validate(frm){if(isBlank(frm.email.value)||frm.email.value.indexOf("@")==-1){frm.email.focus();return false;}if(isBlank(frm.fullname.value)){frm.fullname.focus();return false;}if(isBlank(frm.wikitext.value)){frm.wikitext.focus();return false;}}AJAXCHAT_SHORT_INTERVAL=5;AJAXCHAT_MIDDLE_INTERVAL=10;AJAXCHAT_LONG_INTERVAL=30;AJAXCHAT_MAXIMUM_INTERVAL=5*60;AJAXCHAT_CHECKTIMEOUT=3*1000;AJAXCHAT_SENDTIMEOUT=30*1000;var ajax_chat=null;function Mouse_monitor_class(window){this.lastmousex=0;this.lastmousey=0;this.mousemovehooked=false;this.mousemoved=false;this.window=window;this.document=window.document;var self=this;self.onMouseMove=function(){};self.mouseEvent=function(e){if(false===self.mousemovehooked){return;}var posx=0;var posy=0;if(!e){var e=self.window.event;}if(!e){var e=self.document.event;}if(!e){return;}if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}else{if(e.clientX||e.clientY){posx=e.clientX+self.document.body.scrollLeft;posy=e.clientY+self.document.body.scrollTop;}}if(self.lastmousex!=0&&self.lastmousey!=0){if((posx==0&&posy==0)||posx!=self.lastmousex||posy!=self.lastmousey){self.mousemoved=true;if(self.onMouseMove){try{self.onMouseMove();}catch(e){};}self.onMouseMove=null;self.unhookMouseEvent();}}self.lastmousex=posx;self.lastmousey=posy;};self.hookMouseEvent=function(){if(true===self.mousemovehooked){return;}self.mousemoved=false;self.lastmousex=0;self.lastmousey=0;addEvent(self.document,'mousemove',self.mouseEvent);self.mousemovehooked=true;};self.unhookMouseEvent=function(){if(false===self.mousemovehooked){return;}removeEvent(self.document,'mousemove',self.mouseEvent);self.mousemovehooked=false;};self.sleep=function(delay){var start=(new Date()).getTime();while((new Date()).getTime()-start<delay){};};}function Ajax_chat_class(objectName,outId,pageId,lastRefresh,window){this.objectName=objectName;this.check_sack=new sack(DOKU_BASE+'lib/plugins/chat/ajax.php');this.check_sack.AjaxFailedAlert='';this.check_sack.encodeURIString=false;this.send_sack=new sack(DOKU_BASE+'lib/plugins/chat/ajax.php');this.send_sack.AjaxFailedAlert='';this.send_sack.encodeURIString=false;this.timer=null;this.lastChatAreaUpdate=new Date().getTime();this.chat_timer=null;this.outObj=document.getElementById(outId);this.pageId=pageId;this.lastRefresh=lastRefresh;this.lastSend=lastRefresh;this.refresh=AJAXCHAT_SHORT_INTERVAL;this.clearing=false;this.sending=false;var self=this;this.mouseMonitor=new Mouse_monitor_class(window);this.onMouseMove=function(func){self.mouseMonitor.onMouseMove=function(){func();};self.mouseMonitor.hookMouseEvent();};this.check_sack.onLoading=function(){self.updateInfo('requestTimerInfo','Timer initialized');self.check_sack.requestTimer=setTimeout(function(){self.check_sack.requestTimer=null;try{if(self.check_sack.xmlhttp.abort){self.check_sack.xmlhttp.abort();}}catch(e){}self.updateInfo('requestTimerInfo','Timeout, aborted connection');self.check_sack.onError();},AJAXCHAT_CHECKTIMEOUT);};this.check_sack.onError=function(){if(self.check_sack.requestTimer!==null){clearTimeout(self.check_sack.requestTimer);self.check_sack.requestTimer=null;self.updateInfo('requestTimerInfo','Error, timer aborted');}else{self.updateInfo('requestTimerInfo','Error, no timer');}self.updateInfo('ajaxActive','error, waiting');self.check_sack.onCompletion();};this.check_sack.onLoaded=function(){if(self.check_sack.requestTimer!==null){clearTimeout(self.check_sack.requestTimer);self.check_sack.requestTimer=null;self.updateInfo('requestTimerInfo','OK, timer cleared');}};this.send_sack.onLoading=function(){self.updateInfo('requestTimerInfo','Timer initialized');self.send_sack.requestTimer=setTimeout(function(){self.send_sack.requestTimer=null;try{if(self.send_sack.xmlhttp.abort){self.send_sack.xmlhttp.abort();}}catch(e){}self.updateInfo('requestTimerInfo','Timeout, aborted connection');self.send_sack.onError();},AJAXCHAT_SENDTIMEOUT);};this.send_sack.onError=function(){if(self.send_sack.requestTimer!==null){clearTimeout(self.send_sack.requestTimer);self.send_sack.requestTimer=null;self.updateInfo('requestTimerInfo','Error, timer aborted');}else{self.updateInfo('requestTimerInfo','Error, no timer');}self.updateInfo('ajaxActive','error, waiting');self.send_sack.onCompletion();};this.send_sack.onLoaded=function(){if(self.send_sack.requestTimer!==null){clearTimeout(self.send_sack.requestTimer);self.send_sack.requestTimer=null;self.updateInfo('requestTimerInfo','OK, timer cleared');}};this.getUpdateTimeFromResponse=function(resp){var time=resp.substring(0,resp.indexOf('\n')).replace(/(.*<!--AJAXCHAT_MTIME:)([0-9]+)(-->.*)/,'$2');if(time==null||time==''){time=0;}return time*1;};self.updateInfo('ajaxRefreshInterval',this.refresh+'sec');}Ajax_chat_class.prototype.updateInfo=function(infoTag,infoValue){var infoDiv=document.getElementById('chat-info-pad');if(infoDiv){if(infoDiv.elements[infoTag]){infoDiv.elements[infoTag].value=infoValue;}}};Ajax_chat_class.prototype.chatClear=function(user){var self=this;self.clearing=true;self.send_sack.oldOnError=self.send_sack.onError;self.send_sack.onError=function(){self.send_sack.oldOnError();self.clearing=false;self.send_sack.onError=self.send_sack.oldOnError;};this.send_sack.onCompletion=function(){var data=self.send_sack.response;if(data!==''){self.updateInfo('ajaxLastStatus','Messages cleared');self.outObj.innerHTML=data;self.outObj.style.display='block';updated=self.getUpdateTimeFromResponse(data);self.lastRefresh=updated;self.clearing=false;self.send_sack.onError=self.send_sack.oldOnError;}};this.send_sack.runAJAX('call=clear'+'&pageId='+encodeURIComponent(this.pageId)+'&time='+this.lastRefresh+'&user='+encodeURIComponent(user));};Ajax_chat_class.prototype.chatSend=function(user,message){var self=this;if(true==self.clearing){return;}self.sending=true;self.send_sack.oldOnError=self.send_sack.onError;self.send_sack.onError=function(){self.send_sack.oldOnError();self.sending=false;self.send_sack.onError=self.send_sack.oldOnError;};this.send_sack.onCompletion=function(){var data=self.send_sack.response;if(200==self.send_sack.responseStatus[0]*1){var sentDiv=document.getElementById('chatListSentMessage');if(sentDiv){sentDiv.innerHTML='';sentDiv.style.display='none';}if(data!==''){var updated=self.getUpdateTimeFromResponse(data);var actualData=data.replace(/[^\n]+\n[ ]*/,'');if(actualData.length==0){}self.outObj.innerHTML=(actualData.length>0?actualData+(self.lastRefresh>0?self.outObj.innerHTML:''):"<em>-- no messages --</em>");self.outObj.style.display='block';self.lastRefresh=updated;self.lastSend=updated;}self.sending=false;self.send_sack.onError=self.send_sack.oldOnError;}else{}};this.requestTimeout=AJAXCHAT_SENDTIMEOUT;this.send_sack.runAJAX('call=send'+'&pageId='+encodeURIComponent(self.pageId)+'&time='+self.lastRefresh+'&user='+encodeURIComponent(user)+'&msg='+encodeURIComponent(message));};Ajax_chat_class.prototype.chatCheck=function(){try{var self=this;if(true==self.sending){return;}if(self.chat_timer!==null){clearTimeout(self.chat_timer);self.chat_timer=null;}this.check_sack.onCompletion=function(){if(true==self.clearing||true==self.sending){return;}var data=self.check_sack.response;if(200!=self.check_sack.responseStatus[0]*1){self.updateInfo('ajaxActive','waiting');self.updateInfo('ajaxLastStatus','Error '+self.check_sack.responseStatus[0]+', waiting');}else{self.updateInfo('ajaxActive','waiting');if(data===''){self.updateInfo('ajaxLastStatus','No change');}else{var updated=self.getUpdateTimeFromResponse(data);if((updated==0||updated>self.lastRefresh)&&false==self.clearing&&false==self.sending){var actualData=data.replace(/[^\n]+\n[ ]*/,'');self.outObj.innerHTML=(actualData.length>0?actualData+(self.lastRefresh>0?self.outObj.innerHTML:''):"<em>-- no messages --</em>");self.outObj.style.display='block';self.lastRefresh=updated;self.updateInfo('ajaxLastStatus','New messages fetched');if(actualData.length>0){chatNotifySound();}else{}}}}};this.updateInfo('ajaxActive','checking...');self.check_sack.runAJAX('call=checkAndGet&pageId='+encodeURIComponent(self.pageId)+'&time='+self.lastRefresh);var now=new Date().getTime();if((now-self.lastChatAreaUpdate)/1000>=5*60){self.refresh=AJAXCHAT_MAXIMUM_INTERVAL;self.updateInfo('ajaxRefreshInterval',self.refresh+'sec');}else{if((now-self.lastChatAreaUpdate)/1000>=60){self.refresh=AJAXCHAT_LONG_INTERVAL;self.updateInfo('ajaxRefreshInterval',self.refresh+'sec');self.onMouseMove(function(){if(self.refresh>AJAXCHAT_MIDDLE_INTERVAL){self.refresh=AJAXCHAT_MIDDLE_INTERVAL;self.lastChatAreaUpdate=new Date().getTime()-(30*1000);self.updateInfo('ajaxRefreshInterval',self.refresh+'sec');self.chat_timer=setTimeout(self.objectName+".chatCheck()",100);}});}else{if((now-self.lastChatAreaUpdate)/1000>=30){self.refresh=AJAXCHAT_MIDDLE_INTERVAL;self.updateInfo('ajaxRefreshInterval',self.refresh+'sec');}}}var timeoutFuzzy=(Math.round(Math.random())>0?1:-1)*Math.round(Math.random()*((self.refresh*1000)/10));self.updateInfo('ajaxNextCheck','Next check: '+self.refresh+'s  '+(timeoutFuzzy>0?"+"+timeoutFuzzy+"ms":timeoutFuzzy<0?timeoutFuzzy+"ms":""));}catch(e){}self.chat_timer=setTimeout(self.objectName+".chatCheck()",(self.refresh*1000)+timeoutFuzzy);};Ajax_chat_class.prototype.chatCheckAbort=function(){var self=this;if(null!=self.check_sack.requestTimer){clearTimeout(self.check_sack.requestTimer);self.check_sack.requestTimer=null;this.updateInfo('ajaxActive','aborted check...');}if(self.check_sack.xmlhttp&&self.check_sack.xmlhttp.abort){try{self.check_sack.xmlhttp.abort();}catch(e){}}};function new_ajax_chat(outId,pageId,lastRefresh){ajax_chat=new Ajax_chat_class("ajax_chat",outId,pageId,lastRefresh,window);}function chatRefresh(event){if(ajax_chat===null){return;}var list=document.getElementById('chat-last-message');if(list){if(list.className.indexOf(' chat-line-last')!=-1){list.className=list.className.replace(/ chat-line-last/gi,'');}}ajax_chat.chatCheck();}function chatAreaUpdated(event){if(ajax_chat===null){return;}var now=new Date().getTime();if((now-ajax_chat.lastChatAreaUpdate)/1000<30){if(ajax_chat.refresh>AJAXCHAT_SHORT_INTERVAL){ajax_chat.refresh=AJAXCHAT_SHORT_INTERVAL;ajax_chat.updateInfo('ajaxRefreshInterval',ajax_chat.refresh+'sec');chatRefresh();}else{}}else{chatRefresh();}ajax_chat.lastChatAreaUpdate=now;}function chatSendMessage(user,msg){if(ajax_chat.lastSend>0){var now=(new Date()).getTime();if(now-(ajax_chat.lastSend*1000)<1000){return false;}}var time=new Date();var timeF;if((''+time.getHours()).length>1){timeF=time.getHours()+":";}else{timeF="0"+time.getHours()+":";}if((''+time.getMinutes()).length>1){timeF+=time.getMinutes()+":";}else{timeF+="0"+time.getMinutes()+":";}if((''+time.getSeconds()).length>1){timeF+=time.getSeconds()+"";}else{timeF+="0"+time.getSeconds()+"";}var list=document.getElementById('chatListSentMessage');list.innerHTML="<strong>"+user+"</strong> ("+timeF+"): <br /><blockquote>"+msg+"</blockquote>\n";list.style.display='block';list.style.height='';ajax_chat.chatSend(user,msg);return true;}function focusChatPrompt(){var form=document.getElementById('chatForm');if(form){if(form.chatMessage){form.chatMessage.focus();}}}function chatClearMessages(user){var list=document.getElementById('chatList');list.innerHTML="&nbsp;";ajax_chat.chatClear(user);focusChatPrompt();}function chatEventKeyUp(){var input=document.getElementById('chatForm').chatMessage;}function chatEventClear(){var form=document.getElementById('chatForm');chatClearMessages(form.user.value);return false;}function chatEventSubmit(){focusChatPrompt();var form=document.getElementById('chatForm');if(form.chatMessage.value===''){return false;}if(chatSendMessage(form.user.value,form.chatMessage.value)){form.chatMessage.value='';}return false;}function saveChatUser(){var input=document.getElementById('chatForm').user;if(!input){return;}if(null!==input.timer){clearTimeout(input.timer);input.timer=null;}input.lastKey=null;var expire=new Date();fixDate(expire);expire.setTime(expire.getTime()+365*24*60*60*1000);setCookie('chatName',input.value,expire);}function chatEventUserChanged(e){var input=document.getElementById('chatForm').user;if(!input){return;}if(null!==input.timer){clearTimeout(input.timer);input.timer=null;}var now=new Date();if(!input.lastKey){input.lastKey=now.getTime();input.timer=setTimeout('saveChatUser()',1000);}else{input.lastKey=now.getTime();input.timer=setTimeout('saveChatUser()',1000);}}function chatNotifySound(){var soundPlayer=document.getElementById('newmsg_sound');if(soundPlayer){try{soundPlayer.play();}catch(e){};}}function chatSetVolume(vol,silent,cookie){var soundPlayer=document.getElementById('newmsg_sound');if(soundPlayer){try{soundPlayer.setVolume(vol);if(!silent&&(vol>0)){soundPlayer.play();}var img=document.getElementById('chatVolumeIcon');if(img){img.src=DOKU_BASE+'lib/plugins/chat/volume'+vol+'.gif';img.title='Set notify volume ('+(vol>0?vol:'muted')+')';img.style.width='';img.style.paddingRight='10px';img.style.paddingTop='2px';}}catch(e){};if(cookie){var expire=new Date();fixDate(expire);expire.setTime(expire.getTime()+365*24*60*60*1000);setCookie('chatVolume',vol+'',expire);}}}function chatToggleVolume(){var soundPlayer=document.getElementById('newmsg_sound');if(soundPlayer){try{var volume=soundPlayer.getVolume()+1;if(volume>4){volume=0;}chatSetVolume(volume,false,true);}catch(e){};}}function chatInitialize(){var form=document.getElementById('chatForm');var list=document.getElementById('chatList');if(form){if(form.user&&'text'==form.user.type){var cname=getCookie('chatName');if(null!==cname){form.user.value=cname;}else{saveChatUser();}}if(form.chatMessage){addEvent(form,'submit',chatEventSubmit);addEvent(form.user,'keyup',chatEventUserChanged);addEvent(form.chatMessage,'keyup',chatAreaUpdated);setTimeout('focusChatPrompt()',1000);}if(form.clearButton){addEvent(form.clearButton,'click',chatEventClear);}new_ajax_chat('chatList',form.pageId.value,0);ajax_chat.chatCheck();}if(list){addEvent(list,'mouseup',chatRefresh);}}(new Image()).src=DOKU_BASE+'lib/plugins/chat/volume0.gif';(new Image()).src=DOKU_BASE+'lib/plugins/chat/volume1.gif';(new Image()).src=DOKU_BASE+'lib/plugins/chat/volume2.gif';(new Image()).src=DOKU_BASE+'lib/plugins/chat/volume3.gif';(new Image()).src=DOKU_BASE+'lib/plugins/chat/volume4.gif';addEvent(window,'load',chatInitialize);function WindowSize(){this.w=0;this.h=0;return this.update();}WindowSize.prototype.update=function(){var d=document;this.w=(window.innerWidth)?window.innerWidth:(d.documentElement&&d.documentElement.clientWidth)?d.documentElement.clientWidth:d.body.clientWidth;this.h=(window.innerHeight)?window.innerHeight:(d.documentElement&&d.documentElement.clientHeight)?d.documentElement.clientHeight:d.body.clientHeight;return this;};function PageSize(){this.win=new WindowSize();this.w=0;this.h=0;return this.update();}PageSize.prototype.update=function(){var d=document;this.w=(window.innerWidth&&window.scrollMaxX)?window.innerWidth+window.scrollMaxX:(d.body.scrollWidth>d.body.offsetWidth)?d.body.scrollWidth:d.body.offsetWidt;this.h=(window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:(d.body.scrollHeight>d.body.offsetHeight)?d.body.scrollHeight:d.body.offsetHeight;this.win.update();if(this.w<this.win.w)this.w=this.win.w;if(this.h<this.win.h)this.h=this.win.h;return this;};function PagePos(){this.x=0;this.y=0;return this.update();}PagePos.prototype.update=function(){var d=document;this.x=(window.pageXOffset)?window.pageXOffset:(d.documentElement&&d.documentElement.scrollLeft)?d.documentElement.scrollLeft:(d.body)?d.body.scrollLeft:0;this.y=(window.pageYOffset)?window.pageYOffset:(d.documentElement&&d.documentElement.scrollTop)?d.documentElement.scrollTop:(d.body)?d.body.scrollTop:0;return this;};function UserAgent(){var ua=navigator.userAgent;this.isWinIE=this.isMacIE=false;this.isGecko=ua.match(/Gecko\//);this.isSafari=ua.match(/AppleWebKit/);this.isOpera=window.opera;if(document.all&&!this.isGecko&&!this.isSafari&&!this.isOpera){this.isWinIE=ua.match(/Win/);this.isMacIE=ua.match(/Mac/);this.isNewIE=(ua.match(/MSIE 5\.5/)||ua.match(/MSIE 6\.0/));}return this;}function LightBox(option){var self=this;self._imgs=new Array();self._wrap=null;self._box=null;self._open=-1;self._page=new PageSize();self._pos=new PagePos();self._ua=new UserAgent();self._expandable=false;self._expanded=false;self._expand=option.expandimg;self._shrink=option.shrinkimg;return self._init(option);}LightBox.prototype={_init:function(option){var self=this;var d=document;if(!d.getElementsByTagName)return;var links=d.getElementsByTagName("a");for(var i=0;i<links.length;i++){var anchor=links[i];var num=self._imgs.length;if(!anchor.getAttribute("href")||anchor.getAttribute("rel")!="lightbox")continue;self._imgs[num]={src:anchor.getAttribute("href"),w:-1,h:-1,title:'',cls:anchor.className};if(anchor.getAttribute("title"))self._imgs[num].title=anchor.getAttribute("title");else if(anchor.firstChild&&anchor.firstChild.getAttribute&&anchor.firstChild.getAttribute("title"))self._imgs[num].title=anchor.firstChild.getAttribute("title");anchor.onclick=self._genOpener(num);}var body=d.getElementsByTagName("body")[0];self._wrap=self._createWrapOn(body,option.loadingimg);self._box=self._createBoxOn(body,option);return self;},_genOpener:function(num){var self=this;return function(){self._show(num);if(window.event)window.event.returnValue=false;return false;}},_createWrapOn:function(obj,imagePath){var self=this;if(!obj)return null;var wrap=document.createElement('div');wrap.id='gallery__overlay';with(wrap.style){display='none';position='fixed';top='0px';left='0px';zIndex='50';width='100%';height='100%';}if(self._ua.isWinIE)wrap.style.position='absolute';addEvent(wrap,"click",function(){self._close();});obj.appendChild(wrap);var imag=new Image;imag.onload=function(){var spin=document.createElement('img');spin.id='gallery__loadingImage';spin.src=imag.src;spin.style.position='relative';self._set_cursor(spin);addEvent(spin,'click',function(){self._close();});wrap.appendChild(spin);imag.onload=function(){};};if(imagePath!='')imag.src=imagePath;return wrap;},_createBoxOn:function(obj,option){var self=this;if(!obj)return null;var box=document.createElement('div');box.id='gallery__lightbox';with(box.style){display='none';position='absolute';zIndex='60';}obj.appendChild(box);var img=document.createElement('img');img.id='gallery__lightboxImage';self._set_cursor(img);addEvent(img,'click',function(){self._close();});addEvent(img,'mouseover',function(){self._show_action();});addEvent(img,'mouseout',function(){self._hide_action();});box.appendChild(img);var zoom=document.createElement('img');zoom.id='gallery__actionImage';with(zoom.style){display='none';position='absolute';top='15px';left='15px';zIndex='70';}self._set_cursor(zoom);zoom.src=self._expand;addEvent(zoom,'mouseover',function(){self._show_action();});addEvent(zoom,'click',function(){self._zoom();});box.appendChild(zoom);addEvent(window,'resize',function(){self._set_size(true);});if(option.closeimg){var btn=document.createElement('img');btn.id='gallery__closeButton';with(btn.style){display='inline';position='absolute';right='10px';top='10px';zIndex='80';}btn.src=option.closeimg;self._set_cursor(btn);addEvent(btn,'click',function(){self._close();});box.appendChild(btn);}if(option.nextimg){var btn=document.createElement('img');btn.id='gallery__nextButton';with(btn.style){display='inline';position='absolute';right='10px';bottom='10px';zIndex='80';}btn.src=option.nextimg;self._set_cursor(btn);addEvent(btn,'click',function(){self._move(+1)});box.appendChild(btn);}if(option.previmg){var btn=document.createElement('img');btn.id='gallery__prevButton';with(btn.style){display='inline';position='absolute';left='10px';bottom='10px';zIndex='80';}btn.src=option.previmg;self._set_cursor(btn);addEvent(btn,'click',function(){self._move(-1)});box.appendChild(btn);}var caption=document.createElement('span');caption.id='gallery__lightboxCaption';with(caption.style){display='none';position='absolute';zIndex='80';}box.appendChild(caption);if(!option.effectpos)option.effectpos={x:0,y:0};else{if(option.effectpos.x=='')option.effectpos.x=0;if(option.effectpos.y=='')option.effectpos.y=0;}var effect=new Image;effect.onload=function(){var effectImg=document.createElement('img');effectImg.id='gallery__effectImage';effectImg.src=effect.src;if(option.effectclass)effectImg.className=option.effectclass;with(effectImg.style){position='absolute';display='none';left=[option.effectpos.x,'px'].join('');;top=[option.effectpos.y,'px'].join('');zIndex='90';}self._set_cursor(effectImg);addEvent(effectImg,'click',function(){effectImg.style.display='none';});box.appendChild(effectImg);};if(option.effectimg!='')effect.src=option.effectimg;return box;},_set_photo_size:function(){var self=this;if(self._open==-1)return;var imag=self._box.firstChild;var targ={w:self._page.win.w-30,h:self._page.win.h-30};var orig={w:self._imgs[self._open].w,h:self._imgs[self._open].h};var ratio=1.0;if((orig.w>=targ.w||orig.h>=targ.h)&&orig.h&&orig.w)ratio=((targ.w/orig.w)<(targ.h/orig.h))?targ.w/orig.w:targ.h/orig.h;imag.width=Math.floor(orig.w*ratio);imag.height=Math.floor(orig.h*ratio);self._expandable=(ratio<1.0)?true:false;if(self._ua.isWinIE)self._box.style.display="block";self._box.style.top=[self._pos.y+(self._page.win.h-imag.height-30)/2,'px'].join('');self._box.style.left=[((self._page.win.w-imag.width-30)/2),'px'].join('');self._show_caption(true);},_set_size:function(onResize){var self=this;if(self._open==-1)return;self._page.update();self._pos.update();var spin=self._wrap.firstChild;if(spin){var top=(self._page.win.h-spin.height)/2;if(self._wrap.style.position=='absolute')top+=self._pos.y;spin.style.top=[top,'px'].join('');spin.style.left=[(self._page.win.w-spin.width-30)/2,'px'].join('');}if(self._ua.isWinIE){self._wrap.style.width=[self._page.win.w,'px'].join('');self._wrap.style.height=[self._page.h,'px'].join('');}if(onResize)self._set_photo_size();},_show_action:function(){var self=this;if(self._open==-1||!self._expandable)return;var obj=document.getElementById('gallery__actionImage');if(!obj)return;obj.src=(self._expanded)?self._shrink:self._expand;obj.style.display='inline';},_hide_action:function(){var self=this;var obj=document.getElementById('gallery__actionImage');if(obj)obj.style.display='none';},_zoom:function(){var self=this;if(self._expanded){self._set_photo_size();self._expanded=false;}else if(self._open>-1){var imag=self._box.firstChild;self._box.style.top=[self._pos.y,'px'].join('');self._box.style.left='0px';imag.width=self._imgs[self._open].w;imag.height=self._imgs[self._open].h;self._show_caption(false);self._expanded=true;}self._show_action();},_show_caption:function(enable){var self=this;var caption=document.getElementById('gallery__lightboxCaption');if(!caption)return;if(caption.innerHTML.length==0||!enable){caption.style.display='none';}else{var imag=self._box.firstChild;with(caption.style){top=[imag.height+10,'px'].join('');left='0px';width=[imag.width+20,'px'].join('');height='1.2em';display='block';}}},_move:function(by){var self=this;var num=self._open+by;if(num<1)num=self._imgs.length-1;if(num>=self._imgs.length)num=0;self._disable_keyboard();self._hide_action();self._box.style.display="none";self._show(num);},_show:function(num){var self=this;var imag=new Image;if(num<0||num>=self._imgs.length)return;var loading=document.getElementById('gallery__loadingImage');var caption=document.getElementById('gallery__lightboxCaption');var effect=document.getElementById('gallery__effectImage');self._open=num;self._set_size(false);self._wrap.style.display="block";if(loading)loading.style.display='inline';imag.onload=function(){if(self._imgs[self._open].w==-1){self._imgs[self._open].w=imag.width;self._imgs[self._open].h=imag.height;}if(effect){effect.style.display=(!effect.className||self._imgs[self._open].cls==effect.className)?'block':'none';}if(caption)caption.innerHTML=self._imgs[self._open].title;self._set_photo_size();self._hide_action();self._box.style.display="block";self._box.firstChild.src=imag.src;self._box.firstChild.setAttribute('title',self._imgs[self._open].title);if(loading)loading.style.display='none';};self._expandable=false;self._expanded=false;self._enable_keyboard();imag.src=self._imgs[self._open].src;self._preload_neighbors(num);},_preload_neighbors:function(num){var self=this;if((self._imgs.length-1)>num){var preloadNextImage=new Image();preloadNextImage.src=self._imgs[num+1].src;}if(num>0){var preloadPrevImage=new Image();preloadPrevImage.src=self._imgs[num-1].src;}},_set_cursor:function(obj){var self=this;if(self._ua.isWinIE&&!self._ua.isNewIE)return;obj.style.cursor='pointer';},_close:function(){var self=this;self._open=-1;self._disable_keyboard();self._hide_action();self._wrap.style.display="none";self._box.style.display="none";},_enable_keyboard:function(){__lightbox=this;addEvent(document,'keydown',this._keyboard_action);},_disable_keyboard:function(){delete __lightbox;removeEvent(document,'keydown',this._keyboard_action);},_keyboard_action:function(e){var self=__lightbox;var keycode=0;if(e.which){keycode=e.which;}else{keycode=event.keyCode;}var key=String.fromCharCode(keycode).toLowerCase();if((key=='x')||(key=='c')||(keycode==27)){self._close();}else if((key=='p')||(keycode==37)){self._move(-1);}else if(key=='n'||(keycode==39)){self._move(+1);}}};addInitEvent(function(){var lightbox=new LightBox({loadingimg:DOKU_BASE+'/lib/plugins/gallery/images/loading.gif',expandimg:DOKU_BASE+'/lib/plugins/gallery/images/expand.gif',shrinkimg:DOKU_BASE+'/lib/plugins/gallery/images/shrink.gif',closeimg:DOKU_BASE+'/lib/plugins/gallery/images/close.gif',nextimg:DOKU_BASE+'/lib/plugins/gallery/images/next.gif',previmg:DOKU_BASE+'/lib/plugins/gallery/images/prev.gif'});});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<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},hsc:function(str){str=str.replace(/&/g,"&amp;");str=str.replace(/\"/g,"&quot;");str=str.replace(/\'/g,"&#039;");str=str.replace(/</g,"&lt;");str=str.replace(/>/g,"&gt;");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 qquote(str){return str.split('\'').join('\\\'');}function ajax_spell_class(){this.inited=false;this.utf8ok=1;this.handler=DOKU_BASE+'lib/plugins/spellcheck/spellcheck.php';this.textboxObj=null;this.showboxObj=null;this.suggestObj=null;this.editbarObj=null;this.buttonObj=null;this.imageObj=null;this.txtStart='Check Spelling';this.txtStop='Resume Editing';this.txtRun='Checking...';this.txtNoErr='No Mistakes';this.txtNoSug='No Suggestions';this.txtChange='Change';this.timer=null;this.init=function(txtStart,txtStop,txtRun,txtNoErr,txtNoSug,txtChange){if(this.inited){return;}this.inited=true;var ajax=new sack(this.handler);if(ajax.failed){return;}this.textboxObj=document.getElementById('wiki__text');this.editbarObj=document.getElementById('wiki__editbar');this.showboxObj=document.getElementById('spell__result');this.suggestObj=document.getElementById('spell__suggest');if(is_gecko){this.showboxObj.style.whiteSpace='-moz-pre-wrap';}else if(is_opera_preseven){this.showboxObj.style.whiteSpace='-pre-wrap';}else if(is_opera_seven){this.showboxObj.style.whiteSpace='-o-pre-wrap';}else{this.showboxObj.style['word-wrap']='break-word';}this.txtStart=txtStart;this.txtStop=txtStop;this.txtRun=txtRun;this.txtNoErr=txtNoErr;this.txtNoSug=txtNoSug;this.txtChange=txtChange;var toolbarObj=document.getElementById('tool__bar');this.buttonObj=createToolButton(DOKU_BASE+'lib/plugins/spellcheck/images/spellcheck.png',txtStart,'k','spell__check');this.buttonObj.onclick=function(){return false;};toolbarObj.appendChild(this.buttonObj);this.imageObj=document.getElementById('spell__check_ico');ajax.AjaxFailedAlert='';ajax.encodeURIString=false;ajax.onCompletion=this.initReady;ajax.runAJAX('call=utf8test&data='+encodeURIComponent('ü'));};this.docClick=function(e){try{target=window.event.srcElement;}catch(ex){target=e.target;}if(target.id!=ajax_spell.suggestObj.id){ajax_spell.suggestObj.style.display="none";}};this.setState=function(state){switch(state){case'stop':ajax_spell.buttonObj.onclick=function(){ajax_spell.resume();return false;};ajax_spell.buttonObj.title=ajax_spell.txtStop;ajax_spell.buttonObj.accessKey='';ajax_spell.imageObj.src=DOKU_BASE+'lib/plugins/spellcheck/images/spellstop.png';break;case'noerr':ajax_spell.buttonObj.onclick=function(){ajax_spell.setState('start');return false;};ajax_spell.buttonObj.title=ajax_spell.txtNoErr;ajax_spell.buttonObj.accessKey='';ajax_spell.imageObj.src=DOKU_BASE+'lib/plugins/spellcheck/images/spellnoerr.png';break;case'run':ajax_spell.buttonObj.onclick=function(){return false;};ajax_spell.buttonObj.title=ajax_spell.txtRun;ajax_spell.buttonObj.accessKey='';ajax_spell.imageObj.src=DOKU_BASE+'lib/plugins/spellcheck/images/spellwait.gif';break;default:ajax_spell.buttonObj.onclick=function(){ajax_spell.run();return false;};ajax_spell.buttonObj.title=ajax_spell.txtStart+' [ALT-K]';ajax_spell.buttonObj.accessKey='k';ajax_spell.imageObj.src=DOKU_BASE+'lib/plugins/spellcheck/images/spellcheck.png';break;}};this.correct=function(id,word){var obj=document.getElementById('spell__error'+id);obj.innerHTML=decodeURIComponent(word);obj.style.color="#005500";this.suggestObj.style.display="none";};this.ask=function(id){var word=document.getElementById('spell__error'+id).innerHTML;word=prompt(this.txtChange,word);if(word){this.correct(id,encodeURIComponent(word));}};this.suggest=function(){var args=this.suggest.arguments;if(!args[0]){return;}var id=args[0];this.suggestObj.style.display="none";var x=findPosX('spell__error'+id);var y=findPosY('spell__error'+id);var scrollPos;if(is_opera){scrollPos=0;}else{scrollPos=this.showboxObj.scrollTop;}this.suggestObj.style.left=x+'px';this.suggestObj.style.top=(y+16-scrollPos)+'px';var text='';if(args.length==1){text+=this.txtNoSug+'<br />';}else{for(var i=1;i<args.length;i++){text+='<a href="javascript:ajax_spell.correct('+id+',\''+qquote(args[i])+'\')">';text+=args[i];text+='</a><br />';}}text+='<a href="javascript:ajax_spell.ask('+id+')">';text+='['+this.txtChange+']';text+='</a><br />';this.suggestObj.innerHTML=text;this.suggestObj.style.display="block";};this.initReady=function(){var data=this.response;if(data!='ü'){ajax_spell.utf8ok=0;}addEvent(document,'click',ajax_spell.docClick);addEvent(ajax_spell.textboxObj,'focus',ajax_spell.setState);ajax_spell.setState('start');};this.start=function(){if(ajax_spell.timer!==null){window.clearTimeout(ajax_spell.timer);ajax_spell.timer=null;}else{return;}var data=this.response;var error=data.charAt(0);data=data.substring(1);if(error=='1'){ajax_spell.setState('stop');if(!ajax_spell.utf8ok){data=data.replace(/&#(\d+);/g,function(whole,match1){return String.fromCharCode(+match1);});}ajax_spell.showboxObj.innerHTML=data;ajax_spell.showboxObj.style.width=ajax_spell.textboxObj.style.width;ajax_spell.showboxObj.style.height=ajax_spell.textboxObj.style.height;ajax_spell.textboxObj.style.display='none';ajax_spell.showboxObj.style.display='block';}else{if(error=='2'){alert(data);}ajax_spell.textboxObj.disabled=false;ajax_spell.editbarObj.style.visibility='visible';ajax_spell.setState('noerr');}};this.stop=function(){var data=this.response;if(!ajax_spell.utf8ok){data=data.replace(/&#(\d+);/g,function(whole,match1){return String.fromCharCode(+match1);});data=data.replace(/&amp;/g,'&');}ajax_spell.textboxObj.value=data;ajax_spell.textboxObj.disabled=false;ajax_spell.showboxObj.style.display='none';ajax_spell.textboxObj.style.display='block';ajax_spell.editbarObj.style.visibility='visible';ajax_spell.showboxObj.innerHTML='';ajax_spell.setState('start');};this.timedOut=function(){if(ajax_spell.timer!==null){window.clearTimeout(ajax_spell.timer);ajax_spell.timer=null;ajax_spell.textboxObj.disabled=false;ajax_spell.showboxObj.style.display='none';ajax_spell.textboxObj.style.display='block';ajax_spell.editbarObj.style.visibility='visible';ajax_spell.showboxObj.innerHTML='';ajax_spell.setState('start');window.alert('Error: The spell checker did not respond');}};this.run=function(){ajax_spell.setState('run');ajax_spell.textboxObj.disabled=true;ajax_spell.editbarObj.style.visibility='hidden';var ajax=new sack(ajax_spell.handler);ajax.AjaxFailedAlert='';ajax.encodeURIString=false;ajax.onCompletion=this.start;ajax.runAJAX('call=check&utf8='+ajax_spell.utf8ok+'&data='+encodeURIComponent(ajax_spell.textboxObj.value));this.timer=window.setTimeout(ajax_spell.timedOut,13000);};this.resume=function(){ajax_spell.setState('run');var text=ajax_spell.showboxObj.innerHTML;if(text!==''){var ajax=new sack(ajax_spell.handler);ajax.AjaxFailedAlert='';ajax.encodeURIString=false;ajax.onCompletion=ajax_spell.stop;ajax.runAJAX('call=resume&utf8='+ajax_spell.utf8ok+'&data='+encodeURIComponent(text));}};}var ajax_spell=null;addInitEvent(function(){if(toolbar&&toolbar[0]){ajax_spell=new ajax_spell_class();ajax_spell.init(LANG['plugins']['spellcheck']['start'],LANG['plugins']['spellcheck']['stop'],LANG['plugins']['spellcheck']['wait'],LANG['plugins']['spellcheck']['noerr'],LANG['plugins']['spellcheck']['nosug'],LANG['plugins']['spellcheck']['change']);}});addInitEvent(function(){updateAccessKeyTooltip();});addInitEvent(function(){scrollToMarker();});addInitEvent(function(){focusMarker();});
