/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1796"});YAHOO.util.Get=function(){var M={},L=0,R=0,E=false,N=YAHOO.env.ua,S=YAHOO.lang;var J=function(W,T,X){var U=X||window,Y=U.document,Z=Y.createElement(W);for(var V in T){if(T[V]&&YAHOO.lang.hasOwnProperty(T,V)){Z.setAttribute(V,T[V]);}}return Z;};var I=function(T,U,W){var V=W||"utf-8";return J("link",{"id":"yui__dyn_"+(R++),"type":"text/css","charset":V,"rel":"stylesheet","href":T},U);
};var P=function(T,U,W){var V=W||"utf-8";return J("script",{"id":"yui__dyn_"+(R++),"type":"text/javascript","charset":V,"src":T},U);};var A=function(T,U){return{tId:T.tId,win:T.win,data:T.data,nodes:T.nodes,msg:U,purge:function(){D(this.tId);}};};var B=function(T,W){var U=M[W],V=(S.isString(T))?U.win.document.getElementById(T):T;if(!V){Q(W,"target node not found: "+T);}return V;};var Q=function(W,V){var T=M[W];if(T.onFailure){var U=T.scope||T.win;T.onFailure.call(U,A(T,V));}};var C=function(W){var T=M[W];T.finished=true;if(T.aborted){var V="transaction "+W+" was aborted";Q(W,V);return;}if(T.onSuccess){var U=T.scope||T.win;T.onSuccess.call(U,A(T));}};var O=function(V){var T=M[V];if(T.onTimeout){var U=T.scope||T;T.onTimeout.call(U,A(T));}};var G=function(V,Z){var U=M[V];if(U.timer){U.timer.cancel();}if(U.aborted){var X="transaction "+V+" was aborted";Q(V,X);return;}if(Z){U.url.shift();if(U.varName){U.varName.shift();}}else{U.url=(S.isString(U.url))?[U.url]:U.url;if(U.varName){U.varName=(S.isString(U.varName))?[U.varName]:U.varName;}}var c=U.win,b=c.document,a=b.getElementsByTagName("head")[0],W;if(U.url.length===0){if(U.type==="script"&&N.webkit&&N.webkit<420&&!U.finalpass&&!U.varName){var Y=P(null,U.win,U.charset);Y.innerHTML='YAHOO.util.Get._finalize("'+V+'");';U.nodes.push(Y);a.appendChild(Y);}else{C(V);}return;}var T=U.url[0];if(!T){U.url.shift();return G(V);}if(U.timeout){U.timer=S.later(U.timeout,U,O,V);}if(U.type==="script"){W=P(T,c,U.charset);}else{W=I(T,c,U.charset);}F(U.type,W,V,T,c,U.url.length);U.nodes.push(W);if(U.insertBefore){var e=B(U.insertBefore,V);if(e){e.parentNode.insertBefore(W,e);}}else{a.appendChild(W);}if((N.webkit||N.gecko)&&U.type==="css"){G(V,T);}};var K=function(){if(E){return;}E=true;for(var T in M){var U=M[T];if(U.autopurge&&U.finished){D(U.tId);delete M[T];}}E=false;};var D=function(a){var X=M[a];if(X){var Z=X.nodes,T=Z.length,Y=X.win.document,W=Y.getElementsByTagName("head")[0];if(X.insertBefore){var V=B(X.insertBefore,a);if(V){W=V.parentNode;}}for(var U=0;U<T;U=U+1){W.removeChild(Z[U]);}X.nodes=[];}};var H=function(U,T,V){var X="q"+(L++);V=V||{};if(L%YAHOO.util.Get.PURGE_THRESH===0){K();}M[X]=S.merge(V,{tId:X,type:U,url:T,finished:false,aborted:false,nodes:[]});var W=M[X];W.win=W.win||window;W.scope=W.scope||W.win;W.autopurge=("autopurge" in W)?W.autopurge:(U==="script")?true:false;S.later(0,W,G,X);return{tId:X};};var F=function(c,X,W,U,Y,Z,b){var a=b||G;if(N.ie){X.onreadystatechange=function(){var d=this.readyState;if("loaded"===d||"complete"===d){X.onreadystatechange=null;a(W,U);}};}else{if(N.webkit){if(c==="script"){if(N.webkit>=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;g<e;g=g+1){d=d[f[g]];if(!d){this.attempts++;if(this.attempts++>this.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.7.0",build:"1796"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"root":"2.7.0/build/","base":"http://yui.yahooapis.com/2.7.0/build/","comboBase":"http://yui.yahooapis.com/combo?","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event","datasource"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],"skinnable":true},"carousel":{"type":"js","path":"carousel/carousel-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-min.js","requires":["element","json","datasource"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"]},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop","paginator"],"skinnable":true},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-min.js","requires":["dom","event"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-min.js","requires":["dom","event","dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-min.js","requires":["dom","event","element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"paginator":{"type":"js","path":"paginator/paginator-min.js","requires":["element"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-min.js","requires":["dom","event","dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"],"skinnable":true},"stylesheet":{"type":"js","path":"stylesheet/stylesheet-min.js","requires":["yahoo"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event","dom"],"optional":["json"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;
i<a.length;i=i+1){o[a[i]]=true;}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i);}}return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}return -1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.onTimeout=null;this.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;this.comboBase=YUI.info.comboBase;this.combine=false;this.root=YUI.info.root;this.timeout=0;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name);}});this.skin=lang.merge(YUI.info.skin);this._config(o);};Y.util.YUILoader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(o){for(var i in o){if(lang.hasOwnProperty(o,i)){if(i=="require"){this.require(o[i]);}else{this[i]=o[i];}}}}var f=this.filter;if(lang.isString(f)){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}if(!Y.widget.LogWriter){Y.widget.LogWriter=function(){return Y;};}this.filter=this.FILTERS[f];}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}o.ext=("ext" in o)?o.ext:true;o.requires=o.requires||[];this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin),info=this.moduleInfo,sinf=this.skin,ext=info[mod]&&info[mod].ext;if(!info[name]){this.addModule({"name":name,"type":"css","path":sinf.base+skin+"/"+sinf.path,"after":sinf.after,"rollup":sinf.rollup,"ext":ext});}if(mod){name=this.formatSkin(skin,mod);if(!info[name]){var mdef=info[mod],pkg=mdef.pkg||mod;this.addModule({"name":name,"type":"css","after":sinf.after,"path":pkg+"/"+sinf.base+skin+"/"+mod+".css","ext":ext});}}return name;},getRequires:function(mod){if(!mod){return[];}if(!this.dirty&&mod.expanded){return mod.expanded;}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m));}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name,notMe){var addMe=!(notMe),ckey=(addMe)?PROV:SUPER,m=this.moduleInfo[name],o={};if(!m){return o;}if(m[ckey]){return m[ckey];}var s=m.supersedes,done={},me=this;var add=function(mm){if(!done[mm]){done[mm]=true;lang.augmentObject(o,me.getProvides(mm));}};if(s){for(var i=0;i<s.length;i=i+1){add(s[i]);}}m[SUPER]=o;m[PROV]=lang.merge(o);m[PROV][name]=true;return m[ckey];},calculate:function(o){if(o||this.dirty){this._config(o);this._setup();this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var info=this.moduleInfo,name,i,j;for(name in info){if(lang.hasOwnProperty(info,name)){var m=info[name];if(m&&m.skinnable){var o=this.skin.overrides,smod;if(o&&o[name]){for(i=0;i<o[name].length;i=i+1){smod=this._addSkin(o[name][i],name);}}else{smod=this._addSkin(this.skin.defaultSkin,name);}m.requires.push(smod);}}}var l=lang.merge(this.inserted);if(!this._sandbox){l=lang.merge(l,env.modules);}if(this.ignore){YUI.ObjectUtil.appendArray(l,this.ignore);}if(this.force){for(i=0;i<this.force.length;i=i+1){if(this.force[i] in l){delete l[this.force[i]];}}}for(j in l){if(lang.hasOwnProperty(l,j)){lang.augmentObject(l,this.getProvides(j));}}this.loaded=l;},_explode:function(){var r=this.required,i,mod;for(i in r){if(lang.hasOwnProperty(r,i)){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}}},_skin:function(){},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll,info=this.moduleInfo;if(this.dirty||!this.rollups){for(i in info){if(lang.hasOwnProperty(info,i)){m=info[i];if(m&&m.rollup){rollups[i]=m;}}}this.rollups=rollups;}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=info[i];s=m.supersedes;roll=false;if(!m.rollup){continue;}var skin=(m.ext)?false:this.parseSkin(i),c=0;if(skin){for(j in r){if(lang.hasOwnProperty(r,j)){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break;}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(lang.hasOwnProperty(r,j)){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]];}}}}}}},_onFailure:function(msg){YAHOO.log("Failure","info","loader");var f=this.onFailure;if(f){f.call(this.scope,{msg:"failure: "+msg,data:this.data,success:false});
}},_onTimeout:function(){YAHOO.log("Timeout","info","loader");var f=this.onTimeout;if(f){f.call(this.scope,{msg:"timeout",data:this.data,success:false});}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,checkOptional=!this.loadOptional,me=this;var requires=function(aa,bb){var mm=info[aa];if(loaded[bb]||!mm){return false;}var ii,rr=mm.expanded,after=mm.after,other=info[bb],optional=mm.optional;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true;}}}if(mm.ext&&mm.type=="css"&&!other.ext&&other.type=="css"){return true;}return false;};for(var i in this.required){if(lang.hasOwnProperty(this.required,i)){s.push(i);}}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}if(moved){break;}else{p=p+1;}}if(!moved){break;}}this.sorted=s;},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};lang.dump(o,1);},_combine:function(){this._combining=[];var self=this,s=this.sorted,len=s.length,js=this.comboBase,css=this.comboBase,target,startLen=js.length,i,m,type=this.loadType;YAHOO.log("type "+type);for(i=0;i<len;i=i+1){m=this.moduleInfo[s[i]];if(m&&!m.ext&&(!type||type===m.type)){target=this.root+m.path;target+="&";if(m.type=="js"){js+=target;}else{css+=target;}this._combining.push(s[i]);}}if(this._combining.length){YAHOO.log("Attempting to combine: "+this._combining,"info","loader");var callback=function(o){var c=this._combining,len=c.length,i,m;for(i=0;i<len;i=i+1){this.inserted[c[i]]=true;}this.loadNext(o.data);},loadScript=function(){if(js.length>startLen){YAHOO.util.Get.script(self._filter(js),{data:self._loading,onSuccess:callback,onFailure:self._onFailure,onTimeout:self._onTimeout,insertBefore:self.insertBefore,charset:self.charset,timeout:self.timeout,scope:self});}};if(css.length>startLen){YAHOO.util.Get.css(this._filter(css),{data:this._loading,onSuccess:loadScript,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,scope:self});}else{loadScript();}return;}else{this.loadNext(this._loading);}},insert:function(o,type){this.calculate(o);this._loading=true;this.loadType=type;if(this.combine){return this._combine();}if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return;}this.loadNext();},sandbox:function(o,type){this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=this.moduleInfo[s[i]];if(!m){this._onFailure("undefined module "+m);for(var j=0;j<this._xhr.length;j=j+1){this._xhr[j].abort();}return;}if(m.type!=="js"){this._loadCount++;continue;}url=m.fullpath;url=(url)?this._filter(url):this._url(m.path);var xhrData={success:function(o){var idx=o.argument[0],name=o.argument[2];this._scriptText[idx]=o.responseText;if(this.onProgress){this.onProgress.call(this.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:this.data});}this._loadCount++;if(this._loadCount>=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this._onFailure.call(this.varName+" reference failure");}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return;}if(mname){if(mname!==this._loading){return;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue;}if(s[i]===this._loading){return;}m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return;}if(!this.loadType||this.loadType===m.type){this._loading=s[i];var fn=(m.type==="css")?util.Get.css:util.Get.script,url=m.fullpath,self=this,c=function(o){self.loadNext(o.data);};url=(url)?this._filter(url):this._url(m.path);if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){c=null;this._useYahooListener=true;}fn(url,{data:s[i],onSuccess:c,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,varName:m.varName,scope:self});return;}}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this);}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data});}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load();}},_filter:function(str){var f=this.filter;return(f)?str.replace(new RegExp(f.searchExp,"g"),f.replaceStr):str;},_url:function(path){return this._filter((this.base||"")+path);}};})();YAHOO.register("yuiloader",YAHOO.util.YUILoader,{version:"2.7.0",build:"1796"});
(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});
},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=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),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),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),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),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+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,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];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;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(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}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+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}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+", overrideContext: "+(this.overrideContext||"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};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";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,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN];
I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
/* 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,overrideContext: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;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1796"});YAHOO.register("yuiloader-dom-event", YAHOO, {version: "2.7.0", build: "1796"});

;/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
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(C){var B=YAHOO.util.Event.getTarget(C),A=B.nodeName.toLowerCase();if((A==="input"||A==="button")&&(B.type&&B.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(B.name)+"="+encodeURIComponent(B.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(F){var E,A;try{A=new XMLHttpRequest();E={conn:A,tId:F};}catch(D){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);E={conn:A,tId:F};break;}catch(C){}}}finally{return E;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){var B;for(B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=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<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;
}else{this._has_http_headers=true;}},setHeader:function(A){var B;if(this._has_default_headers){for(B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(M,H,C){var L,B,K,I,P,J=false,F=[],O=0,E,G,D,N,A;this.resetFormState();if(typeof M=="string"){L=(document.getElementById(M)||document.forms[M]);}else{if(typeof M=="object"){L=M;}else{return;}}if(H){this.createFrame(C?C:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=L;return;}for(E=0,G=L.elements.length;E<G;++E){B=L.elements[E];P=B.disabled;K=B.name;if(!P&&K){K=encodeURIComponent(K)+"=";I=encodeURIComponent(B.value);switch(B.type){case"select-one":if(B.selectedIndex>-1){A=B.options[B.selectedIndex];F[O++]=K+encodeURIComponent((A.attributes.value&&A.attributes.value.specified)?A.value:A.text);}break;case"select-multiple":if(B.selectedIndex>-1){for(D=B.selectedIndex,N=B.options.length;D<N;++D){A=B.options[D];if(A.selected){F[O++]=K+encodeURIComponent((A.attributes.value&&A.attributes.value.specified)?A.value:A.text);}}}break;case"radio":case"checkbox":if(B.checked){F[O++]=K+I;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(J===false){if(this._hasSubmitListener&&this._submitElementValue){F[O++]=this._submitElementValue;}J=true;}break;default:F[O++]=K+I;}}}this._isFormSubmit=true;this._sFormData=F.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(YAHOO.env.ua.ie){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');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=[],B=A.split("&"),C,E;for(C=0;C<B.length;C++){E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=decodeURIComponent(B[C].substring(0,E));D[C].value=decodeURIComponent(B[C].substring(E+1));this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,N,E,C){var I="yuiIO"+D.tId,J="multipart/form-data",L=document.getElementById(I),O=this,K=(N&&N.argument)?N.argument:null,M,H,B,G;var A={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",I);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",J);}else{this._formNode.setAttribute("enctype",J);}if(C){M=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,K);if(D.startEvent){D.startEvent.fire(D,K);}if(N&&N.timeout){this._timeOut[D.tId]=window.setTimeout(function(){O.abort(D,N,true);},N.timeout);}if(M&&M.length>0){for(H=0;H<M.length;H++){this._formNode.removeChild(M[H]);}}for(B in A){if(YAHOO.lang.hasOwnProperty(A,B)){if(A[B]){this._formNode.setAttribute(B,A[B]);}else{this._formNode.removeAttribute(B);}}}this.resetFormState();var F=function(){if(N&&N.timeout){window.clearTimeout(O._timeOut[D.tId]);delete O._timeOut[D.tId];}O.completeEvent.fire(D,K);if(D.completeEvent){D.completeEvent.fire(D,K);}G={tId:D.tId,argument:N.argument};try{G.responseText=L.contentWindow.document.body?L.contentWindow.document.body.innerHTML:L.contentWindow.document.documentElement.textContent;G.responseXML=L.contentWindow.document.XMLDocument?L.contentWindow.document.XMLDocument:L.contentWindow.document;}catch(P){}if(N&&N.upload){if(!N.scope){N.upload(G);}else{N.upload.apply(N.scope,[G]);}}O.uploadEvent.fire(G);if(D.uploadEvent){D.uploadEvent.fire(G);}YAHOO.util.Event.removeListener(L,"load",F);setTimeout(function(){document.body.removeChild(L);O.releaseObject(D);},100);};YAHOO.util.Event.addListener(L,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.7.0",build:"1796"});
;/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.6
|| # ---------------------------------------------------------------- # ||
|| # Copyright Â©2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
if(!window.console||!console.firebug){window.console={};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}var BBURL=(typeof (BBURL)=="undefined"?"":BBURL);var SESSIONURL=(typeof (SESSIONURL)=="undefined"?"":SESSIONURL);var SECURITYTOKEN=(typeof (SECURITYTOKEN)=="undefined"?"":SECURITYTOKEN);var vbphrase=(typeof (vbphrase)=="undefined"?new Array():vbphrase);var vB_Editor=new Array();var ignorequotechars=false;var pagenavcounter=0;var is_regexp=(window.RegExp)?true:false;var AJAX_Compatible=false;var viewport_info=null;var vB_Default_Timeout=15000;var userAgent=navigator.userAgent.toLowerCase();var is_opera=(YAHOO.env.ua.opera>0);var is_saf=(YAHOO.env.ua.webkit>0);var is_webtv=(userAgent.indexOf("webtv")!=-1);var is_ie=((YAHOO.env.ua.ie>0)&&(!is_opera)&&(!is_saf)&&(!is_webtv));var is_ie4=(YAHOO.env.ua.ie==4);var is_ie7=(YAHOO.env.ua.ie>=7);var is_ie6=(YAHOO.env.ua.ie==6);var is_ps3=(userAgent.indexOf("playstation 3")!=-1);var is_moz=(YAHOO.env.ua.gecko>0);var is_kon=(userAgent.indexOf("konqueror")!=-1);var is_ns=((userAgent.indexOf("compatible")==-1)&&(userAgent.indexOf("mozilla")!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_saf));var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));var is_mac=(userAgent.indexOf("mac")!=-1);var pointer_cursor=(is_ie?"hand":"pointer");String.prototype.vBlength=function(){return(is_ie&&this.indexOf("\n")!=-1)?this.replace(/\r?\n/g,"_").length:this.length};if("1234".substr(-2,2)=="12"){String.prototype.substr_orig=String.prototype.substr;String.prototype.substr=function(B,A){if(typeof (A)=="undefined"){return this.substr_orig((B<0?this.length+B:B))}else{return this.substr_orig((B<0?this.length+B:B),A)}}}if(typeof Array.prototype.shift==="undefined"){Array.prototype.shift=function(){for(var C=0,A=this[0],B=this.length-1;C<B;C++){this[C]=this[C+1]}this.length--;return A}}function fetch_object(A){if(document.getElementById){return document.getElementById(A)}else{if(document.all){return document.all[A]}else{if(document.layers){return document.layers[A]}else{return null}}}}function fetch_tags(B,A){if(B==null){return new Array()}else{if(typeof B.getElementsByTagName!="undefined"){return B.getElementsByTagName(A)}else{if(B.all&&B.all.tags){return B.all.tags(A)}else{return new Array()}}}}function fetch_tag_count(B,A){return fetch_tags(B,A).length}function do_an_e(A){if(!A||is_ie){window.event.returnValue=false;window.event.cancelBubble=true;return window.event}else{A.stopPropagation();A.preventDefault();return A}}function e_by_gum(A){if(!A||is_ie){window.event.cancelBubble=true;return window.event}else{if(A.target.type=="submit"){A.target.form.submit()}A.stopPropagation();return A}}function validatemessage(B,D,A){if(is_kon||is_saf||is_webtv){return true}else{if(D.length<1){alert(vbphrase.must_enter_subject);return false}else{var C=PHP.trim(stripcode(B,false,ignorequotechars));if(C.length<A){alert(construct_phrase(vbphrase.message_too_short,A));return false}else{if(typeof (document.forms.vbform)!="undefined"&&typeof (document.forms.vbform.imagestamp)!="undefined"){document.forms.vbform.imagestamp.failed=false;if(document.forms.vbform.imagestamp.value.length!=6){alert(vbphrase.complete_image_verification);document.forms.vbform.imagestamp.failed=true;document.forms.vbform.imagestamp.focus();return false}else{return true}}else{return true}}}}}function stripcode(F,G,B){if(!is_regexp){return F}if(B){var C=new Date().getTime();while((startindex=PHP.stripos(F,"[quote"))!==false){if(new Date().getTime()-C>2000){break}if((stopindex=PHP.stripos(F,"[/quote]"))!==false){fragment=F.substr(startindex,stopindex-startindex+8);F=F.replace(fragment,"")}else{break}F=PHP.trim(F)}}if(G){F=F.replace(/<img[^>]+src="([^"]+)"[^>]*>/gi,"$1");var H=new RegExp("<(\\w+)[^>]*>","gi");var E=new RegExp("<\\/\\w+>","gi");F=F.replace(H,"");F=F.replace(E,"");var D=new RegExp("(&nbsp;)","gi");F=F.replace(D," ")}else{var A=new RegExp("\\[(\\w+)(=[^\\]]*)?\\]","gi");var I=new RegExp("\\[\\/(\\w+)\\]","gi");F=F.replace(A,"");F=F.replace(I,"")}return F}function truncate_to_word(D,A){var C,B;C=D.split("");if(C.length>A){for(B=C.length-1;B>-1;--B){if(B>A){C.length=B}else{if(" "===C[B]){C.length=B;break}}}C.push("...")}return C.join("")}function vB_PHP_Emulator(){}vB_PHP_Emulator.prototype.stripos=function(A,B,C){if(typeof C=="undefined"){C=0}index=A.toLowerCase().indexOf(B.toLowerCase(),C);return(index==-1?false:index)};vB_PHP_Emulator.prototype.ltrim=function(A){return A.replace(/^\s+/g,"")};vB_PHP_Emulator.prototype.rtrim=function(A){return A.replace(/(\s+)$/g,"")};vB_PHP_Emulator.prototype.trim=function(A){return this.ltrim(this.rtrim(A))};vB_PHP_Emulator.prototype.preg_quote=function(A){return A.replace(/(\+|\{|\}|\(|\)|\[|\]|\||\/|\?|\^|\$|\\|\.|\=|\!|\<|\>|\:|\*)/g,"\\$1")};vB_PHP_Emulator.prototype.match_all=function(C,E){var A=C.match(RegExp(E,"gim"));if(A){var F=new Array();var B=new RegExp(E,"im");for(var D=0;D<A.length;D++){F[F.length]=A[D].match(B)}return F}else{return false}};vB_PHP_Emulator.prototype.unhtmlspecialchars=function(F,E){var D=new Array(/&lt;/g,/&gt;/g,/&quot;/g,/&amp;/g);var C=new Array("<",">",'"',"&");for(var B in D){if(YAHOO.lang.hasOwnProperty(D,B)){F=F.replace(D[B],C[B])}}if(E){if(is_ie){F=F.replace(/\n/g,"<#br#>")}var A=document.createElement("textarea");A.innerHTML=F;F=A.value;if(null!=A.parentNode){A.parentNode.removeChild(A)}if(is_ie){F=F.replace(/<#br#>/g,"\n")}return F}return F};vB_PHP_Emulator.prototype.unescape_cdata=function(C){var B=/<\=\!\=\[\=C\=D\=A\=T\=A\=\[/g;var A=/\]\=\]\=>/g;return C.replace(B,"<![CDATA[").replace(A,"]]>")};vB_PHP_Emulator.prototype.htmlspecialchars=function(D){var C=new Array((is_mac&&is_ie?new RegExp("&","g"):new RegExp("&(?!#[0-9]+;)","g")),new RegExp("<","g"),new RegExp(">","g"),new RegExp('"',"g"));var B=new Array("&amp;","&lt;","&gt;","&quot;");for(var A=0;A<C.length;A++){D=D.replace(C[A],B[A])}return D};vB_PHP_Emulator.prototype.in_array=function(D,C,B){var E=new String(D);var A;if(B){E=E.toLowerCase();for(A in C){if(YAHOO.lang.hasOwnProperty(C,A)){if(C[A].toLowerCase()==E){return A}}}}else{for(A in C){if(YAHOO.lang.hasOwnProperty(C,A)){if(C[A]==E){return A}}}}return -1};vB_PHP_Emulator.prototype.str_pad=function(C,A,B){C=new String(C);B=new String(B);if(C.length<A){padtext=new String(B);while(padtext.length<(A-C.length)){padtext+=B}C=padtext.substr(0,(A-C.length))+C}return C};vB_PHP_Emulator.prototype.urlencode=function(D){D=escape(D.toString()).replace(/\+/g,"%2B");var B=D.match(/(%([0-9A-F]{2}))/gi);if(B){for(var C=0;C<B.length;C++){var A=B[C].substring(1,3);if(parseInt(A,16)>=128){D=D.replace(B[C],"%u00"+A)}}}D=D.replace("%25","%u0025");return D};vB_PHP_Emulator.prototype.ucfirst=function(D,A){if(typeof A!="undefined"){var B=D.indexOf(A);if(B>0){D=D.substr(0,B)}}D=D.split(" ");for(var C=0;C<D.length;C++){D[C]=D[C].substr(0,1).toUpperCase()+D[C].substr(1)}return D.join(" ")};function vB_AJAX_Handler(A){this.async=A?true:false;this.conn=null}vB_AJAX_Handler.prototype.init=function(){return AJAX_Compatible};vB_AJAX_Handler.is_compatible=function(){return AJAX_Compatible};vB_AJAX_Handler.prototype.onreadystatechange=function(A){this.callback=A};vB_AJAX_Handler.prototype.fetch_data=function(A){console.warn('vB_AJAX_Handler.prototype.fetch_data() is deprecated.\nUse responseXML.getElementsByTagName("x")[i].firstChild.nodeValue instead.');if(A&&A.firstChild&&A.firstChild.nodeValue){return PHP.unescape_cdata(A.firstChild.nodeValue)}else{return""}};vB_AJAX_Handler.prototype.send=function(A,B){this.conn=YAHOO.util.Connect.asyncRequest("POST",A,{success:this.callback},B+"&securitytoken="+SECURITYTOKEN+"&s="+fetch_sessionhash());this.handler=this.conn.conn};function is_ajax_compatible(){if(typeof vb_disable_ajax!="undefined"&&vb_disable_ajax==2){return false}else{if(is_ie&&!is_ie4){return true}else{if(window.XMLHttpRequest){try{var A=new XMLHttpRequest();return A.setRequestHeader?true:false}catch(B){return false}}else{return false}}}}AJAX_Compatible=is_ajax_compatible();console.info("This browser is%s AJAX compatible",AJAX_Compatible?"":" NOT");function vBulletin_AJAX_Error_Handler(A){console.warn("AJAX Error: Status = %s: %s",A.status,A.statusText)}function vB_Hidden_Form(A){this.action=A;this.variables=new Array()}vB_Hidden_Form.prototype.add_variable=function(A,B){this.variables[this.variables.length]=new Array(A,B);console.log("vB_Hidden_Form :: add_variable(%s)",A)};vB_Hidden_Form.prototype.add_variables_from_object=function(F){if(!F){return }console.info("vB_Hidden_Form :: add_variables_from_object(%s)",F.id);var B=fetch_tags(F,"input");var E;for(E=0;E<B.length;E++){if(B[E].disabled){continue}switch(B[E].type){case"checkbox":case"radio":if(B[E].checked){this.add_variable(B[E].name,B[E].value)}break;case"text":case"hidden":case"password":this.add_variable(B[E].name,B[E].value);break;default:continue}}var A=fetch_tags(F,"textarea");for(E=0;E<A.length;E++){if(A[E].disabled){continue}this.add_variable(A[E].name,A[E].value)}var D=fetch_tags(F,"select");for(E=0;E<D.length;E++){if(D[E].disabled){continue}if(D[E].multiple){for(var C=0;C<D[E].options.length;C++){if(D[E].options[C].selected){this.add_variable(D[E].name,D[E].options[C].value)}}}else{if(D[E].selectedIndex>-1){this.add_variable(D[E].name,D[E].options[D[E].selectedIndex].value)}}}};vB_Hidden_Form.prototype.fetch_variable=function(A){for(var B=0;B<this.variables.length;B++){if(this.variables[B][0]==A){return this.variables[B][1]}}return null};vB_Hidden_Form.prototype.submit_form=function(){this.form=document.createElement("form");this.form.method="post";this.form.action=this.action;for(var A=0;A<this.variables.length;A++){var B=document.createElement("input");B.type="hidden";B.name=this.variables[A][0];B.value=this.variables[A][1];this.form.appendChild(B)}console.info("vB_Hidden_Form :: submit_form() -> %s",this.action);document.body.appendChild(this.form).submit()};vB_Hidden_Form.prototype.build_query_string=function(){var B="";for(var A=0;A<this.variables.length;A++){B+=this.variables[A][0]+"="+PHP.urlencode(this.variables[A][1])+"&"}console.info("vB_Hidden_Form :: Query String = %s",B);return B};vB_Hidden_Form.prototype.add_input=vB_Hidden_Form.prototype.add_variable;vB_Hidden_Form.prototype.add_inputs_from_object=vB_Hidden_Form.prototype.add_variables_from_object;function vB_Select_Overlay_Handler(A){this.browser_affected=(is_ie&&YAHOO.env.ua.ie<7);if(this.browser_affected){this.overlay=YAHOO.util.Dom.get(A);this.hidden_selects=new Array();console.log("Initializing <select> overlay handler for '%s'.",this.overlay.id)}}vB_Select_Overlay_Handler.prototype.hide=function(){if(this.browser_affected){var C=YAHOO.util.Dom.getRegion(this.overlay);var B=document.getElementsByTagName("select");for(var A=0;A<B.length;A++){if(region_intersects(B[A],C)){if(YAHOO.util.Dom.isAncestor(this.overlay,B[A])){continue}else{YAHOO.util.Dom.setStyle(B[A],"visibility","hidden");this.hidden_selects.push(YAHOO.util.Dom.generateId(B[A]))}}}}};vB_Select_Overlay_Handler.prototype.show=function(){if(this.browser_affected){var A;while(A=this.hidden_selects.pop()){YAHOO.util.Dom.setStyle(A,"visibility","visible")}}};function openWindow(C,D,B,A){return window.open(getBaseUrl()+C,(typeof A=="undefined"?"vBPopup":A),"statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes"+(typeof D!="undefined"?(",width="+D):"")+(typeof B!="undefined"?(",height="+B):""))}function getBaseUrl(){try{var A=document.getElementsByTagName("base");if(A.length==0){return""}A=A[A.length-1].href;if(!A){return""}return A.match(/.*[\/\\]/)}catch(B){return""}}function js_open_help(B,C,A){return openWindow("help.php?s="+SESSIONHASH+"&do=answer&page="+B+"&pageaction="+C+"&option="+A,600,450,"helpwindow")}function attachments(A){return openWindow("misc.php?"+SESSIONURL+"do=showattachments&t="+A,480,300)}function who(A){return openWindow("misc.php?"+SESSIONURL+"do=whoposted&t="+A,600,300)}function imwindow(D,B,C,A){return openWindow("sendmessage.php?"+SESSIONURL+"do=im&type="+D+"&u="+B,C,A)}function SendMSNMessage(A){if(!is_ie){alert(vbphrase.msn_functions_only_work_in_ie)}else{try{MsgrObj.InstantMessage(A)}catch(B){alert(vbphrase.msn_functions_only_work_in_ie)}}return false}function AddMSNContact(A){if(!is_ie){alert(vbphrase.msn_functions_only_work_in_ie)}else{try{MsgrObj.AddContact(0,A)}catch(B){alert(vbphrase.msn_functions_only_work_in_ie)}}return false}function detect_caps_lock(D){D=(D?D:window.event);var A=(D.which?D.which:(D.keyCode?D.keyCode:(D.charCode?D.charCode:0)));var C=(D.shiftKey||(D.modifiers&&(D.modifiers&4)));var B=(D.ctrlKey||(D.modifiers&&(D.modifiers&2)));return(A>=65&&A<=90&&!C&&!B)||(A>=97&&A<=122&&C)}function log_out(B){var A=document.getElementsByTagName("html")[0];A.style.filter="progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";if(confirm(B)){return true}else{A.style.filter="";return false}}function set_cookie(B,C,A){console.log("Set Cookie :: %s = '%s'",B,C);document.cookie=B+"="+escape(C)+"; path=/"+(typeof A!="undefined"?"; expires="+A.toGMTString():"")}function delete_cookie(A){console.log("Delete Cookie :: %s",A);document.cookie=A+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"}function fetch_cookie(A){cookie_name=A+"=";cookie_length=document.cookie.length;cookie_begin=0;while(cookie_begin<cookie_length){value_begin=cookie_begin+cookie_name.length;if(document.cookie.substring(cookie_begin,value_begin)==cookie_name){var C=document.cookie.indexOf(";",value_begin);if(C==-1){C=cookie_length}var B=unescape(document.cookie.substring(value_begin,C));console.log("Fetch Cookie :: %s = '%s'",A,B);return B}cookie_begin=document.cookie.indexOf(" ",cookie_begin)+1;if(cookie_begin==0){break}}console.log("Fetch Cookie :: %s (null)",A);return null}function js_toggle_all(D,E,C,A,G){for(var B=0;B<D.elements.length;B++){var F=D.elements[B];if(F.type==E&&PHP.in_array(F.name,A,false)==-1){switch(E){case"radio":if(F.value==C){F.checked=G}break;case"select-one":F.selectedIndex=G;break;default:F.checked=G;break}}}}function js_select_all(A){exclude=new Array();exclude[0]="selectall";js_toggle_all(A,"select-one","",exclude,A.selectall.selectedIndex)}function js_check_all(A){exclude=new Array();exclude[0]="keepattachments";exclude[1]="allbox";exclude[2]="removeall";js_toggle_all(A,"checkbox","",exclude,A.allbox.checked)}function js_check_all_option(B,A){exclude=new Array();exclude[0]="useusergroup";js_toggle_all(B,"radio",A,exclude,true)}function checkall(A){js_check_all(A)}function checkall_option(B,A){js_check_all_option(B,A)}function resize_textarea(E,D){var B=fetch_object(D);var C=parseInt(B.offsetWidth)+(E<0?-100:100);var A=parseInt(B.offsetHeight)+(E<0?-100:100);if(C>0){B.style.width=parseInt(B.offsetWidth)+(E<0?-100:100)+"px"}if(A>0){B.style.height=parseInt(B.offsetHeight)+(E<0?-100:100)+"px"}return false}function region_intersects(B,A){B=typeof (B.left)=="undefined"?YAHOO.util.Dom.getRegion(B):B;A=typeof (A.left)=="undefined"?YAHOO.util.Dom.getRegion(A):A;return(B.left>A.right||B.right<A.left||B.top>A.bottom||B.bottom<A.top)?false:true}function fetch_viewport_info(A){if(viewport_info==null||A){viewport_info={x:YAHOO.util.Dom.getDocumentScrollLeft(),y:YAHOO.util.Dom.getDocumentScrollTop(),w:YAHOO.util.Dom.getViewportWidth(),h:YAHOO.util.Dom.getViewportHeight()};console.info("Viewport Info: Size = %dx%d, Position = %d,%d",viewport_info.w,viewport_info.h,viewport_info.x,viewport_info.y)}return viewport_info}function clear_viewport_info(){viewport_info=null}function center_element(B,C,A){viewport_info=fetch_viewport_info(C);YAHOO.util.Dom.setXY(B,[viewport_info.w/2+viewport_info.x-B.clientWidth/2,viewport_info.h/2+viewport_info.y-B.clientHeight/2]);if(document.documentElement.dir=="rtl"){if(A){YAHOO.util.Dom.setStyle(B,"right",0)}else{YAHOO.util.Dom.setStyle(B,"right",YAHOO.util.Dom.getStyle(B,"left"))}YAHOO.util.Dom.setStyle(B,"left",null)}}function fetch_all_stylesheets(D){var G=new Array(),B=0,A=null,E=0,F=0;for(B=0;B<document.styleSheets.length;B++){A=document.styleSheets[B];G.push(A);try{if(A.cssRules){for(E=0;E<A.cssRules.length;E++){if(A.cssRules[E].styleSheet){G.push(A.cssRules[E].styleSheet)}}}else{if(A.imports){for(F=0;F<A.imports.length;F++){G.push(A.imports[F])}}}}catch(C){G.pop();continue}}return G}function highlight_login_box(){var E=fetch_object("navbar_username");var A="inlinemod";var B,C=1600,D=200;if(E){E.focus();E.select();for(B=0;B<C;B+=2*D){window.setTimeout(function(){YAHOO.util.Dom.addClass(E,A)},B);window.setTimeout(function(){YAHOO.util.Dom.removeClass(E,A)},B+D)}}return false}function toggle_collapse(A,B){return false}function vBpagenav(){}vBpagenav.prototype.controlobj_onclick=function(C){this._onclick(C);var A=fetch_tags(this.menu.menuobj,"input");for(var B=0;B<A.length;B++){if(A[B].type=="text"){A[B].focus();break}}};vBpagenav.prototype.form_gotopage=function(A){if((pagenum=parseInt(fetch_object("pagenav_itxt").value,10))>0){window.location=vBmenu.menus[vBmenu.activemenu].addr+"&page="+pagenum}return false};vBpagenav.prototype.ibtn_onclick=function(A){return this.form.gotopage()};vBpagenav.prototype.itxt_onkeypress=function(A){return((A?A:window.event).keyCode==13?this.form.gotopage():true)};function vbmenu_register(B,A,C){if(typeof (vBmenu)=="object"){return vBmenu.register(B,A)}else{return false}}function string_to_node(B){var A=document.createElement("div");A.innerHTML=B;var C=A.firstChild;while(C&&C.nodeType!=1){C=C.nextSibling}if(!C){return A.firstChild.cloneNode(true)}else{return C.cloneNode(true)}}function set_unselectable(B){B=YAHOO.util.Dom.get(B);if(!is_ie4&&typeof B.tagName!="undefined"){if(B.hasChildNodes()){for(var A=0;A<B.childNodes.length;A++){set_unselectable(B.childNodes[A])}}B.unselectable="on"}}function fetch_sessionhash(){return(SESSIONURL==""?"":SESSIONURL.substr(2,32))}function previousSibling(A){do{p=A.previousSibling}while(p&&p.nodeType!=1);return p}function nextSibling(A){do{p=A.nextSibling}while(p&&p.nodeType!=1);return p}function construct_phrase(){if(!arguments||arguments.length<1||!is_regexp){return false}var A=arguments;var D=A[0];var C;for(var B=1;B<A.length;B++){C=new RegExp("%"+B+"\\$s","gi");D=D.replace(C,A[B])}return D}function switch_id(C,E){var F=C.options[C.selectedIndex].value;if(F==""){return }var B=new String(window.location);var A=new String("");B=B.split("#");if(B[1]){A="#"+B[1]}B=B[0];if(B.indexOf(E+"id=")!=-1&&is_regexp){var D=new RegExp(E+"id=\\d+&?");B=B.replace(D,"")}if(B.indexOf("?")==-1){B+="?"}else{lastchar=B.substr(B.length-1);if(lastchar!="&"&&lastchar!="?"){B+="&"}}window.location=B+E+"id="+F+A}function child_img_alt_2_title(A){var C=A.getElementsByTagName("img");for(var B=0;B<C.length;B++){img_alt_2_title(C[B])}}function img_alt_2_title(A){if(!A.title&&A.alt!=""){A.title=A.alt}}function do_securitytoken_replacement(B){if(B==""){return }for(var A=0;A<document.forms.length;A++){if(document.forms[A].elements.securitytoken&&document.forms[A].elements.securitytoken.value==SECURITYTOKEN){document.forms[A].elements.securitytoken.value=B}}SECURITYTOKEN=B;console.log("Securitytoken updated")}function handle_securitytoken_response(A){console.log("Processing securitytoken update");if(A.responseXML&&A.responseXML.getElementsByTagName("securitytoken").length){var B=A.responseXML.getElementsByTagName("securitytoken")[0].firstChild.nodeValue;do_securitytoken_replacement(B);securitytoken_errors=0}else{handle_securitytoken_error(A)}}function handle_securitytoken_error(A){console.log("Securitytoken Error");if(++securitytoken_errors==3){do_securitytoken_replacement("guest")}}var securitytoken_timeout=window.setTimeout("replace_securitytoken()",3600000);var securitytoken_errors=0;function replace_securitytoken(){window.clearTimeout(securitytoken_timeout);if(AJAX_Compatible&&SECURITYTOKEN!=""&&SECURITYTOKEN!="guest"){securitytoken_timeout=window.setTimeout("replace_securitytoken()",3600000);YAHOO.util.Connect.asyncRequest("POST","ajax.php",{success:handle_securitytoken_response,failure:handle_securitytoken_error,timeout:vB_Default_Timeout},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=securitytoken")}}function Comment_Init(B){if(typeof B.id=="undefined"){return }var C=B.id;if(isNaN(C)){var A=null;if(A=C.match(/(\d+)/)){C=A[0]}}if(typeof inlineMod_comment!="undefined"){im_init(B,inlineMod_comment)}if(typeof vB_QuickEditor_Factory!="undefined"){if(typeof vB_QuickEditor_Factory.controls[C]=="undefined"){vB_QuickEditor_Factory.controls[C]=new vB_QuickEditor(C,vB_QuickEditor_Factory)}else{vB_QuickEditor_Factory.controls[C].init()}}if(typeof vB_QuickLoader_Factory!="undefined"){vB_QuickLoader_Factory.controls[C]=new vB_QuickLoader(C,vB_QuickLoader_Factory)}child_img_alt_2_title(B);if(typeof YAHOO.vBulletin.vBRestrain!="undefined"){YAHOO.vBulletin.vBRestrain.addcontainer(B);YAHOO.vBulletin.vBRestrain.resize(B)}}function vBulletin_init(){if(is_webtv){return false}child_img_alt_2_title(document);if(typeof vBmenu=="object"){if(typeof (YAHOO)!="undefined"){YAHOO.util.Event.on(document,"click",vbmenu_hide);YAHOO.util.Event.on(window,"resize",vbmenu_hide)}else{if(window.attachEvent&&!is_saf){document.attachEvent("onclick",vbmenu_hide);window.attachEvent("onresize",vbmenu_hide)}else{if(document.addEventListener&&!is_saf){document.addEventListener("click",vbmenu_hide,false);window.addEventListener("resize",vbmenu_hide,false)}else{window.onclick=vbmenu_hide;window.onresize=vbmenu_hide}}}var B=fetch_tags(document,"td");for(var D=0;D<B.length;D++){if(B[D].hasChildNodes()&&B[D].firstChild.name&&B[D].firstChild.name.indexOf("PageNav")!=-1){var C=B[D].title;B[D].title="";B[D].innerHTML="";B[D].id="pagenav."+D;var A=vBmenu.register(B[D].id);A.addr=C;if(is_saf){A.controlobj._onclick=A.controlobj.onclick;A.controlobj.onclick=vBpagenav.prototype.controlobj_onclick}}}if(typeof C!="undefined"){fetch_object("pagenav_form").gotopage=vBpagenav.prototype.form_gotopage;fetch_object("pagenav_ibtn").onclick=vBpagenav.prototype.ibtn_onclick;fetch_object("pagenav_itxt").onkeypress=vBpagenav.prototype.itxt_onkeypress}vBmenu.activate(true)}vBulletin.init();return true}function vBulletin_Framework(){this.elements=new Array();this.ajaxurls=new Array();this.events=new Array();this.time=new Date();this.add_event("systemInit")}vBulletin_Framework.prototype.init=function(){console.info("Firing System Init");this.events.systemInit.fire()};vBulletin_Framework.prototype.extend=function(C,A){function B(){}B.prototype=A.prototype;C.prototype=new B();C.prototype.constructor=C;C.baseConstructor=A;C.superClass=A.prototype};vBulletin_Framework.prototype.register_control=function(B,E){var C=new Array();for(var D=1;D<arguments.length;D++){C.push(arguments[D])}if(!this.elements[B]){console.info('Creating array vBulletin.elements["%s"]',B);this.elements[B]=new Array()}var A=this.elements[B].push(C);console.log('vBulletin.elements["%s"][%d] = %s',B,A-1,C.join(", "))};vBulletin_Framework.prototype.register_ajax_urls=function(B,C,D){B=B.split("?");B[1]=SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&"+B[1].replace(/\{(\d+)(:\w+)?\}/gi,"%$1$s");C=C.split("?");C[1]=SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&"+C[1].replace(/\{(\d+)(:\w+)?\}/gi,"%$1$s");console.log("Register AJAX URLs for %s",D);for(var A=0;A<D.length;A++){this.ajaxurls[D[A]]=new Array(B,C)}};vBulletin_Framework.prototype.add_event=function(A){this.events[A]=new YAHOO.util.CustomEvent(A)};vBulletin_Framework.prototype.console=function(){if(window.console||console.firebug){var args=new Array();for(var i=0;i<arguments.length;i++){args[args.length]=arguments[i]}try{eval("console.log('"+args.join("','")+"');")}catch(e){}}};var PHP=new vB_PHP_Emulator();var vBulletin=new vBulletin_Framework();vBulletin.events.systemInit.subscribe(function(){YAHOO.util.Event.on(window,"resize",clear_viewport_info);YAHOO.util.Event.on(window,"scroll",clear_viewport_info)});function handle_dismiss_notice_error(C){if(C.argument){var B=YAHOO.util.Dom.get("dismiss_notice_hidden");B.value=C.argument;var A=YAHOO.util.Dom.get("notices");A.submit()}}function handle_dismiss_notice_ajax(G){if(G.responseXML&&G.responseXML.getElementsByTagName("dismissed").length){var D=G.responseXML.getElementsByTagName("dismissed")[0].firstChild.nodeValue;var B=YAHOO.util.Dom.get("navbar_notice_"+D);if(B!=null){YAHOO.util.Dom.setStyle(B,"display","none");var F=YAHOO.util.Dom.get("notices");var A=F.getElementsByTagName("li");var E=0;if(A.length){for(var C=0;C<A.length;C++){if(YAHOO.util.Dom.getStyle(A[C],"display")!="none"){E++}}if(E==0){YAHOO.util.Dom.setStyle("notices","display","none")}}}}else{handle_dismiss_notice_error(G)}}function dismiss_notice(B){if(AJAX_Compatible){var A=YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=dismissnotice",{success:handle_dismiss_notice_ajax,failure:handle_dismiss_notice_error,timeout:vB_Default_Timeout,argument:B},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=dismissnotice&noticeid="+PHP.urlencode(B));return false}return true}function page_jump(A){window.location=A.options[A.selectedIndex].value}function loadVbCss(C,E){if(!window.LESS_THAN_IE7){var D=fetch_object("e_vb_meta_bburl");if(D){var B=(!E&&(C.indexOf(D.content)==-1))?(D.content+"/"+C):C;var A=document.createElement("link");A.setAttribute("rel","stylesheet");A.setAttribute("href",B);A.setAttribute("media","screen");A.setAttribute("type","text/css");A.setAttribute("charset","utf-8");var F=document.getElementsByTagName("head");F=F[0]?F[0]:null;if(F){F.appendChild(A)}}}}if(!window.console||!console.firebug){window.console={};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}YAHOO.namespace("vBulletin");YAHOO.vBulletin.vB_XHTML_Ready=false;var vB_XHTML_Ready=new YAHOO.util.CustomEvent();YAHOO.util.Event.onAvailable("footer",function(){console.log("Fire vB_XHTML_Ready");vB_XHTML_Ready.fire();YAHOO.vBulletin.vB_XHTML_Ready=true});vB_XHTML_Ready.subscribe(init_breadcrumb);function init_breadcrumb(D){var C=YAHOO.util.Dom.get("breadcrumb");var B=C.getElementsByTagName("li");for(var A=0;A<B.length;A++){}}function register_inlinemod(D,F,C,B,E,A){YAHOO.namespace("vBulletin.imodcollection."+B);YAHOO.vBulletin.imodcollection[B]=new InlineModCollection(B,B+"_imodsel",A);YAHOO.vBulletin.imodcollection[B].add_controls(YAHOO.util.Dom.getElementsByClassName(C,F,D),E)}function register_inlinemod_checkboxes(E,H,D,A,C,G,B){var F=new InlineModCollection(C,null,B);F.add_controls(YAHOO.util.Dom.getElementsByClassName(D,H,E),G);F.add_checkboxes(A)}YAHOO.namespace("vBulletin.imodcollections");function InlineModCollection(B,A,C){this.type=B;this.collection=new Array();if(typeof C=="undefined"){C="vbulletin_inline"}this.cookiename=C+this.type;this.selecteditems=this.fetch_ids();this.set_display_count(this.selecteditems.length);this.init_selector(A);YAHOO.vBulletin.imodcollections[B]=this}InlineModCollection.get=function(A){return YAHOO.vBulletin.imodcollections[A]};InlineModCollection.prototype.add_controls=function(D,E){if(typeof E=="undefined"){E=this.type+"_"}for(var B=0;B<D.length;B++){var A=D[B];var C=A.id.substr(E.length);this.add_control(new InlineModControl(A,C,this))}};InlineModCollection.prototype.add_checkboxes=function(B){var A=YAHOO.util.Dom.getElementsByClassName(this.type+"_checkall","input",B);for(var D=0;D<A.length;D++){var C=A[D];if(C.type=="checkbox"){YAHOO.util.Event.on(C,"click",this.set_from_checkbox,this,true)}}};InlineModCollection.prototype.add_control=function(A){if(PHP.in_array(A.itemid,this.selecteditems)!=-1){A.checkbox.checked=true;A.set_inlinemod_highlight()}this.collection.push(A)};InlineModCollection.prototype.init_selector=function(A){var D=YAHOO.util.Dom.get(A);if(D!=null){var B=D.getElementsByTagName("a");for(var C=0;C<B.length;C++){if(B[C].id&&B[C].id.substr(0,D.id.length)==D.id){YAHOO.util.Event.on(B[C],"click",this.set_all_selections,this,true)}}}};InlineModCollection.prototype.set_from_checkbox=function(C){var B=YAHOO.util.Event.getTarget(C);for(var A=0;A<this.collection.length;A++){this.collection[A].set_selection_from_checkbox(B)}this.update_collection_state()};InlineModCollection.prototype.set_all_selections=function(D){var B=YAHOO.util.Event.getTarget(D);if("a"!=B.tagName.toLowerCase()){B=YAHOO.util.Dom.getAncestorByTagName(B,"A")}console.log("Do:%s, ID:%s",B.innerHTML,B.id);var C=B.id.split(":");for(var A=0;A<this.collection.length;A++){this.collection[A].set_selection(C)}this.update_collection_state();YAHOO.util.Event.stopEvent(D);YAHOO.vBulletin.vBPopupMenu.close_all()};InlineModCollection.prototype.update_collection_state=function(){var B=new Array();for(var A=0;A<this.collection.length;A++){B.push(this.collection[A].itemid)}if(B.length){this.selecteditems=this.remove_items(this.selecteditems,B)}for(var A=0;A<this.collection.length;A++){if(this.collection[A].checkbox.checked){this.selecteditems.push(this.collection[A].itemid)}}this.set_cookie(this.selecteditems);this.set_display_count(this.selecteditems.length)};InlineModCollection.prototype.update_state=function(B,A){this.selecteditems=this.remove_items(this.selecteditems,new Array(B));if(A){this.selecteditems.push(B)}this.set_cookie(this.selecteditems);this.set_display_count(this.selecteditems.length)};InlineModCollection.prototype.remove_items=function(D,C){var B=new Array();for(var A=0;A<D.length;A++){if(D[A]!=""&&PHP.in_array(D[A],C)==-1){B.push(D[A])}}return B};InlineModCollection.prototype.set_cookie=function(B){var A=new Date();A.setTime(A.getTime()+3600000);set_cookie(this.cookiename,B.join("-"),A)};InlineModCollection.prototype.fetch_ids=function(){var A=fetch_cookie(this.cookiename);if(A!=null&&A!=""){A=A.split("-");if(A.length>0){return A}}return new Array()};InlineModCollection.prototype.set_display_count=function(A){var B=YAHOO.util.Dom.get(this.type+"_inlinemod_count");if(B){B.innerHTML=A}};function InlineModControl(A,B,D){var C=D.type+"_imod_checkbox_"+B;this.container=YAHOO.util.Dom.get(A);this.checkbox=YAHOO.util.Dom.get(C);this.itemid=B;this.collection=D;if(this.checkbox){YAHOO.util.Event.on(this.checkbox,"click",this.set_inlinemod_state,this,true)}else{console.warn("No inlinemod selection checkbox found for "+C)}}InlineModControl.prototype.init_collection=function(A){if(typeof YAHOO.vBulletin.imodcollection=="undefined"){YAHOO.vBulletin.imodcollection=new InlineModCollection(A)}return YAHOO.vBulletin.imodcollection};InlineModControl.prototype.set_selection_from_checkbox=function(A){if(A.value!="all"){if(A.value!=this.checkbox.value){return }}this.checkbox.checked=A.checked;this.set_inlinemod_highlight()};InlineModControl.prototype.set_selection=function(A){switch(A[1]){case"invert":this.checkbox.checked=!this.checkbox.checked;break;case"none":this.checkbox.checked=false;break;case"class":this.checkbox.checked=YAHOO.util.Dom.hasClass(this.container,A[2]);break;case"flag":if(typeof A[2]!=undefined&&!isNaN(A[2])){this.checkbox.checked=this.checkbox.value&A[2]}else{this.checkbox.checked=true}break;default:case"all":this.checkbox.checked=true;break}this.set_inlinemod_highlight()};InlineModControl.prototype.set_inlinemod_state=function(){this.collection.update_state(this.itemid,this.checkbox.checked);this.set_inlinemod_highlight()};InlineModControl.prototype.set_inlinemod_highlight=function(){var A=(this.checkbox.checked?"addClass":"removeClass");YAHOO.util.Dom[A](this.container,"imod_highlight");console.log("Set Inlinemod State for %s - %s",this.itemid,A)};vB_XHTML_Ready.subscribe(init_searchboxes);function init_searchboxes(){var B=YAHOO.util.Dom.getElementsByClassName("searchbox","input");for(var A=0;A<B.length;A++){new YAHOO.vBulletin.SearchBox(B[A])}}YAHOO.vBulletin.LoadScript=function(B,C){var A=document.createElement("script");YAHOO.util.Dom.setAttribute(A,"type","text/javascript");if(typeof (C)!="undefined"){if(A.readyState){A.onreadystatechange=function(){if(A.readyState=="loaded"||A.readyState=="complete"){A.onreadystatechange=null;C()}}}else{A.onload=function(){C()}}}YAHOO.util.Dom.setAttribute(A,"src",B+"?"+Math.floor(Math.random()*100000));document.getElementsByTagName("head")[0].appendChild(A)};YAHOO.vBulletin.LoadCss=function(A){var B=document.createElement("link");YAHOO.util.Dom.setAttribute(B,"type","text/css");YAHOO.util.Dom.setAttribute(B,"rel","stylesheet");YAHOO.util.Dom.setAttribute(B,"href",A);document.getElementsByTagName("head")[0].appendChild(B)};YAHOO.vBulletin.SearchBox=function(A){this.element=A;this.default_value=this.element.value;YAHOO.util.Event.on(this.element,"focus",this.focus_handler,this,true);YAHOO.util.Event.on(this.element,"blur",this.blur_handler,this,true)};YAHOO.vBulletin.SearchBox.prototype.focus_handler=function(A){if(this.element.value==this.default_value){this.element.value=""}this.element.select()};YAHOO.vBulletin.SearchBox.prototype.blur_handler=function(A){if(this.element.value==""){this.element.value=this.default_value}};vB_XHTML_Ready.subscribe(init_popupmenus);function init_popupmenus(A){YAHOO.vBulletin.vBPopupMenu=new PopupFactory(A)}function PopupFactory(A){this.menu_open=false;this.timeout=null;this.menuclose_timeout=null;this.popups=new Object();this.instrument(A);YAHOO.util.Event.on(document,"click",this.close_all,this,true)}PopupFactory.prototype.instrument=function(C){var B=YAHOO.util.Dom.getElementsByClassName("popupmenu",undefined,C);for(var A=0;A<B.length;A++){if(!YAHOO.util.Dom.hasClass(B[A],"popupcustom")){this.register(B[A])}}};PopupFactory.prototype.register=function(A){var B=YAHOO.util.Dom.generateId(A);this.popups[B]=new PopupMenu(A,this)};PopupFactory.prototype.register_menuobj=function(A){var B=YAHOO.util.Dom.generateId(A.container);this.popups[B]=A};PopupFactory.prototype.close_all=function(B){if(this.menu_open){for(var A in this.popups){this.popups[A].close_menu()}this.menu_open=false}};function PopupMenu(A,B){this.init(A,B)}PopupMenu.prototype.init=function(A,B){this.container=A;this.factory=B;this.display=false;this.menu=null;this.activate_menu();this.control=null;this.activate_control();this.locator=null;this.form=null;this.popup_form_elements=new Array();this.textdirection=document.documentElement.dir=="rtl"?"right":"left"};PopupMenu.prototype.activate_menu=function(){var A=YAHOO.util.Dom.getElementsByClassName("popupbody","*",this.container);if(A.length){this.menu=A[0];YAHOO.util.Dom.generateId(this.menu);if(YAHOO.util.Dom.hasClass(this.container,"hovermenu")){YAHOO.util.Event.on(this.menu,"mouseover",this.cancel_menutimer,this,true);YAHOO.util.Event.on(this.menu,"mouseout",this.start_menutimer,this,true)}}else{}YAHOO.util.Dom.removeClass(A[0],"popuphover");YAHOO.util.Event.on(A[0],"click",this.cancel_close,this,true)};PopupMenu.prototype.activate_control=function(){var A=YAHOO.util.Dom.getElementsByClassName("popupctrl","",this.container);if(A.length){this.control=A[0];YAHOO.util.Dom.generateId(this.control);if(!YAHOO.util.Dom.hasClass(this.container,"noclick")){YAHOO.util.Event.on(this.control,"click",this.toggle_menu,this,true)}if(YAHOO.util.Dom.hasClass(this.container,"hovermenu")){YAHOO.util.Event.on(this.control,"mouseover",this.open_hovermenu,this,true);YAHOO.util.Event.on(this.control,"mouseout",this.start_menutimer,this,true)}else{if(!YAHOO.util.Dom.hasClass(this.container,"nomouseover")){YAHOO.util.Event.on(this.control,"mouseover",this.mouseover,this,true);YAHOO.util.Event.on(this.control,"mouseout",this.mouseout,this,true)}}}};PopupMenu.prototype.cancel_close=function(A){YAHOO.util.Event.stopPropagation(A)};PopupMenu.prototype.mouseover=function(A){if(this.factory.menu_open){this.open_menu(A)}};PopupMenu.prototype.mouseout=function(A){if(this.factory.timeout!=null){this.factory.timeout.cancel()}};PopupMenu.prototype.open_hovermenu=function(A){this.cancel_menutimer(A);this.open_menu(A)};PopupMenu.prototype.start_menutimer=function(A){this.factory.menuclose_timeout=YAHOO.lang.later(300,this,"close_menu",[{e:A}])};PopupMenu.prototype.cancel_menutimer=function(A){if(this.factory.menuclose_timeout!=null){this.factory.menuclose_timeout.cancel()}};PopupMenu.prototype.toggle_menu=function(A){if(this.display){this.close_menu()}else{this.open_menu(A)}YAHOO.util.Event.stopEvent(A)};PopupMenu.prototype.load_menu=function(B){var C={};for(var A in B){C[A]=B[A]}YAHOO.util.Connect.asyncRequest("POST","load-popup.php?id="+this.container.id,{success:this.handle_menu_load,failure:null,timeout:null,scope:this,argument:{e:C}},"id="+this.container.id)};PopupMenu.prototype.handle_menu_load=function(A){alert("Load menu!")};PopupMenu.prototype.open_menu=function(B){if(YAHOO.lang.isNull(this.menu)){this.load_menu(B);return }if(this.factory.timeout!=null){this.factory.timeout.cancel()}this.factory.close_all();if(typeof (B)=="object"){var A=YAHOO.util.Event.getTarget(B)}else{var A=YAHOO.util.Dom.get(B)}if(A!=null){A=(YAHOO.util.Dom.hasClass(A,"popupctrl")?A:YAHOO.util.Dom.getAncestorByClassName(A,"popupctrl"))}this.set_display(true,A);this.factory.menu_open=true};PopupMenu.prototype.close_menu=function(){this.set_display(false);this.factory.menu_open=false};PopupMenu.prototype.set_display=function(C,A){if(YAHOO.lang.isNull(this.menu)){return }var B=(typeof (A)!="undefined"&&YAHOO.util.Dom.hasClass(A.parentNode,"editormenu"));this.display=C;if(C){if(this.check_menu(this.menu)){YAHOO.util.Dom.setStyle(this.menu,"display","block");this.set_offset(this.menu,A);this.set_control_style()}}else{YAHOO.util.Dom.setStyle(this.menu,"display","none");this.set_control_style()}};PopupMenu.prototype.check_menu=function(C){if(!YAHOO.util.Dom.hasClass(C,"noempty")){return true}var A=this.menu.getElementsByTagName("li");if(A.length){for(var B=0;B<A.length;B++){if(!YAHOO.util.Dom.hasClass(A[B],"noempty")){return true}}}return false};PopupMenu.prototype.register_popup_form=function(A){var B=this.contains_form_elements(A);if(B){this.form=B.form}};PopupMenu.prototype.contains_form_elements=function(A){var B=null;B=A.getElementsByTagName("input");if(B.length){return B[0]}else{B=A.getElementsByTagName("textarea");if(B.length){return B[0]}else{B=A.getElementsByTagName("select");if(B.length){return B[0]}}}return false};PopupMenu.prototype.handle_popup_form_submit=function(D){YAHOO.util.Event.stopEvent(D);var C=YAHOO.util.Event.getTarget(D);for(var B=0;B<C.elements.length;B++){var A=C.elements[B];if(A.name){switch(A.tagName){case"textarea":case"select":this.replicate_form_value(A);break;case"input":default:switch(A.type){case"hidden":case"text":case"password":this.replicate_form_value(A);break;case"checkbox":case"radio":if(A.checked){this.replicate_form_value(A)}break}}}}this.form.submit()};PopupMenu.prototype.replicate_form_value=function(B){if(!this.form.elements[B.name]){var A=document.createElement("input");A.name=B.name;A.type="hidden";A.value=B.value;this.form.appendChild(A)}else{this.form.elements[B.name].value=B.value}};PopupMenu.prototype.handle_popup_form_reset=function(A){YAHOO.util.Event.getTarget(A).reset();this.form.reset()};PopupMenu.prototype.set_offset=function(H,E){if(!E){return }var C=YAHOO.util.Dom.getX(E);var A=YAHOO.util.Dom.getY(E);var D=E.offsetWidth;var G=E.offsetHeight;if(this.textdirection=="left"){YAHOO.util.Dom.setX(H,C)}else{YAHOO.util.Dom.setX(H,C+D-(H.offsetWidth+2));YAHOO.util.Dom.setStyle(H,"right","auto")}YAHOO.util.Dom.setY(H,A+G);var B=YAHOO.util.Dom.getClientRegion();var F=YAHOO.util.Dom.getRegion(H);if(F.right>B.right){YAHOO.util.Dom.setX(H,B.right-(H.offsetWidth+2));F=YAHOO.util.Dom.getRegion(H)}if(F.left<B.left){YAHOO.util.Dom.setX(H,B.left);F=YAHOO.util.Dom.getRegion(H)}if(F.bottom>B.bottom){YAHOO.util.Dom.setY(H,A-H.offsetHeight);F=YAHOO.util.Dom.getRegion(H)}if(F.top<B.top){YAHOO.util.Dom.setY(H,B.top)}};PopupMenu.prototype.set_control_style=function(){var A=(this.display?"addClass":"removeClass");YAHOO.util.Dom[A](this.control,"active")};vB_XHTML_Ready.subscribe(init_collapsers);function init_collapsers(){new vBCollapseFactory()}function vBCollapseFactory(A){var B=YAHOO.util.Dom.getElementsByClassName("collapse","a",A);for(var C=0;C<B.length;C++){new vBCollapse(B[C],this)}apply_collapses()}function vBCollapse(B,A){this.init(B,A)}vBCollapse.prototype.init=function(B,A){this.link=B;this.factory=A;this.targetid=null;this.target=null;this.image=null;var D=this.link.id.match(/^collapse_(.*)$/);this.targetid=D[1];this.target=YAHOO.util.Dom.get(this.targetid);this.target.vBCollapseInstance=this;var C=this.link.getElementsByTagName("img");this.image=C[0];if(this.target){YAHOO.util.Event.on(this.link,"click",this.toggle_collapse,this,true)}else{YAHOO.util.Dom.setStyle(this.link,"display","hidden")}};vBCollapse.prototype.collapse=function(){YAHOO.util.Dom.setStyle(this.target,"display","none");this.save_collapsed(true);if(this.image&&!this.image.src.match(/_collapsed.png$/)){var A=new RegExp("\\.png$");this.image.src=this.image.src.replace(A,"_collapsed.png")}};vBCollapse.prototype.expand=function(){YAHOO.util.Dom.setStyle(this.target,"display","");this.save_collapsed(false);if(this.image){var A=new RegExp("_collapsed\\.png$");this.image.src=this.image.src.replace(A,".png")}};vBCollapse.prototype.toggle_collapse=function(A){YAHOO.util.Event.stopEvent(A);if(!is_regexp){return false}if(YAHOO.util.Dom.getStyle(this.target,"display")=="none"){this.expand()}else{this.collapse()}return false};vBCollapse.prototype.save_collapsed=function(D){var C=fetch_cookie("vbulletin_collapse");var B=new Array();if(C!=null){C=C.split("\n");for(var A in C){if(YAHOO.lang.hasOwnProperty(C,A)&&C[A]!=this.targetid&&C[A]!=""){B[B.length]=C[A]}}}if(D){B[B.length]=this.targetid}expires=new Date();expires.setTime(expires.getTime()+(1000*86400*365));set_cookie("vbulletin_collapse",B.join("\n"),expires)};function apply_collapses(){var B=fetch_cookie("vbulletin_collapse");if(B!=null){B=B.split("\n");for(var C in B){var A=YAHOO.util.Dom.get(B[C]);if(A){A.vBCollapseInstance.collapse()}}}}function PostBit_Init(A,C){console.log("PostBit Init: %d",C);YAHOO.vBulletin.vBPopupMenu.instrument(A);if(typeof vB_QuickEditor!="undefined"){vB_AJAX_QuickEdit_Init(A)}if(typeof vB_QuickReply!="undefined"){qr_init_buttons(A)}if(typeof YAHOO.vBulletin.imodcollection!="undefined"&&typeof YAHOO.vBulletin.imodcollection.post!="undefined"){var B=YAHOO.vBulletin.imodcollection.post;B.add_control(new InlineModControl(A,C,B))}if(typeof mq_init!="undefined"){mq_init(A)}if(typeof init_reputation_popupmenus!="undefined"){init_reputation_popupmenus(A)}if(typeof vB_Lightbox!="undefined"){init_postbit_lightbox(A,false,true)}child_img_alt_2_title(A);if(typeof YAHOO.vBulletin.vBRestrain!="undefined"){YAHOO.vBulletin.vBRestrain.addcontainer(A);YAHOO.vBulletin.vBRestrain.resize(A)}}YAHOO.util.Event.onDOMReady(init_restrain);function init_restrain(){YAHOO.vBulletin.vBRestrain=new vBRestrain()}function vBRestrain(){this.containers={};this.length=0;var B=YAHOO.util.Dom.getElementsByClassName("postcontainer","div");for(var A=0;A<B.length;A++){this.addcontainer(B[A]);this.length++}var B=YAHOO.util.Dom.getElementsByClassName("postcontainer","li");for(var A=0;A<B.length;A++){this.addcontainer(B[A]);this.length++}var B=YAHOO.util.Dom.getElementsByClassName("postcontainer","p");for(var A=0;A<B.length;A++){this.addcontainer(B[A]);this.length++}var B=YAHOO.util.Dom.getElementsByClassName("postcontainer","blockquote");for(var A=0;A<B.length;A++){this.addcontainer(B[A]);this.length++}if(this.length>0){this.resizeall();YAHOO.util.Event.on(window,"resize",this.resizeall,this,true)}}vBRestrain.prototype.addcontainer=function(A){if(YAHOO.util.Dom.hasClass(A,"postcontainer")||YAHOO.util.Dom.hasClass(A,"bbcode_container")){if(!A.id){YAHOO.util.Dom.generateId(A)}var F=A.id;this.containers[F]={};this.containers[F].object=A;this.containers[F].objects={};var E=YAHOO.util.Dom.getElementsByClassName("restrain","object",A);for(var D=0;D<E.length;D++){if(YAHOO.util.Dom.hasClass(A,"postcontainer")){var C=YAHOO.util.Dom.getAncestorByClassName(E[D],"bbcode_container");if(C){this.addcontainer(C);continue}}if(!E[D].id){YAHOO.util.Dom.generateId(E[D])}var B=E[D].id;this.containers[F].objects[B]=E[D]}}else{var C=YAHOO.util.Dom.getAncestorByClassName(A,"postcontainer");if(C){this.addcontainer(C)}}};vBRestrain.prototype.resize=function(E){if(E.id&&this.containers[E.id]){var B=this.containers[E.id];var F=document.getElementsByTagName("html")[0].getAttribute("dir").toLowerCase();if(!B.object){return }B.paddingLeft=parseFloat(YAHOO.util.Dom.getStyle(B.object,"paddingLeft"));B.paddingRight=parseFloat(YAHOO.util.Dom.getStyle(B.object,"paddingRight"));B.borderLeftWidth=parseFloat(YAHOO.util.Dom.getStyle(B.object,"borderLeftWidth"));B.borderRightWidth=parseFloat(YAHOO.util.Dom.getStyle(B.object,"borderRightWidth"));var D=YAHOO.util.Dom.getRegion(B.object);B.width=D.width-(isNaN(B.paddingLeft)?0:B.paddingLeft)-(isNaN(B.paddingRight)?0:B.paddingRight)-(isNaN(B.borderLeftWidth)?0:B.borderLeftWidth)-(isNaN(B.borderRightWidth)?0:B.borderRightWidth);if(F=="ltr"){if(isNaN(B.paddingRight)||B.paddingRight<5){B.paddingRight=5}B.right=D.right-(isNaN(B.paddingRight)?0:B.paddingRight)-(isNaN(B.borderRightWidth)?0:B.borderRightWidth)}else{if(isNaN(B.paddingLeft)||B.paddingLeft<5){B.paddingLeft=5}B.left=D.left+(isNaN(B.paddingLeft)?0:B.paddingLeft)+(isNaN(B.borderLeftWidth)?0:B.borderLeftWidth)}if(B.width<=0){return }for(var H in B.objects){if(!B.objects[H]){continue}var C=B.objects[H];var D=YAHOO.util.Dom.getRegion(C);if(D.width==0){D.width=parseInt(YAHOO.util.Dom.getStyle(C,"width"),10);D.height=parseInt(YAHOO.util.Dom.getStyle(C,"height"),10);if(D.width==0){return }if(F=="ltr"){D.right+=D.width}else{D.left-=D.width}}if(!C.origwidth){C.origwidth=D.width;C.origheight=D.height;C.aspect=D.width/D.height}if(F=="ltr"){if(D.right>B.right){var A=D.width-(D.right-B.right)-10;if(A<=0){return }YAHOO.util.Dom.setStyle(C,"width",A+"px");YAHOO.util.Dom.setStyle(C,"height",Math.round(A/C.aspect)+"px")}else{if(D.width<C.origwidth){var G=(B.right-D.right)-10;if(D.width+G>=C.origwidth){YAHOO.util.Dom.setStyle(C,"width",C.origwidth+"px");YAHOO.util.Dom.setStyle(C,"height",C.origheight+"px")}else{var A=D.width+G;if(A<=0){return }YAHOO.util.Dom.setStyle(C,"width",A+"px");YAHOO.util.Dom.setStyle(C,"height",Math.round(A/C.aspect)+"px")}}}}else{if(D.left<B.left){var A=D.width-(B.left-D.left)-10;if(A<=0){return }YAHOO.util.Dom.setStyle(C,"width",A+"px");YAHOO.util.Dom.setStyle(C,"height",Math.round(A/C.aspect)+"px")}else{if(D.width<C.origwidth){var G=(D.left-B.left)-10;if(D.width+G>=C.origwidth){YAHOO.util.Dom.setStyle(C,"width",C.origwidth+"px");YAHOO.util.Dom.setStyle(C,"height",C.origheight+"px")}else{var A=D.width+G;if(A<=0){return }YAHOO.util.Dom.setStyle(C,"width",A+"px");YAHOO.util.Dom.setStyle(C,"height",Math.round(A/C.aspect)+"px")}}}}}}};vBRestrain.prototype.resizeall=function(B){for(var A in this.containers){this.resize(this.containers[A].object)}};
;/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.6
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
function display_post(A){if(AJAX_Compatible){vB_PostLoader[A]=new vB_AJAX_PostLoader(A);vB_PostLoader[A].init()}else{pc_obj=fetch_object("postcount"+this.postid);openWindow("showthread.php?"+(SESSIONURL?"s="+SESSIONURL:"")+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):"")+"&p="+A+"#post"+A)}return false}var vB_PostLoader=new Array();function vB_AJAX_PostLoader(A){this.postid=A;this.post=YAHOO.util.Dom.get("post_"+this.postid)}vB_AJAX_PostLoader.prototype.init=function(){if(this.post){postid=this.postid;pc_obj=fetch_object("postcount"+this.postid);YAHOO.util.Connect.asyncRequest("POST","showpost.php?p="+this.postid,{success:this.display,failure:this.handle_ajax_error,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&postid="+this.postid+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):""))}};vB_AJAX_PostLoader.prototype.handle_ajax_error=function(A){vBulletin_AJAX_Error_Handler(A)};vB_AJAX_PostLoader.prototype.display=function(B){if(B.responseXML){var C=B.responseXML.getElementsByTagName("postbit");if(C.length){var A=string_to_node(C[0].firstChild.nodeValue);this.post.parentNode.replaceChild(A,this.post);PostBit_Init(A,this.postid)}else{openWindow("showthread.php?"+(SESSIONURL?"s="+SESSIONURL:"")+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):"")+"&p="+this.postid+"#post"+this.postid)}}};
;/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.6
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
vB_XHTML_Ready.subscribe(init_posticons);function init_posticons(){var C=YAHOO.util.Dom.get("posticons");var A=YAHOO.util.Dom.get("posticon_preview");var B=new Array();if(C&&A){containers=YAHOO.util.Dom.get("posticons").getElementsByTagName("li");for(i=0;i<containers.length;i++){B[i]=new PostIconPreview(containers[i],A);if(B[i].control.checked){B[i].choose()}}}}function PostIconPreview(B,A){this.posticon_preview=A;this.control=B.getElementsByTagName("input")[0];this.icon=B.getElementsByTagName("img")[0];YAHOO.util.Event.on(this.control,"click",this.choose,this,true)}PostIconPreview.prototype.choose=function(A){this.clear_preview();this.set_preview()};PostIconPreview.prototype.clear_preview=function(A){this.posticon_preview.src="images/clear.gif"};PostIconPreview.prototype.set_preview=function(A){if(this.control.value!=0){this.posticon_preview.src="images/icons/icon"+this.control.value+".gif"}};vB_XHTML_Ready.subscribe(function(A){return handle_dep(document.body)});var DepCtrls=new Object();function handle_dep(B){var A=YAHOO.util.Dom.getElementsByClassName("dep_ctrl","input",B);var D=null;for(var C=0;C<A.length;C++){D=new DepCtrl(A[C]);if(!D.fail){console.log("Dep Ctrl: %s",A[C].id);DepCtrls[A[C].id]=D}}}function DepCtrl(C){this.ctrl=YAHOO.util.Dom.get(C);if(!this.ctrl){console.log("Dep Ctrl (ctrl) FAIL: %s",C.id);this.fail=true;return false}this.deps=YAHOO.util.Dom.get(C.id+"_deps");if(!this.deps){console.log("Dep Ctrl (deps_x) FAIL: %s",C.id);this.fail=true;return false}this.set_disabled_state(this.deps,true);if(this.ctrl.type=="checkbox"){console.log("Checkbox %s",this.ctrl.id);this.add_click_event(this.ctrl)}else{if(this.ctrl.type=="radio"){console.log("Radio %s (%s)",this.ctrl.id,this.ctrl.name);var A=document.getElementsByName(this.ctrl.name);for(var B=0;B<A.length;B++){this.add_click_event(A[B])}}}}DepCtrl.prototype.add_click_event=function(A){YAHOO.util.Event.on(A,"click",this.check_state,this,true)};DepCtrl.prototype.check_state=function(A){this.set_disabled_state(this.deps,true);this.set_focus()};DepCtrl.prototype.set_disabled_state=function(B,C){if(B.tagName&&(B.tagName!="DD"||C)){B.disabled=!this.ctrl.checked||this.ctrl.disabled;if(B.tagName=="INPUT"&&YAHOO.util.Dom.hasClass(B,"dep_ctrl")&&DepCtrls[B.id]){DepCtrls[B.id].set_disabled_state(DepCtrls[B.id].deps,true)}if(B.hasChildNodes()){for(var A=0;A<B.childNodes.length;A++){this.set_disabled_state(B.childNodes[A])}}}};DepCtrl.prototype.is_form_element=function(A){switch(A.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return true;default:return false}};DepCtrl.prototype.set_focus=function(B){var A=YAHOO.util.Dom.getElementsBy(this.is_form_element,"*",this.deps);try{try{A[0].focus()}catch(B){A[0].focus()}}catch(B){}};
;/************************************************************************\
 *
 * VaultWiki
 * Version CES_VERSION
 *
 * CES_VAULT_COPYRIGHT
 *
\************************************************************************/

// #############################################################################
// vB_WikiTabs
// #############################################################################

var vB_WikiTabs = new Array();

// #############################################################################
// vB_WikiTab
// call using:
// vBulletin.register_control("vB_WikiTabs", tab_container, initial_tab_id, overflow_tab_label)
// #############################################################################

vBulletin.events.systemInit.subscribe(function()
{
	if (vBulletin.elements["vB_WikiTabs"])
	{
		var i,
			element;

		for (i = 0; i < vBulletin.elements["vB_WikiTabs"].length; i++)
		{
			element = vBulletin.elements["vB_WikiTabs"][i];
			vB_WikiTabs[element[0]] = new vB_WikiTab(element[0], element[1], element[2]);
		}
		vBulletin.elements["vB_WikiTabs"] = null;
	}
});

// =============================================================================

/**
* VaultWiki tabbed content
*
* @param	string	HTML element containing tab divs - each tab must be a div.content_block with a child of h4... etc.
* @param	string	Identifier of initially-selected tab
* @param	string	Text to place onto the overflow tab - recommend &raquo;
* @param	string	URL from which to request new tab content via AJAX
*/
function vB_WikiTab(tab_object, initial_tab_id, overflow_tab_string)
{

	var i,
		content_blocks,
		li,
		tab_id,
		selected_index,
		collapseobj,
		jsfail;

	console.log("Init vB_WikiTab for %s with initial tab id = %s", tab_container, initial_tab_id);
	this.tab_container = YAHOO.util.Dom.get(tab_object).parentNode;
	this.selected_tab_id = initial_tab_id;

	this.splitter = ajax_load_url[tab_object].indexOf("?") != -1 ? "?" : "&";
	this.ajax_load_url = ajax_load_url[tab_object].split(this.splitter);
	this.ajax_load_url[1] = this.ajax_load_url[1].replace(/\{(\d+)(:\w+)?\}/gi, '%$1$s');

	this.tab_count = 0;
	content_blocks = YAHOO.util.Dom.getElementsByClassName("content_block", "div", tab_container);

	if (content_blocks.length)
	{
		console.log("vB_WikiTab :: Found %d tab content blocks", content_blocks.length);

		this.tab_element = YAHOO.util.Dom.getElementsByClassName("p-cactions", "ul", tab_container)[0];
		selected_index = -1;

		for (i = 0; i < content_blocks.length; i++)
		{
			this.tab_count++;
			tab_id = content_blocks[i].getAttribute("id");

			// hide collapser
			collapseobj = YAHOO.util.Dom.get("collapseobj_" + tab_id);
			if (collapseobj)
			{
				YAHOO.util.Dom.setStyle(collapseobj, "display", "block");
			}

			if (tab_id == this.selected_tab_id)
			{
				selected_index = i;
			}
		}
	}

	// set a default tab
	if (selected_index == -1)
	{
		selected_index = 0;
		this.selected_tab_id = content_blocks[0].getAttribute("id");
	}

	// we can get duplicate tabs, so do a recount
	this.tabs = this.tab_element.getElementsByTagName("li");

	// prevent wrapped tabs from showing by setting the height of the overflow-hidden tab container
	// we have to add the class early or the height is wrong after AJAX edit
	YAHOO.util.Dom.addClass(this.tabs[selected_index], "selected");

	var tab_height = parseInt(this.tabs[selected_index].offsetHeight);
	YAHOO.util.Dom.setStyle(this.tab_element, "height", tab_height + "px");

	for (i = 0; i < this.tab_count; i++)
	{
		if (
			selected_index == i ||
			nojs_tabs.indexOf(this.tabs[i].id.split("-")[1].split("_")[0]) == "-1"
		)
		{
			this.init_tab(this.tabs[i].firstChild);
		}

		this.tabs[i].setAttribute("fixed_width", this.tabs[i].offsetWidth);
		YAHOO.util.Dom.setStyle(this.tabs[i], "display", "none");

		// we need this part of init_tab
		if (selected_index != i)
		{
			YAHOO.util.Dom.setStyle(content_blocks[i], "display", "none");
		}
	}

	// create the overflow tab
	this.overflow_tab = YAHOO.util.Dom.getElementsByClassName("overflow_tab", "li", this.tab_element)[0];
	if (typeof(this.overflow_tab) == "undefined")
	{
		var overflow_link = document.createElement("a");
		overflow_link.setAttribute("href", "javascript://");
		
		this.overflow_tab = this.tab_element.appendChild(document.createElement("li"));
		this.overflow_tab.appendChild(overflow_link);
		YAHOO.util.Dom.addClass(this.overflow_tab, "overflow_tab");
		YAHOO.util.Event.on(overflow_link, "click", this.show_menu, this, true);

		if (overflow_tab_string)
		{
			overflow_link.innerHTML = overflow_tab_string;
		}
		else
		{
			overflow_link.appendChild(document.createTextNode("&raquo;"));
		}
	}

	this.switch_tab(this.selected_tab_id, true);

	YAHOO.util.Event.on(window, "resize", this.resize, this, true);
	YAHOO.util.Event.on(document, "click", this.hide_menu, this, true);
};

/**
* Handles a click on a tab
*
* @return	boolean
*/
vB_WikiTab.prototype.click_tab = function(e)
{
	if (!YAHOO)
	{
		// occurs when changing window.location
		return false;
	}

	YAHOO.util.Event.stopEvent(e);

	var targetTab = YAHOO.util.Event.getTarget(e);
	var selected = targetTab.getAttribute("id").split("-link")[0];

	return this.switch_tab(selected);
};

/**
* Switch to a different tab
*
* @param	string	ID of tab to be selected
* @param	boolean	Force tab switch
*
* @return	boolean	false
*/
vB_WikiTab.prototype.switch_tab = function(selected_tab_id, force)
{
	if (!selected_tab_id)
	{
		return false;
	}

	if (this.selected_tab_id != selected_tab_id || force)
	{
		var i,
			tab_id,
			content_element,
			poll_show = false;

		this.hide_menu();

		this.selected_tab_id = selected_tab_id;
		this.selected_tab = YAHOO.util.Dom.get(this.selected_tab_id + "_tab");

		var poll_obj = YAHOO.util.Dom.get("collapseobj_ca-poll");

		if (
			this.selected_tab_id == "ca-poll" ||
			(
				poll_obj &&
				poll_obj.innerHTML != "" &&
				(
					this.selected_tab_id == "ca-article" ||
					this.selected_tab_id == "ca-talk"
				)
			)
		)
		{
			poll_show = true;
		}

		if (poll_obj)
		{
			YAHOO.util.Dom.setStyle(poll_obj, "display", (poll_show ? "block" : "none"));
		}

		for (i = 0; i < this.tab_count; i++)
		{
			tab_id = this.tabs[i].getAttribute("id").split("_tab")[0];

			if (tab_id == this.selected_tab_id)
			{
				if (!YAHOO.util.Dom.hasClass(this.tabs[i], "selected"))
				{
					YAHOO.util.Dom.addClass(this.tabs[i], "selected");
				}
			}
			else
			{
				YAHOO.util.Dom.removeClass(this.tabs[i], "selected");
			}

			content_element = YAHOO.util.Dom.get(tab_id);
			YAHOO.util.Dom.setStyle(content_element, "display", (tab_id == this.selected_tab_id ? "block" : "none"));

			if (tab_id == this.selected_tab_id && YAHOO.util.Dom.get("collapseobj_" + tab_id).innerHTML == "")
			{
				this.load_tab_content(this.selected_tab_id);
			}
		}

		if (!this.exiter)
		{
			console.log("vB_WikiTab :: Switched to '%s' tab", this.selected_tab_id);

			this.resize();
		}
	}

	return false;
};

/**
* Load an empty tab via POST
*
* @param	string	ID of tab to be selected
*/
vB_WikiTab.prototype.load_tab_content = function(tab_id)
{
	var load_id = tab_id.split("ca-")[1];
	var load_img = YAHOO.util.Dom.get("tab_loading_msg");
	var load_node = YAHOO.util.Dom.get("collapseobj_" + tab_id);

	if (load_node.innerHTML != "")
	{
		// this only happens if we explicitly call a refresh
		load_node.innerHTML = "";
	}

	// creating the img prevents recurrent calls
	var load_img_tab = document.createElement("div");

	load_img_tab.setAttribute("id", "tab_loading_msg_" + load_id);
	YAHOO.util.Dom.setStyle(load_img_tab, "margin", "50px");
	YAHOO.util.Dom.setStyle(load_img_tab, "textAlign", "center");
	YAHOO.util.Dom.setStyle(load_img_tab, "display", "block");
	load_img_tab.innerHTML = load_img.innerHTML;

	if (VAULT_40X_COMPAT)
	{
		var node_class = "vw-content postbit";
	}
	else
	{
		var node_class = "vw-content tborder";
	}

	if (!YAHOO.util.Dom.hasClass(load_node, node_class))
	{
		if (YAHOO.util.Dom.hasClass(load_node, "vw-broken"))
		{
			this.broken_class = true;
			YAHOO.util.Dom.removeClass(load_node, "vw-broken");
		}
		else
		{
			this.broken_class = false;
		}

		YAHOO.util.Dom.addClass(load_node, node_class);
	}

	load_node.appendChild(load_img_tab);
	this.constructed_load_url = construct_phrase(this.ajax_load_url[1], PHP.urlencode(load_id));

	YAHOO.util.Connect.asyncRequest("POST", this.ajax_load_url[0] + this.splitter + this.constructed_load_url,
	{
		success: this.ajax_complete,
		failure: this.ajax_failure,
		timeout: 15000,
		scope: this
	}, this.constructed_load_url + "&ajax=1&securitytoken=" + PHP.urlencode(SECURITYTOKEN));
};

/**
* Recalculates which tabs should be displayed after a page resize
*/
vB_WikiTab.prototype.resize = function(e)
{
	this.hide_menu();

	var total_width,
		i,
		j,
		display_tab_count,
		content_element_id,
		selected_tab,
		replace_tab,
		new_selected_tab,
		menu_element_names;

	var offset_which = YAHOO.util.Dom.getStyle(document.body, "direction") == 'ltr' ? 'left' : 'right';
	YAHOO.util.Dom.setStyle(this.overflow_tab, "display", "block");

	if (offset_which == 'right')
	{
		var offer = YAHOO.util.Dom.getRegion(this.tab_element);
	}
	else
	{
		var offer = { left: this.tab_element.offsetLeft };
	}

	var flow_width = this.overflow_tab.offsetWidth - offer[offset_which] + 10;
	YAHOO.util.Dom.setStyle(this.overflow_tab, "display", "none");

	var of_width = 0;
	total_width = this.tab_element.offsetWidth;
	display_tab_count = 0;

	for (i = 0; i < this.tab_count; i++)
	{
		YAHOO.util.Dom.setStyle(this.tabs[i], "display", "block");

		if (offset_which == 'right')
		{
			offer = YAHOO.util.Dom.getRegion(this.tabs[i]);
		}
		else
		{
			offer = { left: this.tabs[i].offsetLeft };
		}

		of_width = offer[offset_which] + Math.max(parseInt(this.tabs[i].getAttribute("fixed_width")), this.tabs[i].offsetWidth) + flow_width;

		if (of_width <= total_width)
		{
			display_tab_count++;
		}
		else
		{
			YAHOO.util.Dom.setStyle(this.tabs[i], "display", "none");
		}

		content_element_id = this.tabs[i].getAttribute("id").split("_tab")[0];
		if (content_element_id == this.selected_tab_id && YAHOO.util.Dom.getStyle(this.tabs[i], "display") == "none")
		{
			console.info("vB_WikiTab :: Moving selected tab... Found the selected tab: %d, %s", i, content_element_id);
			selected_tab = this.tabs[i];

			for (j = i; j >= 0; j--)
			{
				if (YAHOO.util.Dom.getStyle(this.tabs[j], "display") != "none")
				{
					console.log("vB_WikiTab :: Replace tab %d (%s) with %d (%s)", j, this.tabs[j].getAttribute("tab_id"), i, content_element_id);

					// placeholder for new tab
					replace_tab = this.tabs[j];
					new_selected_tab = this.tab_element.insertBefore(selected_tab.cloneNode(true), replace_tab);

					// remove the selected tab
					YAHOO.util.Event.removeListener(selected_tab, "click", this.click_tab, this, true);
					YAHOO.util.Event.removeListener(selected_tab.firstChild, "click", this.click_tab, this, true);
					selected_tab.parentNode.removeChild(selected_tab);

					YAHOO.util.Dom.setStyle(new_selected_tab, "display", "block");
					this.init_tab(new_selected_tab);

					return this.resize();
				}
			}
		}
	}

	this.display_tab_count = display_tab_count;

	// show the overflow tab and set its title
	menu_element_names = new Array();
	for (i = this.display_tab_count; i < this.tabs.length; i++)
	{
		if (this.tabs[i] != this.overflow_tab)
		{
			menu_element_names.push(this.tabs[i].innerHTML);
		}
	}

	this.overflow_tab.setAttribute("title", menu_element_names.join(",\n"));
	YAHOO.util.Dom.setStyle(this.overflow_tab, "display", (this.tab_count > display_tab_count ? "block" : "none"));

	// update the background position
	for (i = 0; i < this.tab_count; i++)
	{
		if (this.tabs[i].getAttribute("id").split("_tab")[0] == this.selected_tab_id)
		{
			if (offset_which == 'right')
			{
				offer = YAHOO.util.Dom.getRegion(this.tabs[i]);
			}
			else
			{
				offer = { left: this.tabs[i].offsetLeft };
			}
		
			YAHOO.util.Dom.setStyle(this.tabs[i], "backgroundPosition", (offer[offset_which] * -1) + "px 0px");
		}
		else
		{
			YAHOO.util.Dom.setStyle(this.tabs[i], "backgroundPosition", "0px 0px");
		}
	}
};

/**
* Shows the popup menu containing overflowed tabs
*
* @return	boolean	false
*/
vB_WikiTab.prototype.show_menu = function(e)
{
	YAHOO.util.Event.stopEvent(e);

	if (this.menu_open)
	{
		this.hide_menu();

		return false;
	}

	var i,
		counter,
		current_menu_element,
		menupos,
		menupos_x;

	this.menu = document.createElement("ul");
	this.menu.setAttribute("id", this.tab_element.id + "menu");

	if (VAULT_40X_COMPAT)
	{
		YAHOO.util.Dom.addClass(this.menu, "popupbody vw-menu");
		YAHOO.util.Dom.setStyle(this.menu, "display", "block");
	}
	else
	{
		YAHOO.util.Dom.addClass(this.menu, "vbmenu_popup");
		YAHOO.util.Dom.addClass(this.menu, "tab_popup");
	}

	menu_element_names = new Array();
	var linkid, newlink;
	counter = 0;

	for (i = this.display_tab_count - 1; i < this.tab_count; i++)
	{
		if (YAHOO.util.Dom.getStyle(this.tabs[i], "display") != "none")
		{
			continue;
		}

		current_menu_element = this.menu.appendChild(this.tabs[i].cloneNode(true));

		YAHOO.util.Dom.setStyle(current_menu_element, "display", "block");
		YAHOO.util.Dom.setStyle(current_menu_element, "width", "auto");

		if (!VAULT_40X_COMPAT)
		{
			YAHOO.util.Dom.addClass(current_menu_element, "vbmenu_option");
		}

		if (counter++ < 1)
		{
			YAHOO.util.Dom.addClass(current_menu_element, "first");
		}

		if (
			this.selected_tab_id != this.tabs[i].id.split("_")[0] &&
			nojs_tabs.indexOf(this.tabs[i].id.split("-")[1].split("_")[0]) == "-1"
		)
		{
			this.init_tab(current_menu_element);
		}
	}

	this.overflow_tab.appendChild(this.menu);
	menupos = YAHOO.util.Dom.getXY(this.overflow_tab);

	// check that the menu has not opened hanging off the screen
	menupos_x = menupos[0] - current_menu_element.offsetWidth + this.overflow_tab.offsetWidth;
	menupos_x  = (menupos_x < fetch_viewport_info()["x"]) ? menupos[0] : menupos_x;

	YAHOO.util.Dom.setX(this.menu, menupos_x);
	YAHOO.util.Dom.setY(this.menu, menupos[1] + this.overflow_tab.offsetHeight - 1);

	this.menu_open = true;

	return false;
};

/**
* Hides the popup menu containing overflowed tabs
*/
vB_WikiTab.prototype.hide_menu = function()
{
	if (this.menu && this.menu_open)
	{
		this.menu.parentNode.removeChild(this.menu);
	}

	this.menu_open = false;
};

/**
* Initializes a tab with event listeners etc.
*
* @param	object	HTML tab (A) element
* @param	boolean	Extract full title for tab
*/
vB_WikiTab.prototype.init_tab = function(tab_element)
{
	YAHOO.util.Event.on(tab_element, "click", this.click_tab, this, true);
};

/**
* Process the POST response.
*
* @param	object	YUI AJAX
*
* @param	boolean	false
*/
vB_WikiTab.prototype.ajax_complete = function(ajax)
{
	if (ajax.responseXML)
	{
		if (VAULT_40X_COMPAT)
		{
			var node_class = "vw-content postbit";
		}
		else
		{
			var node_class = "vw-content tborder";
		}

		if (fetch_tag_count(ajax.responseXML, "error"))
		{
			// do nothing
			var articleResponse = fetch_tags(ajax.responseXML, "error")[0];
			var tabId = articleResponse.getAttribute("tab_id");

			if (!tabId)
			{
				return false;
			}

			var collapseobj = YAHOO.util.Dom.get("collapseobj_" + tabId);
			if (!collapseobj)
			{
				return false;
			}

			collapseobj.innerHTML = "";

			if (!YAHOO.util.Dom.hasClass(collapseobj, node_class))
			{
				YAHOO.util.Dom.addClass(collapseobj, node_class);
			}

			var error_box = document.createElement("table");

			if (VAULT_40X_COMPAT)
			{
				YAHOO.util.Dom.addClass(error_box, "postbody");
			}

			YAHOO.util.Dom.setStyle(error_box, "margin", "50px");
			YAHOO.util.Dom.setStyle(error_box, "display", "block");

			var error_img = document.createElement("img");
			YAHOO.util.Dom.setStyle(error_img, "margin-right", "20px");

			if (is_ie && !is_ie7)
			{
				error_img.src = VAULT_IMGDIR + "/vault_error.gif";
			}
			else
			{
				error_img.src = VAULT_IMGDIR + "/vault_error.png";
			}

			error_img.alt = "";
			error_img.border = 0;

			var error_ibox = document.createElement("td");
			YAHOO.util.Dom.setStyle(error_ibox, "vertical-align", "middle");
			error_ibox.appendChild(error_img);

			var error_msg = document.createElement("td");
			YAHOO.util.Dom.setStyle(error_msg, "vertical-align", "middle");
			error_msg.innerHTML = articleResponse.firstChild.nodeValue;

			var error_row = document.createElement("tr");
			error_row.appendChild(error_ibox);
			error_row.appendChild(error_msg);
			error_box.appendChild(error_row);

			collapseobj.appendChild(error_box);
		}
		else
		{
			var tab_id;
			var articleResponse = fetch_tags(ajax.responseXML, "article")[0];
			var articleId = fetch_tags(ajax.responseXML, "url")[0];

			if (!articleResponse || !articleId)
			{
				return false;
			}

			var tabId = articleResponse.getAttribute("tab_id");
			if (!tabId)
			{
				return false;
			}

			var collapseobj = YAHOO.util.Dom.get("collapseobj_" + tabId);
			if (!collapseobj)
			{
				return false;
			}

			var threadurl = articleId.firstChild.nodeValue.replace(/\{(\d+)(:\w+)?\}/gi, '%$1$s');
			if (this.ajax_load_url[0] + this.splitter + this.ajax_load_url[1] != threadurl)
			{
				if (vB_ResetHandle.parseRedirect(ajax.responseXML, threadurl))
				{
					this.exiter = true;

					return false;
				}
			}
			else
			{
				if (tabId == "ca-article" || tabId == "ca-talk")
				{
					vB_ResetHandle.insertPoll(ajax.responseXML);
				}

				YAHOO.util.Dom.setStyle(collapseobj, "width", "100%");
				collapseobj.innerHTML = articleResponse.firstChild.nodeValue;
			}

			if (YAHOO.util.Dom.hasClass(collapseobj, node_class))
			{
				if (this.broken_class)
				{
					YAHOO.util.Dom.addClass(collapseobj, "vw-broken");
					this.broken_class = false;
				}

				// this was dynamically set to look nice with the loading img
				YAHOO.util.Dom.removeClass(collapseobj, node_class);
			}

			// re-init auto-links
			if (
				(tabId == "ca-article" || tabId == "ca-talk") &&
				YAHOO.util.Dom.getElementsByClassName("autolink", "a", collapseobj) &&
				typeof SpecialAutoLink == "object"
			)
			{
				SpecialAutoLink = new Special_AutoLink();
			}

			// init dropdown, quick-edit, etc.
			vB_ResetHandle.parseScript(collapseobj, fetch_tags(ajax.responseXML, "popups")[0]);

			if (VAULT_40X_COMPAT)
			{
				vBulletin.events.systemInit.fired = false;
				vBulletin.events.systemInit.fire();

				YAHOO.vBulletin.vB_XHTML_Ready = false;
				vB_XHTML_Ready.fire();
				YAHOO.vBulletin.vB_XHTML_Ready = true;
			}
		}
	}

	return false;
};

/**
* Redirect to the URL on failure
*
* @param	object	YUI AJAX
*/
vB_WikiTab.prototype.ajax_failure = function(ajax)
{
	vBulletin_AJAX_Error_Handler(ajax);

	window.location = this.ajax_load_url[0] + this.splitter + this.constructed_load_url;
};

/**
* Handles AJAX errors
*
* @param	object	YUI AJAX
*/
vB_WikiTab.prototype.handle_ajax_error = function(ajax)
{
	vBulletin_AJAX_Error_Handler(ajax);
};

/* IE 6 & 7 Fixes */
if (!Array.indexOf)
{
	Array.prototype.indexOf = function (obj, start)
	{
		for (var i = (start || 0); i < this.length; i++)
		{
			if (this[i] == obj)
			{
				return i;
			}
		}

		return -1;
	}
}

/* License Box */
;/************************************************************************\
 *
 * CES Vault Wiki
 * Version CES_VERSION
 *
 * CES_VAULT_COPYRIGHT
 *
\************************************************************************/

/**
* Class to handle show/hide of headline sections
*/
function WikiPost_ShowSection()
{
	this.show = null;
	this.hide = null;
	this.closer = [];
}

/**
* Finds all headlines in the post object
*
* @param	int		Unique ID for the containing post
* @param	string	RegEx search string
* @param	string	Tag name for the containing object
*
* @return	object	Object of div objects
*/
WikiPost_ShowSection.prototype.fetch_sections = function(parentobj, indexMatch, indexType)
{
	var postobj = fetch_object(parentobj);
	var divs = fetch_tags(postobj, indexType);

	var sections = [];

	for (var i = 0; i < divs.length; i++)
	{
		if (divs[i].id && divs[i].id.indexOf(indexMatch) != -1)
		{
			sections[sections.length] = divs[i];
		}
	}

	return sections;
};

/**
* Initializes all show/hide links so that they appear
*
* @return	boolean	false
*/
WikiPost_ShowSection.prototype.link_init = function(root)
{
	if (!root)
	{
		root = document;
	}

	var link_spans = YAHOO.util.Dom.getElementsByClassName("top_link", "span", root);
	var ij, j, inner_link, existing, dash_node;
	var imgmatch = new RegExp(/^collapseimg_/);

	for (var i = 0; i < link_spans.length; i++)
	{
		existing = fetch_tags(link_spans[i], "span");

		if (existing.length)
		{
			for (ij = 0; ij < existing.length; ij++)
			{
				link_spans[i].removeChild(existing[ij]);
			}
		}

		for (j = 0; j < link_spans[i].childNodes.length; j++)
		{
			inner_link = link_spans[i].childNodes[j];

			if (inner_link.id && inner_link.id.match(imgmatch))
			{
				dash_node = document.createElement("span");
				dash_node.id = 'colspan' + i + j;
				dash_node.innerHTML = " - ";

				YAHOO.util.Dom.insertAfter(dash_node, inner_link);
				YAHOO.util.Dom.setStyle(inner_link, "display", "inline");
			}
		}
	}

	if (VAULT_40X_COMPAT)
	{
		var collapseEQ = fetch_cookie('vbulletin_collapse');
	}
	else
	{
		var collapseEQ = document.cookie.split("vbulletin_collapse=");
	}

	if ((!collapseEQ || !collapseEQ[1]) && !this.closer.length)
	{
		return false;
	}

	var collapses;

	if (collapseEQ && collapseEQ[1])
	{
		if (VAULT_40X_COMPAT)
		{
			collapses = collapseEQ.split('\n');
		}
		else
		{
			var collapseFind = collapseEQ[1].split(";");
			collapses = collapseFind[0].split("%0A");
		}
	}

	if (this.closer.length)
	{
		var item;

		for (var cl = 0; cl < this.closer.length; cl++)
		{
			item = this.closer[cl][0] + "_" + this.closer[cl][1];

			if (!collapses || collapses.indexOf(item) == "-1")
			{
				this.close(item);
			}
		}
	}

	if (collapses && collapses.length)
	{
		for (var i = 0; i < collapses.length; i++)
		{
			this.close(collapses[i], true);
		}
	}

	return false;
};

/**
* Closes sections on initialization.
*
* @param	array	list of objects to be collapsed
*
* @return	boolean false
*/
WikiPost_ShowSection.prototype.close = function(item, oninit)
{
	var finder;

	if (!(VAULT_40X_COMPAT && oninit) && (finder = YAHOO.util.Dom.get("collapseobj_" + item)))
	{
		YAHOO.util.Dom.setStyle(finder, "display", "none");
	}

	if (finder = YAHOO.util.Dom.get("collapseimg_" + item))
	{
		if (!VAULT_40X_COMPAT && finder.src)
		{
			var findReg = new RegExp("(thead|tcat)\\.gif$");
			finder.src = finder.src.replace(findReg, '$1_collapsed.gif');
		}
		else if (finder.innerHTML == this.hide)
		{
			finder.innerHTML = this.show;
		}
	}

	if (!VAULT_40X_COMPAT && (finder = YAHOO.util.Dom.get("collapsecel_" + item)))
	{
		YAHOO.util.Dom.replaceClass(finder, "thead", "thead_collapsed");
		YAHOO.util.Dom.replaceClass(finder, "tcat", "tcat_collapsed");
	}

	return false;
};

/**
* Toggles the display states of options in the title popup object
*
* @param	int		Unique ID for the containing post
*
* @return	boolean	false
*/
WikiPost_ShowSection.prototype.Popup_Init = function(postid, in_article)
{
	var imgprefix = 'collapseimg_';
	var showall = fetch_object(imgprefix + postid + '_show');
	var hideall = fetch_object(imgprefix + postid + '_hide');

	if (!showall && !hideall)
	{
		return false;
	}

	var parentid = this.fetch_id(postid, in_article);
	var tocids = this.fetch_sections(parentid, 'toc_', 'table');
	var toccol = this.fetch_sections(parentid, 'collapseobj_toc_', 'tbody');
	var sectionids = this.fetch_sections(parentid, 'collapseobj_' + postid + '_', 'div');

	if (tocids.length > 0)
	{
		var colsave = '';

		for (var k = 0; k < tocids.length; k++)
		{
			// tricky way to preserve toc width
			colsave = toccol[k].style.display;
			toccol[k].style.display = '';
			tocids[k].style.width = tocids[k].offsetWidth + 'px';
			toccol[k].style.display = colsave;
		}
	}

	if (sectionids.length == 0)
	{
		return false;
	}

	for (var i = 0; i < sectionids.length; i++)
	{
		if (sectionids[i].style.display == 'none')
		{
			var hidden = true;
		}
		else
		{
			var shown = true;
		}

		if (hidden && shown)
		{
			break;
		}	
	}

	if (showall != null && !hidden)
	{
		showall.style.display = 'none';
	}

	if (hideall != null && !shown)
	{
		hideall.style.display = 'none';
	}

	return false;
};

/**
* Gets the ID of the parent object.
*
* @param	integer	Type of parent object
*
* @return	string	Unique HTML ID attribute
*/
WikiPost_ShowSection.prototype.fetch_id = function(postid, in_article)
{
	if (in_article == 2)
	{
		return parentid = 'forum_header';
	}
	else if (in_article == 1)
	{
		return parentid = 'collapseobj_ca-article';
	}
	else
	{
		return parentid = 'post_message_' + postid;
	}
};

/**
* Updates vbulletin_collapse cookie with collapse preferences
*
* @param	string	Collapseable object ID
* @param	boolean	Add a cookie
*/
WikiPost_ShowSection.prototype.save_collapsed = function(targetid, addcollapsed)
{
	if (VAULT_40X_COMPAT)
	{
		var collapsed = fetch_cookie('vbulletin_collapse');
		var tmp = new Array();

		if (collapsed != null)
		{
			collapsed = collapsed.split('\n');

			for (var i in collapsed)
			{
				if (YAHOO.lang.hasOwnProperty(collapsed, i) && collapsed[i] != targetid && collapsed[i] != '')
				{
					tmp[tmp.length] = collapsed[i];
				}
			}
		}

		if (addcollapsed)
		{
			tmp[tmp.length] = targetid;
		}

		expires = new Date();
		expires.setTime(expires.getTime() + (1000 * 86400 * 365));
		set_cookie('vbulletin_collapse', tmp.join('\n'), expires);
	}
	else
	{
		save_collapsed(targetid, addcollapsed);
	}
};
	
/**
* Toggles the collapse state of an object, and saves state to 'vbulletin_collapse' cookie
*
* @param	string	Unique ID for the collapse group
*
* @return	boolean	false
*/
WikiPost_ShowSection.prototype.toggle = function(postid, sectionid)
{
	var imgprefix = 'collapseimg_';
	var sectionids = [];
	var img = null;
	var obj = null;
	var imgid = '';

	if (sectionid == 'showall' || sectionid == 'hideall')
	{
		// this only happens if in_article would be 1
		var parentid = this.fetch_id(postid, 1);

		// get all the objids and put them in the var
		sectionids = this.fetch_sections(parentid, 'collapseobj_' + postid + '_', 'div');
	}
	else
	{
		sectionids[0] = fetch_object('collapseobj_' + postid + '_' + sectionid);
	}

	for (var i = 0; i < sectionids.length; i++)
	{
		obj = sectionids[i];

		if (!obj)
		{
			return false;
		}

		imgid = obj.id.replace('obj', 'img');

		if (sectionid == 'showall' || sectionid == 'hideall')
		{
			img = fetch_object(imgid);
		}
		else
		{
			img = fetch_object(imgprefix + postid + '_' + sectionid);
		}

		if (obj.style.display == 'none' && sectionid != 'hideall')
		{
			obj.style.display = '';

			if (sectionid == 'showall')
			{
				var idstr = obj.id.replace('collapseobj_', '');
			}
			else
			{
				var idstr = postid + '_' + sectionid;
			}

			this.save_collapsed(idstr, false);

			if (img)
			{
				img.innerHTML = this.hide;
			}
		}
		else if (sectionid != 'showall')
		{
			obj.style.display = 'none';

			if (sectionid == 'hideall')
			{
				var idstr = obj.id.replace('collapseobj_', '');
			}
			else
			{
				var idstr = postid + '_' + sectionid;
			}

			this.save_collapsed(idstr, true);

			if (img)
			{
				img.innerHTML = this.show;
			}
		}
	}

	var showall = null;
	var hideall = null;

	if (
		(showall = fetch_object(imgprefix + postid + '_show')) != null &&
		(hideall = fetch_object(imgprefix + postid + '_hide')) != null
	)
	{
		if (sectionid == 'showall')
		{
			showall.style.display = 'none';
		}
		else
		{
			showall.style.display = '';
		}

		if (sectionid == 'hideall')
		{
			hideall.style.display = 'none';
		}
		else
		{
			hideall.style.display = '';
		}
	}

	if (sectionid != 'showall' && sectionid != 'hideall')
	{
		this.Popup_Init(postid);
	}

	return false;
};

// #############################################################################
// other frequently used functions

/**
* Fix for anchor URLs
*
* @param	string	name
*
* @return	boolean false
*/
Toc_Jump = function(ancname)
{
	if (ancname.indexOf('footnote_') != -1 || ancname.indexOf('ref') != -1)
	{
		var anchor = document.getElementById(ancname);
		anchor.setAttribute("footnote", 1);
	}
	else
	{
		var anchor = document.getElementsByName(ancname)[0];
	}

	if (anchor)
	{
		if (anchor.getAttribute("footnote") == 1)
		{
			var select_anc = YAHOO.util.Dom.getElementsByClassName("ref_select", "a");
			if (select_anc && select_anc.length)
			{
				for (var q = 0; q < select_anc.length; q++)
				{
					if (YAHOO.util.Dom.hasClass(select_anc[q], "ref_select"))
					{
						YAHOO.util.Dom.removeClass(select_anc[q], "ref_select");
					}
				}
			}

			YAHOO.util.Dom.addClass(anchor, "ref_select");
		}

		if (anchor.scrollIntoView)
		{
			anchor.scrollIntoView(true);
		}
	}

	return false;
};

/**
* Fix for anchor URLs on edit preview
*
* @param	string	name
*
* @return	boolean false
*/
Toc_Create_URLs = function(parentid)
{
	var toc = YAHOO.util.Dom.get(parentid);
	var links = YAHOO.util.Dom.getElementsByClassName("toc_gen_url", "span", toc);
	var anchor = null;

	if (!links.length)
	{
		return false;
	}

	for (i = 0; i < links.length; i++)
	{
		anchor[i] = document.createElement("a");
		anchor[i].href = links[i].name;
		anchor[i].innerHTML = links[i].innerHTML;

		links[i].parentNode.appendChild(anchor[i]);
		links[i].parentNode.removeChild(links[i]);
	}
};

/**
* Rewrite of PostBit_Init
*
* @param	object	postbit
* @param	integer	post id
*/
PostBit_Init = function(obj, postid)
{
	console.log("PostBit Init: %d", postid);

	if (typeof vBmenu != 'undefined')
	{
		// init profile menu(s)
		var divs = fetch_tags(obj, 'div');
		for (var i = 0; i < divs.length; i++)
		{
			if (divs[i].id && divs[i].id.substr(0, 9) == 'postmenu_')
			{
				vBmenu.register(divs[i].id, true);
			}
		}
	}

	if (typeof SpecialAutoLink != 'undefined')
	{
		SpecialAutoLink = new Special_AutoLink();
	}

	if (typeof vB_Section != 'undefined')
	{
		// reset show/hide links
		vB_Section.link_init();
	}

	if (typeof vB_QuickEditor != 'undefined')
	{
		// init quick edit controls
		vB_AJAX_QuickEdit_Init(obj);
	}

	if (typeof vB_QuickReply != 'undefined')
	{
		// init quick reply button
		qr_init_buttons(obj);
	}

	if (typeof mq_init != 'undefined')
	{
		// init quick reply button
		mq_init(obj);
	}

	if (typeof vBrep != 'undefined')
	{
		if (typeof postid != 'undefined' && typeof postid != 'null')
		{
			vbrep_register(postid);
		}
	}

	if (typeof inlineMod != 'undefined')
	{
		im_init(obj);
	}

	if (typeof vB_Lightbox != 'undefined')
	{
		init_postbit_lightbox(obj);
	}

	child_img_alt_2_title(obj);

	if (VAULT_40X_COMPAT && typeof YAHOO.vBulletin.vBRestrain != "undefined")
	{
		YAHOO.vBulletin.vBRestrain.addcontainer(obj);
		YAHOO.vBulletin.vBRestrain.resize(obj);
	}
};

// #############################################################################
// initialize the section class

var vB_Section = new WikiPost_ShowSection();

/* License Box */
;/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.6
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
custom_editor_events={editor_switch:new YAHOO.util.CustomEvent("editor_switch"),editor_resize:new YAHOO.util.CustomEvent("editor_resize")};function vB_Text_Editor(A,G,B,D,C,F,E){this._construct(A,G,B,D,C,F,E);this.init(C)}vB_Text_Editor.prototype._construct=function(A,G,B,D,C,F,E){this.editorid=A;this.wysiwyg_mode=parseInt(G,10)?1:0;this.initialized=false;this.parsetype=(typeof B=="undefined"?"nonforum":B);this.ajax_extra=(typeof F=="undefined"?"":F);this.parsesmilies=(typeof D=="undefined"?1:D);this.popupmode=(true);this.controlbar=fetch_object(this.editorid+"_controls");this.textobj=fetch_object(this.editorid+"_textarea");this.buttons=new Array();this.popups=new Array();this.prompt_popup=null;this.fontstate=null;this.sizestate=null;this.colorstate=null;this.clipboard="";this.disabled=false;this.history=new vB_History();this.influx=0;this.allowbasicbbcode=((typeof allowbasicbbcode!="undefined"&&allowbasicbbcode)?true:false);this.ltr=((typeof ltr!="undefined"&&ltr=="right")?"right":"left");this.activeimg=null;this.content=E};vB_Text_Editor.prototype.add_range=function(B){this.check_focus();var C=this.editwin.getSelection();var A=this.editdoc.createRange();A.selectNodeContents(B);C.removeAllRanges();C.addRange(A)};vB_Text_Editor.prototype.apply_format=function(D,A,B){if(this.wysiwyg_mode){if(is_moz){this.editdoc.execCommand("useCSS",false,true)}this.editdoc.execCommand(D,(typeof A=="undefined"?false:A),(typeof B=="undefined"?true:B));return false}else{switch(D){case"bold":case"italic":case"underline":this.wrap_tags(D.substr(0,1),false);return ;case"justifyleft":case"justifycenter":case"justifyright":this.wrap_tags(D.substr(7),false);return ;case"indent":this.wrap_tags(D,false);return ;case"fontname":this.wrap_tags("font",B);return ;case"fontsize":this.wrap_tags("size",B);return ;case"forecolor":this.wrap_tags("color",B);return ;case"createlink":var C=this.get_selection();if(C){this.wrap_tags("url",B)}else{this.wrap_tags("url",B,B)}return ;case"insertimage":this.wrap_tags("img",false,B);return ;case"removeformat":return }}};vB_Text_Editor.prototype.build_attachments_popup=function(E){var G,F,D=0;var B=YAHOO.util.Dom.get(vB_Attachments.listobjid);if(B){var A=B.getElementsByTagName("li");var C=A[1].nextSibling;while(C){C.editorid=this.editorid;if(!YAHOO.util.Event.getListeners(C,"mouseover")){YAHOO.util.Event.on(C,"mouseover",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C,"mouseout",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C,"mouseup",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C,"mousedown",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C,"click",vB_Text_Editor_Events.prototype.attachoption_onclick)}C=C.nextSibling;D++}}else{return }if(D>1){F=document.createElement("div");F.editorid=this.editorid;F.controlkey=E.id;F.className="osmilie";F.style.fontWeight="bold";F.style.paddingLeft="25px";F.style.whiteSpace="nowrap";F.innerHTML=vbphrase.insert_all;F.onmouseover=F.onmouseout=F.onmousedown=F.onmouseup=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;F.onclick=vB_Text_Editor_Events.prototype.attachinsertall_onclick}};vB_Text_Editor.prototype.build_fontname_popup=function(B){if(YAHOO.util.Dom.get(this.editorid+"_fontfield")){this.fontoptions={"":YAHOO.util.Dom.get(this.editorid+"_fontfield").innerHTML}}if(!YAHOO.util.Event.getListeners(B,"mouseover")){YAHOO.util.Event.on(B,"mouseover",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mouseout",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mouseup",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mousedown",vB_Text_Editor.prototype.menu_context,B,this);var C=YAHOO.util.Dom.getElementsByClassName("fontname","",B);for(i=0;i<C.length;i++){C[i].cmd=B.cmd;C[i].controlkey=B.id;C[i].editorid=this.editorid;YAHOO.util.Event.on(C[i],"mouseover",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"mouseout",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"mouseup",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"mousedown",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"click",vB_Text_Editor_Events.prototype.formatting_option_onclick_font);var A=C[i].firstChild.innerHTML;this.fontoptions[A]=A}}};vB_Text_Editor.prototype.build_fontsize_popup=function(B){if(YAHOO.util.Dom.get(this.editorid+"_sizefield")){this.sizeoptions={"":YAHOO.util.Dom.get(this.editorid+"_sizefield").innerHTML}}if(!YAHOO.util.Event.getListeners(B,"mouseover")){YAHOO.util.Event.on(B,"mouseover",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mouseout",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mouseup",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mousedown",vB_Text_Editor.prototype.menu_context,B,this);var C=YAHOO.util.Dom.getElementsByClassName("fontsize","",B);for(i=0;i<C.length;i++){C[i].cmd=B.cmd;C[i].controlkey=B.id;C[i].editorid=this.editorid;YAHOO.util.Event.on(C[i],"mouseover",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"mouseout",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"mouseup",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"mousedown",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[i],"click",vB_Text_Editor_Events.prototype.formatting_option_onclick_size);var A=C[i].firstChild.firstChild.innerHTML;this.sizeoptions[A]=A}}};vB_Text_Editor.prototype.build_forecolor_popup=function(C){if(!YAHOO.util.Event.getListeners(C,"mouseover")){YAHOO.util.Event.on(C,"mouseover",vB_Text_Editor.prototype.menu_context,C,this);YAHOO.util.Event.on(C,"mouseout",vB_Text_Editor.prototype.menu_context,C,this);YAHOO.util.Event.on(C,"mouseup",vB_Text_Editor.prototype.menu_context,C,this);YAHOO.util.Event.on(C,"mousedown",vB_Text_Editor.prototype.menu_context,C,this);YAHOO.util.Event.on(this.editorid+"_color_out","click",vB_Text_Editor_Events.prototype.colorout_onclick,C,this);YAHOO.util.Event.on(this.editorid+"_color_bar","click",vB_Text_Editor_Events.prototype.colorout_onclick,C,this);var B=YAHOO.util.Dom.getElementsByClassName("colorbutton","",C);if(B.length){for(var A=0;A<B.length;A++){B[A].cmd=C.cmd;B[A].editorid=this.editorid;B[A].controlkey=C.id;B[A].colorname=YAHOO.util.Dom.getStyle(B[A].firstChild,"background-color");B[A].id=this.editorid+"_color_"+this.translate_color_commandvalue(B[A].colorname);YAHOO.util.Event.on(B[A],"mouseover",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(B[A],"mouseout",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(B[A],"mouseup",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(B[A],"mousedown",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(B[A],"click",vB_Text_Editor_Events.prototype.coloroption_onclick)}}}};vB_Text_Editor.prototype.build_smilie_popup=function(D){if(!YAHOO.util.Event.getListeners(D,"mouseover")){YAHOO.util.Event.on(D,"mouseover",vB_Text_Editor.prototype.menu_context,D,this);YAHOO.util.Event.on(D,"mouseout",vB_Text_Editor.prototype.menu_context,D,this);YAHOO.util.Event.on(D,"mouseup",vB_Text_Editor.prototype.menu_context,D,this);YAHOO.util.Event.on(D,"mousedown",vB_Text_Editor.prototype.menu_context,D,this);var C=YAHOO.util.Dom.getElementsByClassName("smilie","",D);if(C.length){for(var A=0;A<C.length;A++){var E=YAHOO.util.Dom.get("moresmilies");if(E){YAHOO.util.Dom.setStyle(E,"cursor",pointer_cursor);E.editorid=this.editorid;E.controlkey=D.id;YAHOO.util.Event.on(E,"click",vB_Text_Editor_Events.prototype.smiliemore_onclick)}C[A].editorid=this.editorid;C[A].controlkey=D.id;C[A].smilietext=C[A].firstChild.firstChild.alt;var B=C[A].id.match(/^smilie_dropdown_([0-9]+)$/);C[A].smilieid=B[1];YAHOO.util.Event.on(C[A],"mouseover",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[A],"mouseout",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[A],"mouseup",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[A],"mousedown",vB_Text_Editor_Events.prototype.menuoption_onmouseevent);YAHOO.util.Event.on(C[A],"click",vB_Text_Editor_Events.prototype.smilieoption_onclick)}}}};vB_Text_Editor.prototype.build_select=function(F){var E=document.createElement("select");E.id=this.editorid+"_select_"+F.cmd;E.editorid=this.editorid;E.cmd=F.cmd;var D=document.createElement("option");D.value="";D.text=F.title;E.add(D,is_ie?E.options.length:null);D=document.createElement("option");D.value="";D.text=" ";E.add(D,is_ie?E.options.length:null);var C;switch(F.cmd){case"fontname":for(C=0;C<fontoptions.length;C++){D=document.createElement("option");D.value=fontoptions[C];D.text=(fontoptions[C].length>10?(fontoptions[C].substr(0,10)+"..."):fontoptions[C]);E.add(D,is_ie?E.options.length:null)}E.onchange=vB_Text_Editor_Events.prototype.formatting_select_onchange;break;case"fontsize":for(C=0;C<sizeoptions.length;C++){D=document.createElement("option");D.value=sizeoptions[C];D.text=sizeoptions[C];E.add(D,is_ie?E.options.length:null)}E.onchange=vB_Text_Editor_Events.prototype.formatting_select_onchange;break;case"forecolor":for(C in coloroptions){if(YAHOO.lang.hasOwnProperty(coloroptions,C)){D=document.createElement("option");D.value=coloroptions[C];D.text=PHP.trim((coloroptions[C].length>5?(coloroptions[C].substr(0,5)+"..."):coloroptions[C]).replace(new RegExp("([A-Z])","g")," $1"));D.style.backgroundColor=C;E.add(D,is_ie?E.options.length:null)}}E.onchange=vB_Text_Editor_Events.prototype.formatting_select_onchange;break;case"smilie":for(var A in smilieoptions){if(!YAHOO.lang.hasOwnProperty(smilieoptions,A)){continue}for(var B in smilieoptions[A]){if(!YAHOO.lang.hasOwnProperty(smilieoptions[A],B)){continue}if(B!="more"){D=document.createElement("option");D.value=smilieoptions[A][B][1];D.text=smilieoptions[A][B][1];D.smilieid=B;D.smiliepath=smilieoptions[A][B][0];D.smilietitle=smilieoptions[A][B][2];E.add(D,is_ie?E.options.length:null)}}}E.onchange=vB_Text_Editor_Events.prototype.smilieselect_onchange;break;case"attach":E.onmouseover=vB_Text_Editor_Events.prototype.attachselect_onmouseover;E.onchange=vB_Text_Editor_Events.prototype.attachselect_onchange;break}while(F.hasChildNodes()){F.removeChild(F.firstChild)}this.buttons[F.cmd]=F.appendChild(E)};vB_Text_Editor.prototype.button_context=function(C,B,A){if(this.disabled){return }if(typeof A=="undefined"){A="button"}if(YAHOO.util.Dom.hasClass(C,"imagebutton_disabled")){return }switch(C.state){case true:switch(B){case"mouseover":case"mousedown":case"mouseup":this.set_control_style(C,A,"down");break;case"mouseout":this.set_control_style(C,A,"selected");break}break;default:switch(B){case"mouseover":case"mouseup":this.set_control_style(C,A,"hover");break;case"mousedown":this.set_control_style(C,A,"down");break;case"mouseout":this.set_control_style(C,A,"normal");break}break}};vB_Text_Editor.prototype.setbookmark=function(){var B=this.wysiwyg_mode?this.editdoc.selection:document.selection;if(is_ie&&(B.type=="Text"||B.type=="None")){var A=B.createRange();this.bookmark=A.getBookmark()}};vB_Text_Editor.prototype.restorebookmark=function(){if(is_ie&&this.bookmark){var E=this.wysiwyg_mode?this.editdoc:document;var B=E.body.createTextRange();B.moveToBookmark(this.bookmark);if(!this.wysiwyg_mode&&B.parentElement().id!=this.editorid+"_textarea"){var A=document.selection.createRange();var F=A.duplicate();F.moveToElementText(this.editdoc);if(F.text.length>0){var D=F.text.length;var C=F.text.match(/\r/g);if(C){D=D-C.length}F.moveStart("character",D);F.collapse();F.select()}}else{B.select()}this.bookmark=null}};vB_Text_Editor.prototype.check_focus=function(){if(!this.editwin.hasfocus||(is_moz&&is_mac)){this.editwin.focus();this.restorebookmark();if(is_opera){this.editwin.focus()}}};vB_Text_Editor.prototype.collapse_selection_end=function(){var range;if(this.editdoc.selection){range=this.editdoc.selection.createRange();eval("range.move('character', -1);");range.collapse(false);range.select()}else{if(document.selection&&document.selection.createRange){range=document.selection.createRange();range.collapse(false);range.select()}else{if(typeof (this.editdoc.selectionStart)!="undefined"){var sel_text=this.editdoc.value.substr(this.editdoc.selectionStart,this.editdoc.selectionEnd-this.editdoc.selectionStart);this.editdoc.selectionStart=this.editdoc.selectionStart+sel_text.vBlength()}else{if(window.getSelection){}}}}};vB_Text_Editor.prototype.createlink_wysiwyg=function(B,A){return this.apply_format("createlink",is_ie,(typeof A=="undefined"?true:A))};vB_Text_Editor.prototype.createlink=function(B,A){if(this.wysiwyg_mode){if(is_moz||is_opera){if(typeof A=="undefined"){A=this.show_prompt(vbphrase.enter_link_url,"http://",true)}if((A=this.verify_prompt(A))!==false){if(this.get_selection()){this.apply_format("unlink");this.createlink_wysiwyg(B,A)}else{this.insert_text('<a href="'+A+'">'+A+"</a>")}}return true}else{return this.createlink_wysiwyg(B,A)}}else{this.prompt_link("url",A,vbphrase.enter_link_url,"http://")}};vB_Text_Editor.prototype.destroy=function(){var A;for(A in this.buttons){if(YAHOO.lang.hasOwnProperty(this.buttons,A)){this.set_control_style(this.buttons[A],"button","normal")}}YAHOO.util.Event.removeListener(this.editdoc,"mousemove",vB_Text_Editor_Events.prototype.editdoc_onmousemove);YAHOO.util.Event.removeListener(this.editdoc,"click",vB_Text_Editor_Events.prototype.editdoc_onclick);YAHOO.util.Event.removeListener(this.editdoc,"mousedown",vB_Text_Editor_Events.prototype.editdoc_onmousedown);YAHOO.vBulletin.vBPopupMenu.close_all();this.remove_editor_dialog()};vB_Text_Editor.prototype.disable_editor=function(C){if(this.wysiwyg_mode){if(!this.disabled){this.disabled=true;var B=fetch_object(this.editorid+"_hider");if(B){B.parentNode.removeChild(B)}var D=document.createElement("div");D.id=this.editorid+"_hider";D.className="wysiwyg textbox hider";D.style.width=this.editbox.style.width;D.style.height=this.editbox.style.height;var A=document.createElement("div");A.style.padding="8px";A.innerHTML=C;D.appendChild(A);this.editbox.parentNode.appendChild(D);this.editbox.style.display="none"}}else{if(!this.disabled){this.disabled=true;if(typeof C!="undefined"){this.editbox.value=C}this.editbox.disabled=true}}};vB_Text_Editor.prototype.email=function(C,A){if(this.wysiwyg_mode){if(typeof A=="undefined"){A=this.show_prompt(vbphrase.enter_email_link,"",true)}A=this.verify_prompt(A);if(A===false){return this.apply_format("unlink")}else{var B=this.get_selection();return this.insert_text('<a href="mailto:'+A+'">'+(B?B:A)+"</a>",(B?true:false))}}else{this.prompt_link("email",A,vbphrase.enter_email_link,"")}};vB_Text_Editor.prototype.enable_editor=function(B){if(this.wysiwyg_mode){if(typeof B!="undefined"){this.set_editor_contents(B)}this.editbox.style.display="";var A=fetch_object(this.editorid+"_hider");if(A){A.parentNode.removeChild(A)}this.disabled=false}else{if(typeof B!="undefined"){this.editbox.value=B}this.editbox.disabled=false;this.disabled=false}};vB_Text_Editor.prototype.format=function(D,C,A){D=do_an_e(D);if(this.disabled){return false}if(C!="redo"){this.history.add_snapshot(this.get_editor_contents())}if(C=="switchmode"){switch_editor_mode(this.editorid);return }else{if(C.substr(0,6)=="resize"){var F=parseInt(C.substr(9),10);var E=parseInt(C.substr(7,1),10)=="1"?1:-1;this.resize_editor(F*E);return }}this.check_focus();var B;if(C.substr(0,4)=="wrap"){B=this.wrap_tags(C.substr(6),(C.substr(4,1)=="1"?true:false))}else{if(this[C]){if(A===false){B=this[C](D)}else{B=this[C](D,A)}}else{try{B=this.apply_format(C,false,(typeof A=="undefined"?true:A))}catch(D){this.handle_error(C,D);B=false}}}if(C!="undo"){this.history.add_snapshot(this.get_editor_contents())}this.set_context(C);this.check_focus();return B};vB_Text_Editor.prototype.get_editor_contents=function(){if(this.wysiwyg_mode){return this.editdoc.body.innerHTML}else{return this.editdoc.value}};vB_Text_Editor.prototype.get_selection=function(){if(this.wysiwyg_mode){if(is_moz){selection=this.editwin.getSelection();this.check_focus();var A=selection?selection.getRangeAt(0):this.editdoc.createRange();return this.read_nodes(A.cloneContents(),false)}else{if(is_opera){selection=this.editwin.getSelection();this.check_focus();A=selection?selection.getRangeAt(0):this.editdoc.createRange();var C=document.implementation.createLSSerializer();return C.writeToString(A.cloneContents())}else{var A=this.editdoc.selection.createRange();if(A.htmlText&&A.text){return A.htmlText}else{var D="";for(var B=0;B<A.length;B++){D+=A.item(B).outerHTML}return D}}}}else{if(typeof (this.editdoc.selectionStart)!="undefined"){return this.editdoc.value.substr(this.editdoc.selectionStart,this.editdoc.selectionEnd-this.editdoc.selectionStart)}else{if(document.selection&&document.selection.createRange){return document.selection.createRange().text}else{if(window.getSelection){return window.getSelection()+""}else{return false}}}}};vB_Text_Editor.prototype.handle_error=function(A,B){};vB_Text_Editor.prototype.init=function(A){if(this.initialized){return }this.textobj.disabled=false;if(this.tempiframe){this.tempiframe.parentNode.removeChild(this.tempiframe)}this.set_editor_contents(A);this.set_editor_functions();this.init_controls();this.init_smilies(fetch_object(this.editorid+"_smiliebox"));if(typeof smilie_window!="undefined"&&!smilie_window.closed){this.init_smilies(smilie_window.document.getElementById("smilietable"))}this.captcha=document.getElementById("imagestamp");if(this.captcha!=null){this.captcha.setAttribute("tabIndex",1)}this.initialized=true};vB_Text_Editor.prototype.init_command_button=function(A){A.cmd=A.id.substr(A.id.indexOf("_cmd_")+5);A.editorid=this.editorid;this.buttons[A.cmd]=A;if(A.cmd=="switchmode"){if(AJAX_Compatible){A.state=this.wysiwyg_mode?true:false;this.set_control_style(A,"button",this.wysiwyg_mode?"selected":"normal")}else{A.parentNode.removeChild(A)}}else{A.state=false;A.mode="normal";if(A.cmd=="bold"||A.cmd=="italic"||A.cmd=="underline"){this.allowbasicbbcode=true}}A.onclick=A.onmousedown=A.onmouseover=A.onmouseout=vB_Text_Editor_Events.prototype.command_button_onmouseevent};vB_Text_Editor.prototype.init_controls=function(){var A=new Array();var C,B,D,G,F;if(this.controlbar==null){return }var D=YAHOO.util.Dom.getElementsByClassName("imagebutton","",this.controlbar);for(C=0;C<D.length;C++){if(YAHOO.util.Dom.hasClass(D[C],"imagebutton")&&D[C].id){A[A.length]=D[C].id;if(is_ie){G=D[C].getElementsByTagName("img");for(B=0;B<G.length;B++){if(G[B].alt==""){G[B].title=D[C].title}}}}}var E=YAHOO.util.Dom.getElementsByClassName("menubutton","",this.controlbar);for(C=0;C<E.length;C++){if(YAHOO.util.Dom.hasClass(E[C],"menubutton")&&E[C].id){A[A.length]=E[C].id;if(is_ie){G=D[C].getElementsByTagName("img");for(B=0;B<G.length;B++){if(G[B].alt==""){G[B].title=D[C].title}}}}}for(C=0;C<A.length;C++){F=fetch_object(A[C]);if(F.id.indexOf(this.editorid+"_cmd_")!=-1){this.init_command_button(F)}else{if(F.id.indexOf(this.editorid+"_popup_")!=-1){this.init_popup_menu(F)}}}set_unselectable(this.controlbar)};vB_Text_Editor.prototype.init_menu_container=function(C,B,A,E){var D=document.createElement("div");D.id=this.editorid+"_popup_"+C+"_menu";D.className="vbmenu_popup";D.style.display="none";D.style.cursor="default";D.style.padding="3px";D.style.width=B;D.style.height=A;D.style.overflow=E;return D};vB_Text_Editor.prototype.init_popup_menu=function(B){if(this.disabled){return false}B.cmd=B.id.substr(B.id.indexOf("_popup_")+7);B.editorid=this.editorid;this.buttons[B.cmd]=B;switch(B.cmd){case"fontname":this.build_fontname_popup(B);break;case"fontsize":this.build_fontsize_popup(B);break;case"forecolor":this.build_forecolor_popup(B);break;case"smilie":this.build_smilie_popup(B);break;case"attach":var A=YAHOO.util.Dom.getElementsByClassName("popupctrl","div",B);if(!YAHOO.util.Event.getListeners(B,"mouseover")){YAHOO.util.Event.on(B,"mouseover",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mouseout",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mouseup",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(B,"mousedown",vB_Text_Editor.prototype.menu_context,B,this);YAHOO.util.Event.on(A[0],"click",vB_Text_Editor.prototype.attachpopup);YAHOO.util.Event.on("manageattach","click",vB_Text_Editor_Events.prototype.attachmanage_onclick);this.popups.attach=true;if(typeof vB_Attachments!="undefined"&&vB_Attachments.has_attachments()){this.build_attachments_popup(B)}else{if(typeof (vB_Attachments)!="undefined"){}return false}}}return true};vB_Text_Editor.prototype.attachpopup=function(B,A){if(typeof (vB_Attachments)!="undefined"&&!vB_Attachments.has_attachments()){vB_Attachments.attachmanage()}};vB_Text_Editor.prototype.init_smilies=function(C){if(C!=null){var B=fetch_tags(C,"img");for(var A=0;A<B.length;A++){if(B[A].id&&B[A].id.indexOf("_smilie_")!=false){B[A].style.cursor=pointer_cursor;B[A].editorid=this.editorid;B[A].onclick=vB_Text_Editor_Events.prototype.smilie_onclick;B[A].unselectable="on"}}}};vB_Text_Editor.prototype.insert_node_at_selection=function(F){this.check_focus();var E=this.editwin.getSelection();var B=E?E.getRangeAt(0):this.editdoc.createRange();E.removeAllRanges();B.deleteContents();var C=B.startContainer;var G=B.startOffset;switch(C.nodeType){case Node.ELEMENT_NODE:if(F.nodeType==Node.DOCUMENT_FRAGMENT_NODE){D=F.firstChild}else{D=F}C.insertBefore(F,C.childNodes[G]);this.add_range(D);break;case Node.TEXT_NODE:if(F.nodeType==Node.TEXT_NODE){var A=G+F.length;C.insertData(G,F.data);B=this.editdoc.createRange();B.setEnd(C,A);B.setStart(C,A);E.addRange(B)}else{C=C.splitText(G);var D;if(F.nodeType==Node.DOCUMENT_FRAGMENT_NODE){D=F.firstChild}else{D=F}C.parentNode.insertBefore(F,C);this.add_range(D)}break}};vB_Text_Editor.prototype.insert_smilie=function(F,E,D,A){if(this.wysiwyg_mode){if(is_moz||is_opera){this.check_focus();try{this.apply_format("InsertImage",false,D);var C=fetch_tags(this.editdoc.body,"img");for(var B=0;B<C.length;B++){if(C[B].src==D){C[B].className="inlineimg";if(C[B].getAttribute("smilieid")<1){C[B].setAttribute("smilieid",A);C[B].setAttribute("border","0")}}}}catch(F){}}else{this.check_focus();return this.insert_text('<img src="'+D+'" border="0" class="inlineimg" alt="0" smilieid="'+A+'" />',false)}}else{this.check_focus();return this.insert_text(E,E.length,0)}};vB_Text_Editor.prototype.insert_text=function(F,E,A){if(this.wysiwyg_mode){if(is_moz||is_opera){this.editdoc.execCommand("insertHTML",false,F)}else{this.check_focus();if(typeof (this.editdoc.selection)!="undefined"&&this.editdoc.selection.type!="Text"&&this.editdoc.selection.type!="None"){E=false;this.editdoc.selection.clear()}var D=this.editdoc.selection.createRange();D.pasteHTML(F);if(F.indexOf("\n")==-1){if(E===false){}else{if(typeof E!="undefined"){D.moveStart("character",-F.vBlength()+E);D.moveEnd("character",-A)}else{D.moveStart("character",-F.vBlength())}}D.select()}}}else{var C=false;this.check_focus();if(typeof (this.editdoc.selectionStart)!="undefined"){var G=this.editdoc.selectionStart+0;var B=this.editdoc.scrollTop;this.editdoc.value=this.editdoc.value.substr(0,this.editdoc.selectionStart)+F+this.editdoc.value.substr(this.editdoc.selectionEnd);if(E===false){}else{if(typeof E!="undefined"){this.editdoc.selectionStart=G+E;this.editdoc.selectionEnd=G+F.vBlength()-A}else{this.editdoc.selectionStart=G;this.editdoc.selectionEnd=G+F.vBlength()}}this.editdoc.scrollTop=B}else{if(document.selection&&document.selection.createRange){var D=document.selection.createRange();D.text=F.replace(/\r?\n/g,"\r\n");if(E===false){}else{if(typeof E!="undefined"){if((E-F.vBlength())!=0){D.moveStart("character",E-F.vBlength());C=true}if(A!=0){D.moveEnd("character",-A);C=true}}else{D.moveStart("character",-F.vBlength());C=true}}if(C){D.select()}}else{this.editdoc.value+=F}}}};vB_Text_Editor.prototype.insertvideo=function(A){this.create_editor_dialog('<img src="'+IMGDIR_MISC+'/lightbox_progress.gif" alt="" />',this.insertvideo_confirm);YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=fetchhtml",{success:this.insertvideo_ajax,failure:this.remove_editor_dialog,timeout:vB_Default_Timeout,argument:[this.editorid],scope:this},SESSIONURL+"&securitytoken="+SECURITYTOKEN+"&ajax=1&do=fetchhtml&template=editor_video_overlay")};vB_Text_Editor.prototype.insertvideo_ajax=function(B){if(B.responseXML){var A=B.responseXML.getElementsByTagName("html");if(A.length){this.create_editor_dialog(A[0].firstChild.nodeValue,this.insertvideo_confirm,true);YAHOO.util.Dom.get("videourl").focus();YAHOO.util.Event.on("videourl","keypress",this.dialog_submit_event,this,true);return }}this.remove_editor_dialog()};vB_Text_Editor.prototype.insertvideo_confirm=function(){var A=this.dialog.elements.videourl.value;var B=false;if(A=this.verify_prompt(A)){this.insert_text("[video]"+A+"[/video]")}this.remove_editor_dialog()};vB_Text_Editor.prototype.insertimagesettings_ajax=function(B){if(B.responseXML){var A=B.responseXML.getElementsByTagName("html");if(A.length){this.create_editor_dialog(A[0].firstChild.nodeValue,this.insertimagesettings_confirm,true);YAHOO.util.Dom.get("imageconfigtarget").src=this.activeimg.src;YAHOO.util.Event.on("vb_alignment_none","click",vB_Text_Editor.prototype.insertimagesettings_alignment,this);YAHOO.util.Event.on("vb_alignment_right","click",vB_Text_Editor.prototype.insertimagesettings_alignment,this);YAHOO.util.Event.on("vb_alignment_left","click",vB_Text_Editor.prototype.insertimagesettings_alignment,this);YAHOO.util.Event.on("vb_alignment_center","click",vB_Text_Editor.prototype.insertimagesettings_alignment,this);YAHOO.util.Event.on("vb_link_none","click",vB_Text_Editor.prototype.insertimagesettings_link,this);YAHOO.util.Event.on("vb_link_content","click",vB_Text_Editor.prototype.insertimagesettings_link,this);YAHOO.util.Event.on("vb_link_image","click",vB_Text_Editor.prototype.insertimagesettings_link,this);this.remove_activeimg();return }}this.remove_activeimg();this.remove_editor_dialog()};vB_Text_Editor.prototype.insertimagesettings_confirm=function(){var B=YAHOO.util.Dom.get("imageconfigtarget");var C=B.src.match(/attachmentid=(\d+)/i);if(C){var A=new vB_Hidden_Form(null);A.add_variables_from_object(YAHOO.util.Dom.get(this.editorid+"_dialog"));A.add_variable("attachmentid",C[1]);YAHOO.util.Dom.setStyle("imageoverlay_progress","display","inline");YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=saveimageconfig",{success:this.remove_editor_dialog,failure:this.insertimagesettings_failure,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=saveimageconfig&ajax=1&"+A.build_query_string())}else{alert(this.phrase.unable_to_parse_attachmentid_from_image);this.remove_editor_dialog()}};vB_Text_Editor.prototype.insertimagesettings_failure=function(){YAHOO.util.Dom.setStyle("imageoverlay_progress","display","none");alert(vbphrase.saving_of_settings_failed)};vB_Text_Editor.prototype.insertimagesettings_link=function(C){var B=YAHOO.util.Event.getTarget(C);var A=YAHOO.util.Dom.get("linkurl");switch(B.id){case"vb_link_none":A.setAttribute("value","");break;case"vb_link_content":A.setAttribute("value","What goes here?");break;case"vb_link_image":A.setAttribute("value","[image]");break}};vB_Text_Editor.prototype.insertimagesettings_alignment=function(B){var A=YAHOO.util.Event.getTarget(B);YAHOO.util.Dom.removeClass("imageconfigtarget","left");YAHOO.util.Dom.removeClass("imageconfigtarget","right");YAHOO.util.Dom.removeClass("imageconfigtarget","center");switch(A.id){case"vb_alignment_left":YAHOO.util.Dom.addClass("imageconfigtarget","left");break;case"vb_alignment_right":YAHOO.util.Dom.addClass("imageconfigtarget","right");break;case"vb_alignment_center":YAHOO.util.Dom.addClass("imageconfigtarget","center");break}};vB_Text_Editor.prototype.insertimagesettings_failure=function(A){this.remove_activeimg();this.remove_editor_dialog()};vB_Text_Editor.prototype.insertimage=function(B,A){if(this.wysiwyg_mode&&typeof (vBulletin.attachinfo)!="undefined"&&typeof (vBulletin.attachinfo.contenttypeid)!="undefined"&&vBulletin.attachinfo.contenttypeid!=0&&typeof (A)=="undefined"&&vBulletin.attachinfo.advimagepopup){this.show_editor_progress();YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=fetchhtml",{success:this.insertimage_ajax,failure:this.remove_editor_dialog,timeout:vB_Default_Timeout,argument:[this.editorid],scope:this},SESSIONURL+"&securitytoken="+SECURITYTOKEN+"&ajax=1&do=fetchhtml&template=editor_upload_overlay")}else{img=this.show_prompt(vbphrase.enter_image_url,"http://",true);if(img=this.verify_prompt(img)){return this.apply_format("insertimage",false,img)}else{return false}}};vB_Text_Editor.prototype.insertimage_ajax=function(C){if(C.responseXML){var A=C.responseXML.getElementsByTagName("html");if(A.length){this.create_editor_dialog(A[0].firstChild.nodeValue,this.insertimage_confirm,true);if(typeof (TabsLightJS)=="undefined"){var B=this;YAHOO.vBulletin.LoadCss("css.php?sheet=yuiupload.css");YAHOO.vBulletin.LoadScript("clientscript/vbulletin-tabslight.js?v="+SIMPLEVERSION,function(){init_tabslight()});YAHOO.vBulletin.LoadScript("clientscript/yui/combo/imageupload.js?v="+SIMPLEVERSION,function(){YAHOO.vBulletin.LoadScript("clientscript/vbulletin_yuiupload.js?v="+SIMPLEVERSION,function(){YAHOO.vBulletin.LoadScript("clientscript/vbulletin_imageup.js?v="+SIMPLEVERSION,function(){B.insertimage_ready()})})})}else{init_tabslight();this.insertimage_ready()}return }}this.remove_editor_dialog()};vB_Text_Editor.prototype.insertimage_ready=function(B){this.hide_editor_progress();YAHOO.util.Dom.removeClass("editor_upload_overlay","hidden");this.position_dialog(this.dialog);var A=new vB_ImageUpload(this.editorid+"_dialog");A.events.complete.subscribe(this.insertimage_complete,this);A.events.uploaddone.subscribe(this.insertimage_uploaddone,this)};vB_Text_Editor.prototype.insertimage_confirm=function(E){YAHOO.util.Event.stopEvent(E);if(!YAHOO.util.Dom.get("urlretrieve")||!YAHOO.util.Dom.get("urlretrieve").checked){if(img=this.verify_prompt(YAHOO.util.Dom.get("urlupload").value)){this.check_focus();this.apply_format("insertimage",false,img)}this.remove_editor_dialog();return }var C=YAHOO.util.Dom.get("urlupload").value;if(C){this.show_editor_progress();var F={upload:this.insertimage_uploadurl,failure:function(G){vBulletin_AJAX_Error_Handler(G);this.hide_editor_progress()},scope:this};var B=YAHOO.util.Dom.get(this.editorid+"_dialog");B.action="newattachment.php";B.posthash.value=vBulletin.attachinfo.posthash;B.poststarttime.value=vBulletin.attachinfo.poststarttime;B.contenttypeid.value=vBulletin.attachinfo.contenttypeid;for(var D in vBulletin.attachinfo.values){var A=document.createElement("input");A.name="values["+D+"]";A.value=vBulletin.attachinfo.values[D];A.type="hidden";B.appendChild(A)}YAHOO.util.Connect.setForm(B,true,true);YAHOO.util.Connect.asyncRequest("POST","newattachment.php",F,"ajax=1");return false}};vB_Text_Editor.prototype.insertimage_uploadurl=function(B){var C=B.responseText.match(/^ok - ([\d]+) - ([01])/);if(C){this.insert_attachment(C[1],vBulletin.attachinfo.contenttypeid,C[2]);this.remove_editor_dialog()}else{this.hide_editor_progress();var A=B.responseText.match(/^error: (.*)$/);alert(A?A[1]:vbphrase.upload_failed);YAHOO.util.Dom.get("urlupload").focus()}};vB_Text_Editor.prototype.insertimage_uploaddone=function(C,A,B){B.insert_attachment(A[0],A[1],A[2])};vB_Text_Editor.prototype.insertimage_complete=function(C,A,B){B.remove_editor_dialog()};vB_Text_Editor.prototype.remove_attachment=function(C){var A=YAHOO.util.Dom.getElementsByClassName("previewthumb","img",this.editdoc.body);var D=A.length;for(var B=0;B<D;B++){if(C==YAHOO.util.Dom.getAttribute(A[B],"attachmentid")){A[B].parentNode.removeChild(A[B])}}};vB_Text_Editor.prototype.insert_attachment=function(B,A,C){if(C!=0&&this.wysiwyg_mode){if(is_moz){this.insert_text('<img src="attachment.php?'+(SESSIONURL!=""?SESSIONURL+"amp;":"")+"attachmentid="+B+"&amp;cid="+A+'&amp;stc=1" alt="" attachmentid="'+B+'" class="previewthumb" />')}else{this.insert_text('<img src="'+BBURL+"/attachment.php?"+(SESSIONURL!=""?SESSIONURL+"amp;":"")+"attachmentid="+B+"&amp;cid="+A+'&amp;stc=1" alt="" attachmentid="'+B+'" class="previewthumb" />')}}else{if(C!=0){this.insert_text("[ATTACH=CONFIG]"+B+"[/ATTACH]")}else{this.insert_text("[ATTACH]"+B+"[/ATTACH]")}}this.collapse_selection_end()};vB_Text_Editor.prototype.insertlist=function(C,D){var A="[LIST"+(D?("="+D):"")+"]\n";var F="[/LIST]";var E;if(E=this.get_selection()){var H=new RegExp("([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])","gi");E=A+PHP.trim(E).replace(H,"$1[*]")+"\n"+F;this.insert_text(E,E.vBlength(),0)}else{this.insert_text(A+F,A.length,F.length);if(YAHOO.env.ua.ie>=7){var I=fetch_tags(document,"base");var B;if(I&&I[0]&&I[0].href){B=I[0].href}else{B=""}var G=window.showModalDialog(B+"clientscript/ieprompt.html?",{value:"",label:vbphrase.enter_list_item,dir:document.documentElement.dir,title:document.title,listtype:D},"dialogWidth:320px; dialogHeight:232px; dialogTop:"+(parseInt(window.screenTop)+parseInt(window.event.clientY)+parseInt(document.body.scrollTop)-100)+"px; dialogLeft:"+(parseInt(window.screenLeft)+parseInt(window.event.clientX)+parseInt(document.body.scrollLeft)-160)+"px; resizable: No;");if(this.verify_prompt(G)){this.insert_text(G,G.vBlength(),0)}}else{while(G=this.show_prompt(vbphrase.enter_list_item,"",false)){G="[*]"+G+"\n";this.insert_text(G,G.vBlength(),0)}}}};vB_Text_Editor.prototype.insertorderedlist=function(A){if(this.wysiwyg_mode){return this.apply_format("insertorderedlist",false,true)}else{this.insertlist(vbphrase.insert_ordered_list,"1")}};vB_Text_Editor.prototype.insertunorderedlist=function(A){if(this.wysiwyg_mode){return this.apply_format("insertunorderedlist",false,true)}else{this.insertlist(vbphrase.insert_unordered_list,"")}};vB_Text_Editor.prototype.menu_context=function(C,B){if(this.disabled){return }var A=YAHOO.util.Dom.getElementsByClassName("popupctrl","div",B);switch(C.type){case"mouseout":if(!YAHOO.util.Dom.hasClass(A[0],"imagebutton_down")){this.set_control_style(A[0],"button","normal")}break;case"mousedown":if(YAHOO.util.Dom.hasClass(A[0],"imagebutton_down")){this.set_control_style(A[0],"button","hover")}else{this.set_control_style(A[0],"popup","down")}break;case"mouseup":case"mouseover":this.set_control_style(A[0],"button","hover");break}};vB_Text_Editor.prototype.open_smilie_window=function(B,A){smilie_window=openWindow("misc.php?"+SESSIONURL+"do=getsmilies&editorid="+this.editorid,B,A,"smilie_window");window.onunload=vB_Text_Editor_Events.prototype.smiliewindow_onunload};vB_Text_Editor.prototype.outdent=function(B){if(this.wysiwyg_mode){return this.apply_format("outdent",false,true)}else{var A=this.get_selection();A=this.strip_simple("indent",A,1);this.insert_text(A)}};vB_Text_Editor.prototype.prepare_submit=function(C,A){var B;if(this.wysiwyg_mode){this.textobj.value=this.get_editor_contents();returnvalue=validatemessage(stripcode(this.textobj.value,true),C,A)}else{returnvalue=validatemessage(this.textobj.value,C,A)}if(returnvalue){return returnvalue}else{if(this.captcha!=null&&this.captcha.failed){return returnvalue}else{this.check_focus();return false}}};vB_Text_Editor.prototype.prompt_link=function(C,B,A,D){if(typeof B=="undefined"){B=this.show_prompt(A,D,true)}if((B=this.verify_prompt(B))!==false){if(this.get_selection()){this.apply_format("unlink");this.wrap_tags(C,B)}else{this.wrap_tags(C,B,B)}}return true};vB_Text_Editor.prototype.read_nodes=function(C,H){var F="";var G=/_moz/i;switch(C.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:var D;var E;if(H){D=!C.hasChildNodes();F="<"+C.tagName.toLowerCase();var A=C.attributes;for(E=0;E<A.length;++E){var B=A.item(E);if(!B.specified||B.name.match(G)||B.value.match(G)){continue}F+=" "+B.name.toLowerCase()+'="'+B.value+'"'}F+=D?" />":">"}for(E=C.firstChild;E;E=E.nextSibling){F+=this.read_nodes(E,true)}if(H&&!D){F+="</"+C.tagName.toLowerCase()+">"}break;case Node.TEXT_NODE:F=PHP.htmlspecialchars(C.data);break}return F};vB_Text_Editor.prototype.recreate_editor=function(A,G,B,D,C,F,E){return new vB_Text_Editor(A,G,B,D,C,F,E)};vB_Text_Editor.prototype.redo=function(){if(this.wysiwyg_mode){return this.apply_format("redo",false,true)}else{this.history.move_cursor(1);var A;if((A=this.history.get_snapshot())!==false){this.editdoc.value=A}}};vB_Text_Editor.prototype.removeformat=function(D){if(this.wysiwyg_mode){return this.apply_format("removeformat",false,true)}else{var B=new Array("b","i","u");var C=new Array("font","color","size");var E=this.get_selection();if(E===false){return }var A;for(A in B){if(YAHOO.lang.hasOwnProperty(B,A)){E=this.strip_simple(B[A],E)}}for(A in C){if(YAHOO.lang.hasOwnProperty(C,A)){E=this.strip_complex(C[A],E)}}this.insert_text(E)}};vB_Text_Editor.prototype.resize_editor=function(B){var A=parseInt(YAHOO.util.Dom.getStyle(this.editbox,"height"),10)+B;if(A>=60){YAHOO.util.Dom.setStyle(this.editbox,"height",A+"px");if(is_ie){YAHOO.util.Dom.setStyle(this.editdoc.body,"height",A-6+"px")}if(B%99!=0){set_cookie("editor_height",A)}custom_editor_events.editor_switch.fire(this)}};vB_Text_Editor.prototype.set_color_context=function(C){if(this.buttons.forecolor){if(typeof C=="undefined"){C=this.editdoc.queryCommandValue("forecolor")}if(C!=this.colorstate){if(this.popupmode){var B=fetch_object(this.editorid+"_color_"+this.translate_color_commandvalue(this.colorstate));if(B!=null){B.state=false;this.button_context(B,"mouseout","menu")}this.colorstate=C;elmid=this.editorid+"_color_"+this.translate_color_commandvalue(C);B=fetch_object(elmid);if(B!=null){B.state=true;this.button_context(B,"mouseout","menu")}}else{this.colorstate=C;C=this.translate_color_commandvalue(this.colorstate);for(var A=0;A<this.buttons.forecolor.options.length;A++){if(this.buttons.forecolor.options[A].value==C){this.buttons.forecolor.selectedIndex=A;break}}}}}};vB_Text_Editor.prototype.set_context=function(C){if(!this.wysiwyg_mode){return }for(var A in contextcontrols){if(!YAHOO.lang.hasOwnProperty(contextcontrols,A)){continue}var D=fetch_object(this.editorid+"_cmd_"+contextcontrols[A]);if(D!=null){var B=this.editdoc.queryCommandState(contextcontrols[A]);if(D.state!=B){D.state=B;this.button_context(D,(D.cmd==C?"mouseover":"mouseout"))}}}this.set_font_context();this.set_size_context();this.set_color_context()};vB_Text_Editor.prototype.set_control_style=function(B,A,C){if(B.mode!=C){B.mode=C;YAHOO.util.Dom.removeClass(B,"imagebutton_selected");YAHOO.util.Dom.removeClass(B,"imagebutton_hover");YAHOO.util.Dom.removeClass(B,"imagebutton_down");switch(B.mode){case"down":YAHOO.util.Dom.addClass(B,"imagebutton_down");break;case"selected":YAHOO.util.Dom.addClass(B,"imagebutton_selected");break;case"hover":YAHOO.util.Dom.addClass(B,"imagebutton_hover");break;case"normal":break}return }};vB_Text_Editor.prototype.set_direction=function(){this.editdoc.dir=this.textobj.dir};vB_Text_Editor.prototype.set_editor_contents=function(B){if(this.wysiwyg_mode){if(fetch_object(this.editorid+"_iframe")){this.editbox=fetch_object(this.editorid+"_iframe");YAHOO.util.Dom.setStyle(this.editbox,"display","")}else{var A=document.createElement("iframe");if(is_ie&&window.location.protocol=="https:"){A.src="clientscript/index.html"}if(is_ie){YAHOO.util.Dom.setAttribute(A,"frameBorder","0")}this.editbox=this.textobj.parentNode.appendChild(A);this.editbox.id=this.editorid+"_iframe";this.editbox.tabIndex=1;YAHOO.util.Dom.addClass(this.editbox,"textbox")}this.textobj.style.display="none";this.editwin=this.editbox.contentWindow;this.editdoc=this.editwin.document;this.write_editor_contents((typeof B=="undefined"?this.textobj.value:B),true);if(this.editdoc.dir=="rtl"){}this.spellobj=this.editdoc.body;this.editdoc.editorid=this.editorid;this.editwin.editorid=this.editorid;if(is_moz){this.editdoc.addEventListener("keypress",vB_Text_Editor_Events.prototype.editdoc_onkeypress,true)}else{YAHOO.util.Dom.setStyle(this.editdoc.body,"height",parseInt(YAHOO.util.Dom.getStyle(this.editbox,"height"),10)-6+"px");YAHOO.util.Event.on(this.editwin,"scroll",vB_Text_Editor.prototype.resize_ie_body,this,true)}}else{var A=this.textobj.parentNode.getElementsByTagName("iframe")[0];if(A){this.textobj.style.display="";this.textobj.style.width=A.style.width;this.textobj.style.height=A.style.height;YAHOO.util.Dom.setStyle(A,"display","none")}this.editwin=this.textobj;this.editdoc=this.textobj;this.editbox=this.textobj;this.spellobj=this.textobj;this.set_editor_width(this.textobj.style.width);if(typeof B!="undefined"){this.write_editor_contents(B)}this.editdoc.editorid=this.editorid;this.editwin.editorid=this.editorid;this.history.add_snapshot(this.get_editor_contents())}if(typeof (vB_Attachments)!="undefined"){vB_Attachments.editor=this}};vB_Text_Editor.prototype.set_editor_functions=function(){if(this.wysiwyg_mode){if(!YAHOO.util.Event.getListeners(this.editdoc,"mousemove")){YAHOO.util.Event.on(this.editdoc,"mousemove",vB_Text_Editor_Events.prototype.editdoc_onmousemove,this,true);YAHOO.util.Event.on(this.editdoc,"click",vB_Text_Editor_Events.prototype.editdoc_onclick,this,true);YAHOO.util.Event.on(this.editdoc,"mousedown",vB_Text_Editor_Events.prototype.editdoc_onmousedown,this,true);if(is_moz){YAHOO.util.Event.on(this.editdoc,"dragend",vB_Text_Editor_Events.prototype.editdoc_ondragend,this,true);this.editdoc.addEventListener("mouseup",vB_Text_Editor_Events.prototype.editdoc_onmouseup,true);this.editdoc.addEventListener("keyup",vB_Text_Editor_Events.prototype.editdoc_onkeyup,true);this.editwin.addEventListener("focus",vB_Text_Editor_Events.prototype.editwin_onfocus,true);this.editwin.addEventListener("blur",vB_Text_Editor_Events.prototype.editwin_onblur,true)}else{this.editdoc.onmouseup=vB_Text_Editor_Events.prototype.editdoc_onmouseup;this.editdoc.onkeyup=vB_Text_Editor_Events.prototype.editdoc_onkeyup;if(this.editdoc.attachEvent){this.editdoc.body.attachEvent("onresizestart",vB_Text_Editor_Events.prototype.editdoc_onresizestart)}this.editwin.onfocus=vB_Text_Editor_Events.prototype.editwin_onfocus;this.editwin.onblur=vB_Text_Editor_Events.prototype.editwin_onblur}}}else{if(this.editdoc.addEventListener){if(!YAHOO.util.Event.getListeners(this.editdoc,"keypress")){YAHOO.util.Event.on(this.editdoc,"keypress",vB_Text_Editor_Events.prototype.editdoc_onkeypress,this,true)}}else{if(is_ie){this.editdoc.onkeydown=vB_Text_Editor_Events.prototype.editdoc_onkeypress}}this.editwin.onfocus=vB_Text_Editor_Events.prototype.editwin_onfocus;this.editwin.onblur=vB_Text_Editor_Events.prototype.editwin_onblur}};vB_Text_Editor.prototype.set_editor_style=function(){if(!this.wysiwyg_mode){return }var F="";var H=false;var C=fetch_all_stylesheets(document.styleSheets);for(var M=0;M<C.length;M++){try{var K=(C[M].cssRules?C[M].cssRules:C[M].rules);if(K.length<=0){continue}}catch(I){continue}for(var E=0;E<K.length;E++){if(!K[E].selectorText){continue}var B=false;var J=new Array();if(K[E].selectorText.indexOf(".wysiwyg")>=0){var A=K[E].selectorText.split(",");for(var D=0;D<A.length;D++){if(A[D].indexOf(".wysiwyg")>=0){J.push(A[D])}if(A[D].indexOf("#usercss")>=0){H=true}}B=true}if(B){var G="{ "+K[E].style.cssText+" }";if(is_moz){G=G.replace(/; /g," !important; ")}F+=J.join(", ")+" "+G+"\n"}}}if(is_ie){this.editdoc.createStyleSheet().cssText=F}else{var L=this.editdoc.createElement("style");L.type="text/css";L.innerHTML=F;this.editdoc.documentElement.childNodes[0].appendChild(L)}if(H){this.editdoc.body.parentNode.id="usercss"}YAHOO.util.Dom.addClass(this.editdoc.body,"wysiwyg");YAHOO.util.Dom.addClass(this.editdoc.body,this.content)};vB_Text_Editor.prototype.set_editor_width=function(C,B){if(this.wysiwyg_mode){this.editbox.style.width=C}else{if(typeof (this.textobj.style.oWidth)=="undefined"||B){this.textobj.style.oWidth=C}if(false){this.textobj.style.width=this.textobj.style.oWidth;var A=this.textobj.offsetWidth;if(A>0){this.textobj.style.width=A+"px";this.textobj.style.width=(A+A-this.textobj.offsetWidth)+"px"}}else{this.textobj.style.width=C}}};vB_Text_Editor.prototype.set_font_context=function(B){if(this.buttons.fontname){if(typeof B=="undefined"){B=this.editdoc.queryCommandValue("fontname")}switch(B){case"":if(!is_ie&&window.getComputedStyle){B=this.editdoc.body.style.fontFamily}break;case null:B="";break}if(B!=this.fontstate){this.fontstate=B;var A;if(this.popupmode){if(YAHOO.lang.hasOwnProperty(this.fontoptions,this.fontstate)){YAHOO.util.Dom.get(this.editorid+"_fontfield").innerHTML=this.fontoptions[this.fontstate]}else{YAHOO.util.Dom.get(this.editorid+"_fontfield").innerHTML=this.fontoptions[""]}}else{for(A=0;A<this.buttons.fontname.options.length;A++){if(this.buttons.fontname.options[A].value==thingy){this.buttons.fontname.selectedIndex=A;break}}}}}};vB_Text_Editor.prototype.set_size_context=function(A){if(this.buttons.fontsize){if(typeof A=="undefined"){A=this.editdoc.queryCommandValue("fontsize")}switch(A){case null:case"":if(is_moz){A=this.translate_fontsize(this.editdoc.body.style.fontSize)}break}if(A!=this.sizestate){this.sizestate=A;var B;if(this.popupmode){if(YAHOO.lang.hasOwnProperty(this.sizeoptions,this.sizestate)){YAHOO.util.Dom.get(this.editorid+"_sizefield").innerHTML=this.sizeoptions[this.sizestate]}else{YAHOO.util.Dom.get(this.editorid+"_sizefield").innerHTML=this.sizeoptions[""]}}else{for(B=0;B<this.buttons.fontsize.options.length;B++){if(this.buttons.fontsize.options[B].value==this.sizestate){this.buttons.fontsize.selectedIndex=B;break}}}}}};vB_Text_Editor.prototype.show_prompt=function(F,B,D){var E;if(YAHOO.env.ua.ie>=7){var C=fetch_tags(document,"base");var A;if(C&&C[0]&&C[0].href){A=C[0].href}else{A=""}E=window.showModalDialog(A+"clientscript/ieprompt.html?",{value:B,label:F,dir:document.documentElement.dir,title:document.title,forceltr:(typeof (D)!="undefined"?D:false)},"dialogWidth:320px; dialogHeight:150px; dialogTop:"+(parseInt(window.screenTop)+parseInt(window.event.clientY)+parseInt(document.body.scrollTop)-100)+"px; dialogLeft:"+(parseInt(window.screenLeft)+parseInt(window.event.clientX)+parseInt(document.body.scrollLeft)-160)+"px; resizable: No;")}else{E=prompt(F,B)}if(typeof (E)=="undefined"){return false}else{if(E==false||E==null){return E}else{return PHP.trim(new String(E))}}};vB_Text_Editor.prototype.spelling=function(){if(is_ie){try{eval("new ActiveXObject('ieSpell.ieSpellExtension').CheckDocumentNode(this.spellobj);")}catch(e){if(e.number==-2146827859&&confirm(vbphrase.iespell_not_installed)){window.open("http://www.iespell.com/download.php")}}}else{if(is_moz){}}};vB_Text_Editor.prototype.strip_complex=function(A,G,B){var D="["+A+"=";var C="[/"+A+"]";if(typeof B=="undefined"){B=-1}while((startindex=PHP.stripos(G,D))!==false&&B!=0){B--;if((stopindex=PHP.stripos(G,C))!==false){var E=PHP.stripos(G,"]",startindex);if(E!==false&&E>startindex&&E<stopindex){var F=G.substr(E+1,stopindex-E-1);G=G.substr(0,startindex)+F+G.substr(stopindex+C.length)}else{break}}else{break}}return G};vB_Text_Editor.prototype.strip_simple=function(A,F,B){var D="["+A+"]";var C="[/"+A+"]";if(typeof B=="undefined"){B=-1}while((startindex=PHP.stripos(F,D))!==false&&B!=0){B--;if((stopindex=PHP.stripos(F,C))!==false){var E=F.substr(startindex+D.length,stopindex-startindex-D.length);F=F.substr(0,startindex)+E+F.substr(stopindex+C.length)}else{break}}return F};vB_Text_Editor.prototype.switch_editor_ajax=function(){var A=(this.wysiwyg_mode?0:1);YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=editorswitch",{success:do_switch_editor_mode,timeout:vB_Default_Timeout,argument:[this.editorid,A]},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=editorswitch&towysiwyg="+A+"&parsetype="+this.parsetype+"&allowsmilie="+this.parsesmilies+"&message="+PHP.urlencode(this.get_editor_contents())+(this.ajax_extra?("&"+this.ajax_extra):"")+(typeof this.textobj.form["options[allowbbcode]"]!="undefined"?"&allowbbcode="+this.textobj.form["options[allowbbcode]"].checked:""))};vB_Text_Editor.prototype.translate_color_commandvalue=function(A){if(is_moz){if(A==""||A==null){A=window.getComputedStyle(this.editdoc.body,null).getPropertyValue("color")}if(A.toLowerCase().indexOf("rgb")==0){var B=A.match(/^rgb\s*\(([0-9]+),\s*([0-9]+),\s*([0-9]+)\)$/);if(B){return this.translate_silly_hex((B[1]&255).toString(16),(B[2]&255).toString(16),(B[3]&255).toString(16))}else{return this.translate_color_commandvalue(null)}}else{return A}}else{return this.translate_silly_hex((A&255).toString(16),((A>>8)&255).toString(16),((A>>16)&255).toString(16))}};vB_Text_Editor.prototype.translate_fontsize=function(A){switch(A){case"7.5pt":case"10px":return 1;case"10pt":return 2;case"12pt":return 3;case"14pt":return 4;case"18pt":return 5;case"24pt":return 6;case"36pt":return 7;default:return""}};vB_Text_Editor.prototype.translate_silly_hex=function(C,B,A){return"#"+(PHP.str_pad(C,2,0)+PHP.str_pad(B,2,0)+PHP.str_pad(A,2,0))};vB_Text_Editor.prototype.undo=function(){if(this.wysiwyg_mode){return this.apply_format("undo",false,true)}else{this.history.add_snapshot(this.get_editor_contents());this.history.move_cursor(-1);var A;if((A=this.history.get_snapshot())!==false){this.editdoc.value=A}}};vB_Text_Editor.prototype.unlink=function(B){if(this.wysiwyg_mode){return this.apply_format("unlink",false,true)}else{var A=this.get_selection();A=this.strip_simple("url",A);A=this.strip_complex("url",A);this.insert_text(A)}};vB_Text_Editor.prototype.verify_prompt=function(A){switch(A){case"http://":case"null":case"undefined":case"false":case"":case null:case false:return false;default:return A}};vB_Text_Editor.prototype.wrap_tags=function(F,A,C){F=F.toUpperCase();switch(F){case"CODE":case"HTML":case"PHP":this.apply_format("removeformat");break}if(typeof C=="undefined"){C=this.get_selection();if(C===false){C=""}else{C=new String(C)}}var E;if(A===true){var B=this.show_prompt(construct_phrase(vbphrase.enter_tag_option,("["+F+"]")),"",false);if(B=this.verify_prompt(B)){E="["+F+'="'+B+'"]'}else{return false}}else{if(A!==false){E="["+F+'="'+A+'"]'}else{E="["+F+"]"}}var D="[/"+F+"]";var G=E+C+D;this.insert_text(G,E.vBlength(),D.vBlength());return false};vB_Text_Editor.prototype.write_editor_contents=function(E,C){if(this.wysiwyg_mode){if(E==""){if(is_ie){E="<p></p>"}else{if(is_moz){E="<br />"}}}if(this.editdoc&&this.editdoc.initialized){this.editdoc.body.innerHTML=E}else{var A="";var D=document.childNodes[0];if(typeof (D.text)!="undefined"&&D.nodeType==8){A=D.text}else{if(D.nodeType==10){A="<!DOCTYPE "+D.name+' PUBLIC "'+D.publicId+'"'+(D.systemId?'"'+D.systemId+'"':"")+">"}}A='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';var B=is_ie?'<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">':"";E=A+"<html><head>"+B+"</head><body>"+E+"</body></html>";this.editdoc=this.editwin.document;this.editdoc.open("text/html","replace");this.editdoc.write(E);this.editdoc.close();if(C){if(is_moz){this.editdoc.designMode="on"}else{this.editdoc.body.contentEditable=true}}this.editdoc.body.spellcheck=true;this.editdoc.initialized=true;this.set_editor_style()}this.resize_ie_body();this.set_direction()}else{this.textobj.value=E}};vB_Text_Editor.prototype.show_editor_progress=function(){var A=this.progress;if(!A){A=document.createElement("div");document.body.appendChild(A);A.id=this.editorid+"_progress";YAHOO.util.Dom.setStyle(A,"position","absolute");YAHOO.util.Dom.setStyle(A,"z-index",1000);YAHOO.util.Dom.setStyle(A,"border","1px solid black");YAHOO.util.Dom.setStyle(A,"background-color","white")}A.innerHTML='<img src="'+IMGDIR_MISC+'/lightbox_progress.gif" alt="" />';this.position_dialog(A,300,200);this.progress=A;this.create_dialog_overlay();return A};vB_Text_Editor.prototype.hide_editor_progress=function(){if(this.progress){this.progress.parentNode.removeChild(this.progress);this.progress=null}if(!this.dialog&&this.dialog_overlay){this.dialog_overlay.parentNode.removeChild(this.dialog_overlay);this.dialog_overlay=null}};vB_Text_Editor.prototype.create_editor_dialog=function(C,A,D){var B=this.dialog;if(!B){B=document.createElement("form");document.body.appendChild(B);B.encoding="multipart/form-data";B.id=this.editorid+"_dialog";B.style.position="absolute";B.style.zIndex=1000;B.style.border="1px solid black";B.style.backgroundColor="white";YAHOO.util.Event.on(B,"submit",this.dialog_submit_event,this,true)}B.innerHTML=C;this.position_dialog(B);this.set_dialog_events(B);this.run_scripts_in_element(B);this.move_css_in_element(B);this.dialog=B;this.create_dialog_overlay();this.dialog_confirm_callback=A;if(typeof (D)!="undefined"){this.setbookmark()}return B};vB_Text_Editor.prototype.position_dialog=function(B,C,A){var E=YAHOO.util.Dom.getRegion(this.editorid);var D=YAHOO.util.Dom.getRegion(B);if(typeof (C)!="undefined"){D.height=A;D.width=C}B.style.top=Math.max(parseInt(E.top+(E.height-D.height)/2,10),E.top)+"px";B.style.left=Math.max(parseInt(E.left+(E.width-D.width)/2,10),E.left)+"px"};vB_Text_Editor.prototype.set_dialog_events=function(C){var A=C.getElementsByTagName("input");for(var B=0;B<A.length;B++){var D=A[B];if(D.type=="submit"){YAHOO.util.Event.on(D,"click",this.dialog_button_click_event,this,true)}}};vB_Text_Editor.prototype.create_dialog_overlay=function(){if(this.dialog_overlay){return this.dialog_overlay}var B=YAHOO.util.Dom.getRegion(this.editorid);var A=document.createElement("div");document.body.appendChild(A);A.style.position="absolute";A.style.zIndex=10;A.style.width=B.width+"px";A.style.height=B.height+"px";A.style.top=B.top+"px";A.style.left=B.left+"px";A.style.backgroundColor="#000000";YAHOO.util.Dom.setStyle(A,"opacity",0.5);this.dialog_overlay=A;return A};vB_Text_Editor.prototype.dialog_button_click_event=function(B){var A=YAHOO.util.Event.getTarget(B);this.dialog_submitted=(A&&YAHOO.util.Dom.hasClass(A,"dialog_submit_button"))};vB_Text_Editor.prototype.dialog_submit_event=function(B){var C=B.charCode?B.charCode:B.keyCode;if(typeof (C)!="undefined"&&C!=0){if(C==13){this.dialog_submitted=true}else{if(C==27){this.remove_editor_dialog()}else{return }}}var A=this.dialog_submitted;this.dialog_submitted=false;YAHOO.util.Event.stopEvent(B);if(A&&this.dialog_confirm_callback){this.dialog_confirm_callback.call(this,B)}else{this.remove_editor_dialog()}};vB_Text_Editor.prototype.remove_editor_dialog=function(){if(this.dialog){this.dialog.parentNode.removeChild(this.dialog);this.dialog=null}if(this.dialog_overlay){this.dialog_overlay.parentNode.removeChild(this.dialog_overlay);this.dialog_overlay=null}if(this.progress){this.progress.parentNode.removeChild(this.progress);this.progress=null}this.dialog_props={}};vB_Text_Editor.prototype.run_scripts_in_element=function(E){var B,D,G;var A=E.getElementsByTagName("script"),C=document.getElementsByTagName("head")[0];var F=A.length;for(D=0;D<F;D++){B=A[D];G=document.createElement("script");if(B.type){G.type=B.type}if(B.text){G.text=B.text}if(B.src){G.src=B.src}if(B.id){G.id=B.id}C.appendChild(G)}};vB_Text_Editor.prototype.move_css_in_element=function(C){var A=C.getElementsByTagName("link");var B=document.getElementsByTagName("head")[0];var E=A.length;for(i=0;i<E;i++){var D=A[i];link_tag=document.createElement("link");if(D.rel){link_tag.rel=D.rel}if(D.type){link_tag.type=D.type}if(D.href){link_tag.href=D.href}B.appendChild(link_tag);D.parentNode.removeChild(D)}};vB_Text_Editor.prototype.remove_activeimg=function(){if(this.activeimg){YAHOO.util.Dom.removeClass(this.activeimg,"previewthumbactive");this.activeimg=null;var C=YAHOO.util.Dom.getElementsByClassName("previewthumbedit","img",this.editdoc.body);var B=C.length;for(var A=0;A<B;A++){C[A].parentNode.removeChild(C[A])}}};vB_Text_Editor.prototype.resize_ie_body=function(){if(is_ie&&this.wysiwyg_mode){var B=this.editdoc.body.scrollHeight;var A=parseInt(YAHOO.util.Dom.getStyle(this.editdoc.body,"height"),10);var C=parseInt(YAHOO.util.Dom.getStyle(this.editbox,"height"),10);if(B<C){YAHOO.util.Dom.setStyle(this.editdoc.body,"height",C-6+"px")}else{YAHOO.util.Dom.setStyle(this.editdoc.body,"height",B-7+"px")}}};function vB_Text_Editor_Events(){}vB_Text_Editor_Events.prototype.smilie_onclick=function(A){vB_Editor[this.editorid].insert_smilie(A,this.alt,this.src,this.id.substr(this.id.lastIndexOf("_")+1));if(typeof smilie_window!="undefined"&&!smilie_window.closed){smilie_window.focus()}return false};vB_Text_Editor_Events.prototype.command_button_onmouseevent=function(A){A=do_an_e(A);if(A.type=="click"&&!YAHOO.util.Dom.hasClass(this.editorid+"_cmd_"+this.cmd,"imagebutton_disabled")){vB_Editor[this.editorid].format(A,this.cmd,false,true)}vB_Editor[this.editorid].button_context(this,A.type)};vB_Text_Editor_Events.prototype.formatting_select_onchange=function(B){var A=this.options[this.selectedIndex].value;if(A!=""){vB_Editor[this.editorid].format(B,this.cmd,A)}this.selectedIndex=0};vB_Text_Editor_Events.prototype.smilieselect_onchange=function(A){if(this.options[this.selectedIndex].value!=""){vB_Editor[this.editorid].insert_smilie(A,this.options[this.selectedIndex].value,this.options[this.selectedIndex].smiliepath,this.options[this.selectedIndex].smilieid)}this.selectedIndex=0};vB_Text_Editor_Events.prototype.attachselect_onchange=function(B){var A=this.options[this.selectedIndex].value;if(A!=""){vB_Editor[this.editorid].wrap_tags("attach",false,A)}this.selectedIndex=0};vB_Text_Editor_Events.prototype.attachselect_onmouseover=function(A){if(this.options.length<=2){vB_Editor[this.editorid].build_attachments_popup(this);return true}};vB_Text_Editor_Events.prototype.menuoption_onmouseevent=function(A){A=do_an_e(A);vB_Editor[this.editorid].button_context(this,A.type,"menu")};vB_Text_Editor_Events.prototype.formatting_option_onclick_font=function(A){vB_Editor[this.editorid].format(A,this.cmd,this.firstChild.innerHTML);YAHOO.vBulletin.vBPopupMenu.close_all()};vB_Text_Editor_Events.prototype.formatting_option_onclick_size=function(A){vB_Editor[this.editorid].format(A,this.cmd,this.firstChild.firstChild.innerHTML);YAHOO.vBulletin.vBPopupMenu.close_all()};vB_Text_Editor_Events.prototype.coloroption_onclick=function(C){var B=this.colorname;B=B.toLowerCase();if(B.indexOf("rgb")==0){var A=B.match(/^rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/);if(A){B=vB_Editor[this.editorid].translate_silly_hex((A[1]&255).toString(16),(A[2]&255).toString(16),(A[3]&255).toString(16))}else{B="#000000"}}YAHOO.util.Dom.setStyle(this.editorid+"_color_bar","background-color",B);vB_Editor[this.editorid].format(C,this.cmd,B);YAHOO.vBulletin.vBPopupMenu.close_all();YAHOO.util.Dom.get(this.editorid+"_color_bar").isinitialized=1};vB_Text_Editor_Events.prototype.colorout_onclick=function(C){if(typeof YAHOO.util.Dom.get(this.editorid+"_color_bar").isinitialized=="undefined"){return false}var B=YAHOO.util.Dom.getStyle(this.editorid+"_color_bar","background-color");B=B.toLowerCase();if(B.indexOf("rgb")==0){var A=B.match(/^rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/);if(A){B=vB_Editor[this.editorid].translate_silly_hex((A[1]&255).toString(16),(A[2]&255).toString(16),(A[3]&255).toString(16))}else{B="#000000"}}YAHOO.util.Event.stopEvent(C);vB_Editor[this.editorid].format(C,"forecolor",B);return false};vB_Text_Editor_Events.prototype.smilieoption_onclick=function(A){vB_Editor[this.editorid].button_context(this,"mouseout","menu");vB_Editor[this.editorid].insert_smilie(A,this.smilietext,fetch_tags(this,"img")[0].src,this.smilieid);YAHOO.vBulletin.vBPopupMenu.close_all()};vB_Text_Editor_Events.prototype.smiliemore_onclick=function(A){vB_Editor[this.editorid].open_smilie_window(smiliewindow_x,smiliewindow_y);YAHOO.vBulletin.vBPopupMenu.close_all()};vB_Text_Editor_Events.prototype.attachmanage_onclick=function(A){YAHOO.vBulletin.vBPopupMenu.close_all();if(typeof (vB_Attachments)!="undefined"){vB_Attachments.attachmanage()}};vB_Text_Editor_Events.prototype.attachoption_onclick=function(A){vB_Editor[this.editorid].button_context(this,"mouseout","menu");vB_Editor[this.editorid].wrap_tags("attach",false,this.attachmentid);YAHOO.vBulletin.vBPopupMenu.close_all()};vB_Text_Editor_Events.prototype.attachinsertall_onclick=function(C){var B="";var A=(vB_Editor[this.editorid].wysiwyg_mode?"<br /><br />":"\r\n\r\n");for(var D in vB_Attachments.attachments){if(YAHOO.lang.hasOwnProperty(vB_Attachments.attachments,D)){B+=B!=""?A:"";B+="[ATTACH]"+D+"[/ATTACH]"}}vB_Editor[this.editorid].insert_text(B);YAHOO.vBulletin.vBPopupMenu.close_all()};vB_Text_Editor_Events.prototype.smiliewindow_onunload=function(A){if(typeof smilie_window!="undefined"&&!smilie_window.closed){smilie_window.close()}};vB_Text_Editor_Events.prototype.editwin_onfocus=function(A){this.hasfocus=true};vB_Text_Editor_Events.prototype.editwin_onblur=function(A){this.hasfocus=false};vB_Text_Editor_Events.prototype.editdoc_onmousemove=function(G){var F=YAHOO.util.Event.getTarget(G);var A=YAHOO.util.Event.getRelatedTarget(G);try{if(YAHOO.util.Dom.hasClass(F,"previewthumbedit")||this.activeimg==F){if(YAHOO.util.Dom.hasClass(F,"previewthumbedit")){YAHOO.util.Dom.addClass(F,"previewthumbedithover")}return }}catch(G){this.remove_activeimg();return }this.remove_activeimg();if(YAHOO.util.Dom.hasClass(F,"previewthumb")){YAHOO.util.Dom.addClass(F,"previewthumbactive");var H=this.editdoc.body.appendChild(this.editdoc.createElement("img"));YAHOO.util.Dom.addClass(H,"previewthumbedit");var D=IMGDIR_MISC.match(/^https?:\/\//i);var C=D?IMGDIR_MISC:BBURL+"/"+IMGDIR_MISC;H.src=C+"/pencil.png";YAHOO.util.Dom.setStyle(H,"cursor","pointer");H.unselectable="on";H.contentEditable="false";YAHOO.util.Dom.setStyle(H,"-moz-user-select","none");var E=YAHOO.util.Dom.getXY(F);if(is_ie&&this.editdoc.dir=="rtl"){YAHOO.util.Dom.setY(H,E[1]);var B=this.editdoc.body.clientWidth;YAHOO.util.Dom.setStyle(H,"left",(0-(B-F.offsetLeft-F.width))+"px")}else{if(this.editdoc.dir=="rtl"){E[0]+=F.width-H.width}YAHOO.util.Dom.setXY(H,E)}this.activeimg=F}};vB_Text_Editor_Events.prototype.editdoc_ondragend=function(B){var A=YAHOO.util.Dom.getElementsByClassName("previewthumb","img",this.editdoc);var C=false;for(i=0;i<A.length;i++){if(C=PHP.stripos(A[i].src,"attachment.php")){A[i].src=A[i].src.substr(C)}}};vB_Text_Editor_Events.prototype.editdoc_onmousedown=function(B){var A=YAHOO.util.Event.getTarget(B);try{if(YAHOO.util.Dom.hasClass(A,"previewthumbedit")){YAHOO.util.Event.stopEvent(B)}}catch(B){return }};vB_Text_Editor_Events.prototype.editdoc_onclick=function(D){this.check_focus();var C=YAHOO.util.Event.getTarget(D);if(YAHOO.util.Dom.hasClass(C,"previewthumbedit")){this.create_editor_dialog('<img src="'+IMGDIR_MISC+'/lightbox_progress.gif" alt="" />',this.insertimagesettings_confirm);var A=this.activeimg.src.match(/attachmentid=(\d+)/i);var B=parseInt(A[1]);YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=fetchhtml_imagesettings",{success:this.insertimagesettings_ajax,failure:this.insertimagesettings_failure,timeout:vB_Default_Timeout,argument:[this.editorid],scope:this},SESSIONURL+"&securitytoken="+SECURITYTOKEN+"&ajax=1&do=fetchhtml_imagesettings&attachmentid="+B)}};vB_Text_Editor_Events.prototype.editdoc_onmouseup=function(A){vB_Editor[this.editorid].set_context();YAHOO.vBulletin.vBPopupMenu.close_all();vB_Editor[this.editorid].resize_ie_body()};vB_Text_Editor_Events.prototype.editdoc_onkeyup=function(A){vB_Editor[this.editorid].set_context();vB_Editor[this.editorid].resize_ie_body()};vB_Text_Editor_Events.prototype.editdoc_onkeypress=function(C){if(!C){C=window.event}if(C.ctrlKey&&!C.altKey){if(vB_Editor[this.editorid].allowbasicbbcode==false){return }var A=C.charCode?C.charCode:C.keyCode;var B;switch(String.fromCharCode(A).toLowerCase()){case"b":B="bold";break;case"i":B="italic";break;case"u":B="underline";break;default:return }C=do_an_e(C);vB_Editor[this.editorid].apply_format(B,false,null);return false}else{if(C.keyCode==9){if(C.shiftKey||(C.modifiers&&(C.modifiers&4))){return }if(is_opera){return }if(fetch_object("tag_add_input")!=null){fetch_object("tag_add_input").focus()}else{if(fetch_object("rb_iconid_0")!=null){fetch_object("rb_iconid_0").focus()}else{if(fetch_object(this.editorid+"_save")!=null){fetch_object(this.editorid+"_save").focus()}else{if(fetch_object("qr_submit")!=null){fetch_object("qr_submit").focus()}else{return }}}}C=do_an_e(C);return }}};vB_Text_Editor_Events.prototype.editdoc_onresizestart=function(A){if(A.srcElement.tagName=="IMG"){return false}};function save_iframe_to_textarea(){for(var A in vB_Editor){if(!YAHOO.lang.hasOwnProperty(vB_Editor,A)){continue}if(vB_Editor[A].wysiwyg_mode&&vB_Editor[A].initialized){vB_Editor[A].textobj.value=vB_Editor[A].get_editor_contents()}}}if(window.attachEvent){window.attachEvent("onbeforeunload",save_iframe_to_textarea)}else{if(window.addEventListener){window.addEventListener("unload",save_iframe_to_textarea,true)}}function switch_editor_mode(A){if(AJAX_Compatible){if(vB_Editor[A].influx==1){return }else{vB_Editor[A].influx=1}YAHOO.vBulletin.vBPopupMenu.close_all();vB_Editor[A].switch_editor_ajax()}}function do_switch_editor_mode(H){if(H.responseXML){var A=H.argument[0];var B=vB_Editor[A].parsetype;var F=vB_Editor[A].parsesmilies;var I=vB_Editor[A].ajax_extra;vB_Editor[A].destroy();var G=H.responseXML.getElementsByTagName("message")[0];if(typeof G!="undefined"){G=G.firstChild}var C=(G?G.nodeValue:"");var E=C.match(/&#([0-9]+);/g);if(E){for(var D=0;typeof E[D]!="undefined";D++){if(submatch=E[D].match(/^&#([0-9]+);$/)){C=C.replace(submatch[0],String.fromCharCode(submatch[1]))}}}vB_Editor[A]=vB_Editor[A].recreate_editor(A,H.argument[1],B,F,C,I,vB_Editor[A].content);vB_Editor[A].check_focus();fetch_object(A+"_mode").value=H.argument[1];custom_editor_events.editor_switch.fire(vB_Editor[A])}}var contextcontrols=new Array("bold","italic","underline","justifyleft","justifycenter","justifyright","insertorderedlist","insertunorderedlist");function vB_History(){this.cursor=-1;this.stack=new Array()}vB_History.prototype.move_cursor=function(A){var B=this.cursor+A;if(B>=0&&this.stack[B]!=null&&typeof this.stack[B]!="undefined"){this.cursor+=A}};vB_History.prototype.add_snapshot=function(A){if(this.stack[this.cursor]==A){return }else{this.cursor++;this.stack[this.cursor]=A;if(typeof this.stack[this.cursor+1]!="undefined"){this.stack[this.cursor+1]=null}}};vB_History.prototype.get_snapshot=function(){if(typeof this.stack[this.cursor]!="undefined"&&this.stack[this.cursor]!=null){return this.stack[this.cursor]}else{return false}};
;/************************************************************************\
 *
 * VaultWiki
 * Version CES_VERSION
 *
 * CES_VAULT_COPYRIGHT
 *
\************************************************************************/

/**
* Initialize AJAX post editing
*
* @param	mixed	ID of element (or actual element) containing postbits
*/
function vB_AJAX_QuickSection_Init(postobj)
{
	if (AJAX_Compatible)
	{
		if (typeof postobj == 'string')
		{
			vB_QuickSection.qe_obj = postobj;
			postobj = fetch_object(postobj);
		}

		var anchors = fetch_tags(postobj, 'a');
		vB_QuickSection.postanchors = anchors;

		for (var i = 0; i < anchors.length; i++)
		{
			if (anchors[i].name && anchors[i].name.indexOf('vB::QuickSection::') != -1)
			{
				anchors[i].onclick = vB_AJAX_QuickSection_Events.prototype.editbutton_click;
			}
		}
	}
}

// #############################################################################
// vB_AJAX_QuickSection
// #############################################################################

/**
* Class to allow quick editing of posts within postbit via AJAX
*/
function vB_AJAX_QuickSection()
{
	this.ajax_load_url = null;
	this.postid = null;
	this.sectid = null;
	this.objid = null;
	this.messageobj = null;
	this.container = null;
	this.originalhtml = null;
	this.editstate = false;
	this.editorcounter = 0;
	this.ajax_req = null;
	this.show_advanced = true;
	this.postanchors = null;
	this.qe_obj = '';
}

// =============================================================================
// vB_AJAX_QuickSection methods

/**
* Check if the AJAX system is ready for us to proceed
*
* @return	boolean
*/
vB_AJAX_QuickSection.prototype.ready = function()
{
	if (this.editstate || YAHOO.util.Connect.isCallInProgress(this.ajax_req))
	{
		return false;
	}
	else
	{
		return true;
	}
};

/**
* Prepare to edit a single post
*
* @param	string	Name attribute of clicked link - takes the form of 'vB::QuickSection::$postid:$sectionid'
*
* @return	boolean
*/
vB_AJAX_QuickSection.prototype.edit = function(anchor_name)
{
	if (typeof vb_disable_ajax != 'undefined' && vb_disable_ajax > 0)
	{
		// couldn't initialize, return true to allow click to go through
		return true;
	}

	this.qe_obj = '';
	var q;

	for (var i in section_holders)
	{
		var holder = YAHOO.util.Dom.get(section_holders[i]);
		if (!holder)
		{
			continue;
		}

		var holden = holder.getElementsByTagName("a");
		if (!holden)
		{
			continue;
		}

		for (q = 0; q < holden.length; q++)
		{
			if (holden[q].name == anchor_name)
			{
				this.qe_obj = holder.id;
				break;
			}
		}

		if (this.qe_obj != '')
		{
			break;
		}
	}
	
	if (this.qe_obj == '')
	{
		return true;
	}

	if (
		this.qe_obj == "forum_header" ||
		typeof vB_WikiTabs != "object" ||
		typeof vB_WikiTabs[tab_container] != "object"
	)
	{
		// ajax url not set
		this.splitter = ajax_load_url[this.qe_obj].indexOf("?") != -1 ? "?" : "&";
		this.ajax_load_url = ajax_load_url[this.qe_obj].split(this.splitter);
		this.ajax_load_url[1] = this.ajax_load_url[1].replace(/\{(\d+)(:\w+)?\}/gi, '%$1$s');
	}
	else
	{
		this.splitter = vB_WikiTabs[tab_container].splitter;
		this.ajax_load_url = vB_WikiTabs[tab_container].ajax_load_url;
	}

	for (var i = 0; i < this.postanchors.length; i++)
	{
		if (this.postanchors[i].name && this.postanchors[i].name.indexOf('vB::QuickSection::') != -1)
		{
			this.postanchors[i].onclick = '';
		}
	}

	var tmppostid = anchor_name.substr(anchor_name.lastIndexOf('::') + 2);
	var tmpsectid = tmppostid;

	tmpsectid = tmpsectid.substr(tmppostid.lastIndexOf(':') + 1);
	tmppostid = tmppostid.substring(0, tmppostid.lastIndexOf(':'));

	if (YAHOO.util.Connect.isCallInProgress(this.ajax_req))
	{
		// something is waiting to complete
		return false;
	}
	else if (!this.ready())
	{
		if (this.postid == tmppostid)
		{
			this.full_edit();
			return false;
		}
		this.abort();
	}

	this.editorcounter++;
	this.editorid = 'vB_Editor_QE_' + this.editorcounter;

	this.postid = tmppostid;
	this.sectid = tmpsectid;

	this.objid = 'collapseobj_' + this.postid + '_' + this.sectid;
	this.messageobj = fetch_object(this.objid);
	this.originalhtml = this.messageobj.innerHTML;

	this.unchanged = null;
	this.unchanged_reason = null;

	this.fetch_editor();
	this.editstate = true;

	return false;
};

/**
* Send an AJAX request to fetch the editor HTML
*/
vB_AJAX_QuickSection.prototype.fetch_editor = function()
{
	document.body.style.cursor = 'wait';

	YAHOO.util.Connect.asyncRequest("POST", "ajax.php?do=quickedit&p=" + this.postid + "&section=" + this.sectid,
	{
		success: this.display_editor,
		failure: this.error_opening_editor,
		timeout: 15000,
		scope: this
	}, SESSIONURL
		+ 'do=quickedit&p=' + this.postid
		+ '&section=' + this.sectid
		+ '&securitytoken=' + PHP.urlencode(SECURITYTOKEN)
		+ '&editorid=' + PHP.urlencode(this.editorid)
		+ '&fromheader=' + (this.qe_obj == "forum_header" ? 1 : 0));
};

/**
* Handle unspecified AJAX server error when opening editor - opens full editor
*
* @param	object	YUI AJAX
*/
vB_AJAX_QuickSection.prototype.error_opening_editor = function(ajax)
{
	vBulletin_AJAX_Error_Handler(ajax);

	window.location = this.ajax_load_url[0] + this.splitter + construct_phrase(this.ajax_load_url[1], "edit") + "&section=" + this.sectid;
}

/**
* Handle unspecified AJAX server error when saving
*
* @param	object	YUI AJAX
*/
vB_AJAX_QuickSection.prototype.handle_save_error = function(ajax)
{
	vBulletin_AJAX_Error_Handler(ajax);
	
	this.show_advanced = false;
	this.full_edit();
}

/**
* Display the editor HTML when AJAX says fetch_editor() is ready
*
* @param	object	YUI AJAX
*
* @return	boolean
*/
vB_AJAX_QuickSection.prototype.display_editor = function(ajax)
{
	if (ajax.responseXML)
	{
		document.body.style.cursor = 'auto';

		var failUrl = this.ajax_load_url[0] + this.splitter + construct_phrase(this.ajax_load_url[1], "edit") + "&section=" + this.sectid;
		if (fetch_tag_count(ajax.responseXML, 'disabled'))
		{
			// this will fire if quick edit has been disabled after the showthread page is loaded
			window.location = failUrl;
		}
		else if (fetch_tag_count(ajax.responseXML, 'error'))
		{
			// do nothing
		}
		else
		{
			var editor = fetch_tags(ajax.responseXML, 'editor')[0];

			if (typeof editor == 'undefined')
			{
				window.location = failUrl;
			}

			var reason = editor.getAttribute('reason');

			// display the editor
			this.messageobj.innerHTML = editor.firstChild.nodeValue;

			// display the reason
			var reasonfield = YAHOO.util.Dom.get(this.editorid + '_edit_reason');
			if (reasonfield)
			{
				this.unchanged_reason = PHP.unhtmlspecialchars(reason);
				reasonfield.value = this.unchanged_reason;
				reasonfield.onkeypress = vB_AJAX_QuickSection_Events.prototype.reason_key_trap;
			}

			// initialize the editor
			vB_Editor[this.editorid] = new vB_Text_Editor(
				this.editorid,
				editor.getAttribute('mode'),
				editor.getAttribute('parsetype'),
				editor.getAttribute('parsesmilies')
			);

			if (!VAULT_40X_COMPAT)
			{
				vB_Editor[this.editorid].set_editor_width('99%', true);
			}

			var cureditor = YAHOO.util.Dom.get(this.editorid + '_editor');
			var curmsg = YAHOO.util.Dom.get(this.editorid + '_textarea');

			if (cureditor)
			{
				if (!VAULT_40X_COMPAT && !is_ie)
				{
					YAHOO.util.Dom.addClass(cureditor, "QuickSection");
				}

				YAHOO.util.Dom.setStyle(curmsg, "width", (VAULT_40X_COMPAT ? "100%" : "99%"));

				var edithead = YAHOO.util.Dom.getElementsBy(function(e)
				{
					if (e && e.name && e.name == "vB::QuickSection::" + vB_QuickSection.postid + ":" + vB_QuickSection.sectid)
					{
						return true;
					}

					return false;
				}, "a")[0];

				if (edithead)
				{
					// link.span.hX
					edithead = edithead.parentNode.parentNode;
					if (edithead.scrollIntoView)
					{
						edithead.scrollIntoView(true);
					}

					if (
						vB_Section &&
						YAHOO.util.Dom.getStyle("collapseobj_" + vB_QuickSection.postid + "_" + vB_QuickSection.sectid, "display") == "none"
					)
					{
						vB_Section.toggle(vB_QuickSection.postid, vB_QuickSection.sectid);
					}
				}
			}

			vB_Editor[this.editorid].check_focus();
			this.unchanged = vB_Editor[this.editorid].get_editor_contents();

			fetch_object(this.editorid + '_save').onclick = this.save;
			fetch_object(this.editorid + '_abort').onclick = this.abort;
			fetch_object(this.editorid + '_adv').onclick = this.full_edit;
		}
	}

	return false;
};

/**
* Destroy the editor, and use the specified text as the post contents
*
* @param	ajax	Quick edit response
* @param	string	Type of restore
*/
vB_AJAX_QuickSection.prototype.restore = function(ajax_response, type)
{
	this.hide_errors(true);
	if (this.editorid && vB_Editor[this.editorid] && vB_Editor[this.editorid].initialized)
	{
		vB_Editor[this.editorid].destroy();
	}

	if (type == 'tableobj')
	{
		// usually called when message is saved
		var failUrl = vB_QuickSection.ajax_load_url[0] + this.splitter + vB_QuickSection.ajax_load_url[1].split("&do")[0];
		if (!ajax_response)
		{
			window.location = failUrl;
		}

		var tab_id;
		var articleResponse = fetch_tags(ajax_response, "article")[0];
		var articleId = fetch_tags(ajax_response, "url")[0];

		if (!articleResponse || !articleId)
		{
			window.location = failUrl;
		}

		var tabId = articleResponse.getAttribute("tab_id");
		if (!tabId)
		{
			window.location = failUrl;
		}

		if (tabId == "forum_header")
		{
			var collapseobj = YAHOO.util.Dom.get(tabId);
		}
		else
		{
			var collapseobj = YAHOO.util.Dom.get("collapseobj_" + tabId);
		}

		if (!collapseobj)
		{
			window.location = failUrl;
		}

		var threadurl = articleId.firstChild.nodeValue.replace(/\{(\d+)(:\w+)?\}/gi, '%$1$s');
		if (!threadurl)
		{
			window.location = failUrl;
		}

		if (tabId == "forum_header")
		{
			collapseobj.parentNode.innerHTML = articleResponse.firstChild.nodeValue;
			collapseobj = YAHOO.util.Dom.get(tabId).parentNode;
		}
		else
		{
			vB_ResetHandle.parseRedirect(ajax_response, threadurl);
			collapseobj = YAHOO.util.Dom.get("collapseobj_" + tabId);
		}

		vB_ResetHandle.parseScript(collapseobj, fetch_tags(ajax_response, "popups")[0]);
	}
	else
	{
		// usually called when message edit is cancelled
		this.messageobj.innerHTML = ajax_response;
	}

	vB_QuickSection.Section_Init(fetch_object(vB_QuickSection.qe_obj));

	this.editstate = false;
};

/**
* Cancel the post edit and restore everything to how it started
*
* @param	event	Event object
*/
vB_AJAX_QuickSection.prototype.abort = function(e)
{
	document.body.style.cursor = 'auto';
	vB_QuickSection.restore(vB_QuickSection.originalhtml, 'messageobj');
};

/**
* Pass the edits along to the full editpost.php interface
*
* @param	event	Event object
*/
vB_AJAX_QuickSection.prototype.full_edit = function(e)
{
	var form = new vB_Hidden_Form(vB_QuickSection.ajax_load_url[0] + vB_QuickSection.splitter + construct_phrase(vB_QuickSection.ajax_load_url[1], "edit") + "&section=" + vB_QuickSection.sectid);

	form.add_variable('action', 'updatepost');
	form.add_variable('s', fetch_sessionhash());

	if (vB_QuickSection.show_advanced)
	{
		form.add_variable('advanced', 1);
	}
	else
	{
		// a quick edit, but not an ajax quick edit
		form.add_variable('quickeditnoajax', 1);
	}

	form.add_variable('section', vB_QuickSection.sectid);
	form.add_variable('securitytoken', SECURITYTOKEN);
	form.add_variable('wysiwyg', vB_Editor[vB_QuickSection.editorid].wysiwyg_mode);
	form.add_variable('message', vB_Editor[vB_QuickSection.editorid].get_editor_contents());
	form.add_variable('minor', (fetch_object(vB_QuickSection.editorid + '_minor').checked ? 1 : 0));
	form.add_variable('reason', fetch_object(vB_QuickSection.editorid + '_edit_reason').value);
	form.add_variable('poststarttime', fetch_object(vB_QuickSection.editorid + '_starttime').value);

	form.submit_form();
};

/**
* Save the edited post via AJAX
*
* @param	event	Event object
*/
vB_AJAX_QuickSection.prototype.save = function(e)
{
	var newtext = vB_Editor[vB_QuickSection.editorid].get_editor_contents();
	var newreason = vB_Editor[vB_QuickSection.editorid];

	if (newtext == vB_QuickSection.unchanged && newreason == vB_QuickSection.unchanged_reason)
	{
		vB_QuickSection.abort(e);
	}
	else
	{
		fetch_object(vB_QuickSection.editorid + '_posting_msg').style.display = '';
		document.body.style.cursor = 'wait';

		pc_obj = fetch_object('postcount' + vB_QuickSection.postid);

		this.ajax_req = YAHOO.util.Connect.asyncRequest("POST", vB_QuickSection.ajax_load_url[0] + vB_QuickSection.splitter + construct_phrase(vB_QuickSection.ajax_load_url[1], "edit"), {
			success: vB_QuickSection.update,
			failure: vB_QuickSection.handle_save_error,
			timeout: 15000,
			scope: vB_QuickSection
		}, construct_phrase(vB_QuickSection.ajax_load_url[1], "edit")
			+ "&action=updatepost&ajax=1"
			+ '&section=' + vB_QuickSection.sectid
			+ '&wysiwyg=' + vB_Editor[vB_QuickSection.editorid].wysiwyg_mode
			+ '&message=' + PHP.urlencode(newtext)
			+ '&securitytoken=' + PHP.urlencode(SECURITYTOKEN)
			+ '&minor=' + (fetch_object(vB_QuickSection.editorid + '_minor').checked ? 1 : 0)
			+ '&reason=' + PHP.urlencode(fetch_object(vB_QuickSection.editorid + '_edit_reason').value)
			+ '&poststarttime=' + PHP.urlencode(fetch_object(vB_QuickSection.editorid + '_starttime').value)
			+ (pc_obj != null ? '&postcount=' + PHP.urlencode(pc_obj.name) : '')
			+ '&fromheader=' + (vB_QuickSection.qe_obj == "forum_header" ? 1 : 0)
		);

		vB_QuickSection.pending = true;
	}
};

/**
* Check for errors etc. and initialize restore when AJAX says save() is complete
*
* @param	object	YUI AJAX
*
* @return	boolean	false
*/
vB_AJAX_QuickSection.prototype.update = function(ajax)
{
	if (ajax.responseXML)
	{
		vB_QuickSection.pending = false;
		document.body.style.cursor = 'auto';
		fetch_object(vB_QuickSection.editorid + '_posting_msg').style.display = 'none';

		// this is the nice error handler, of which Safari makes a mess
		if (fetch_tag_count(ajax.responseXML, 'error'))
		{
			var errors = fetch_tags(ajax.responseXML, 'error');

			var error_html = '<ol>';
			for (var i = 0; i < errors.length; i++)
			{
				error_html += '<li>' + errors[i].firstChild.nodeValue + '</li>';
			}
			error_html += '</ol>';

			vB_QuickSection.show_errors('<ol>' + error_html + '</ol>');
		}
		else
		{
			if (vB_ResetHandle)
			{
				vB_QuickSection.restore(ajax.responseXML, 'tableobj');
			}
			else
			{
				window.location = vB_QuickSection.ajax_load_url[0] + vB_QuickSection.splitter + vB_QuickSection.ajax_load_url[1].split("&do")[0];
			}
		}
	}

	return false;
};

/**
* Pop up a window showing errors
*
* @param	string	Error HTML
*/
vB_AJAX_QuickSection.prototype.show_errors = function(errortext)
{
	// add the 'unselectable' attribute to the ajax errors close button
	set_unselectable('ajax_wiki_errors_closebtn');

	YAHOO.util.Dom.get('ajax_wiki_errors_message').innerHTML = errortext;
	var errortable = YAHOO.util.Dom.get('ajax_wiki_errors');
	var measurer = (is_saf ? 'body' : 'documentElement');
	errortable.style.left = (is_ie ? document.documentElement.clientWidth : self.innerWidth) / 2 - 200 + document[measurer].scrollLeft + 'px';
	errortable.style.top = (is_ie ? document.documentElement.clientHeight : self.innerHeight) / 2 - 150 + document[measurer].scrollTop + 'px';

	if (VAULT_40X_COMPAT)
	{
		YAHOO.util.Dom.removeClass(errortable, "hidden");
	}
	else
	{
		errortable.style.width = '400px';
		errortable.style.zIndex = 500;
		errortable.style.display = '';
	}
};

/**
* Hide the error window
*/
vB_AJAX_QuickSection.prototype.hide_errors = function(skip_focus_check)
{
	this.errors = false;

	if (VAULT_40X_COMPAT)
	{
		YAHOO.util.Dom.addClass("ajax_wiki_errors", "hidden");
	}
	else
	{
		YAHOO.util.Dom.get("ajax_wiki_errors").style.display = 'none';
	}

	if (skip_focus_check != true)
	{
		vB_Editor[this.editorid].check_focus();
	}
};

// =============================================================================
// vB_AJAX_QuickSection Event Handlers

/**
* Class to handle quick editor events
*/
function vB_AJAX_QuickSection_Events()
{
}

/**
* Handles clicks on edit buttons of postbits
*/
vB_AJAX_QuickSection_Events.prototype.editbutton_click = function(e)
{
	return vB_QuickSection.edit(this.name);
};

/**
* Key trapper for reason box
*/
vB_AJAX_QuickSection_Events.prototype.reason_key_trap = function(e)
{
	e = e ? e : window.event;

	switch (e.keyCode)
	{
		case 9: // tab
		{
			YAHOO.util.Dom.get(vB_QuickSection.editorid + '_save').focus();
			return false;
		}
		break;

		case 13: // enter
		{
			vB_QuickSection.save();
			return false;
		}
		break;

		default:
		{
			return true;
		}
	}
}

/**
* This function runs all the necessary Javascript code on a PostBit
* after it has been loaded via AJAX. Don't use this method before a
* complete page load or you'll have problems.
*
* @param	object	Object containing postbits
*/
vB_AJAX_QuickSection.prototype.Section_Init = function(obj)
{
	console.log("Section Init: %d", this.postid + '-' + this.sectid);

	if (VAULT_40X_COMPAT)
	{
		YAHOO.vBulletin.vBPopupMenu.instrument(obj);
	}

	if (typeof vB_QuickSection != 'undefined')
	{
		// init quick edit controls
		vB_AJAX_QuickSection_Init(obj);
	}

	if (typeof vB_Lightbox != 'undefined')
	{
		init_postbit_lightbox(obj);
	}

	child_img_alt_2_title(obj);
};

// #############################################################################
// initialize the editor class

var vB_QuickSection = new vB_AJAX_QuickSection();
var section_holders = [];

/* License Box */
;/************************************************************************\
 *
 * CES Vault Wiki
 * Version CES_VERSION
 *
 * CES_VAULT_COPYRIGHT
 *
\************************************************************************/

// #############################################################################
// vB_ResetHandler
// #############################################################################
function vB_ResetHandler()
{
	// handles adding of JS and CSS
};

/**
* Process HTML after a redirect
*
* @param	ajax	response
* @param	string	article URL
*
* @return	boolean	false
*/
vB_ResetHandler.prototype.parseRedirect = function(ajax_response, thread_url)
{
	var splitter = thread_url.indexOf('?') != -1 ? '?' : '&';
	var tabResponse = fetch_tags(ajax_response, "tabs")[0];

	if (!tabResponse || !tabResponse.firstChild)
	{
		return false;
	}

	this.insertPoll(ajax_response);

	// we had an article redirect, destroy all tabs
	YAHOO.util.Dom.get(tab_container).innerHTML = tabResponse.firstChild.nodeValue;

	var articleResponse = fetch_tags(ajax_response, "article")[0];

	if (!articleResponse || !articleResponse.firstChild)
	{
		return false;
	}

	var tabId = articleResponse.getAttribute("tab_id");
	YAHOO.util.Dom.get("collapseobj_" + tabId).innerHTML = articleResponse.firstChild.nodeValue;

	// re-init tabs in case permissions or article status changed
	ajax_load_url[tab_container] = thread_url;

	if (vB_WikiTabs)
	{
		if (vB_WikiTabs[tab_container] && vB_WikiTabs[tab_container].overflow_tab)
		{
			var overflow_html = vB_WikiTabs[tab_container].overflow_tab.innerHTML;
		}
		else
		{
			var overflow_html = "&raquo;";
		}

		vB_WikiTabs[tab_container] = new vB_WikiTab(tab_container, tabId, overflow_html);
	}

	return false;
};

/**
* Dynamically parses Javascript
*
* @param	object	tab
* @param	object	popups
*
* @return	boolean	false
*/
vB_ResetHandler.prototype.parseScript = function(cobj, popups)
{
	var dropdowns = cobj.getElementsByTagName("script");

	var tabId = cobj.getAttribute("id");
	if (tabId != "forum_header")
	{
		tabId = tabId.split("collapseobj_")[1];
	}

	if (popups)
	{
		var existpop = YAHOO.util.Dom.get("popups_" + tabId);
		if (existpop)
		{
			existpop.parentNode.removeChild(existpop);
		}

		if (popups.firstChild)
		{
			var popdiv = document.createElement("div");
			popdiv.setAttribute("id", "popups_" + tabId);
			popdiv.innerHTML = popups.firstChild.nodeValue;
			document.body.appendChild(popdiv);

			// dropdowns.concat doesn't work?!
			var drop2 = popdiv.getElementsByTagName("script");
			if (drop2.length)
			{
				for (var p = 0; p < drop2.length; p++)
				{
					dropdowns[dropdowns.length] = drop2[p];
				}
			}
		}
	}

	if (dropdowns.length)
	{
		var i, dropHTML;
		for (var i = 0; i < dropdowns.length; i++)
		{
			if (dropdowns[i].getAttribute("type") != "text/javascript")
			{
				continue;
			}

			if (dropdowns[i].getAttribute("src"))
			{
				this.include(dropdowns[i].getAttribute("src"));
			}
			else if (dropdowns[i].innerHTML)
			{
				if (typeof PHP != "object")
				{
					return false;
				}

				dropHTML = PHP.trim(dropdowns[i].innerHTML);

				if (dropHTML.substring(0, 4) == "<!--")
				{
					dropHTML = dropHTML.substring(4);
				}

				this.eval(dropdowns[i], dropHTML);
			}
		}
	}

	return false;
};

/**
* Dynamically includes a Javascript file
*
* @param	string	javascript HTTP-path
*
* @return	boolean	false
*/
vB_ResetHandler.prototype.include = function(scriptpath)
{
	var oXML = this.getXMLHttpObj();

	if (!oXML || !scriptpath)
	{
		return false;
	}

	oXML.open("GET", scriptpath, false);
	oXML.send("");

	if (window.execScript)
	{
		window.execScript(oXML.responseText);
	}
	else
	{
		window.eval(oXML.responseText);	
	}

	return false;
};

/**
* Fetch the request object for a JS include.
*
* @return	object	XMLHttpRequest || ActiveXObject
*/
vB_ResetHandler.prototype.getXMLHttpObj = function()
{
	if (typeof XMLHttpRequest != "undefined")
	{
		return new XMLHttpRequest();
	}

	var i,
		axO = [
			'Msxml2.XMLHTTP.6.0',
			'Msxml2.XMLHTTP.3.0',
			'Msxml2.XMLHTTP',
			'Microsoft.XMLHTTP'
		];

	for (i = 0; i < axO.length; i++)
	{
		try
		{
			return new ActiveXObject(axO[i]);
		}

		catch (e)
		{
		}
	}

	return null;
};

/**
* Add stylesheets for new tabs.
* IMPORTANT: Only use absolute URLs in @imports!
*
* @param	string	CSS Text
*/
vB_ResetHandler.prototype.appendCSS = function(insertStyle)
{
	if (!YAHOO.util.Dom.get("vw-custom"))
	{
		var style2 = document.createElement("style");
		style2.id = "vw-custom";
		style2.type = "text/css";

		if (style2.styleSheet && is_ie)
		{
			var importPaths;

			while (importPaths = insertStyle.match(/@import url\(\"(.*)\"\);/))
			{
				document.styleSheets[document.styleSheets.length - 1].addImport(importPaths[1]);
				insertStyle = insertStyle.replace(importPaths[0], '');
			}

			style2.styleSheet.cssText = insertStyle;
		}
		else
		{
			style2.appendChild(document.createTextNode(insertStyle));
		}

		document.getElementsByTagName("head")[0].appendChild(style2);
	}
};

/*
* Insert the HTML for a poll.
*
* @param	ajax	response
*/
vB_ResetHandler.prototype.insertPoll = function(ajax_response)
{
	var pollResponse = fetch_tags(ajax_response, "poll")[0];
	if (pollResponse)
	{
		var pollobj = YAHOO.util.Dom.get("collapseobj_ca-poll");
		if (pollobj)
		{
			pollobj.innerHTML = (pollResponse.firstChild ? pollResponse.firstChild.nodeValue : "");
		}
	}
};

vB_ResetHandler.prototype.eval = function(obj, src)
{
	window.resetObj = obj;

    if (window.execScript)
	{
        window.execScript(src);
        return;
    }

    var fn = function()
	{
        window.eval.call(window, src);
    };

    fn();

	window.resetObj = null;
};

document.writeOrig = document.write;

document.write = function(src)
{
	if (window.resetObj)
	{
		var dummy = document.createElement("div");
		dummy.innerHTML = src;

		if (dummy.hasChildNodes())
		{
			for (var cn = 0; cn < dummy.childNodes.length; cn++)
			{
				YAHOO.util.Dom.insertBefore(dummy.childNodes[cn], window.resetObj);
			}
		}
	}
	else
	{
		document.writeOrig(src);
	}
};

// #############################################################################
// initialize the resetter

var vB_ResetHandle = new vB_ResetHandler();

/* License Box */