var OZONE=function(){};OZONE.ajax={_callbackArray:new Array(),_callbackArrayIndex:0,_javascriptLoadLock:false,requestModule:function(A,G,F,H,I){OZONE.visuals.cursorWait();if(G==null){G=new Object()}if(A==null||A==""){A="Empty"}G.moduleName=A;if(I&&I.clearRequestQueue){OZONE.ajax._callbackArray=new Array()}var D=OZONE.ajax._callbackArrayIndex++;OZONE.ajax._callbackArray[D]={callback:F,arg:H};G.callbackIndex=D;var B=OZONE.utils.getCookie("wikidot_token7");if(B==null){alert("Error processing the request.\n\nYou have no valid security token which is required to prevent identity theft.\nPlease enable cookies in your browser if you have this option disabled and reload the page.");OZONE.visuals.cursorClear();return }G.wikidot_token7=B;var E=OZONE.utils.arrayToPostData(G);var C=OZONE.ajax.requestModuleCallback;YAHOO.util.Connect.asyncRequest("POST","/ajax-module-connector.php",C,E)},parseResponse:function(A){res=JSON.parse(A);if(!res){alert(A.replace(/\r?\n/g," "))}return res},requestModuleCallback:{success:function(D){var B=OZONE.ajax.parseResponse(D.responseText);if(B.status=="wrong_token7"){alert("wikidot.com security error:\n\nYour authentication token in the request is not valid. Please enable cookies in your browser and try to repeat the action.\n\nIf you see this message on the page not associated with the wikidot.com wiki hosting it probably means an indentity theft attempt or improper use of wikidot.com service.");OZONE.visuals.cursorClear();return }var E=B.callbackIndex;if(E==null){OZONE.visuals.cursorClear();OZONE.dialog.cleanAll()}if(!OZONE.ajax._callbackArray[E]){return }var F=OZONE.ajax._callbackArray[E]["callback"];if(!F){alert("internal: callback error")}var A=OZONE.ajax._callbackArray[E]["arg"];if(A!=null){F(B,A)}else{F(B)}if(B.jsInclude!=null){for(var C=0;C<B.jsInclude.length;C++){OZONE.utils.addJavascriptUrl(B.jsInclude[C])}}if(B.cssInclude!=null){for(var C=0;C<B.cssInclude.length;C++){OZONE.utils.addStyleUrl(B.cssInclude[C])}}OZONE.visuals.cursorClear()},failure:function(A){alert("The ajax request failed. Please check your internet connection or\nreport a bug if the error repeats during your work.\ncode:"+A.status);OZONE.visuals.cursorClear();OZONE.dialog.cleanAll()}},requestQuickModule:function(A,D,F){if(D==null){D=new Object()}if(A==null||A==""){alert("Quick module name empty.")}var E=OZONE.ajax._callbackArrayIndex++;OZONE.ajax._callbackArray[E]=F;D.callbackIndex=E;var C=JSON.stringify(D);var B=OZONE.ajax.requestQuickModuleCallback;YAHOO.util.Connect.asyncRequest("POST","/quickmodule.php?module="+A,B,C)},parseResponse:function(A){res=JSON.parse(A);if(!res){alert(A.replace(/\r?\n/g," "))}return res},requestQuickModuleCallback:{success:function(B){var A=OZONE.ajax.parseResponse(B.responseText);var C=A.callbackIndex;var D=OZONE.ajax._callbackArray[C];D(A)},failure:function(A){alert("The ajax request failed. Please check your internet connection or\nreport a bug if the error repeats during your work.")}}};OZONE.utils={formToArray:function(D){D=$(D);if(D==null){return }var C=new Object();for(i=0;i<D.length;i++){var A=D.elements[i];var B=A.type;if(B=="text"||B=="hidden"||B=="password"||B=="select-one"||B=="textarea"||B=="select"){C[A.name]=A.value}if(B=="checkbox"&&A.checked==true){C[A.name]="on"}if(B=="radio"&&A.checked==true){C[A.name]=A.value}}return C},arrayToPostData:function(A){if(A==null){return null}var B="";var C;for(key in A){C=encodeURIComponent(A[key]);B+="&"+key+"="+C}if(B.length>0){B=B.substring(1)}return B},addJavascriptUrl:function(C,E,B){if(OZONE.utils._javascripLoadLock&&(new Date()).getTime()<OZONE.utils._javascripLoadLock+2000){setTimeout(function(){OZONE.utils.addJavascriptUrl(C,E,B)},50);return }OZONE.utils._javascripLoadLock=false;var D=document.getElementsByTagName("head").item(0);var A=D.getElementsByTagName("script");for(i=0;i<A.length;i++){if(A[i].getAttribute("src")==C){if(B){if(E){E()}return }D.removeChild(A[i])}}OZONE.utils._javascripLoadLock=(new Date()).getTime();var F=document.createElement("script");F.setAttribute("type","text/javascript");F.setAttribute("src",C);if(YAHOO.env.ua.ie){F.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){F.onreadystatechange=null;OZONE.utils._javascripLoadLock=false;if(E){E.call()}}}}else{YAHOO.util.Event.addListener(F,"load",function(){OZONE.utils._javascripLoadLock=false;if(E){E.call()}})}D.appendChild(F)},addStyleUrl:function(B,D,A){var C=document.getElementsByTagName("head").item(0);var E=C.getElementsByTagName("link");for(i=0;i<E.length;i++){if(E[i].type="text/css"&&E[i].getAttribute("src")==B){if(A){if(D){D()}return }C.removeChild(E[i])}}var F=document.createElement("link");F.rel="stylesheet";F.type="text/css";F.href=B;if(D){YAHOO.util.Event.addListener(F,"load",D)}C.appendChild(F)},setInnerHTMLContent:function(A,C){var B=$(A);if(B){B.innerHTML=C;OZONE.utils.formatDates(B);OZONE.dialog.hovertip.dominit(B)}},disableEnterKey:function(C){var A;var B=(C.target)?C.target:C.srcElement;if(B.tagName=="TEXTAREA"){return true}if(window.event){A=window.event.keyCode}else{A=C.which}if(A==13){return false}else{return true}},escapeHtml:function(A){if(A==null||A==""){return""}return A.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")},unescapeHtml:function(A){if(A==null||A==""){return""}return A.split("&gt;").join(">").split("&lt;").join("<").split("&amp;").join("&")},formatDates:function(Y){var J=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var A=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var U=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var N=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");Y=$(Y);var D="";var G=YAHOO.util.Dom.getElementsByClassName("odate","span",Y);for(i=0;i<G.length;i++){var X=G[i].innerHTML;if(X.match(/^[0-9]+$/)){var E=X;var T=new Date();T.setTime(E*1000);D=T.toLocaleString()}if(X.match(/^[0-9]+\s*\|.*$/)){var W;var E=X.replace(/^([0-9]+)\s*\|.*/,"$1");var O=X.replace(/^[0-9]+\s*\|\s*(.*?)(?:\|(.*))?$/,"$1");var F=X.replace(/^[0-9]+\s*\|\s*(.*?)(?:\|(.*))?$/,"$2");G[i].timestamp=E;var T=new Date();T.setTime(E*1000);D=O;D=D.replace(/%r/g,"%I:%M:%S %p");D=D.replace(/%R/g,"%H:%M");D=D.replace(/%T/g,"%H:%M:%S");D=D.replace(/%D/g,"%m/%d/%y");D=D.replace(/%a/g,N[T.getDay()]);D=D.replace(/%A/g,U[T.getDay()]);D=D.replace(/%b/g,A[T.getMonth()]);D=D.replace(/%B/g,J[T.getMonth()]);D=D.replace(/%c/g,T.toLocaleString());W=T.getDate();D=D.replace(/%d/g,(W<10)?"0"+W:W);D=D.replace(/%e/g,T.getDate());var P=T.getHours();D=D.replace(/%H/g,(P<10)?"0"+P:P);var Q=(P-1)%12+1;D=D.replace(/%I/g,(Q<10)?"0"+Q:Q);var V=T.getMonth();D=D.replace(/%m/g,(V+1<10)?"0"+(V+1):V+1);var M=T.getMinutes();D=D.replace(/%M/g,(M<10)?"0"+M:M);D=D.replace(/%p/g,(P<12)?"AM":"PM");var L=T.getSeconds();D=D.replace(/%S/g,(L<10)?"0"+L:L);var I=T.getYear();I=(I<10)?"0"+I:""+I;D=D.replace(/%y/g,I.substring(I.length-2));var C=T.getFullYear();D=D.replace(/%Y/g,C);if(D.match(/%z/i)){var S;S=T.toLocaleString().replace(/^.*?([A-Z]{3,}(?:\+[0-9]+)?).*$/,"$1");if(S==T.toLocaleString()){var K=T.getTimezoneOffset();K=-K/60;K=((K<10)?"0"+K:K)+"00";S=(K>0)?"+"+K:"-"+K}D=D.replace(/%z/ig,S)}if(D.match(/%O/)||F.match(/agohover/)){var R=OZONE.request.timestamp-E;R+=Math.floor(((new Date()).getTime()-OZONE.request.date.getTime())*0.001);var H=OZONE.utils.calculateDateAgo(R);D=D.replace(/%O/,H);if(F.match(/agohover/)){var B=H+" ago";OZONE.dialog.hovertip.makeTip(G[i],{text:B,style:{width:"auto"}});YAHOO.util.Event.addListener(G[i],"mouseover",function(b){var a=OZONE.request.timestamp-this.timestamp;a+=Math.floor(((new Date()).getTime()-OZONE.request.date.getTime())*0.001);var Z=OZONE.utils.calculateDateAgo(a);this.hovertip.getElementsByTagName("div").item(0).innerHTML=Z+" "+ogettext("ago")})}}}if(D){G[i].innerHTML=D;G[i].style.visibility="visible";G[i].style.display="inline"}}},calculateDateAgo:function(D){var A;if(D>=60*60*24){var E=Math.floor(D/(60*60*24));A=""+E+" "+((E)>1?ogettext("days"):ogettext("day"))}else{if(D>=60*60){var B=Math.floor(D/(60*60));A=""+B+" "+((B)>1?ogettext("hours"):ogettext("hour"))}else{if(D>=60){var C=Math.floor(D/60);A=""+C+" "+((C)>1?ogettext("minutes"):ogettext("minute"))}else{if(D==0){D++}A=""+D+" "+((D)>1?ogettext("seconds"):ogettext("second"))}}}return A},formatDatesOld:function(C){if(C==null){var E=document.getElementsByTagName("odate")}else{var B=$(C);var E=B.getElementsByTagName("odate")}for(i=0;i<E.length;i++){var D=E[i].innerHTML;var A=new Date();A.setTime(D*1000);var F=A.toLocaleString();E[i].innerHTML=F}},loadPage:function(B,D){var C=document.createElement("form");for(p in D){var A=document.createElement("input");A.type="hidden";A.name=p;A.value=D[p];C.appendChild(A)}C.name="loadPageForm";C.action=B;C.method="post";C.display="none";C.target="_self";document.getElementsByTagName("body").item(0).appendChild(C);C.submit()},getCookie:function(C){if(document.cookie.length>0){var B=document.cookie.indexOf(C+"=");if(B!=-1){B=B+C.length+1;var A=document.cookie.indexOf(";",B);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(B,A))}}return null},olang:function(A){return A.replace(/\[\[olang (.*?)\|\]\]/g,function(H,G,F,C){var E=OZONE.lang;var B=new RegExp(E+":([^|]*)(||]])");var D=H.match(B);if(D){return D[1]}})}};OZONE.lang="en";OZONE.loc={};OZONE.loc.messages={};OZONE.loc.addMessages=function(A,C){if(!OZONE.loc.messages[C]){OZONE.loc.messages[C]={}}for(var B in A){OZONE.loc.messages[C][B]=A[B]}};OZONE.loc.addMessage=function(B,A,C){if(!OZONE.loc.messages[C]){OZONE.loc.messages[C]={}}OZONE.loc.messages[C][B]=A};OZONE.loc.getMessage=function(A,B){if(OZONE.loc.messages[B]){if(OZONE.loc.messages[B][A]){return OZONE.loc.messages[B][A]}}return A};ogettext=function(A){return OZONE.loc.getMessage(A,OZONE.lang)};OZONE.visuals={cursorWait:function(){var A=document.getElementsByTagName("body")[0];YAHOO.util.Dom.addClass(A,"wait")},cursorClear:function(){var A=document.getElementsByTagName("body")[0];YAHOO.util.Dom.removeClass(A,"wait")},scrollTo:function(A,B){OZONE.visuals.scrollToCenter(A,B)},scrollToCenter:function(B,A){var C=new fx.ScrollCenter({duration:200,transition:fx.sineOut});C.scrollTo(B);if(A!=null&&A.blink==true){ofx34=new fx.Opacity(B,{duration:150,transition:fx.circ});setTimeout("ofx34.custom(1,0.1)",300);setTimeout("ofx34.custom(0.1,1);",1000)}if(A!=null&&A.alterHref==true){}},scrollOffsetY:function(){var A;if(self.pageYOffset){A=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}else{if(document.body){A=document.body.scrollTop}}}return A},bodyHeight:function(){var A,D;var C=document.body.scrollHeight;var B=document.body.offsetHeight;if(C>B){return document.body.scrollHeight}else{return document.body.offsetHeight}},initScroll:function(){if(window.location.hash!=null&&window.location.href!=""){var A=window.location.hash.replace(/#/,"");if(A!=null&&A!=""&&$(A)){OZONE.visuals.scrollTo(A,{blink:true})}}},highlightText:function(G,I){if(I.indexOf(" ")!=-1){var A=I.split(/ +/);for(var C=0;C<A.length;C++){if(!A[C].match(/^\-/)){OZONE.visuals.highlightText(G,A[C])}}return }G=$(G);if(!G){return }if(G.hasChildNodes){var E=G.childNodes;for(var C=E.length-1;C>=0;C--){OZONE.visuals.highlightText(E[C],I)}}if(G.nodeType==3){var B=new RegExp(I,"gi");if(G.nodeValue.match(B)){var D=(" "+G.nodeValue+" ").split(B);p=G.parentNode;for(var C=0;C<D.length;C++){if(C!=0){var H=document.createElement("span");H.className="search-highlight";H.appendChild(document.createTextNode(I));p.insertBefore(H,G)}var F=document.createTextNode(D[C]);if(C!=D.length-1){p.insertBefore(F,G)}else{p.replaceChild(F,G)}}}}}};OZONE.forms={};OZONE.forms.lengthLimiter=function(B,C,A){this.textElement=$(B);this.countElement=$(C);this.limit=A;YAHOO.util.Event.addListener(this.textElement,"keyup",this.keyListener,this,true);this.keyListener()};OZONE.forms.lengthLimiter.prototype.keyListener=function(C){var A=this.textElement.value.replace(/\r\n/,"\n").length;this.countElement.innerHTML=this.limit-A;if(A>this.limit){var B=this.textElement.scrollTop;this.textElement.value=this.textElement.value.substr(0,this.limit);this.textElement.scrollTop=B;A=this.textElement.value.replace(/\r\n/,"\n").length;this.countElement.innerHTML=this.limit-A}};OZONE.dom={insertAfter:function(A,C,B){if(B.nextSibling){A.insertBefore(C,B.nextSibling)}else{A.appendChild(C)}},onDomReady:function(C,B,D){if(!D){D=document}if(typeof D.getElementsByTagName!="undefined"&&(D.getElementsByTagName("body")[0]!=null||D.body!=null)&&(typeof B!="string"||$(B))){if(typeof C=="function"){C()}else{OZONE.dom.onDomReady.fs[C].call()}}else{var E;if(typeof C=="function"){if(!OZONE.dom.onDomReady.fs){OZONE.dom.onDomReady.fs=new Array()}E=OZONE.dom.onDomReady.fs.push(C)-1}else{E=C}var A="OZONE.dom.onDomReady("+E;if(typeof B=="string"){A+=',"'+B+'"'}A+=")";setTimeout(A,200)}}};OZONE.request={};OZONE.init=function(){};