Warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 410
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 410
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 410
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 410
Warning: Cannot modify header information - headers already sent by (output started at /var/www/deki-hayes/includes/libraries/ui_handlers.php:410) in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 124
Warning: Cannot modify header information - headers already sent by (output started at /var/www/deki-hayes/includes/libraries/ui_handlers.php:410) in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 126
Warning: Cannot modify header information - headers already sent by (output started at /var/www/deki-hayes/includes/libraries/ui_handlers.php:410) in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 127
Warning: Cannot modify header information - headers already sent by (output started at /var/www/deki-hayes/includes/libraries/ui_handlers.php:410) in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 128
Warning: Cannot modify header information - headers already sent by (output started at /var/www/deki-hayes/includes/libraries/ui_handlers.php:410) in /var/www/deki-hayes/includes/libraries/ui_handlers.php on line 135
/*
yahoo-dom-event.js (31,068),
animation.js (13,669),
connection.js (11,878),
element.js (8,543),
dragdrop.js (22,571),
json.js (2,734),
wikibits.js (8,424),
menu.js (9,831),
md5.compressed.js (5,234),
print.js (4,917),
gallery.js (1,387),
messaging.js (3,745),
general.js (5,695),
Mindtouch.util.js (3,079),
jquery.min.js (54,221),
comments.js (2,599),
thickbox.js (12,743),
pagebus.js (4,035),
rgbcolor.js (8,752),
nav.js (33,718)
*/
stylePath = "/skins/ace/";
_skin_path = "/skins/";
_script_path = "/";
baseHref = "http://wiki.aransalut.net";
_editor_path = "/editor/Xinha";
_editor_url = "/editor/Xinha/core";
_editor_lang = "es";
_editor_skin = "";
var _gallery_sort = "date-desc";
var _total_images = 6;
var Browser = new BrowserVersion();
/* --------- YAHOO-DOM-EVENT.JS --------- */
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.1",build:"984"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){A=H[0];}try{F=K.fn.call(J,A,K.obj);}catch(E){this.lastError=E;}}else{try{F=K.fn.call(J,this.type,H,K.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);
I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.1",build:"984"});
/* --------- CONNECTION.JS --------- */
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};}catch(C){for(var B=0;B=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E");if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C0){for(var G=0;Gthis.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return ;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;
this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(Cthis.maxX){C=this.maxX;}}if(this.constrainY){if(Fthis.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");
YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G0&&I-NB&&F0&&J-D=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1)||"null";}}B.pop();return"["+S.join(",")+"]";}if(W==="object"){if(!J){return"null";}for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.1",build:"984"});
/* --------- WIKIBITS.JS --------- */
/*
* MindTouch DekiWiki - a commercial grade open source wiki
* derived from MediaWiki (www.mediawiki.org)
* Copyright (C) 2006 MindTouch, Inc.
* www.mindtouch.com oss@mindtouch.com
*
* For community documentation and downloads visit www.opengarden.org;
* please review the licensing section.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* http://www.gnu.org/copyleft/gpl.html
*/
//node is the current checkbox
function select_checkboxes(node) {
//select all checkboxes that is in the same form as this checkbox
var boxes = DekiWiki.$("input[@type='checkbox']", DekiWiki.$(node).parents('form'));
return node.checked ? boxes.check(): boxes.uncheck();
}
// make the specified div a windowed control in IE6
// this masks an iframe (which is a windowed control) onto the div,
// turning the div into a windowed control itself
function makeWindowed(p_div)
{
var is_ie6 =
document.all &&
(navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1);
if (is_ie6)
{
var html =
"";
if (p_div) p_div.innerHTML += html;
// force refresh of div
var olddisplay = p_div.style.display;
p_div.style.display = 'none';
p_div.style.display = olddisplay;
};
}
var saveFlag = false;
var MTPageLoad = function() {};
MTPageLoad.HookEditSectionIcons = function() {
DekiWiki.$("h2.editable,h3.editable,h4.editable,h5.editable,h6.editable", DekiWiki.$("#pageText"))
.wrapInner("")
.append(''
+'

'
);
HookSectionEditBehavior();
};
var HookSectionEditBehavior = function() {
DekiWiki.$("h2.editable,h3.editable,h4.editable,h5.editable,h6.editable", DekiWiki.$("#pageText"))
.hover(
function() { DekiWiki.$("div.editIcon > a", this).get(0).style.visibility = 'visible'; },
function() { DekiWiki.$("div.editIcon > a", this).get(0).style.visibility = 'hidden'; }
);
};
function BrowserVersion(){
BrowserVersion.minInternetExplorerVersion = 6.0;
BrowserVersion.minFirefoxVersion = 1.5;
BrowserVersion.minCaminoVersion = "1.0";
BrowserVersion.minFlockVersion = "0.5";
this.isIE = false;
this.isFF = false;
this.isMozilla = false;
this.isNS = true;
this.isCamino = false;
this.isSafari = false;
this.isFlock = false;
this.version = null;
this.isSupported = true;
var browserApp = navigator.userAgent;
var s = "MSIE";
var i;
if((i = browserApp.indexOf(s)) >= 0){
this.isIE = true;
this.isNS = false;
this.version = parseFloat(browserApp.substr(i+s.length));
if(this.version < BrowserVersion.minInternetExplorerVersion){
this.isSupported = false;
}
return;
}
s = "Firefox/";
if((i = browserApp.indexOf(s)) >= 0){
this.isFF = true;
this.version = parseFloat(browserApp.substr(i+s.length));
if(this.version < BrowserVersion.minFirefoxVersion){
this.isSupported = false;
}
return;
}
s = "SeaMonkey/";
if((i = browserApp.indexOf(s)) >= 0){
this.isMozilla = true;
this.isSupported = true;
return;
}
s = "Safari/";
if((i = browserApp.indexOf(s)) >= 0){
this.isSafari = true;
this.isSupported = true;
return;
}
s = "Camino/";
if((i = browserApp.indexOf(s)) >= 0){
this.isCamino = true;
this.version = browserApp.substr(i+s.length);
if(this.version < BrowserVersion.minCaminoVersion){
this.isSupported = false;
}
return;
}
s = "Flock/";
if((i = browserApp.indexOf(s)) >= 0){
this.isFlock = true;
this.version = browserApp.substr(i+s.length);
if(this.version >= BrowserVersion.minFlockVersion){
this.isSupported = true;
}
return;
}
s = "Netscape6/";
if((i = browserApp.indexOf(s)) >= 0){
this.isNS = true;
this.version = parseFloat(browserApp.substr(i+s.length));
return;
}
s = "Gecko";
if((i = browserApp.indexOf(s)) >= 0){
this.isNS = true;
this.version = 6.1;
}
};
function showToc(node) {
return DWMenu.Position('menuPageContent', node, -2, 0);
}
/***
* hooks an onclick to all links in the table of contents dropdown which closes the window
*/
function hookTOCLinks() {
DekiWiki.$('.pageToc ol a').click(function() { DWMenu.BodyClick(); });
};
function breadcrumbLoad(z) {
document.getElementById('breadcrumb').innerHTML = z;
};
function array_search(needle, haystack) {
for (var i = 0; i < haystack.length; i++ ) {
if (haystack[i] == needle)
return i;
}
return false;
};
// in [-]HH:MM format...
// won't yet work with non-even tzs
function fetchTimezone() {
// FIXME: work around Safari bug
var localclock = new Date();
// returns negative offset from GMT in minutes
var tzRaw = localclock.getTimezoneOffset();
return formatTimezone(tzRaw);
};
function formatTimezone(tzSecs) {
var tzHour = Math.floor( Math.abs(tzSecs) / 60);
var tzMin = Math.abs(tzSecs) % 60;
return ((tzSecs >= 0) ? "-" : "") + ((tzHour < 10) ? "0" : "") + tzHour +
":" + ((tzMin < 10) ? "0" : "") + tzMin;
};
function openWindow(href,menu) {
window.open(href, 'popupwindow', 'width='+(winX - 100)+',height='+(winY - 100)+',scrollbars,resizable' + (menu ? ',menubar=yes' : ''));
return false;
};
// StepanR: Functions store and check attachments view mode,
// that is if revisions are shown or not
var gAttachments = new Array();
function SwitchShowMode(aId, aShowRevisions) {
gAttachments[aId] = aShowRevisions;
}
function isShowRevisionsEnabled(aId)
{
if (gAttachments[aId] != undefined) {
return gAttachments[aId];
}
return 'false';
}
function toggleAttachments(fileId) {
DekiWiki.$('#showlink-'+fileId).toggle();
DekiWiki.$('#hidelink-'+fileId).toggle();
DekiWiki.$('#attachTable tr.attach_'+fileId).toggle();
return false;
};
function toggleChangesTable(divid) {
DekiWiki.$('#showlink-'+divid).toggle();
DekiWiki.$('#hidelink-'+divid).toggle();
DekiWiki.$('table tr.'+divid).toggle();
return false;
};
/* blank function for sajax callback */
function cb_blank() {};
function selectSkin(node) {
var divs = DekiWiki.$('#styleSelections').find('input').get();
var activeSkin = false;
for ( var i = 0; i < divs.length; i++ ) {
if (divs[i].name == 'wgActiveSkin') {
divs[i].disabled = true;
}
}
var child = DekiWiki.$('#skinStyle'+node.id).find('input').get();
for ( var i = 0; i < child.length; i++ ) {
if (child[i].name == 'wgActiveSkin') {
child[i].disabled = false;
activeSkin = child[i].checked == true;
}
}
if (!activeSkin) {
child[0].checked = true;
}
showPreview();
};
function showPreview() {
var child = DekiWiki.$('#styleSelections').find('input').get();
for ( var i = 0; i < child.length; i++ ) {
if (child[i].checked == true) {
if (child[i].name == 'wgActiveTemplate') {
var wgActiveTemplate = child[i].value;
}
else if (child[i].name == 'wgActiveSkin') {
var wgActiveSkin = child[i].value;
}
}
}
DekiWiki.$('#previewSkin').html('
');
};
/* --------- MENU.JS --------- */
/*
* MindTouch DekiWiki - a commercial grade open source wiki
* derived from MediaWiki (www.mediawiki.org)
* Copyright (C) 2006 MindTouch, Inc.
* www.mindtouch.com oss@mindtouch.com
*
* For community documentation and downloads visit www.opengarden.org;
* please review the licensing section.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* http://www.gnu.org/copyleft/gpl.html
*/
function DWMenu() {};
DWMenu.Bubble = false;
DWMenu.Opened = false;
DWMenu.OpenedNow = false;
DWMenu.Selected = false;
DWMenu.LinkClick = function(divid, xoffset) {
if (DWMenu.Opened && DWMenu.Opened != divid)
DWMenu.Toggle(DWMenu.Opened, xoffset);
DWMenu.Toggle(divid, xoffset);
};
DWMenu.Toggle = function(divid, xoffset) {
var node = DekiWiki.$('#'+divid);
//todo nullref
var display = node.css('display');
node.toggle();
if (display == 'block') {
DWMenu.Opened = false;
}
else {
node.css('visibility', 'hidden'); //for ie6
var dimensions = Mindtouch.util.Dom.getDimensions(node);
var position = YAHOO.util.Dom.getXY(node);
if (typeof(winX) != 'null') {
if ((position[0] + dimensions.width) > (winX - 36)) {
if (typeof(offsetX) == 'undefined') offsetX = 0;
node.css('left', (position[0] - dimensions.width + offsetX + 5)+'px');
}
}
node.css('visibility', '');
DWMenu.Opened = divid;
DWMenu.OpenedNow = true;
}
}
DWMenu.Position = function (divid, elt, offsetX, offsetY) {
if (!document.getElementById(divid)) return;
var x = YAHOO.util.Dom.getX(elt);
var y = YAHOO.util.Dom.getY(elt);
var dimensions = Mindtouch.util.Dom.getDimensions(elt);
offsetY = offsetY + dimensions.height;
if (typeof(offsetX) == 'number') x = x + offsetX;
if (typeof(offsetY) == 'number') y = y + offsetY;
DekiWiki.$("#" + divid).css("left", x+'px').css("top", y+'px');
DWMenu.LinkClick(divid, dimensions.width);
return false;
};
DWMenu.Off = function(divid) {
var display = DekiWiki.$('#'+divid).css('display');
if (display == 'block') {
DekiWiki.$('#'+divid).toggle();
DWMenu.Opened = false;
}
};
DWMenu.BodyClick = function() {
if (!DWMenu.OpenedNow && !DWMenu.Bubble && DWMenu.Opened) {
if (!DWMenu.Selected) {
DWMenu.Toggle(DWMenu.Opened);
}
}
if (DWMenu.Bubble)
DWMenu.Bubble = false;
if (DWMenu.OpenedNow)
DWMenu.OpenedNow = false;
};
//deprecated
var menuLinkClick = function(divid, offsetX) {
DWMenu.LinkClick(divid, offsetX);
};
var menuToggle = function(navid, offsetX) {
DWMenu.Toggle(navid, offsetX);
};
var menuPosition = function (navid, elt, offsetX, offsetY) {
return DWMenu.Position(navid, elt, offsetX, offsetY);
};
var menuOff = function(navid) {
DWMenu.Off(navid);
};
var menuBodyClick = function() {
DWMenu.BodyClick();
};
var FileMenu = {
lastOpened : null, //the last opened menu id
isOpening : null,
openMenu : false,
justClosed : false,
maxHeight: 132, //max height of the menu
minHeight: 1, //min height of the menu; keep at least 1px for IE
bodyClick : function() {
if (this.isOpening) {
this.isOpening = null;
return;
}
if(this.lastOpened) {
this.hide();
}
return false;
},
/***
*
*/
show : function(node, titleID, attachID, isLoggedIn, showRevisions, areRevisions, reviseURL, isRestricted, inGallery, fullUrl) {
this.menuBubble = true;
this.isOpening = true;
var divFiller = 'menuFiller'; //filler div for filling the menu
var divMenu = 'npdmenu_' + titleID; //menu generated by generateMenu()
if (this.lastOpened && '_' + titleID != this.lastOpened) {
this.hide();
}
else if (this.lastOpened) {
this.hide();
this.justClosed = true;
return false;
}
this.lastOpened = '_' + titleID;
var eltFiller = document.getElementById(divFiller);
eltFiller.style.position = 'absolute';
eltFiller.style.left = (YAHOO.util.Dom.getX(node))+'px';
eltFiller.style.top = (YAHOO.util.Dom.getY(node) + 16) + 'px';
//StepanR: I need an attachment name for menu generation function, this actual only for latest revisions. Previous revs already has ids in title
var lAttachName = node.parentNode.parentNode.className.substr('attach_'.length);
//for IE
eltFiller.style.display = '';
//first, generate the new menu
eltFiller.appendChild(this.generateMenu(titleID, attachID, isLoggedIn, showRevisions, areRevisions, reviseURL, isRestricted, lAttachName, inGallery, fullUrl));
//calculations need to be done when an element is visible
eltFiller.style.display = 'block';
var dimensions = Mindtouch.util.Dom.getDimensions(divMenu);
var linkDimensions = Mindtouch.util.Dom.getDimensions(node);
var position = YAHOO.util.Dom.getXY(eltFiller);
if (typeof(winX) != 'null' && typeof(winY) != 'null')
{
var pageDimensions = YAHOO.util.Dom.getXY(DekiWiki.$('#bodyHeight').get(0));
var pageHeight = pageDimensions[1];
var extendsRight = (position[0] + dimensions.width) > (winX - 36);
var extendsBottom = (position[1] + dimensions.height) > pageHeight;
var horizOffset = position[0] - dimensions.width + linkDimensions.width + 5;
if (extendsRight) {
if (typeof(offsetX) == 'undefined') offsetX = 0;
eltFiller.style.left = horizOffset+'px';
}
if (extendsBottom) {
var vertOffset = position[1] - ((position[1] + dimensions.height) - pageHeight);
eltFiller.style.top = vertOffset + 'px';
horizOffset = position[0] + linkDimensions.width;
eltFiller.style.left = horizOffset+'px';
}
}
DekiWiki.$('#'+divMenu).toggle();
menuLinkClick(divMenu, dimensions.width);
return false;
},
hide: function () {
if (this.lastOpened) {
var eltMenu = 'npdmenu' + this.lastOpened;
var elt = document.getElementById(eltMenu);
elt.parentNode.removeChild(elt);
menuLinkClick(eltMenu);
}
this.lastOpened = null;
},
generateMenu : function (titleID, attachID, isLoggedIn, showRevisions, areRevisions, reviseURL, isRestricted, lAttachName, inGallery, fullUrl) {
function addMenuItem(icon, text, href, onclick, cssClass) {
var item = document.createElement('li');
var a = document.createElement('a');
a.href = href;
a.className = 'mlink'+(cssClass && cssClass != '' ? ' '+cssClass: '');
item.className = 'mlink'+(cssClass && cssClass != '' ? ' '+cssClass: '');
a.appendChild(iconify(icon+(cssClass && cssClass != '' ? '-'+cssClass: '')));
var span = document.createElement('span');
span.innerHTML = text;
span.className = 'text';
a.appendChild(span);
if (onclick && isLoggedIn)
a.onclick = onclick;
item.appendChild(a);
menuList.appendChild(item);
};
var divid = 'npdmenu_' + titleID;
var divMain = document.createElement('div');
divMain.onclick = function () {
menuBubble = true;
};
divMain.className = 'dmenu';
var divWrap = document.createElement('div');
divWrap.id = divid;
divWrap.className = 'dmenu-wrap';
var divTop = document.createElement('div');
divTop.className = 'dmenu-top';
var divBottom = document.createElement('div');
divBottom.className = 'dmenu-bottom';
var divBody = document.createElement('div');
divBody.className = 'dmenu-body';
var menuList = document.createElement('ul');
if (inGallery) {
addMenuItem('attachoriginal', wfMsg('menu-view-original'), fullUrl, function () {}, false);
}
if (isLoggedIn) {
addMenuItem('attachedit', wfMsg('menu-edit-description'), '#', function () {
if (!isRestricted) {
return doPopupEditAttach(_page_ID, attachID);
}
}, isRestricted ? 'disabled': false);
addMenuItem('attachmove', wfMsg('menu-move-file'), '#', function () {
if (!isRestricted) {
return doPopupMoveAttach(_page_ID, attachID, inGallery);
}
}, isRestricted ? 'disabled': false);
// StepanR: if file revisions are displayed, then we use ids fo deletion.
var RevMode = isShowRevisionsEnabled(lAttachName);
addMenuItem('attachdel', wfMsg('menu-delete-file'), '#', function() {
if (!isRestricted) {
if (confirm(wfMsg('menu-confirm-delete'))) {
x_wfDeleteFile(attachID, inGallery, function(z) {
if (inGallery) {
Attachments.SetImageCount(Attachments.GetImageCount() - 1);
MTGallery.Refresh();
Attachments.SetCount();
}
else {
window.location.reload();
}
});
}
return false;
}
}, isRestricted ? 'disabled': false);
}
else {
addMenuItem('attachedit', wfMsg('menu-edit-description'), '#', function () { return false; }, 'disabled');
addMenuItem('attachmove', wfMsg('menu-move-file'), '#', function () { return false; }, 'disabled');
addMenuItem('attachdel', wfMsg('menu-delete-file'), '#', function() { return false; }, 'disabled');
}
if (showRevisions) {
if (areRevisions) {
addMenuItem('attachhist', wfMsg('menu-previous-versions'), reviseURL, false, false);
}
else {
addMenuItem('attachhist', wfMsg('menu-previous-versions'), '#', function () { return false;}, 'disabled');
}
}
divBody.appendChild(menuList);
divWrap.appendChild(divTop);
divWrap.appendChild(divBody);
divWrap.appendChild(divBottom);
divMain.appendChild(divWrap);
return divMain;
}
};
/* --------- MD5.COMPRESSED.JS --------- */
var hexcase=0;
var b64pad="";
var chrsz=8;
function hex_md5(s){
return binl2hex(core_md5(str2binl(s),s.length*chrsz));
}
function b64_md5(s){
return binl2b64(core_md5(str2binl(s),s.length*chrsz));
}
function str_md5(s){
return binl2str(core_md5(str2binl(s),s.length*chrsz));
}
function hex_hmac_md5(_4,_5){
return binl2hex(core_hmac_md5(_4,_5));
}
function b64_hmac_md5(_6,_7){
return binl2b64(core_hmac_md5(_6,_7));
}
function str_hmac_md5(_8,_9){
return binl2str(core_hmac_md5(_8,_9));
}
function core_md5(x,_b){
x[_b>>5]|=128<<((_b)%32);
x[(((_b+64)>>>9)<<4)+14]=_b;
var a=1732584193;
var b=-271733879;
var c=-1732584194;
var d=271733878;
for(var i=0;i16){
_39=core_md5(_39,key.length*chrsz);
}
var _3a=Array(16),opad=Array(16);
for(var i=0;i<16;i++){
_3a[i]=_39[i]^909522486;
opad[i]=_39[i]^1549556828;
}
var _3c=core_md5(_3a.concat(str2binl(_38)),512+_38.length*chrsz);
return core_md5(opad.concat(_3c),512+128);
}
function safe_add(x,y){
var lsw=(x&65535)+(y&65535);
var msw=(x>>16)+(y>>16)+(lsw>>16);
return (msw<<16)|(lsw&65535);
}
function bit_rol(num,cnt){
return (num<>>(32-cnt));
}
function str2binl(str){
var bin=Array();
var _45=(1<>5]|=(str.charCodeAt(i/chrsz)&_45)<<(i%32);
}
return bin;
}
function binl2str(bin){
var str="";
var _49=(1<>5]>>>(i%32))&_49);
}
return str;
}
function binl2hex(_4b){
var _4c=hexcase?"0123456789ABCDEF":"0123456789abcdef";
var str="";
for(var i=0;i<_4b.length*4;i++){
str+=_4c.charAt((_4b[i>>2]>>((i%4)*8+4))&15)+_4c.charAt((_4b[i>>2]>>((i%4)*8))&15);
}
return str;
}
function binl2b64(_4f){
var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str="";
for(var i=0;i<_4f.length*4;i+=3){
var _53=(((_4f[i>>2]>>8*(i%4))&255)<<16)|(((_4f[i+1>>2]>>8*((i+1)%4))&255)<<8)|((_4f[i+2>>2]>>8*((i+2)%4))&255);
for(var j=0;j<4;j++){
if(i*8+j*6>_4f.length*32){
str+=b64pad;
}else{
str+=tab.charAt((_53>>6*(3-j))&63);
}
}
}
return str;
}
/* --------- PRINT.JS --------- */
/*
* MindTouch DekiWiki - a commercial grade open source wiki
* derived from MediaWiki (www.mediawiki.org)
* Copyright (C) 2006 MindTouch, Inc.
* www.mindtouch.com oss@mindtouch.com
*
* For community documentation and downloads visit www.opengarden.org;
* please review the licensing section.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* http://www.gnu.org/copyleft/gpl.html
*/
var Print = {
open : function(href, menu) {
window.open(href, 'popupwindow', 'width='+600+',height='+winY+'' + (menu ? ',menubar=yes' : '')+',resizable=yes,scrollbars=yes');
return false;
},
doPrint : function () {
window.print();
// the first time you print in firefox (or mozilla), immediately executing parent.close() will
// result in the page just closing with no print; oddly, if you open the print dialogue again,
// the document will print then close the window correctly
// setting a timeout on the close allows the browser to popup the "print" dialogue before parent.close()
//window.setTimeout("Print.doClose()", 2000);
},
doClose : function () {
window.close();
},
createEndnotes : function () {
var elt = document.getElementById('pageText');
var endnotes = '';
var j = 0;
var Browser = new BrowserVersion();
var links = elt.getElementsByTagName('a');
for (i = 0; i < links.length; i++ ) {
if (links[i].getAttribute('href')) {
if (Browser.isIE && Browser.version < 7) {
if (links[i].innerHTML == ' ') {
continue;
}
}
j++;
var sup = document.createElement('sup');
sup.className = 'endnotes';
sup.innerHTML = j;
links[i].appendChild(sup);
endnotes += ''+(j)+' '+links[i].getAttribute('href')+'
';
}
}
var div = document.createElement('div');
div.setAttribute('id', 'endnotes');
div.setAttribute('class', 'print-toc');
elt.appendChild(div);
div.innerHTML = ''+wfMsg('print-end-notes')+'
'+endnotes+'
';
},
changeEndnotesDisplay : function () {
var displayType = document.getElementById('printOptLinks').checked;
var endnotes = document.getElementsByTagName('sup');
for (i = 0; i < endnotes.length; i++ ) {
if (endnotes[i].className == 'endnotes')
endnotes[i].style.display = displayType ? 'inline': 'none';
}
var endnotesBody = document.getElementById('endnotes');
if (endnotesBody)
endnotesBody.style.display = displayType ? 'block' : 'none';
},
changeFooterDisplay : function () {
if (document.getElementById('printOptFooter').checked)
DekiWiki.$("#printfooter").css("display", "block");
else
DekiWiki.$("#printfooter").css("display", "none");
},
changeTocDisplay : function () {
if (document.getElementById('printOptToc').checked)
DekiWiki.$("#pageToc").css("display", "block");
else
DekiWiki.$("#pageToc").css("display", "none");
},
onBodyLoad : function () {
Print.createEndnotes();
Print.changeEndnotesDisplay();
Print.changeTocDisplay();
Print.changeFooterDisplay();
},
showPreferences: function(node) {
var prefsnode = document.getElementById('printPrefs');
if (!prefsnode) return;
if (prefsnode.style.display == 'none') {
DekiWiki.$("#pageContent").addClass("prefsToggledOn");
prefsnode.style.display = 'block';
node.className = 'showPrintPrefs';
}
else {
DekiWiki.$("#pageContent").removeClass("prefsToggledOn");
prefsnode.style.display = 'none';
node.className = 'hidePrintPrefs';
}
},
toggleEndnotes : function() {
Print.changeEndnotesDisplay();
x_wfSetUserOption('printlinks', document.getElementById('printOptLinks').checked ? '1': 'null', function(returned) {});
},
toggleFooter : function() {
Print.changeFooterDisplay();
x_wfSetUserOption('printfooter', document.getElementById('printOptFooter').checked ? '1': 'null', function(returned) {});
},
toggleToc : function() {
Print.changeTocDisplay();
x_wfSetUserOption('printtoc', document.getElementById('printOptToc').checked ? '1': 'null', function(returned) {});
}
};
function saveToPDF (page) {
window.location = page + '&action=export&type=pdf';
}
/* --------- GALLERY.JS --------- */
function MTGallery() {};
MTGallery.Offset = 0;
MTGallery.PageID = 0;
MTGallery.SortBy = _gallery_sort;
MTGallery.FileID = 0;
MTGallery.Next = function() {
MTGallery.Offset = MTGallery.Offset + _total_images;
return MTGallery.Show();
};
MTGallery.Back = function() {
MTGallery.Offset = MTGallery.Offset - _total_images;
return MTGallery.Show();
};
MTGallery.Refresh = function() {
return MTGallery.Show();
};
MTGallery.ShowAll = function(showingRevisions) {
MTGallery.Offset = -1;
if (showingRevisions) {
MTGallery.FileID = 0;
}
return MTGallery.Show();
};
MTGallery.ShowRevisions = function(FileID) {
MTGallery.Offset = -1;
MTGallery.SortBy = 'date-desc';
MTGallery.FileID = FileID;
MTGallery.Show();
MTGallery.FileID = 0;
return false;
};
MTGallery.Sort = function(node) {
MTGallery.SortBy = node.value;
return MTGallery.Show();
};
MTGallery.Show = function() {
if (MTGallery.PageID == 0) {
MTGallery.PageID = _page_ID;
}
x_wfInlineImageGallery(MTGallery.PageID, MTGallery.Offset, MTGallery.SortBy, MTGallery.FileID, function(z) {
if (!DekiWiki.$('#pageGallery').get(0)) return;
DekiWiki.$('#pageGallery').html(z);
MTGallery.ReloadViewHooks();
});
return false;
};
MTGallery.ReloadViewHooks = function() {
tb_init('#pageGallery a.lightbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
}
/* --------- MESSAGING.JS --------- */
/***
* MindTouch Messaging
* Outputs success/error messages that autoclose
*/
var MTMessage = function () {};
MTMessage.Active = false;
MTMessage.DefaultTimerValue = 6;
MTMessage.TimeValue = MTMessage.DefaultTimerValue;
MTMessage.Timer = false;
MTMessage.Show = function(headerText, bodyText, msgType, detailsArray) {
if (MTMessage.Active)
return;
if (typeof(msgType) == 'undefined')
msgType = 'ui-errormsg';
MTMessage.Active = true;
MTMessage.SetHeader(headerText);
MTMessage.SetBody(bodyText);
if (typeof(detailsArray) == 'undefined' || detailsArray == '') {
document.getElementById('MTMessageDetailsLink').style.display = 'none';
}
else {
MTMessage.SetDetails(detailsArray);
}
var node = document.getElementById('MTMessage');
document.getElementById('MTMessageStyle').className = 'ui-msg '+msgType;
document.getElementById('MTMessage').style.display = 'block';
YAHOO.util.Dom.setStyle('MTMessage', 'opacity', 1);
document.getElementById('MTMessageUnpaused').style.display = 'inline';
document.getElementById('MTMessagePaused').style.display = 'none';
document.getElementById('MTMessage').onmouseover = function() {
if (MTMessage.Timer)
MTMessage.PauseTimer();
};
MTMessage.GoTimer();
return false;
};
MTMessage.Hide = function() {
MTMessage.TimeValue = MTMessage.DefaultTimerValue;
if (Browser.isIE && Browser.version < 7) {
document.getElementById('MTMessage').style.display = 'none';
MTMessage.Active = false;
return false;
}
var anim = new YAHOO.util.Anim('MTMessage', { opacity: { to: 0 } }, 1, YAHOO.util.Easing.easeOut);
anim.onComplete.subscribe(function () {
document.getElementById('MTMessage').style.display = 'none';
MTMessage.Active = false;
});
anim.animate();
return false;
};
MTMessage.PauseTimer = function() {
MTMessage.Timer = false;
document.getElementById('MTMessageUnpaused').style.display = 'none';
document.getElementById('MTMessagePaused').style.display = 'inline';
};
MTMessage.UnPauseTimer = function() {
document.getElementById('MTMessageUnpaused').style.display = 'inline';
document.getElementById('MTMessagePaused').style.display = 'none';
MTMessage.GoTimer();
};
MTMessage.GoTimer = function() {
MTMessage.Timer = true;
MTMessage.TimeValue = MTMessage.DefaultTimerValue;
MTMessage.TimerValue(MTMessage.TimeValue);
};
MTMessage.TimerValue = function() {
if (!MTMessage.Timer)
return;
MTMessage.TimeValue = MTMessage.TimeValue - 1;
document.getElementById('MTMessageTimer').innerHTML = MTMessage.TimeValue+' ';
if ((MTMessage.TimeValue) < 1) {
MTMessage.Hide();
}
else {
setTimeout("MTMessage.TimerValue("+(MTMessage.TimeValue)+")", 1000);
}
};
MTMessage.SetHeader = function(val) {
document.getElementById('MTMessageHeader').innerHTML = val;
};
MTMessage.SetBody = function(val) {
document.getElementById('MTMessageDesc').innerHTML = val;
};
MTMessage.ShowDetails = function(anode) {
document.getElementById('MTMessageDetails').style.display = 'block';
document.getElementById('MTMessageTextarea').select();
anode.parentNode.innerHTML = anode.innerHTML; //remove link
};
MTMessage.SetDetails = function(val) {
var node, container;
container = document.getElementById('MTMessageDetails');
node = document.getElementById('MTMessageTextarea');
// remove the previous message's details
if ( node )
{
container.removeChild(node);
}
node = document.createElement('textarea');
node.id = 'MTMessageTextarea';
node.className = 'ui-msgtextarea';
node.setAttribute('readonly', 'true');
node.value = eval(val);
container.appendChild(node);
};
/* --------- GENERAL.JS --------- */
String.prototype.utf8ToCodepoint = function() {
var z = this.charCodeAt(0), length;
if (z & 0x80) {
length = 0;
while (z & 0x80) {
length++;
z <<= 1;
}
} else
length = 1;
if (length != this.length) return false;
if (length == 1) return z;
// Mask off the length-determining bits and shift back to the original location
z &= 0xff;
z >>= length;
// Add in the free bits from subsequent bytes
for ( var i=1; i < length; i++ ) {
z <<= 6;
z |= this.charCodeAt(i) & 0x3f;
}
return z;
};
String.prototype.utf8ToString = function() {
var val = this.replace(/[\xc0-\xfd][\x80-\xbf]*/g, function(s) {
return String.fromCharCode(s.utf8ToCodepoint());
});;
return val;
};
String.prototype.utf8URL = function() {
var val = this.replace(/[ \?%\+&=#\.\u0080-\uFFFF]/g, function(s) {
switch (s) {
case ' ': return '_';
// case ' ': return '%20';
case '+': return '%2B';
default:
return escape(String.charToUtf8(s.charCodeAt(0)));
}
});
return val;
};
String.prototype.utf8 = function() {
var val = this.replace(/[\u0080-\uFFFF]/g, function(s) {
return String.charToUtf8(s.charCodeAt(0));
});
return val;
};
String.charToUtf8 = function(codepoint) {
if(codepoint < 0x80) return String.fromCharCode(codepoint);
if(codepoint < 0x800) return String.fromCharCode(
codepoint >> 6 & 0x3f | 0xc0,
codepoint & 0x3f | 0x80);
if(codepoint < 0x10000) return String.fromCharCode(
codepoint >> 12 & 0x0f | 0xe0,
codepoint >> 6 & 0x3f | 0x80,
codepoint & 0x3f | 0x80);
if(codepoint < 0x110000) return String.fromCharCode(
codepoint >> 18 & 0x07 | 0xf0,
codepoint >> 12 & 0x3f | 0x80,
codepoint >> 6 & 0x3f | 0x80,
codepoint & 0x3f | 0x80);
// There should be no assigned code points outside this range, but
return String.fromCharCode(codepoint);
};
var winX = null;
var winY = null;
clientWindow = function () {
if (self.innerHeight) {
winX = self.innerWidth;
winY = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
winX = document.documentElement.clientWidth;
winY = document.documentElement.clientHeight;
}
else if (document.body) {
winX = document.body.clientWidth;
winY = document.body.clientHeight;
}
};
function mt_gen() {
}
/***
* takes a string and escapes single quotes and encodes html
*/
mt_gen.htmlspecialchars = function(str) {
// performs HTML encoding of some given string
mt_gen.htmlEncode_regEx = [
new RegExp().compile(/&/ig),
new RegExp().compile(//ig),
new RegExp().compile(/'/ig),
new RegExp().compile(/\xA0/g),
// \x22 means '"' -- we use hex reprezentation so that we don't disturb
// JS compressors (well, at least mine fails.. ;)
new RegExp().compile(/\x22/g),
// special encode none-ASCII
new RegExp().compile(/[\x80-\xFF]/g)
];
mt_gen.htmlEncode_regExR = [
"&",
"<",
">",
"\\'",
" ",
""",
function(s,b){return ""+s.charCodeAt(0)+";";}
];
if(typeof str.replace == 'undefined') str = str.toString();
for (var i = 0; i < mt_gen.htmlEncode_regEx.length; ++i)
str = str.replace(mt_gen.htmlEncode_regEx[i], mt_gen.htmlEncode_regExR[i]);
return str;
};
mt_gen.getUrlFromName = function(href) {
href = mt_gen.extractName(href).replace(/ /g,'_');
if (href.indexOf('&') > 0 || href.indexOf('?') > 0 || href.indexOf('+') > 0 || href.indexOf('#') > 0 ||
href.indexOf('\\') > 0 || href.indexOf('//') > 0 || href.indexOf('%') > 0
)
href = 'index.php?title=' + encodeURIComponent(href);
return '/' + href;
};
mt_gen.extractName = function(href) {
if (href.charAt(0) == '/') href = href.substr(1);
if (href.indexOf('index.php?title=') == 0)
href = href.substr('index.php?title='.length);
href = href.replace(/&action=.+$/i, '');
try { href = unescape(href); } catch (e) {}
return href;
};
function iconify(icon_class, parentClass) {
if (!parentClass) parentClass = 'icon';
var span = document.createElement('span');
span.className = parentClass;
var img = document.createElement('img');
img.src = '/skins/common/icons/icon-trans.gif';
if (typeof(icon_class) != 'undefined' && icon_class != '') {
img.className = icon_class;
}
span.appendChild(img);
return span;
};
//returns an XML document
function encode_xml(data, outer) {
var result = '';
if (typeof(data) == 'object') {
for (key in data) {
var value = data[key];
if (strncmp(value,'@',1) == 0) {
} else {
var tag = outer != null ? outer: key;
if (is_numeric_array(value)) {
result += encode_xml(value, key);
} else if (typeof(value) == 'object') {
var attrs = '';
for (attr_key in value) {
var attr_value = value[attr_key];
if(strncmp(attr_key, '@', 1) == 0) {
attrs += ' '+attr_key.substr(0, 1)+ '="'+mt_gen.htmlspecialchars(attr_value)+'"';
}
}
result += '<' + tag + attrs + '>' + encode_xml(value) + '' + tag + '>'+"\n";
} else if (tag != '#text') {
result += '<' + tag + '>' + encode_xml(value) + '' + tag + '>';
} else {
result += mt_gen.htmlspecialchars(value);
}
}
}
} else if (typeof(data) == 'string') {
result = mt_gen.htmlspecialchars(data);
} else {
result = data;
}
return result;
}
function strncmp(str1, str2, len) {
if (typeof(str1) != 'string' || typeof(str2) != 'string') {
return 1;
}
return str1.substr(0, len) == str2 ? 0: 1; //not exactly like PHP implementation, but returns 0 if true
}
function is_numeric_array(data) {
var construct = data.constructor;
return construct == Array;
}
/* --------- MINDTOUCH.UTIL.JS --------- */
if (typeof DekiWiki == "undefined") {
var DekiWiki = {};
}
DekiWiki.url = {};
DekiWiki.url.encode = function(plaintext)
{
// The Javascript escape and unescape functions do not correspond
// with what browsers actually do...
var SAFECHARS = "0123456789" + // Numeric
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic
"abcdefghijklmnopqrstuvwxyz" +
"-_.!~*'()"; // RFC2396 Mark characters
var HEX = "0123456789ABCDEF";
var encoded = "";
for (var i = 0; i < plaintext.length; i++ ) {
var ch = plaintext.charAt(i);
if (ch == " ") {
encoded += "+"; // x-www-urlencoded, rather than %20
} else if (SAFECHARS.indexOf(ch) != -1) {
encoded += ch;
} else {
var charCode = ch.charCodeAt(0);
if (charCode > 255) {
encoded += "+";
} else {
encoded += "%";
encoded += HEX.charAt((charCode >> 4) & 0xF);
encoded += HEX.charAt(charCode & 0xF);
}
}
} // for
return encoded;
}
DekiWiki.util = {};
DekiWiki.util.Dom = {};
DekiWiki.util.Dom.getDimensions = function(element) {
var region = YAHOO.util.Dom.getRegion(element);
var width = region.right - region.left;
var height = region.bottom - region.top;
return {"width": width, "height": height};
}
DekiWiki.util.Dom.getText = function(node) {
if(typeof(node.innerText) != 'undefined') {
return node.innerText;
} else {
return node.textContent;
}
}
DekiWiki.util.Dom.setInnerHTML = function (el, html) {
el = YAHOO.util.Dom.get(el);
if (!el || typeof html !== 'string') {
return null;
}
// Break circular references.
(function (o) {
var a = o.attributes, i, l, n, c;
if (a) {
l = a.length;
for (i = 0; i < l; i += 1) {
n = a[i].name;
if (typeof o[n] === 'function') {
o[n] = null;
}
}
}
a = o.childNodes;
if (a) {
l = a.length;
for (i = 0; i < l; i += 1) {
c = o.childNodes[i];
// Purge child nodes.
arguments.callee(c);
// Removes all listeners attached to the element via YUI's addListener.
YAHOO.util.Event.purgeElement(c);
}
}
})(el);
// Remove scripts from HTML string, and set innerHTML property
el.innerHTML = html.replace(/