if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var F=arguments,G=null,I,J,H;for(I=0;I<F.length;I=I+1){H=F[I].split(".");G=YAHOO;for(J=(H[0]=="YAHOO")?1:0;J<H.length;J=J+1){G[H[J]]=G[H[J]]||{};G=G[H[J]]}}return G};YAHOO.log=function(F,E,G){var H=YAHOO.widget.Logger;if(H&&H.log){return H.log(F,E,G)}else{return false}};YAHOO.register=function(M,R,J){var N=YAHOO.env.modules;if(!N[M]){N[M]={versions:[],builds:[]}}var L=N[M],O=J.version,P=J.build,Q=YAHOO.env.listeners;L.name=M;L.version=O;L.build=P;L.versions.push(O);L.builds.push(P);L.mainClass=R;for(var K=0;K<Q.length;K=K+1){Q[K](L)}if(R){R.VERSION=O;R.BUILD=P}else{YAHOO.log("mainClass is undefined for module "+M,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(B){return YAHOO.env.modules[B]||null};YAHOO.env.ua=function(){var E={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var F=navigator.userAgent,D;if((/KHTML/).test(F)){E.webkit=1}D=F.match(/AppleWebKit\/([^\s]*)/);if(D&&D[1]){E.webkit=parseFloat(D[1]);if(/ Mobile\//.test(F)){E.mobile="Apple"}else{D=F.match(/NokiaN[^\/]*/);if(D){E.mobile=D[0]}}D=F.match(/AdobeAIR\/([^\s]*)/);if(D){E.air=D[0]}}if(!E.webkit){D=F.match(/Opera[\s\/]([^\s]*)/);if(D&&D[1]){E.opera=parseFloat(D[1]);D=F.match(/Opera Mini[^;]*/);if(D){E.mobile=D[0]}}else{D=F.match(/MSIE\s([^;]*)/);if(D&&D[1]){E.ie=parseFloat(D[1])}else{D=F.match(/Gecko\/([^\s]*)/);if(D){E.gecko=1;D=F.match(/rv:([^\s\)]*)/);if(D&&D[1]){E.gecko=parseFloat(D[1])}}}}}return E}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var H=YAHOO_config.listener,E=YAHOO.env.listeners,F=true,G;if(H){for(G=0;G<E.length;G=G+1){if(E[G]==H){F=false;break}}if(F){E.push(H)}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(D){if(D){var C=YAHOO.lang;return C.isNumber(D.length)&&C.isFunction(D.splice)}return false},isBoolean:function(B){return typeof B==="boolean"},isFunction:function(B){return typeof B==="function"},isNull:function(B){return B===null},isNumber:function(B){return typeof B==="number"&&isFinite(B)},isObject:function(B){return(B&&(typeof B==="object"||YAHOO.lang.isFunction(B)))||false},isString:function(B){return typeof B==="string"},isUndefined:function(B){return typeof B==="undefined"},hasOwnProperty:function(C,D){if(Object.prototype.hasOwnProperty){return C.hasOwnProperty(D)}return !YAHOO.lang.isUndefined(C[D])&&C.constructor.prototype[D]!==C[D]},_IEEnumFix:function(K,L){if(YAHOO.env.ua.ie){var I=["toString","valueOf"],G;for(G=0;G<I.length;G=G+1){var H=I[G],J=L[H];if(YAHOO.lang.isFunction(J)&&J!=Object.prototype[H]){K[H]=J}}}},extend:function(H,G,I){if(!G||!H){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.")}var J=function(){};J.prototype=G.prototype;H.prototype=new J();H.prototype.constructor=H;H.superclass=G.prototype;if(G.prototype.constructor==Object.prototype.constructor){G.prototype.constructor=G}if(I){for(var F in I){H.prototype[F]=I[F]}YAHOO.lang._IEEnumFix(H.prototype,I)}},augmentObject:function(I,J){if(!J||!I){throw new Error("Absorb failed, verify dependencies.")}var G=arguments,K,H,L=G[2];if(L&&L!==true){for(K=2;K<G.length;K=K+1){I[G[K]]=J[G[K]]}}else{for(H in J){if(L||!I[H]){I[H]=J[H]}}YAHOO.lang._IEEnumFix(I,J)}},augmentProto:function(F,G){if(!G||!F){throw new Error("Augment failed, verify dependencies.")}var E=[F.prototype,G.prototype];for(var H=2;H<arguments.length;H=H+1){E.push(arguments[H])}YAHOO.lang.augmentObject.apply(this,E)},dump:function(N,R){var L=YAHOO.lang,K,S,P=[],O="{...}",M="f(){...}",Q=", ",T=" => ";if(!L.isObject(N)){return N+""}else{if(N instanceof Date||("nodeType" in N&&"tagName" in N)){return N}else{if(L.isFunction(N)){return M}}}R=(L.isNumber(R))?R:3;if(L.isArray(N)){P.push("[");for(K=0,S=N.length;K<S;K=K+1){if(L.isObject(N[K])){P.push((R>0)?L.dump(N[K],R-1):O)}else{P.push(N[K])}P.push(Q)}if(P.length>1){P.pop()}P.push("]")}else{P.push("{");for(K in N){if(L.hasOwnProperty(N,K)){P.push(K+T);if(L.isObject(N[K])){P.push((R>0)?L.dump(N[K],R-1):O)}else{P.push(N[K])}P.push(Q)}}if(P.length>1){P.pop()}P.push("}")}return P.join("")},substitute:function(V,T,c){var f,g,h,Z,Y,W,R=YAHOO.lang,a=[],S,e="dump",b=" ",U="{",X="}";for(;;){f=V.lastIndexOf(U);if(f<0){break}g=V.indexOf(X,f);if(f+1>=g){break}S=V.substring(f+1,g);Z=S;W=null;h=Z.indexOf(b);if(h>-1){W=Z.substring(h+1);Z=Z.substring(0,h)}Y=T[Z];if(c){Y=c(Z,Y,W)}if(R.isObject(Y)){if(R.isArray(Y)){Y=R.dump(Y,parseInt(W,10))}else{W=W||"";var d=W.indexOf(e);if(d>-1){W=W.substring(4)}if(Y.toString===Object.prototype.toString||d>-1){Y=R.dump(Y,parseInt(W,10))}else{Y=Y.toString()}}}else{if(!R.isString(Y)&&!R.isNumber(Y)){Y="~-"+a.length+"-~";a[a.length]=S}}V=V.substring(0,f)+Y+V.substring(g+1)}for(f=a.length-1;f>=0;f=f-1){V=V.replace(new RegExp("~-"+f+"-~"),"{"+a[f]+"}","g")}return V},trim:function(C){try{return C.replace(/^\s+|\s+$/g,"")}catch(D){return C}},merge:function(){var F={},H=arguments;for(var G=0,E=H.length;G<E;G=G+1){YAHOO.lang.augmentObject(F,H[G],true)}return F},later:function(O,L,N,J,R){O=O||0;L=L||{};var K=N,P=J,Q,M;if(YAHOO.lang.isString(N)){K=L[N]}if(!K){throw new TypeError("method undefined")}if(!YAHOO.lang.isArray(P)){P=[J]}Q=function(){K.apply(L,P)};M=(R)?setInterval(Q,O):setTimeout(Q,O);return{interval:R,cancel:function(){if(this.interval){clearInterval(M)}else{clearTimeout(M)}}}},isValue:function(D){var C=YAHOO.lang;return(C.isObject(D)||C.isString(D)||C.isNumber(D)||C.isBoolean(D))}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.1",build:"984"});YAHOO.util.Get=function(){var X={},Y=0,T=0,f=false,W=YAHOO.env.ua,S=YAHOO.lang;var a=function(B,E,A){var D=A||window,G=D.document,F=G.createElement(B);for(var C in E){if(E[C]&&YAHOO.lang.hasOwnProperty(E,C)){F.setAttribute(C,E[C])}}return F};var c=function(D,C,A){var B=A||"utf-8";return a("link",{"id":"yui__dyn_"+(T++),"type":"text/css","charset":B,"rel":"stylesheet","href":D},C)};var V=function(D,C,A){var B=A||"utf-8";return a("script",{"id":"yui__dyn_"+(T++),"type":"text/javascript","charset":B,"src":D},C)};var j=function(B,A){return{tId:B.tId,win:B.win,data:B.data,nodes:B.nodes,msg:A,purge:function(){g(this.tId)}}};var i=function(D,A){var C=X[A],B=(S.isString(D))?C.win.document.getElementById(D):D;if(!B){U(A,"target node not found: "+D)}return B};var U=function(A,B){var D=X[A];if(D.onFailure){var C=D.scope||D.win;D.onFailure.call(C,j(D,B))}};var h=function(A){var D=X[A];D.finished=true;if(D.aborted){var B="transaction "+A+" was aborted";U(A,B);return }if(D.onSuccess){var C=D.scope||D.win;D.onSuccess.call(C,j(D))}};var d=function(F,B){var G=X[F];if(G.aborted){var D="transaction "+F+" was aborted";U(F,D);return }if(B){G.url.shift();if(G.varName){G.varName.shift()}}else{G.url=(S.isString(G.url))?[G.url]:G.url;if(G.varName){G.varName=(S.isString(G.varName))?[G.varName]:G.varName}}var J=G.win,K=J.document,A=K.getElementsByTagName("head")[0],E;if(G.url.length===0){if(G.type==="script"&&W.webkit&&W.webkit<420&&!G.finalpass&&!G.varName){var C=V(null,G.win,G.charset);C.innerHTML='YAHOO.util.Get._finalize("'+F+'");';G.nodes.push(C);A.appendChild(C)}else{h(F)}return }var H=G.url[0];if(G.type==="script"){E=V(H,J,G.charset)}else{E=c(H,J,G.charset)}e(G.type,E,F,H,J,G.url.length);G.nodes.push(E);if(G.insertBefore){var I=i(G.insertBefore,F);if(I){I.parentNode.insertBefore(E,I)}}else{A.appendChild(E)}if((W.webkit||W.gecko)&&G.type==="css"){d(F,H)}};var Z=function(){if(f){return }f=true;for(var B in X){var A=X[B];if(A.autopurge&&A.finished){g(A.tId);delete X[B]}}f=false};var g=function(F){var A=X[F];if(A){var G=A.nodes,E=G.length,H=A.win.document,B=H.getElementsByTagName("head")[0];if(A.insertBefore){var C=i(A.insertBefore,F);if(C){B=C.parentNode}}for(var D=0;D<E;D=D+1){B.removeChild(G[D])}}A.nodes=[]};var b=function(D,E,C){var A="q"+(Y++);C=C||{};if(Y%YAHOO.util.Get.PURGE_THRESH===0){Z()}X[A]=S.merge(C,{tId:A,type:D,url:E,finished:false,nodes:[]});var B=X[A];B.win=B.win||window;B.scope=B.scope||B.win;B.autopurge=("autopurge" in B)?B.autopurge:(D==="script")?true:false;S.later(0,B,d,A);return{tId:A}};var e=function(I,D,E,G,C,B,J){var A=J||d;if(W.ie){D.onreadystatechange=function(){var K=this.readyState;if("loaded"===K||"complete"===K){A(E,G)}}}else{if(W.webkit){if(I==="script"){if(W.webkit>=420){D.addEventListener("load",function(){A(E,G)})}else{var H=X[E];if(H.varName){var F=YAHOO.util.Get.POLL_FREQ;H.maxattempts=YAHOO.util.Get.TIMEOUT/F;H.attempts=0;H._cache=H.varName[0].split(".");H.timer=S.later(F,H,function(K){var N=this._cache,O=N.length,P=this.win,M;for(M=0;M<O;M=M+1){P=P[N[M]];if(!P){this.attempts++;if(this.attempts++>this.maxattempts){var L="Over retry limit, giving up";H.timer.cancel();U(E,L)}else{}return }}H.timer.cancel();A(E,G)},null,true)}else{S.later(YAHOO.util.Get.POLL_FREQ,null,A,[E,G])}}}}else{D.onload=function(){A(E,G)}}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(A){S.later(0,null,h,A)},abort:function(B){var A=(S.isString(B))?B:B.tId;var C=X[A];if(C){C.aborted=true}},script:function(B,A){return b("script",B,A)},css:function(B,A){return b("css",B,A)}}}();YAHOO.register("get",YAHOO.util.Get,{version:"2.5.1",build:"984"});(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:{"base":"http://yui.yahooapis.com/2.5.1/build/","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"],"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},"charts":{"type":"js","path":"charts/charts-experimental-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-beta-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-beta-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-beta-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop"],"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-beta-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"skinnable":true},"element":{"type":"js","path":"element/element-beta-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-beta-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-beta-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},"profiler":{"type":"js","path":"profiler/profiler-beta-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-beta-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-beta-min.js","requires":["dom","event","dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-beta-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-beta-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"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-experimental.js","requires":["yahoo"]},"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-beta-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.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;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(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){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){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;if(this.dirty||!this.rollups){for(i in this.moduleInfo){m=this.moduleInfo[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=this.moduleInfo[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(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){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]]}}}}}}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,me=this;var requires=function(aa,bb){if(loaded[bb]){return false}var ii,mm=info[aa],rr=mm&&mm.expanded,after=mm&&mm.after,other=info[bb];if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true}if(after&&YUI.ArrayUtil.indexOf(after,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)){return true}return false};for(var i in this.required){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)},insert:function(o,type){this.calculate(o);if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js")};this.insert(null,"css");return }this._loading=true;this.loadType=type;this.loadNext()},sandbox:function(o,type){if(o){}else{}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.call(this.scope,{msg:"undefined module "+m,data:this.data});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||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.scope,{msg:this.varName+" reference failure",data:this.data})}}},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||this._url(m.path),self=this,c=function(o){self.loadNext(o.data)};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,insertBefore:this.insertBefore,charset:this.charset,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()}},_url:function(path){var u=this.base||"",f=this.filter;u=u+path;if(f){u=u.replace(new RegExp(f.searchExp),f.replaceStr)}return u}}})();var Request={getRequestURI:function(A){if(!A){var A=document.location.href}return"/"+A.split(/[\/]+/).slice(2).join("/")},redirect:function(A){document.location.href=A},getFirstToken:function(){return Request.getRequestURI().split(/[\/]+/).first()},getLastToken:function(){return Request.getRequestURI().split(/[\/]+/).last()},getAnchor:function(){try{var B=/#([0-9a-z_-]+)/;var A=B.exec(Request.getRequestURI());if(A){return A[1]}else{return false}}catch(C){return false}},getParameters:function(){return document.location.href.replace("/^.*?/","").toQueryParams()}};function escape_utf8(G){if(G==""||G==null){return""}G=G.toString();var B="";for(var E=0;E<G.length;E++){var H=G.charCodeAt(E);var D=new Array();if(H>65536){D[0]=240|((H&1835008)>>>18);D[1]=128|((H&258048)>>>12);D[2]=128|((H&4032)>>>6);D[3]=128|(H&63)}else{if(H>2048){D[0]=224|((H&61440)>>>12);D[1]=128|((H&4032)>>>6);D[2]=128|(H&63)}else{if(H>128){D[0]=192|((H&1984)>>>6);D[1]=128|(H&63)}else{D[0]=H}}}for(var C=0;C<D.length;C++){var A=D[C];var F=nibble_to_hex((A&240)>>>4)+nibble_to_hex(A&15);B+="%"+F}}return B}function nibble_to_hex(A){var B="0123456789ABCDEF";return B.charAt(A)}function str2hex(D){var C="";var B=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");for(var A=0;A<D.length;A++){C+=B[D.charCodeAt(A)>>4]+B[D.charCodeAt(A)&15]}return C}function hex2str(C){var A=C.length;var D=new String;var B=0;for(B=0;B<A;B+=2){D+=String.fromCharCode("0x"+C.substr(B,2))}return D}function findPosX(A){var B=0;if(A.offsetParent){while(A.offsetParent){B+=A.offsetLeft;A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(B.offsetParent){A+=B.offsetTop;B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}document.getElementsByClassName=function(F,C){if(!C){C="*"}var E=document.getElementsByTagName(C);var D=new Array();for(var B=0,A=0;B<E.length;B++){var G=" "+E[B].className+" ";if(G.indexOf(" "+F+" ")!=-1){D[A++]=E[B]}}return D};if(!Array.prototype.push){Array.prototype.push=function(){var C=0,A=this.length,B=arguments;for(C;C<B.length;C++){this[A+C]=B[C]}return this.length}}if(!Array.prototype.pop){Array.prototype.pop=function(){var A=this[this.length-1];this.length--;return A}}function setCookie(C,D,E){var A="";if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));A="; expires="+B.toGMTString()}document.cookie=C+"="+D+A+"; path=/"}function getCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function deleteCookie(A){setCookie(A,"",-1)}String.prototype.escapeForXML=function(){return this.replace(/&/,"&amp;").replace(/"/,"&quot;").replace(/</,"&lt;").replace(/>/,"&gt;")};String.prototype.escapeForDisplay=function(){return this.replace("<","&lt;")};function removeElement(A){A.parentNode.removeChild(A)}function encodeURIComponentWrapped(A){if(typeof encodeURIComponent=="function"){return encodeURIComponent(A)}else{return A}}function ajax_call(){var args=ajax_call.arguments;var callback=args[args.length-1];var url="/ajax/"+args[0];var querystring="";querystring="ajax_function="+args[1];for(var i=2;i<args.length-1;i++){querystring+="&ajax_arg[]="+encodeURIComponentWrapped(args[i])}querystring+="&ajax_rnd="+new Date().getTime();var ajax=new Ajax.Request(url,{method:"post",postBody:querystring,onSuccess:function(request){if(request.responseText.charAt(0)=="-"){alert("Error: "+request.responseText.substring(2))}else{if(callback!=null){callback(request.responseText.substring(2))}}var json=ajax.getHeader("X-JSON");json=eval(json);if(json){var curLen=json.length;for(var j=0;j<curLen;j++){eval(json[j])}}},on404:function(request){dbg('Error 404: location "'+request.statusText+'" was not found.')},onFailure:function(request){dbg("Error "+request.status+": "+request.statusText)}})}function toggleLayerVisibility(B){var C=$(B);var A=C.style.display!="none";C.style.display=A?"none":"block";return !A}function showLayer(A){var B=$(A);B.style.display="block"}function hideLayer(A){var B=$(A);B.style.display="none"}function addClass(A,B){if(!hasClass(A,B)){if(A.className){A.className+=" "+B}else{A.className=B}}}function removeClass(A,B){var C=new RegExp("(^|\\s)"+B+"(\\s|$)");A.className=A.className.replace(C,"$2")}function hasClass(A,B){var C=new RegExp("(^|\\s)"+B+"(\\s|$)");return C.test(A.className)}function toggleClass(A,B,C){if(A.className==B){A.className=C}else{A.className=B}}function toggleElement(E,B,D){var A=$(E);var C=Element.getStyle(A,"display");if(!D){D="none"}if(!C){C=D}if(B){if(B=="show"){A.style.display="block"}else{if(B=="hide"){A.style.display="none"}}}else{if(C=="none"){toggleElement(E,"show")}else{toggleElement(E,"hide")}}return A.style.display}function createElement(C,B){var A=null;if(document.createElementNS){A=document.createElementNS("http://www.w3.org/1999/xhtml",C)}else{A=document.createElement(C)}if(typeof B!="undefined"){B.appendChild(A)}return A}function confirmLink(B,A,D,C,E){B=$(B);B.onclick=function(){var G=B.id+"_confirm";var F='<div id="'+G+'" style="display:block;">are you sure? <a href="javascript:void(0)" onclick="'+E+'">yes</a>/<a href="javascript:void(0);" onclick="toggleElement(\''+G+"');\">no</a></div>";if(!$(G)){new Insertion.After(this,F)}else{toggleElement(G)}}}function findIdInClass(B){var C=/id_([0-9a-z_-]+)/;var A=C.exec(B.className);if(A){return A[1]}}function findParamInClass(E,B){try{var C=new RegExp("(?:^| )"+E+"_([A-Za-z0-9/:?&-._]+)");var A=C.exec(B.className);if(A){return A[1]}}catch(D){}return false}function dbg(A){if(window.console){window.console.log(A)}else{alert(A)}}function getWindowDimensions(){var A;if(window.innerWidth!=null){A={width:window.innerWidth,height:window.innerHeight}}else{if(document.documentElement&&document.documentElement.clientWidth){A={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}else{if(document.body!=null){A={width:document.body.clientWidth,height:document.body.clientHeight}}}}return A}function formatTime(B){B=parseInt(B);hours=0;minutes=0;var A="";if((B/3600)>=1){hours=Math.floor((B/3600));B=B-(hours*3600);A+=hours+"h "}if((B/60)>=1){minutes=Math.floor((B/60));B=B-(minutes*60);A+=minutes+"m "}if(B>0){if(B<10){A+="0"+B+"s"}else{A+=B+"s"}}return A}function doSearch(A,B){if(B=="context"){ajax_call("request","add_search",Request.getRequestURI(),A,function(C){document.location.href=C});return false}return true}function getSearchKind(B){var A=$(B);return A[A.selectedIndex].value}function replaceSrc(B,A){setTimeout(function(){$(B).src=A},100)}function cssBrowserSelector(){var B=navigator.userAgent.toLowerCase(),D=function(G){return B.indexOf(G)!=-1},C=document.getElementsByTagName("html")[0],A=(!(/opera|webtv/i.test(B))&&/msie (\d)/.test(B))?("ie ie"+RegExp.$1):D("gecko/")?"gecko":D("opera/9")?"opera opera9":/opera (\d)/.test(B)?"opera opera"+RegExp.$1:D("konqueror")?"konqueror":D("applewebkit/")?"webkit safari":D("mozilla/")?"gecko":"",E=(D("x11")||D("linux"))?" linux":D("mac")?" mac":D("win")?" win":"";var F=A+E+" js";C.className+=C.className?" "+F:F}cssBrowserSelector();var envs=new Object();function addEnv(B,A){envs[B]=A}function getEnv(A){if(envs[A]){return envs[A]}else{return""}}var Prototype={Version:"1.6.0.3",Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:navigator.userAgent.indexOf("Opera")>-1,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div")["__proto__"]&&document.createElement("div")["__proto__"]!==document.createElement("form")["__proto__"]},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var E=null,D=$A(arguments);if(Object.isFunction(D[0])){E=D.shift()}function A(){this.initialize.apply(this,arguments)}Object.extend(A,Class.Methods);A.superclass=E;A.subclasses=[];if(E){var B=function(){};B.prototype=E.prototype;A.prototype=new B;E.subclasses.push(A)}for(var C=0;C<D.length;C++){A.addMethods(D[C])}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction}A.prototype.constructor=A;return A}};Class.Methods={addMethods:function(G){var C=this.superclass&&this.superclass.prototype;var B=Object.keys(G);if(!Object.keys({toString:true}).length){B.push("toString","valueOf")}for(var A=0,D=B.length;A<D;A++){var F=B[A],E=G[F];if(C&&Object.isFunction(E)&&E.argumentNames().first()=="$super"){var H=E;E=(function(I){return function(){return C[I].apply(this,arguments)}})(F).wrap(H);E.valueOf=H.valueOf.bind(H);E.toString=H.toString.bind(H)}this.prototype[F]=E}return this}};var Abstract={};Object.extend=function(A,C){for(var B in C){A[B]=C[B]}return A};Object.extend(Object,{inspect:function(A){try{if(Object.isUndefined(A)){return"undefined"}if(A===null){return"null"}return A.inspect?A.inspect():String(A)}catch(B){if(B instanceof RangeError){return"..."}throw B}},toJSON:function(A){var C=typeof A;switch(C){case"undefined":case"function":case"unknown":return ;case"boolean":return A.toString()}if(A===null){return"null"}if(A.toJSON){return A.toJSON()}if(Object.isElement(A)){return }var B=[];for(var E in A){var D=Object.toJSON(A[E]);if(!Object.isUndefined(D)){B.push(E.toJSON()+": "+D)}}return"{"+B.join(", ")+"}"},toQueryString:function(A){return $H(A).toQueryString()},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A)},keys:function(A){var B=[];for(var C in A){B.push(C)}return B},values:function(B){var A=[];for(var C in B){A.push(B[C])}return A},clone:function(A){return Object.extend({},A)},isElement:function(A){return !!(A&&A.nodeType==1)},isArray:function(A){return A!=null&&typeof A=="object"&&"splice" in A&&"join" in A},isHash:function(A){return A instanceof Hash},isFunction:function(A){return typeof A=="function"},isString:function(A){return typeof A=="string"},isNumber:function(A){return typeof A=="number"},isUndefined:function(A){return typeof A=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,"").split(",");return A.length==1&&!A[0]?[]:A},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}},bindAsEventListener:function(){var A=this,C=$A(arguments),B=C.shift();return function(D){return A.apply(B,[D||window.event].concat(C))}},curry:function(){if(!arguments.length){return this}var A=this,B=$A(arguments);return function(){return A.apply(this,B.concat($A(arguments)))}},delay:function(){var A=this,B=$A(arguments),C=B.shift()*1000;return window.setTimeout(function(){return A.apply(A,B)},C)},defer:function(){var A=[0.01].concat($A(arguments));return this.delay.apply(this,A)},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)))}}});Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var C;for(var B=0,D=arguments.length;B<D;B++){var A=arguments[B];try{C=A();break}catch(E){}}return C}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B;C=arguments.callee.prepareReplacement(C);while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index);A+=String.interpret(C(B));D=D.slice(B.index+B[0].length)}else{A+=D,D=""}}return A},sub:function(C,A,B){A=this.gsub.prepareReplacement(A);B=Object.isUndefined(B)?1:B;return this.gsub(C,function(D){if(--B<0){return D[0]}return A(D)})},scan:function(B,A){this.gsub(B,A);return String(this)},truncate:function(B,A){B=B||30;A=Object.isUndefined(A)?"...":A;return this.length>B?this.slice(0,B-A.length)+A:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML},unescapeHTML:function(){var A=new Element("div");A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue}):A.childNodes[0].nodeValue):""},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A){return{}}return A[1].split(B||"&").inject({},function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift());var D=F.length>1?F.join("="):F[0];if(D!=undefined){D=decodeURIComponent(D)}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]]}E[C].push(D)}else{E[C]=D}}return E})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(A){return A<1?"":new Array(A+1).join(this)},camelize:function(){var D=this.split("-"),A=D.length;if(A==1){return D[0]}var C=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var B=1;B<A;B++){C+=D[B].charAt(0).toUpperCase()+D[B].substring(1)}return C},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]];return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16)});if(B){return'"'+A.replace(/"/g,'\\"')+'"'}return"'"+A.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}")},isJSON:function(){var A=this;if(A.blank()){return false}A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(A){return this.indexOf(A)>-1},startsWith:function(A){return this.indexOf(A)===0},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(A,B){return new Template(this,B).evaluate(A)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.stripTags().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B}var A=new Template(B);return function(C){return A.evaluate(C)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(D){if(A==null){return""}var F=D[1]||"";if(F=="\\"){return D[2]}var B=A,G=D[3];var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;D=E.exec(G);if(D==null){return F}while(D!=null){var C=D[1].startsWith("[")?D[2].gsub("\\\\]","]"):D[1];B=B[C];if(null==B||""==D[3]){break}G=G.substring("["==D[3]?D[1].length:D[0].length);D=E.exec(G)}return F+String.interpret(B)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(C,B){var A=0;try{this._each(function(E){C.call(B,E,A++)})}catch(D){if(D!=$break){throw D}}return this},eachSlice:function(D,C,B){var A=-D,E=[],F=this.toArray();if(D<1){return F}while((A+=D)<F.length){E.push(F.slice(A,A+D))}return E.collect(C,B)},all:function(C,B){C=C||Prototype.K;var A=true;this.each(function(E,D){A=A&&!!C.call(B,E,D);if(!A){throw $break}});return A},any:function(C,B){C=C||Prototype.K;var A=false;this.each(function(E,D){if(A=!!C.call(B,E,D)){throw $break}});return A},collect:function(C,B){C=C||Prototype.K;var A=[];this.each(function(E,D){A.push(C.call(B,E,D))});return A},detect:function(C,B){var A;this.each(function(E,D){if(C.call(B,E,D)){A=E;throw $break}});return A},findAll:function(C,B){var A=[];this.each(function(E,D){if(C.call(B,E,D)){A.push(E)}});return A},grep:function(D,C,B){C=C||Prototype.K;var A=[];if(Object.isString(D)){D=new RegExp(D)}this.each(function(F,E){if(D.match(F)){A.push(C.call(B,F,E))}});return A},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true}}var B=false;this.each(function(C){if(C==A){B=true;throw $break}});return B},inGroupsOf:function(B,A){A=Object.isUndefined(A)?null:A;return this.eachSlice(B,function(C){while(C.length<B){C.push(A)}return C})},inject:function(A,C,B){this.each(function(E,D){A=C.call(B,A,E,D)});return A},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A)})},max:function(C,B){C=C||Prototype.K;var A;this.each(function(E,D){E=C.call(B,E,D);if(A==null||E>=A){A=E}});return A},min:function(C,B){C=C||Prototype.K;var A;this.each(function(E,D){E=C.call(B,E,D);if(A==null||E<A){A=E}});return A},partition:function(D,B){D=D||Prototype.K;var C=[],A=[];this.each(function(F,E){(D.call(B,F,E)?C:A).push(F)});return[C,A]},pluck:function(B){var A=[];this.each(function(C){A.push(C[B])});return A},reject:function(C,B){var A=[];this.each(function(E,D){if(!C.call(B,E,D)){A.push(E)}});return A},sortBy:function(B,A){return this.map(function(D,C){return{value:D,criteria:B.call(A,D,C)}}).sort(function(F,E){var D=F.criteria,C=E.criteria;return D<C?-1:D>C?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop()}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(C){if(!C){return[]}if(C.toArray){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}if(Prototype.Browser.WebKit){$A=function(C){if(!C){return[]}if(!(typeof C==="function"&&typeof C.length==="number"&&typeof C.item==="function")&&C.toArray){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length;A<C;A++){B(this[A])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(A){return A!=null})},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A])})},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B)})},reverse:function(A){return(A!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C)}return D})},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var A=[];this.each(function(B){var C=Object.toJSON(B);if(!Object.isUndefined(C)){A.push(C)}});return"["+A.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,A){A||(A=0);var B=this.length;if(A<0){A=B+A}for(;A<B;A++){if(this[A]===C){return A}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;var C=this.slice(0,A).reverse().indexOf(B);return(C<0)?C:A-C-1}}Array.prototype.toArray=Array.prototype.clone;function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[];for(var B=0,C=this.length;B<C;B++){E.push(this[B])}for(var B=0,C=arguments.length;B<C;B++){if(Object.isArray(arguments[B])){for(var A=0,D=arguments[B].length;A<D;A++){E.push(arguments[B][A])}}else{E.push(arguments[B])}}return E}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(B,A){$R(0,this,true).each(B,A);return this},toPaddedString:function(C,B){var A=this.toString(B||10);return"0".times(C-A.length)+A},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize()});function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function A(B,C){if(Object.isUndefined(C)){return B}return B+"="+encodeURIComponent(String.interpret(C))}return{initialize:function(B){this._object=Object.isHash(B)?B.toObject():Object.clone(B)},_each:function(C){for(var B in this._object){var D=this._object[B],E=[B,D];E.key=B;E.value=D;C(E)}},set:function(B,C){return this._object[B]=C},get:function(B){if(this._object[B]!==Object.prototype[B]){return this._object[B]}},unset:function(B){var C=this._object[B];delete this._object[B];return C},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(C){var B=this.detect(function(D){return D.value===C});return B&&B.key},merge:function(B){return this.clone().update(B)},update:function(B){return new Hash(B).inject(this,function(C,D){C.set(D.key,D.value);return C})},toQueryString:function(){return this.inject([],function(D,E){var C=encodeURIComponent(E.key),B=E.value;if(B&&typeof B=="object"){if(Object.isArray(B)){return D.concat(B.map(A.curry(C)))}}else{D.push(A(C,B))}return D}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C;this.end=A;this.exclusive=B},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ()}},include:function(A){if(A<this.start){return false}if(this.exclusive){return A<this.end}return A<=this.end}});var $R=function(C,A,B){return new ObjectRange(C,A,B)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A])}catch(F){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A);this.transport=Ajax.getTransport();this.request(B)},request:function(B){this.url=B;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D["_method"]=this.method;this.method="post"}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="}}}try{var A=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(A)}Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E["Connection"]="close"}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(Object.isFunction(C.push)){for(var B=0,D=C.length;B<D;B+=2){E[C[B]]=C[B+1]}}else{$H(C).each(function(F){E[F.key]=F.value})}}for(var A in E){this.transport.setRequestHeader(A,E[A])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(D){this.dispatchException(D)}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON)}catch(D){this.dispatchException(D)}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=D.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(E,F){this.updateContent(E.responseText);if(Object.isFunction(D)){D(E,F)}}).bind(this);$super(C,B)},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options;if(!A.evalScripts){D=D.stripScripts()}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={};B[A.insertion]=D;C.insert(B)}else{A.insertion(C,D)}}else{C.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=C;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;A<C;A++){D.push($(arguments[A]))}return D}if(Object.isString(B)){B=document.getElementById(B)}return Element.extend(B)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[];var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,D=E.snapshotLength;B<D;B++){C.push(Element.extend(E.snapshotItem(B)))}return C}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var A=this.Element;this.Element=function(D,C){C=C||{};D=D.toLowerCase();var B=Element.cache;if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">';delete C.name;return Element.writeAttribute(document.createElement(D),C)}if(!B[D]){B[D]=Element.extend(document.createElement(D))}return Element.writeAttribute(B[D].cloneNode(false),C)};Object.extend(this.Element,A||{});if(A){this.Element.prototype=A.prototype}}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){A=$(A);A.style.display="none";return A},show:function(A){A=$(A);A.style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement()}if(Object.isElement(B)){return A.update().insert(B)}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A},replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(C,E){C=$(C);if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E}}var D,F,B,G;for(var A in E){D=E[A];A=A.toLowerCase();F=Element._insertionTranslations[A];if(D&&D.toElement){D=D.toElement()}if(Object.isElement(D)){F(C,D);continue}D=Object.toHTML(D);B=((A=="before"||A=="after")?C.parentNode:C).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(B,D.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(F.curry(C));D.evalScripts.bind(D).defer()}return C},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{})}else{if(Object.isString(C)){C=new Element(C,A)}else{C=new Element("div",C)}}if(B.parentNode){B.parentNode.replaceChild(C,B)}C.appendChild(B);return C},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(F){var E=F.first(),C=F.last();var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true)}});return A+">"},recursivelyCollect:function(A,C){A=$(A);var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A))}}return B},ancestors:function(A){return $(A).recursivelyCollect("parentNode")},descendants:function(A){return $(A).select("*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling")},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling")},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings())},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(B,D,A){B=$(B);if(arguments.length==1){return $(B.parentNode)}var C=B.ancestors();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},down:function(B,C,A){B=$(B);if(arguments.length==1){return B.firstDescendant()}return Object.isNumber(C)?B.descendants()[C]:Element.select(B,C)[A||0]},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var C=B.previousSiblings();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},next:function(C,D,B){C=$(C);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C))}var A=C.nextSiblings();return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},select:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B,A)},adjacent:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(B){B=$(B);var C=B.readAttribute("id"),A=arguments.callee;if(C){return C}do{C="anonymous_element_"+A.counter++}while($(C));B.writeAttribute("id",C);return C},readAttribute:function(C,A){C=$(C);if(Prototype.Browser.IE){var B=Element._attributeTranslations.read;if(B.values[A]){return B.values[A](C,A)}if(B.names[A]){A=B.names[A]}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value}}return C.getAttribute(A)},writeAttribute:function(E,C,F){E=$(E);var B={},D=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=D.names[A]||A;F=B[A];if(D.values[A]){C=D.values[A](E,F)}if(F===false||F===null){E.removeAttribute(C)}else{if(F===true){E.setAttribute(C,C)}else{E.setAttribute(C,F)}}}return E},getHeight:function(A){return $(A).getDimensions().height},getWidth:function(A){return $(A).getDimensions().width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(A,B){if(!(A=$(A))){return }var C=A.className;return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C)))},addClassName:function(A,B){if(!(A=$(A))){return }if(!A.hasClassName(B)){A.className+=(A.className?" ":"")+B}return A},removeClassName:function(A,B){if(!(A=$(A))){return }A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip();return A},toggleClassName:function(A,B){if(!(A=$(A))){return }return A[A.hasClassName(B)?"removeClassName":"addClassName"](B)},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C)}C=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(B,A){B=$(B),A=$(A);if(B.compareDocumentPosition){return(B.compareDocumentPosition(A)&8)===8}if(A.contains){return A.contains(B)&&A!==B}while(B=B.parentNode){if(B==A){return true}}return false},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();window.scrollTo(B[0],B[1]);return A},getStyle:function(B,C){B=$(B);C=C=="float"?"cssFloat":C.camelize();var D=B.style[C];if(!D||D=="auto"){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(B,C){B=$(B);var E=B.style,A;if(Object.isString(C)){B.style.cssText+=";"+C;return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B}for(var D in C){if(D=="opacity"){B.setOpacity(C[D])}else{E[(D=="float"||D=="cssFloat")?(Object.isUndefined(E.styleFloat)?"cssFloat":"styleFloat"):D]=C[D]}}return B},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(C){C=$(C);var G=C.getStyle("display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(Prototype.Browser.Opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return Element._returnOffset(C,A)},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName.toUpperCase()=="BODY"){break}var C=Element.getStyle(B,"position");if(C!=="static"){break}}}while(B);return Element._returnOffset(D,A)},absolutize:function(B){B=$(B);if(B.getStyle("position")=="absolute"){return B}var D=B.positionedOffset();var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px";return B},relativize:function(A){A=$(A);if(A.getStyle("position")=="relative"){return A}A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A},cumulativeScrollOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode}while(B);return Element._returnOffset(C,A)},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent)}if(A==document.body){return $(A)}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A)}}return $(document.body)},viewportOffset:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break}}while(B=B.offsetParent);B=D;do{if(!Prototype.Browser.Opera||(B.tagName&&(B.tagName.toUpperCase()=="BODY"))){A-=B.scrollTop||0;C-=B.scrollLeft||0}}while(B=B.parentNode);return Element._returnOffset(C,A)},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});D=$(D);var E=D.viewportOffset();B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=B.getOffsetParent();F=C.viewportOffset()}if(C==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){B.style.width=D.offsetWidth+"px"}if(A.setHeight){B.style.height=D.offsetHeight+"px"}return B}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(D,B,C){switch(C){case"left":case"top":case"right":case"bottom":if(D(B,"position")==="static"){return null}case"height":case"width":if(!Element.visible(B)){return null}var E=parseInt(D(B,C),10);if(E!==B["offset"+C.capitalize()]){return E+"px"}var A;if(C==="height"){A=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{A=["border-left-width","padding-left","padding-right","border-right-width"]}return A.inject(E,function(F,G){var H=D(B,G);return H===null?F:F-parseInt(H,10)})+"px";default:return D(B,C)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(C,A,B){if(B==="title"){return A.title}return C(A,B)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(C,B){B=$(B);try{B.offsetParent}catch(E){return $(document.body)}var A=B.getStyle("position");if(A!=="static"){return C(B)}B.setStyle({position:"relative"});var D=C(B);B.setStyle({position:A});return D});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(E,C){C=$(C);try{C.offsetParent}catch(G){return Element._returnOffset(0,0)}var B=C.getStyle("position");if(B!=="static"){return E(C)}var D=C.getOffsetParent();if(D&&D.getStyle("position")==="fixed"){D.setStyle({zoom:1})}C.setStyle({position:"relative"});var F=E(C);C.setStyle({position:B});return F})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(B,A){try{A.offsetParent}catch(C){return Element._returnOffset(0,0)}return B(A)});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B]}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100}}return 1}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return C};Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}B=$(B);var A=B.currentStyle;if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1}var D=B.getStyle("filter"),C=B.style;if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter");return B}else{if(E<0.00001){E=0}}C.filter=F(D)+"alpha(opacity="+(E*100)+")";return B};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2)},_getAttrNode:function(A,C){var B=A.getAttributeNode(C);return B?B.value:""},_getEv:function(A,B){B=A.getAttribute(B);return B?B.toString().slice(23,-2):null},_flag:function(A,B){return $(A).hasAttribute(B)?B:null},style:function(A){return A.style.cssText.toLowerCase()},title:function(A){return A.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName.toUpperCase()=="IMG"&&A.width){A.width++;A.width--}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(C){}}}return A};Element.Methods.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}B=B.offsetParent}while(B);return Element._returnOffset(C,A)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}if(Object.isElement(C)){return B.update().insert(C)}C=Object.toHTML(C);var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D)});Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D)})}else{B.innerHTML=C.stripScripts()}C.evalScripts.bind(C).defer();return B}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(C,E){C=$(C);if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){C.parentNode.replaceChild(E,C);return C}E=Object.toHTML(E);var D=C.parentNode,B=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[B]){var F=C.next();var A=Element._getContentFromAnonymousElement(B,E.stripScripts());D.removeChild(C);if(F){A.each(function(G){D.insertBefore(G,F)})}else{A.each(function(G){D.appendChild(G)})}}else{C.outerHTML=E.stripScripts()}E.evalScripts.bind(E).defer();return C}}Element._returnOffset=function(B,C){var A=[B,C];A.left=B;A.top=C;return A};Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C];if(A){D.innerHTML=A[0]+B+A[1];A[2].times(function(){D=D.firstChild})}else{D.innerHTML=B}return $A(D.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return !!(B&&B.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div")["__proto__"]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div")["__proto__"];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var A={},B=Element.Methods.ByTag;var C=Object.extend(function(F){if(!F||F._extendedByPrototype||F.nodeType!=1||F==window){return F}var D=Object.clone(A),E=F.tagName.toUpperCase(),H,G;if(B[E]){Object.extend(D,B[E])}for(H in D){G=D[H];if(Object.isFunction(G)&&!(H in F)){F[H]=G.methodize()}}F._extendedByPrototype=Prototype.emptyFunction;return F},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);Object.extend(A,Element.Methods.Simulated)}}});C.refresh();return C})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)})}if(arguments.length==2){var B=C;C=arguments[1]}if(!B){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(B)){B.each(H)}else{H(B)}}function H(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function A(L,K,F){F=F||false;for(var N in L){var M=L[N];if(!Object.isFunction(M)){continue}if(!F||!(N in K)){K[N]=M.methodize()}}}function E(L){var F;var K={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(K[L]){F="HTML"+K[L]+"Element"}if(window[F]){return window[F]}F="HTML"+L+"Element";if(window[F]){return window[F]}F="HTML"+L.capitalize()+"Element";if(window[F]){return window[F]}window[F]={};window[F].prototype=document.createElement(L)["__proto__"];return window[F]}if(I.ElementExtensions){A(Element.Methods,HTMLElement.prototype);A(Element.Methods.Simulated,HTMLElement.prototype,true)}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var G=E(J);if(Object.isUndefined(G)){continue}A(D[J],G.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var A={},C=Prototype.Browser;$w("width height").each(function(E){var B=E.capitalize();if(C.WebKit&&!document.evaluate){A[E]=self["inner"+B]}else{if(C.Opera&&parseFloat(window.opera.version())<9.5){A[E]=document.body["client"+B]}else{A[E]=document.documentElement["client"+B]}}});return A},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var A=this.expression;if(Prototype.Browser.WebKit&&(A.include("-of-type")||A.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(A)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(A){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return }this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A;if(Selector._cache[E]){this.xpath=Selector._cache[E];return }this.matcher=[".//*"];while(E&&D!=E&&(/\S/).test(E)){D=E;for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A));E=E.replace(A[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;var C=this.expression,B;switch(this.mode){case"selectorsAPI":if(A!==document){var D=A.id,E=$(A).identify();C="#"+E+" "+C}B=$A(A.querySelectorAll(C)).map(Element.extend);A.id=D;return B;case"xpath":return document._getElementsByXPath(this.xpath,A);default:return this.matcher(A)}},match:function(H){this.tokens=[];var L=this.expression,A=Selector.patterns,E=Selector.assertions;var B,D,F;while(L&&B!==L&&(/\S/).test(L)){B=L;for(var I in A){D=A[I];if(F=L.match(D)){if(E[I]){this.tokens.push([I,Object.clone(F)]);L=L.replace(F[0],"")}else{return this.findElements(document).include(H)}}}}var K=true,C,J;for(var I=0,G;G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0)]","checked":"[@checked]","disabled":"[(@disabled) and (@type!='hidden')]","enabled":"[not(@disabled) and (@type!='hidden')]","not":function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,C;var F=[];while(H&&E!=H&&(/\S/).test(H)){E=H;for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B);F.push("("+C.substring(1,C.length-1)+")");H=H.replace(B[0],"");break}}}return"[not("+F.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(E,C){var F,G=C[6],B;if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]"}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1}var D=F[1]?Number(F[1]):1;var A=F[2]?Number(F[2]):0;B="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(B).evaluate({fragment:E,a:D,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6])}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D)}return B},mark:function(A){var D=Prototype.emptyFunction;for(var B=0,C;C=A[B];B++){C._countedByPrototype=D}return A},unmark:function(A){for(var B=0,C;C=A[B];B++){C._countedByPrototype=undefined}return A},index:function(A,D,G){A._countedByPrototype=Prototype.emptyFunction;if(D){for(var B=A.childNodes,E=B.length-1,C=1;E>=0;E--){var F=B[E];if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}else{for(var E=0,C=1,B=A.childNodes;F=B[E];E++){if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}},unique:function(B){if(B.length==0){return B}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(!(E=B[C])._countedByPrototype){E._countedByPrototype=Prototype.emptyFunction;D.push(Element.extend(E))}}return Selector.handlers.unmark(D)},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"))}return B},child:function(A){var E=Selector.handlers;for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G)}}}return C},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D)}}return B},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,H,C,B){var I=C.toUpperCase();var E=[],G=Selector.handlers;if(A){if(B){if(B=="descendant"){for(var F=0,D;D=A[F];F++){G.concat(E,D.getElementsByTagName(C))}return E}else{A=this[B](A)}if(C=="*"){return A}}for(var F=0,D;D=A[F];F++){if(D.tagName.toUpperCase()===I){E.push(D)}}return E}else{return H.getElementsByTagName(C)}},id:function(B,A,H,F){var G=$(H),D=Selector.handlers;if(!G){return[]}if(!B&&A==document){return[G]}if(B){if(F){if(F=="child"){for(var C=0,E;E=B[C];C++){if(G.parentNode==E){return[G]}}}else{if(F=="descendant"){for(var C=0,E;E=B[C];C++){if(Element.descendantOf(G,E)){return[G]}}}else{if(F=="adjacent"){for(var C=0,E;E=B[C];C++){if(Selector.handlers.previousElementSibling(G)==E){return[G]}}}else{B=D[F](B)}}}}for(var C=0,E;E=B[C];C++){if(E==G){return[G]}}return[]}return(G&&Element.descendantOf(G,A))?[G]:[]},className:function(B,A,C,D){if(B&&D){B=this[D](B)}return Selector.handlers.byClassName(B,A,C)},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B])}var H=" "+F+" ";for(var E=0,D=[],G,A;G=C[E];E++){A=G.className;if(A.length==0){continue}if(A==F||(" "+A+" ").include(H)){D.push(G)}}return D},attrPresence:function(C,B,A,G){if(!C){C=B.getElementsByTagName("*")}if(C&&G){C=this[G](C)}var E=[];for(var D=0,F;F=C[D];D++){if(Element.hasAttribute(F,A)){E.push(F)}}return E},attr:function(A,I,H,J,C,B){if(!A){A=I.getElementsByTagName("*")}if(A&&B){A=this[B](A)}var K=Selector.operators[C],F=[];for(var E=0,D;D=A[E];E++){var G=Element.readAttribute(D,H);if(G===null){continue}if(K(G,J)){F.push(D)}}return F},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B)}if(!B){B=A.getElementsByTagName("*")}return Selector.pseudos[C](B,E,A)}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue}C.push(E)}return C},"last-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue}C.push(E)}return C},"only-child":function(B,G,A){var E=Selector.handlers;for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F)}}return C},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A)},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true)},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true)},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true)},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A)},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[]}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E)}return D})},nth:function(A,L,N,K,C){if(A.length==0){return[]}if(L=="even"){L="2n+0"}if(L=="odd"){L="2n+1"}var J=Selector.handlers,I=[],B=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,K,C);B.push(D.parentNode)}}if(L.match(/^\d+$/)){L=Number(L);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==L){I.push(D)}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;G++){if(D.nodeIndex==P[G]){I.push(D)}}}}}J.unmark(A);J.unmark(B);return I},"empty":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.tagName=="!"||E.firstChild){continue}C.push(E)}return C},"not":function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;B=A[F];F++){if(!B._countedByPrototype){E.push(B)}}G.unmark(H);return E},"enabled":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(!E.disabled&&(!E.type||E.type!=="hidden")){C.push(E)}}return C},"disabled":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.disabled){C.push(E)}}return C},"checked":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E)}}return C}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B==A||B&&B.startsWith(A)},"$=":function(B,A){return B==A||B&&B.endsWith(A)},"*=":function(B,A){return B==A||B&&B.include(A)},"$=":function(B,A){return B.endsWith(A)},"*=":function(B,A){return B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+(B||"").toUpperCase()+"-").include("-"+(A||"").toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip())});return A},matchElements:function(F,G){var E=$$(G),D=Selector.handlers;D.mark(E);for(var C=0,B=[],A;A=F[C];C++){if(A._countedByPrototype){B.push(A)}}D.unmark(E);return B},findElement:function(B,C,A){if(Object.isNumber(C)){A=C;C=false}return Selector.matchElements(B,C||"*")[A||0]},findChildElements:function(E,G){G=Selector.split(G.join(","));var D=[],F=Selector.handlers;for(var C=0,B=G.length,A;C<B;C++){A=new Selector(G[C].strip());F.concat(D,A.findElements(E))}return(B>1)?F.unique(D):D}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var C=0,D;D=A[C];C++){if(D.tagName!=="!"){B.push(D)}}return B},unmark:function(A){for(var B=0,C;C=A[B];B++){C.removeAttribute("_countedByPrototype")}return A}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){$(A).reset();return A},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B}}else{if(Object.isUndefined(B.hash)){B.hash=true}}var C,F,A=false,E=B.submit;var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name;F=$(I).getValue();if(F!=null&&I.type!="file"&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]]}H[C].push(F)}else{H[C]=F}}}return H});return B.hash?D:Object.toQueryString(D)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C))}return B})},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return $A(A).map(Element.extend)}for(var E=0,H=[],F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue}H.push(Element.extend(B))}return H},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return A?A:C.find(function(D){return["input","select","textarea"].include(D.tagName.toLowerCase())})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(B,A){B=$(B),A=Object.clone(A||{});var D=A.parameters,C=B.readAttribute("action")||"";if(C.blank()){C=window.location.href}A.parameters=B.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(A.parameters,D)}if(B.hasAttribute("method")&&!A.method){A.method=B.method}return new Ajax.Request(C,A)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(C,F){if(Object.isUndefined(F)){return this[C.type=="select-one"?"selectOne":"selectMany"](C)}else{var B,D,G=!Object.isArray(F);for(var A=0,E=C.length;A<E;A++){B=C.options[A];D=this.optionValue(B);if(G){if(D==F){B.selected=true;return }}else{B.selected=F.include(D)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(D){var A,E=D.length;if(!E){return null}for(var C=0,A=[];C<E;C++){var B=D.options[C];if(B.selected){A.push(this.optionValue(B))}}return A},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null}return Element.extend(A)}});Event.Methods=(function(){var A;if(Prototype.Browser.IE){var B={0:1,1:4,2:2};A=function(D,C){return D.button==B[C]}}else{if(Prototype.Browser.WebKit){A=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;case 1:return D.which==1&&D.metaKey;default:return false}}}else{A=function(D,C){return D.which?(D.which===C+1):(D.button===C)}}}return{isLeftClick:function(C){return A(C,0)},isMiddleClick:function(C){return A(C,1)},isRightClick:function(C){return A(C,2)},element:function(E){E=Event.extend(E);var D=E.target,C=E.type,F=E.currentTarget;if(F&&F.tagName){if(C==="load"||C==="error"||(C==="click"&&F.tagName.toLowerCase()==="input"&&F.type==="radio")){D=F}}if(D.nodeType==Node.TEXT_NODE){D=D.parentNode}return Element.extend(D)},findElement:function(D,F){var C=Event.element(D);if(!F){return C}var E=[C].concat(C.ancestors());return Selector.findElement(E,F,0)},pointer:function(E){var D=document.documentElement,C=document.body||{scrollLeft:0,scrollTop:0};return{x:E.pageX||(E.clientX+(D.scrollLeft||C.scrollLeft)-(D.clientLeft||0)),y:E.pageY||(E.clientY+(D.scrollTop||C.scrollTop)-(D.clientTop||0))}},pointerX:function(C){return Event.pointer(C).x},pointerY:function(C){return Event.pointer(C).y},stop:function(C){Event.extend(C);C.preventDefault();C.stopPropagation();C.stopped=true}}})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize();return B});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(B){if(!B){return false}if(B._extendedByPrototype){return B}B._extendedByPrototype=Prototype.emptyFunction;var C=Event.pointer(B);Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y});return Object.extend(B,A)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents")["__proto__"];Object.extend(Event.prototype,A);return Prototype.K}})();Object.extend(Event,(function(){var B=Event.cache;function C(J){if(J._prototypeEventID){return J._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return J._prototypeEventID=[++arguments.callee.id]}function G(J){if(J&&J.include(":")){return"dataavailable"}return J}function A(J){return B[J]=B[J]||{}}function F(L,J){var K=A(L);return K[J]=K[J]||[]}function H(K,J,L){var O=C(K);var N=F(O,J);if(N.pluck("handler").include(L)){return false}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false}Event.extend(P);L.call(K,P)};M.handler=L;N.push(M);return M}function I(M,J,K){var L=F(M,J);return L.find(function(N){return N.handler==K})}function D(M,J,K){var L=A(M);if(!L[J]){return false}L[J]=L[J].without(I(M,J,K))}function E(){for(var K in B){for(var J in B[K]){B[K][J]=null}}}if(window.attachEvent){window.attachEvent("onunload",E)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}return{observe:function(L,J,M){L=$(L);var K=G(J);var N=H(L,J,M);if(!N){return L}if(L.addEventListener){L.addEventListener(K,N,false)}else{L.attachEvent("on"+K,N)}return L},stopObserving:function(L,J,M){L=$(L);var O=C(L),K=G(J);if(!M&&J){F(O,J).each(function(P){L.stopObserving(J,P.handler)});return L}else{if(!J){Object.keys(A(O)).each(function(P){L.stopObserving(P)});return L}}var N=I(O,J,M);if(!N){return L}if(L.removeEventListener){L.removeEventListener(K,N,false)}else{L.detachEvent("on"+K,N)}D(O,J,M);return L},fire:function(L,K,J){L=$(L);if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement}var M;if(document.createEvent){M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",true,true)}else{M=document.createEventObject();M.eventType="ondataavailable"}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M)}else{L.fireEvent(M.eventType,M)}return Event.extend(M)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var B;function A(){if(document.loaded){return }if(B){window.clearInterval(B)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){B=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A()}},0);Event.observe(window,"load",A)}else{document.addEventListener("DOMContentLoaded",A,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;A()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{};return Element.clonePosition(C,B,A)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().strip();var D=/\s/.test(E)?$w(E).map(A).join(""):A(E);return D?document._getElementsByXPath(".//*"+D,C):[]}:function(E,F){F=F.toString().strip();var G=[],H=(/\s/.test(F)?$w(F):null);if(!H&&!F){return G}var C=$(E).getElementsByTagName("*");F=" "+F+" ";for(var D=0,J,I;J=C[D];D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){G.push(Element.extend(J))}}return G};return function(D,C){return $(C||document.body).getElementsByClassName(D)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A)},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0})._each(A)},set:function(A){this.element.className=A},add:function(A){if(this.include(A)){return }this.set($A(this).concat(A).join(" "))},remove:function(A){if(!this.include(A)){return }this.set($A(this).without(A).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();if(Prototype.Browser.IE){try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}}var Keyboard={BACKSPACE:8,ENTER:13,SHIFT:16,CONTROL:17,ESCAPE:27,SPACE:32,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90};if(Prototype.Browser.WebKit){}Object.extend(Event,{_domReady:function(){if(arguments.callee.done){return }arguments.callee.done=true;if(this._timer){clearInterval(this._timer)}this._readyCallbacks.each(function(A){A()});this._readyCallbacks=null},onDOMReady:function(f){if(!this._readyCallbacks){var domReady=this._domReady.bind(this);if(document.addEventListener){document.addEventListener("DOMContentLoaded",domReady,false);/*@cc_on @*//*@if (@_win32)
            document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
            document.getElementById("__ie_onload").onreadystatechange = function() {
                if (this.readyState == "complete") domReady(); 
            };
        /*@end @*/}if(/WebKit/i.test(navigator.userAgent)){this._timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){domReady()}},10)}Event.observe(window,"load",domReady);Event._readyCallbacks=[]}Event._readyCallbacks.push(f)}});var DM_KeyHandler={actions:[],potentialActions:[],keyNum:0,timer:null,shift:1,registerAction:function(B,A,C){this.actions.push({"keys":B,"modifier":A,"callback":C});this.potentialActions.push({"keys":B,"modifier":A,"callback":C});this.resetKeys(this)},resetKeys:function(A){if(typeof A=="number"){A=window.keyHandler}clearTimeout(A.timer);A.keyNum=0;A.potentialActions=A.actions.clone()},handler:function(E){if(Event.element(E).tagName=="INPUT"||Event.element(E).tagName=="TEXTAREA"||Event.element(E).tagName=="SELECT"||Event.element(E).tagName=="OPTION"){return true}var F=E.keyCode?E.keyCode:E.which;var B=[];for(var D=0,A=this.potentialActions.length;D<A;D++){var C=this.potentialActions[D].keys;if(isNaN(C)&&C.charAt(this.keyNum)==String.fromCharCode(F).toLowerCase()&&this.checkModifier(this.potentialActions[D].modifier,E)){B.push(this.potentialActions[D]);if(this.potentialActions[D].keys.length-1==this.keyNum){this.potentialActions[D].callback();this.resetKeys(this);B.clear()}}else{if(!isNaN(C)&&C==F){B.push(this.potentialActions[D]);this.potentialActions[D].callback();this.resetKeys(this);B.clear()}}}if(B.length>0){this.keyNum++;window.keyHandler=this;this.timer=setTimeout(this.resetKeys,1000);this.potentialActions=B.clone()}else{this.resetKeys(this)}},checkModifier:function(A,B){if(A==this.shift){return B.shiftKey}}};DM_KeyHandler.bKeyHandler=DM_KeyHandler.handler.bindAsEventListener(DM_KeyHandler);window.keyHandler=DM_KeyHandler;Event.observe(document,"keydown",DM_KeyHandler.bKeyHandler);var EventSelectors={version:"1.0_pre",cache:[],start:function(A){this.rules=A||{};this.timer=new Array();this._extendRules();this.assign(this.rules)},assign:function(B){var A=null;this._unloadCache();B._each(function(D){var C=$A(D.key.split(","));C.each(function(E){var G=E.split(":");var F=G[1];$$(G[0]).each(function(H){if(G[1]==""||G.length==1){return D.value(H)}if(F.toLowerCase()=="loaded"){this.timer[G[0]]=setInterval(this._checkLoaded.bind(this,H,G[0],D),15)}else{A=function(J){var I=Event.element(J);if(I.nodeType==3){I=I.parentNode}D.value($(I),J)};this.cache.push([H,F,A]);Event.observe(H,F,A)}}.bind(this))}.bind(this))}.bind(this))},_unloadCache:function(){if(!this.cache){return }for(var A=0;A<this.cache.length;A++){Event.stopObserving.apply(this,this.cache[A]);this.cache[A][0]=null}this.cache=[]},_checkLoaded:function(A,D,C){var B=$(A);if(A.tagName!="undefined"){clearInterval(this.timer[D]);C.value(B)}},_extendRules:function(){Object.extend(this.rules,{_each:function(A){for(key in this){if(key=="_each"){continue}var B=this[key];var C=[key,B];C.key=key;C.value=B;A(C)}}})}};var DM_Pngfix={blank:"/images/transparent.gif",rules:{"img.png":function(A){if(A.fixed!=null){return }var B=A.src;A.fixed=true;A.style.backgroundImage="none";A.style.width=A.width+"px";A.style.height=A.height+"px";A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B+"', sizingMethod='scale')";A.src=DM_Pngfix.blank}},initialize:function(){Event.onDOMReady(function(){var B=navigator.appVersion.split("MSIE");var A=parseFloat(B[1]);if(!(A<=6&&(document.body.filters))){return }EventSelectors.start(DM_Pngfix.rules)})}};DM_Pngfix.initialize();var DM_Widget_Header={flagsVisible:false,flagsTimeout:null,subNavTimeout:null,navTimeout:null,loginTimeout:null,selectedLocale:null,moving:false,rules:{"#dm_header":function(A){if(DM_Widget_Header.menuShown){toggleElement("menu_"+DM_Widget_Header.menuShown,"show")}},"a.current_flag":function(A){DM_Widget_Header.selectedLocale=A;A.onclick=function(){if(DM_Widget_Header.flagsVisible==false){DM_Widget_Header.showFlags()}DM_Widget_Header.toggleFlags()}},"div#header_flags":function(A){A.onmousemove=DM_Widget_Header.showFlags;$("dm_footer").insert({bottom:A.remove()})},"div#header_flags a":function(A){A.onclick=function(){if(A.name){DM_Widget_Header.selectFlag(A.name)}else{return true}};A.onmousemove=DM_Widget_Header.showFlags;A.onmouseover=DM_Widget_Header.showFlags},"div.footer_flags a":function(A){A.onclick=function(){DM_Widget_Header.selectFlag(A.name)}},"#channel_next_link":function(A){var B=1;A.onclick=function(){if(!DM_Widget_Header.moving){var C=$("channels_container").getWidth();var D=$("channels_list_endmarker").offsetLeft;B=B*-1;new Effect.Move($("channels_list"),{x:(D-C)*B,mode:"relative",duration:1.2,beforeStart:function(){DM_Widget_Header.moving=true},afterFinish:function(){DM_Widget_Header.moving=false;if(A.innerHTML=="&gt;&gt;"||A.innerHTML==">>"){A.innerHTML="&lt;&lt;"}else{A.innerHTML="&gt;&gt;"}}})}}},"div#main_menu a":function(A){A.onmouseover=function(){clearTimeout(DM_Widget_Header.navTimeout);DM_Widget_Header.navTimeout=setTimeout(function(){if(Element.hasClassName(A,"group")){DM_Widget_Header.toggleSubNav("show").showMenu("menu_group")}else{if(Element.hasClassName(A,"channel")){DM_Widget_Header.toggleSubNav("show").showMenu("menu_channel")}else{if(Element.hasClassName(A,"user")){DM_Widget_Header.toggleSubNav("show").showMenu("menu_user")}else{if(Element.hasClassName(A,"video")){DM_Widget_Header.toggleSubNav("show").showMenu("menu_video")}else{if(Element.hasClassName(A,"mychannel")){DM_Widget_Header.toggleSubNav("hide")}}}}}},200);clearTimeout(DM_Widget_Header.subNavTimeout)};A.onmouseout=function(){clearTimeout(DM_Widget_Header.navTimeout);DM_Widget_Header.timeoutHideSubNav()}},"#dm_header_login_form":function(A){A.onmouseover=function(){clearTimeout(DM_Widget_Header.loginTimeout)};A.onmouseout=function(){DM_Widget_Header.loginTimeout=setTimeout(DM_Widget_Header.hideLogin,20000)}},"div.header_sub_nav":function(A){A.onmouseover=function(){DM_Widget_Header.toggleSubNav("show");clearTimeout(DM_Widget_Header.subNavTimeout)};A.onmouseout=function(){DM_Widget_Header.timeoutHideSubNav()}},"a#close_login":function(A){A.onclick=function(){DM_Widget_Header.hideLogin()}},"#top_search, #footer_search":function(A){A.onsubmit=function(){if(A.id=="top_search"){var B=$("top_search_field")}else{var B=$("footer_search_field")}var C=new RegExp("^\\s*$","g");if(C.test(B.value)){return false}}}},hideLogin:function(){if(Prototype.Browser.IE||Prototype.Browser.Gecko){new Effect.Fade("dm_header_login_form",{duration:0.2});new Effect.Appear("dm_header_search",{queue:"end",duration:0.2,afterFinish:function(){$$("div.right_menu")[0].show()}})}else{$("dm_header_login_form").hide();$("dm_header_search").show();Element.show($$("div.right_menu")[0])}},showLogin:function(){DM_Widget_Header.loginTimeout=setTimeout(DM_Widget_Header.hideLogin,20000);if(Prototype.Browser.IE||Prototype.Browser.Gecko){new Effect.Fade("dm_header_search",{duration:0.2});new Effect.Appear("dm_header_login_form",{queue:"end",duration:0.2,afterFinish:function(){$("username_text").focus()}})}else{$("dm_header_search").hide();$("dm_header_login_form").show();$("username_text").focus()}Element.hide($$("div.right_menu")[0])},toggleFlags:function(){if(DM_Widget_Header.flagsVisible==true&&DM_Widget_Header.flagsTimeout!=null){clearTimeout(DM_Widget_Header.flagsTimeout);DM_Widget_Header.flagsTimeout=null}Effect.toggle($("header_flags"),"appear",{duration:0.2,queue:"end"});DM_Widget_Header.flagsVisible=!DM_Widget_Header.flagsVisible;if(DM_Widget_Header.flagsVisible){DM_Widget_Header.selectedLocale.addClassName("show_flags")}else{DM_Widget_Header.selectedLocale.removeClassName("show_flags")}},toggleSubNav:function(B){var A=$("header_sub_nav");if(B=="show"){new Effect.Appear("header_sub_nav",{duration:0.2})}else{new Effect.Fade("header_sub_nav",{duration:0.5});$("channel_next_link_container").hide()}return this},timeoutHideSubNav:function(){if(DM_Widget_Header.enableSubNavTimeout){if(DM_Widget_Header.subNavTimeout){clearTimeout(DM_Widget_Header.subNavTimeout)}DM_Widget_Header.subNavTimeout=setTimeout("DM_Widget_Header.toggleSubNav('hide');",1000)}},showMenu:function(A){$$("div.header_sub_nav div.header_sub_nav_content").each(function(B){$(B).hide();$("channel_next_link_container").hide()});if(A!="none"){toggleElement(A,"show");if(A=="menu_channel"){$("channels_list").show();$("channel_next_link_container").show()}}return false},showFlags:function(){if(DM_Widget_Header.flagsTimeout!=null){clearTimeout(DM_Widget_Header.flagsTimeout);DM_Widget_Header.flagsTimeout=null}DM_Widget_Header.flagsTimeout=setTimeout(DM_Widget_Header.toggleFlags,7000);return false},selectFlag:function(A){DM_Widget_Header.showFlags();setCookie("lang",A,365);ajax_call("locale","switch_to",location.href,A,function(B){location.href=B.split("#")[0]})},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_Header.rules)})}};DM_Widget_Header.initialize();var DM_Widget_Footer={hack:function(){if($("bodyall")){bodyHeight=$("bodyall").offsetHeight;winHeight=window.innerHeight?window.innerHeight:document.body.clientHeight;if(bodyHeight<winHeight){$("content").style.height=(winHeight-(bodyHeight-$("content").offsetHeight))+"px"}}},initialize:function(){Event.onDOMReady(function(){DM_Widget_Footer.hack()})}};DM_Widget_Footer.initialize();var DM_Widget={rules:{"div.ajax_widget":function(A){var B=findParamInClass("name",A);DM_Widget.get(B,hex2str(findParamInClass("url",A)),A)},"form.ajax_form":function(A){A.onsubmit=function(){DM_Widget.submitAjaxForm(A);return false}}},submitAjaxForm:function(A){var B=A.id.replace("DM_Widget_","");DM_Widget.get(B,Request.getRequestURI(),A.parentNode,{postData:Form.serialize(A)})},get:function(D,B,C,A){if(!A){var A={}}if(!A.postData){A.postData=null;post=null}else{post=A.postData}if(!A.loadingElement){A.loadingElement=null}else{Element.addClassName(A.loadingElement,"dm_loading")}if(!A.callback){A.callback=null}DM_Widget.addCSS(D);ajax_call("widget","get",D,B,post,function(E){DM_Widget.callbackAjaxWidget(D,C,E,A)})},addCSS:function(D){var A=new Date();var C=D.underscore();var B="/css/widget/"+C+".css?"+A.getTime();if(!$("css_"+C)){var E=document.createElement("link");E.setAttribute("href",B);E.setAttribute("rel","stylesheet");E.setAttribute("id","css_"+C);$$("head").shift().insert(E,{position:"bottom"})}},addScript:function(A){var B=document.createElement("script");B.setAttribute("src","/js/widget/"+A.underscore()+".js");B.setAttribute("type","text/javascript");$$("head").shift().appendChild(B);return B},callbackAjaxWidget:function(D,C,A,B){if(B.loadingElement){Element.removeClassName(B.loadingElement,"dm_loading")}$(C).replace(A);if(B.callback){B.callback(A)}DM_Widget.assignRules(D)},assignRules:function(widgetName){try{eval("var widget = DM_Widget_"+widgetName+";");if(widget){if(widget.rules){widget.rules._each=DM_Widget.rules._each;EventSelectors.assign(widget.rules)}if(widget.dependencies){widget.dependencies.each(function(name){DM_Widget.assignRules(name)})}}}catch(e){}EventSelectors.assign(DM_Widget.rules)},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget.rules)})}};DM_Widget.initialize();String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(C[B]).toColorPart()}while(++B<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;B<4;B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()}}if(this.length==7){A=this.toLowerCase()}}}return(A.length==7?A:(arguments[0]||this))};Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(A,B){return $A($(A).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,B))?Element.collectTextNodesIgnoreClass(C,B):""))}).flatten().join("")};Element.setContentZoom=function(A,B){A=$(A);A.setStyle({fontSize:(B/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return A};Element.getInlineOpacity=function(A){return $(A).style.opacity||""};Element.forceRerendering=function(A){try{A=$(A);var C=document.createTextNode(" ");A.appendChild(C);A.removeChild(C)}catch(B){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5},reverse:function(A){return 1-A},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;return A>1?1:A},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){A=A||5;return(((B%(1/A))*A).round()==0?((B*A*2)-(B*A*2).floor()):1-((B*A*2)-(B*A*2).floor()))},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},none:function(A){return 0},full:function(A){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(B,C){B=$(B);C=(C||"appear").toLowerCase();var A=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});Effect[B.visible()?Effect.PAIRS[C][1]:Effect.PAIRS[C][0]](B,A)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(A){this.effects._each(A)},add:function(B){var C=new Date().getTime();var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;switch(A){case"front":this.effects.findAll(function(D){return D.state=="idle"}).each(function(D){D.startOn+=B.finishOn;D.finishOn+=B.finishOn});break;case"with-last":C=this.effects.pluck("startOn").max()||C;break;case"end":C=this.effects.pluck("finishOn").max()||C;break}B.startOn+=C;B.finishOn+=C;if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var C=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(C)}}});Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return }var B=(C-this.startOn)/this.totalTime,A=(B*this.totalFrames).round();if(A>this.currentFrame){this.render(B);this.currentFrame=A}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){var A=$H();for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var A=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(A)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(A)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(A)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return }this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]}.bind(this))},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,C,D){return B+((this._base[D]+(this._delta[D]*A)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.Fade=function(C){C=$(C);var A=C.getInlineOpacity();var B=Object.extend({from:C.getOpacity()||1,to:0,afterFinishInternal:function(D){if(D.options.to!=0){return }D.element.hide().setStyle({opacity:A})}},arguments[1]||{});return new Effect.Opacity(C,B)};Effect.Appear=function(B){B=$(B);var A=Object.extend({from:(B.getStyle("display")=="none"?0:B.getOpacity()||0),to:1,afterFinishInternal:function(C){C.element.forceRerendering()},beforeSetup:function(C){C.element.setOpacity(C.options.from).show()}},arguments[1]||{});return new Effect.Opacity(B,A)};Effect.BlindUp=function(A){A=$(A);A.makeClipping();return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(B){B=$(B);var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(C){C.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(C){C.element.undoClipping()}},arguments[1]||{}))};Effect.SlideDown=function(C){C=$(C).cleanWhitespace();var A=C.down().getStyle("bottom");var B=C.getDimensions();return new Effect.Scale(C,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:A})}},arguments[1]||{}))};Effect.SlideUp=function(C){C=$(C).cleanWhitespace();var A=C.down().getStyle("bottom");var B=C.getDimensions();return new Effect.Scale(C,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:A})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(C){this.element=$(C);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(A.style)){this.style=$H(A.style)}else{if(A.style.include(":")){this.style=A.style.parseStyle()}else{this.element.addClassName(A.style);this.style=$H(this.element.getStyles());this.element.removeClassName(A.style);var B=this.element.getStyles();this.style=this.style.reject(function(D){return D.value==B[D.key]});A.afterFinishInternal=function(D){D.element.addClassName(D.options.style);D.transforms.each(function(E){D.element.style[E.style]=""})}}}this.start(A)},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff"}B=B.parseColor();return $R(0,2).map(function(C){return parseInt(B.slice(C*2+1,C*2+3),16)})}this.transforms=this.style.map(function(G){var F=G[0],E=G[1],D=null;if(E.parseColor("#zzzzzz")!="#zzzzzz"){E=E.parseColor();D="color"}else{if(F=="opacity"){E=parseFloat(E);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(E)){var C=E.match(/^([\+\-]?[0-9\.]+)(.*)$/);E=parseFloat(C[1]);D=(C.length==3)?C[2]:null}}}var B=this.element.getStyle(F);return{style:F.camelize(),originalValue:D=="color"?A(B):parseFloat(B||0),targetValue:D=="color"?A(E):E,unit:D}}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var D={},B,C=this.transforms.length;while(C--){D[(B=this.transforms[C]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit)}this.element.setStyle(D,true)}});Effect.Transform=Class.create({initialize:function(A){this.tracks=[];this.options=arguments[1]||{};this.addTracks(A)},addTracks:function(A){A.each(function(B){B=$H(B);var C=B.values().first();this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:C}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(A){var D=A.get("ids"),C=A.get("effect"),B=A.get("options");var E=[$(D)||$$(D)].flatten();return E.map(function(F){return new C(F,Object.extend({sync:true},B))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var B,A=$H();if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';B=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(C){if(B[C]){A.set(C,B[C])}});if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return A};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(B){var A=document.defaultView.getComputedStyle($(B),null);return Element.CSS_PROPERTIES.inject({},function(C,D){C[D]=A[D];return C})}}else{Element.getStyles=function(B){B=$(B);var A=B.currentStyle,C;C=Element.CSS_PROPERTIES.inject({},function(E,D){E.set(D,A[D]);return E});if(!C.opacity){C.set("opacity",B.getOpacity())}return C}}Effect.Methods={morph:function(A,B){A=$(A);new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A},visualEffect:function(C,E,B){C=$(C);var D=E.dasherize().camelize(),A=D.charAt(0).toUpperCase()+D.substring(1);new Effect[A](C,B);return C},highlight:function(B,A){B=$(B);new Effect.Highlight(B,A);return B}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(C,B){C=$(C);Effect[A.charAt(0).toUpperCase()+A.substring(1)](C,B);return C}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]});Element.addMethods(Effect.Methods);var DM_Widget_Popup=Class.create({options:{dim:true,close_button:true,close_button_bottom:false},initialize:function(B){DM_Widget_Popup.boundClose=DM_Widget_Popup.close.bind(DM_Widget_Popup);DM_Widget_Popup.playerPosition=0;B=(B||{});DM_Widget_Popup.options={};if(this.options.dim){DM_Widget_Popup.dimmer=new Element("div",{id:"dimmer",style:"display: none;"});DM_Widget_Popup.dimmer.setStyle({width:$("bodyall").getWidth()+"px",height:$("wrapper").getHeight()+"px"})}if($$("html").first().hasClassName("ie6")){DM_Widget_Popup.iframe=new Element("iframe",{src:"about:blank",id:"iframe_dimmer",style:"display: block;","class":"popup_widget background_3"})}DM_Widget_Popup.popup=new Element("div",{id:"popup_dimmer",style:"display: none;","class":"popup_widget background_3"});DM_Widget_Popup.popupContent=new Element("div",{id:"popupContent"});DM_Widget_Popup.popupCloseContainer=new Element("div",{id:"popupCloseContainer"});if(this.options.close_button){var C=new Element("a",{"class":"close_img"});C.observe("click",DM_Widget_Popup.boundClose);DM_Widget_Popup.popup.insert(DM_Widget_Popup.popupCloseContainer);DM_Widget_Popup.popupCloseContainer.insert(C)}DM_Widget_Popup.popup.insert(DM_Widget_Popup.popupContent);if(this.options.close_button&&this.options.close_button_bottom){var A=new Element("a",{"class":"foreground2 light_border bottom_close_button"});A.update(DM_CloseLabel);A.observe("click",DM_Widget_Popup.boundClose);DM_Widget_Popup.popup.insert(A)}if(this.options.dim){$("bodyall").insert({top:DM_Widget_Popup.dimmer});if(DM_Widget_Popup.iframe){$("bodyall").insert({bottom:DM_Widget_Popup.iframe})}DM_Widget_Popup.dimmer.insert({after:DM_Widget_Popup.popup})}else{$("bodyall").insert({top:DM_Widget_Popup.popup});if(DM_Widget_Popup.iframe){$("bodyall").insert({bottom:DM_Widget_Popup.iframe})}}Element.observe(window,"resize",function(){var D=$("bodyall").getWidth();var E=$("wrapper").getWidth();if($("dimmer")){$("dimmer").setStyle({width:((D<E)?E:D)+"px",height:$("wrapper").getHeight()+"px"})}})},update:function(A){DM_Widget_Popup.popupContent.update(A)},open:function(){if(($("video_player")||$("videoplayer"))&&!DM_Widget_Popup.playerPosition){if($("video_player")){var A=$("video_player")}else{var A=$("videoplayer")}DM_Widget_Popup.playerPosition=(Position.cumulativeOffset(A)[1])+A.getHeight()}var D=$$(".dmpi_masscast");if($("video_player")&&D.length){D.each(function(E){if(E.getHeight()&&1*(E.cumulativeOffset().top+E.getHeight())>DM_Widget_Popup.playerPosition){DM_Widget_Popup.playerPosition=E.cumulativeOffset().top+E.getHeight()}})}if(DM_Widget_Popup.playerPosition){var B={top:DM_Widget_Popup.playerPosition+10+"px",left:"35%"};if(DM_Widget_Popup.iframe){DM_Widget_Popup.iframe.setStyle(B)}DM_Widget_Popup.popup.setStyle(B)}else{var C=document.viewport.getScrollOffsets().top+Math.round((document.viewport.getHeight()-DM_Widget_Popup.popup.getHeight())/2);if(C<0){C=0}var B={top:C+"px",left:Math.round((document.viewport.getWidth()-DM_Widget_Popup.popup.getWidth())/2)+"px"};if(DM_Widget_Popup.iframe){DM_Widget_Popup.iframe.setStyle(B);DM_Widget_Popup.iframe.setStyle({width:$("popup_dimmer").getWidth()+"px",height:$("popup_dimmer").getHeight()+"px"})}DM_Widget_Popup.popup.setStyle(B)}if(this.options.dim){DM_Widget_Popup.dimmer.show()}if(this.options.close_button){DM_KeyHandler.registerAction(Keyboard.ESCAPE,null,DM_Widget_Popup.boundClose)}DM_Widget_Popup.popup.show()},close:function(){if($("dimmer")){$("dimmer").remove()}if($("popup_dimmer")){$("popup_dimmer").remove();if($("iframe_dimmer")){$("iframe_dimmer").remove()}}delete (DM_Widget_Popup)}});DM_Widget_Popup.close=function(){if($("dimmer")){$("dimmer").remove()}if($("popup_dimmer")){$("popup_dimmer").remove();if($("iframe_dimmer")){$("iframe_dimmer").remove()}}};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return }this.DETECT_KEY=D?D:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(E){this.setAttribute("swf",E)}if(C){this.setAttribute("id",C)}if(K){this.setAttribute("width",K)}if(F){this.setAttribute("height",F)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(J){this.addParam("bgcolor",J)}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(A,B){this.params[A]=B},getParams:function(){return this.params},addVariable:function(A,B){this.variables[A]=B},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var A=new Array();var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B]}return A},getSWFHTML:function(){var D="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var C=this.getParams();for(var A in C){D+=[A]+'="'+C[A]+'" '}var B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"'}D+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var A in C){D+='<param name="'+A+'" value="'+C[A]+'" />'}var B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />'}D+="</object>"}return D},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var C=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var D=1;var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new deconcept.PlayerVersion([B,0,0])}catch(E){D=null}}}else{try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always"}catch(E){if(C.major==6){return C}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(D!=null){C=new deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","))}}}return C};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D==null){return C}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var DM_Widget_VideoItem={currentElementId:null,rules:{"div.dm_widget_playlistvideoitem":function(A){A.onmouseover=function(){A.lastChild.style.visibility="visible"};A.onmouseout=function(){A.lastChild.style.visibility="hidden"}},"div.dm_widget_videoitem":function(A){A.onmouseover=function(){A.select("div.actions").invoke("show")};A.onmouseout=function(){A.select("div.actions").each(function(B){if(!B.hasClassName("below_preview")){B.hide()}})}},"div.remove_bookmark":function(A){A.onclick=function(){DM_Widget_VideoItem.currentElement=A;ajax_call("video","toggle_bookmark",findIdInClass(A),DM_Widget_VideoItem.itemRemoved);return false}},"div.censor_video":function(A){A.onclick=function(){DM_Widget_VideoItem.currentElement=A;ajax_call("admin","admin_toggle","video",findIdInClass(A),"moderation",DM_Widget_VideoItem.itemRemoved);return false}},"div.explicit_video":function(A){A.onclick=function(){DM_Widget_VideoItem.currentElement=A;ajax_call("admin","admin_toggle","video",findIdInClass(A),"explicit",DM_Widget_VideoItem.itemRemoved);return false}},"div.get_admin_panel":function(A){A.onclick=function(){setCookie("admin_panel_status",1);DM_Widget.get("AdminPanel",hex2str(findParamInClass("url",A)),$("admin_panel_container").firstDescendant());toggleElement($("admin_panel_container"),"show");return false}},"div.copyright_claim_video":function(A){A.onclick=function(){DM_Widget_VideoItem.currentElement=A;ajax_call("copyrightowner","send_abuse",findIdInClass(A),"explicit",DM_Widget_VideoItem.itemRemoved);return false}},"div.play_video":function(A){A.onclick=function(){var D=findIdInClass(A);if($("preview_player")){var B=false;if(DM_Widget_VideoItem.currentElement==A){B=true}$("preview_player").remove();$$("div.below_preview").invoke("removeClassName","below_preview");$$("div.play_video").invoke("removeClassName","stop");if(B){return false}}var E=A.parentNode.parentNode.appendChild(document.createElement("div"));E.setAttribute("id","preview_player");E.setAttribute("class","id_"+D);A.parentNode.addClassName("below_preview");A.addClassName("stop");var C=new SWFObject("/swf/"+D+"&autoPlay=1","video_player","100%","100%","7");C.addParam("allowFullScreen","true");C.addParam("allowScriptAccess","always");C.write("preview_player");DM_Widget_VideoItem.currentElement=A;return false}},"div.copyright_video":function(A){A.onclick=function(){DM_Widget_VideoItem.currentElement=A;ajax_call("admin","admin_toggle","video",findIdInClass(A),"moderation_copyright",DM_Widget_VideoItem.itemRemoved);return false}},"div.copyrightTS_video":function(A){A.onclick=function(){DM_Widget_VideoItem.currentElement=A;ajax_call("admin","admin_toggle","video",findIdInClass(A),"moderationTS_copyright",DM_Widget_VideoItem.itemRemoved);return false}},"div.quicklist":function(A){A.onclick=function(){if(Element.hasClassName(A,"add")){ajax_call("quicklist","add_video",findIdInClass(A),function(B){DM_Widget_VideoItem.callbackQuicklist(B,A)})}else{ajax_call("quicklist","remove_video",findIdInClass(A),function(B){DM_Widget_VideoItem.callbackQuicklist(B,A)})}return false}},"div.video_tools":function(A){A.onmouseover=function(){var B=A.nextSibling;videoItem=A.parentNode;videoItem.style.zIndex=3;B.style.visibility="visible";Effect.Appear("video_tools_".findIdInClass(videoItem),{duration:0.8,to:1,from:0});DM_Widget_VideoItem;return false}},"div.delete_video_playlist":function(A){var B=A.parentNode;A.onclick=function(){if(!Element.hasClassName(A,"loading")){Element.addClassName(A,"loading");DM_Widget_VideoItem.currentElement=A;var C=escape(hex2str(findParamInClass("url",B)));ajax_call("playlist","delete_video",C,DM_Widget_VideoItem.itemPlaylistDeleted)}return false}},"div.slider_track":function(D){var E=D.parentNode.parentNode.parentNode;var C=parseInt(findParamInClass("playlist_size",E));var A=D.parentNode.nextSibling.nextSibling;var F=A.nextSibling;if(C>1){var B={range:$R(1,C),values:$A($R(1,C)),sliderValue:findParamInClass("position",E),onSlide:function(G){A.innerHTML=DM_Widget_VideoItem.positionLabel+" "+G+"/"+C;F.style.display="none"},onChange:function(G){A.innerHTML=DM_Widget_VideoItem.positionLabel+" "+G+"/"+C;F.style.display="block";E.new_position=G}};E.slider=new Control.Slider(D.childNodes[0],D,B)}A.innerHTML=DM_Widget_VideoItem.positionLabel+" "+findParamInClass("position",E)+"/"+C},"a.slider_save":function(A){A.onclick=function(){if(!Element.hasClassName(A,"loading")){var C=A.parentNode.parentNode;var B=escape(hex2str(findParamInClass("url",C)));Element.addClassName(A,"loading");ajax_call("playlist","move_video_at_position",B,C.new_position,DM_Widget_VideoItem.itemMoved)}}},"div.move_up":function(A){A.onclick=function(){var C=A.parentNode.parentNode;var B=parseInt(findParamInClass("playlist_size",C));if(B>1){if(C.slider.value>1){C.slider.setValue(C.slider.value-1)}else{return }var D=A.nextSibling.lastNode}}},"div.move_down":function(A){A.onclick=function(){var C=A.parentNode.parentNode;var B=parseInt(findParamInClass("playlist_size",C));if(B>1){if(C.slider.value<B){C.slider.setValue(C.slider.value+1)}else{return }var D=A.previousSibling.lastNode}}}},callbackGetWidget:function(A){$("admin_panel_content").innerHTML=A;EventSelectors.assign(DM_Widget.rules);EventSelectors.assign(DM_Widget_AdminPanel.rules);EventSelectors.assign(DM_Widget_ExtractPreview.rules)},callbackQuicklist:function(A,B){if(A){Element.removeClassName(B,"add");Element.addClassName(B,"remove")}else{Element.removeClassName(B,"remove");Element.addClassName(B,"add")}},itemRemoved:function(A){if(A==1){DM_Widget_VideoItem.currentElement.parentNode.parentNode.parentNode.style.opacity=0.7;Element.addClassName(DM_Widget_VideoItem.currentElement,"cancel")}else{$(DM_Widget_VideoItem.currentElement).parentNode.parentNode.parentNode.style.opacity=1;Element.removeClassName(DM_Widget_VideoItem.currentElement,"cancel")}},itemPlaylistDeleted:function(){Effect.Fade($(DM_Widget_VideoItem.currentElement).parentNode)},itemMoved:function(){document.location.reload()},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_VideoItem.rules)})}};DM_Widget_VideoItem.initialize();var DM_Widget_PageItem_Video_Preview={item:null,container:null,sprite1:null,sprite2:null,state:0,step:0,total:0,timer:-1,handler:function(){switch(this.state){case 0:this.container=new Element("div").setStyle({position:"absolute",overflow:"hidden",top:"2px",left:"2px",width:this.item.getWidth()+"px",height:this.item.getHeight()+"px",display:"none"});var A=this.item.up().down("img",0).readAttribute("src").replace(/(\/\d+x\d+\/)/g,"/SPRITE/");A=A.replace(/jpeg_preview_([^\.]+)/,"jpeg_preview_sprite");this.sprite2=new Element("img",{src:A}).setStyle({position:"absolute",border:"none",opacity:0,width:this.item.getWidth()+"px",height:(this.item.getHeight()*this.total)+"px"});this.container.insert(this.sprite2);this.item.insert({before:this.container});this.state++;break;case 1:if(this.sprite2.complete||(typeof (this.sprite2.naturalWidth)!="undefined"&&this.sprite2.naturalWidth!==0)){var A=this.item.up().down("img",0).readAttribute("src").replace(/(\/\d+x\d+\/)/g,"/SPRITE/");A=A.replace(/jpeg_preview_([^\.]+)/,"jpeg_preview_sprite");this.sprite1=new Element("img",{src:A}).setStyle({position:"absolute",border:"none",opacity:0,width:this.item.getWidth()+"px",height:(this.item.getHeight()*this.total)+"px"});this.container.insert({top:this.sprite1});this.container.setStyle({display:"block"});this.state++;this.step=0;new Effect.Opacity(this.sprite2,{from:0,to:1,duration:0.4})}break;case 2:this.step++;if(this.step>=this.total){this.step=0}this.sprite1.setStyle({opacity:1});if(DM_Widget_PageItem_Video_Preview.step%2){this.sprite1.setStyle({top:"-"+(this.step*this.item.getHeight())+"px"});new Effect.Opacity(this.sprite2,{from:1,to:0,duration:0.4})}else{this.sprite2.setStyle({top:"-"+(this.step*this.item.getHeight())+"px"});new Effect.Opacity(this.sprite2,{from:0,to:1,duration:0.4})}break}this.timer=window.setTimeout(function(){DM_Widget_PageItem_Video_Preview.handler()},this.state==1?50:1000)},rules:{"div.psprite":function(A){A.setStyle({backgroundColor:"#000000",opacity:0,cursor:"hand"});A.onmouseover=function(){DM_Widget_PageItem_Video_Preview.item=A;DM_Widget_PageItem_Video_Preview.state=0;DM_Widget_PageItem_Video_Preview.total=this.hasClassName("pmode8")?8:4;DM_Widget_PageItem_Video_Preview.timer=window.setTimeout(function(){DM_Widget_PageItem_Video_Preview.handler()},500)};A.onmouseout=function(){window.clearTimeout(DM_Widget_PageItem_Video_Preview.timer);if(DM_Widget_PageItem_Video_Preview.container){DM_Widget_PageItem_Video_Preview.container.remove();DM_Widget_PageItem_Video_Preview.container=null}}}},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_PageItem_Video_Preview.rules)})}};DM_Widget_PageItem_Video_Preview.initialize();var DM_Widget_UserTools={userId:null,rules:{"a.show_blog_list":function(A){A.onclick=function(){toggleElement("blog_list")}},"div#blog_list div.close":function(A){A.onclick=function(){toggleElement(A.parentNode.parentNode)}},"div.link_subscribe":function(A){A.onclick=function(){ajax_call("relation","toggle_subscribe",findIdInClass(A),DM_Widget_UserTools.toggleSubscription(A))}},"a.refuse_request":function(A){A.onclick=function(){Element.addClassName(A,"loading");ajax_call("relation","ignore",findIdInClass(A),function(B){DM_Widget_UserTools.callbackFadeRelation(A,B)})}},"a.accept_request":function(A){A.onclick=function(){if(!$("popup")){var B=findIdInClass(A);ajax_call("relation","add_to_friend",B,function(C){DM_Widget_UserTools.callbackRelationPopup(A,C)})}}},"a.add_to_friends":function(A){A.onclick=function(){DM_Widget_UserTools.toggleRelation(A,"add",findIdInClass(A))}},"a.edit_contact":function(A){A.onclick=function(){DM_Widget_UserTools.toggleRelation(A,"edit",findIdInClass(A))}},"a.delete_relation":function(A){A.onclick=function(){Element.addClassName(A,"loading");ajax_call("relation","delete",findIdInClass(A),function(){DM_Widget_UserTools.callbackFadeRelation(A)})}}},toggleRelation:function(C,F,B){Element.addClassName(C,"loading");if(!$("popup")){var D="/contact/"+F+"/"+findIdInClass(C);var E=(Position.cumulativeOffset(C)[1])+10+"px";var A=(Position.cumulativeOffset(C)[0])-455+"px";DM_Widget_Popup.getWidget(C,D,"RelationEdit",E,A);DM_Widget_UserTools.userId=B}Element.removeClassName(C,"loading")},toggleSubscription:function(A){var B=A;Element.addClassName(B.firstChild.lastChild,"loading");return function(C){if(B.firstChild.lastChild!=null){if(C==1){if(typeof thefilter_enabled!="undefined"&&thefilter_enabled){if(thefilter_debug_enabled){dbg("DMFilterCapture_OnUserAddToChannel("+thefilter_userId+", "+thefilter_publisherId+', "'+thefilter_recommandation_enabled+'");')}DMFilterCapture_OnUserAddToChannel(thefilter_userId,thefilter_publisherId,thefilter_recommandation_enabled)}B.firstChild.lastChild.innerHTML=DM_Widget_UserTools.remove_subscription_label}else{if(typeof thefilter_enabled!="undefined"&&thefilter_enabled){if(thefilter_debug_enabled){dbg("DMFilterCapture_OnUserRemoveFromChannel("+thefilter_userId+", "+thefilter_publisherId+', "'+thefilter_recommandation_enabled+'");')}DMFilterCapture_OnUserRemoveFromChannel(thefilter_userId,thefilter_publisherId,thefilter_recommandation_enabled)}B.firstChild.lastChild.innerHTML=DM_Widget_UserTools.add_subscription_label}Element.removeClassName(B.firstChild.lastChild,"loading")}DM_Widget_UserTools.updateSubscriptionCounter(C)}},updateSubscriptionCounter:function(A){var C=$("user_nb_subscriptions");if(C){var B=parseInt(C.innerHTML);if(A==1){C.innerHTML=B+1}else{if(B>0){C.innerHTML=B-1}}}},callbackRelationPopup:function(D,A){var C=findIdInClass(D);var E="/contact/add/"+C;var F=(Position.cumulativeOffset(D)[1])+10+"px";var B=(Position.cumulativeOffset(D)[0])-455+"px";DM_Widget_Popup.getWidget(D,E,"RelationEdit",F,B)},callbackFadeRelation:function(A){if($("user_list_item_"+findIdInClass(A))){new Effect.Fade($("user_list_item_"+findIdInClass(A)),{duration:0.6})}Element.removeClassName(A,"loading")},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_UserTools.rules)})}};DM_Widget_UserTools.initialize();var DM_Widget_PageItem_Masscast={allowDebug:false,enableCrossFade:false,enableRotateAd:false,crossFadeDuration:1,allowedDerivated:["Middle","Top","Right1","Right2","Right3","BottomLeft"],allowedPosition:["Middle","Top","Right1","Right2","Right3","BottomLeft","Preroll","Midroll","Postroll","Frame1","x10","x11"],positionMinHeight:{"Middle":250,"Top":90,"Right1":100,"Right2":100,"Right3":100,"BottomLeft":300},positionCalled:[],defaultReloadTime:{},reloadTime:{},reloadMaxDuration:{},reloadTimeout:{},positionCode:{},theaterAd:{},initDate:new Date(),OAS_RICH:null,call:null,canCallOAS:true,richedOAS:false,instreamPulled:false,noFrame:false,isMiddle:false,debug:function(D){if(this.allowDebug&&typeof console!="undefined"){var B=new Date();var A=(B.getHours()<10)?"0"+B.getHours():B.getHours();var C=(B.getMinutes()<10)?"0"+B.getMinutes():B.getMinutes();var E=(B.getSeconds()<10)?"0"+B.getSeconds():B.getSeconds();console.log(A+":"+C+":"+E+" - "+D)}},callOAS:function(B){if(this.canCallOAS===false){return }this.canCallOAS=false;this.debug("Calling OAS ...");this.call=B;var A=new Element("script",{src:this.call,id:"oas_call",type:"text/javascript"});$$("head")[0].insert(A)},richOAS:function(){if(typeof OAS_RICH!="function"||this.richedOAS===true){return }this.richedOAS=true;this.debug("Looking for data from OAS");var B=document.write;var C;document.write=function(D){C=C+D};for(var A=0;A<this.allowedPosition.length;A++){C="";OAS_RICH(this.allowedPosition[A]);this.positionCode[this.allowedPosition[A]]=C}document.write=B;this.getTheaterAdCode()},playerCallback:function(E,G){if(E=="advertising"){this.debug("Recieving data from player");this.initDate=new Date();var D=G.indexOf('<!--OAS AD="',D);var C=0;var B="";var F="";if(D==-1){this.positionCode[this.positionCalled[0]]=G}else{while(D!=-1){D+=12;C=G.indexOf('"-->',D);B=G.substring(D,C);D=C+4;C=G.indexOf("<!--",D);C=(C==-1)?G.length:C;F=G.substring(D,C);if(!F.blank()){this.debug("code recieved for position : "+B);this.positionCode[B]=F}D=G.indexOf('<!--OAS AD="',D)}}this.renderAllPosition()}else{if(E=="instream"&&this.instreamPulled===false){var A=this.positionCode.Preroll+this.positionCode.Midroll+this.positionCode.Postroll+this.positionCode["x10"];if(A.length>0){this.debug("Player pulled instream");this.instreamPulled=true;return A}else{this.debug("Player could not pull instream");return""}}}},getBuzzableVideoId:function(){var code=eval(this.positionCode["x11"]);if(typeof code!="undefined"&&typeof code.videoId!="undefined"){return code.videoId}return false},hasTheaterAd:function(){return $H(this.theaterAd).values().length!==0},getSWF:function(B,A){return this.hasTheaterAd()?A:B},getTheaterAdCode:function(){var A=document.write;document.write=function(C){C=C.replace(/^\s+|\s+$|\\n/g,"");var B=C.match(/^(curtainPath|backgroundPath|clickTAG|clickTARGET|accountingPath)\s*=\s*(.*)$/);if(B){DM_Widget_PageItem_Masscast.theaterAd[B[1]]=B[2]}};OAS_RICH("Frame1");document.write=A;if(this.hasTheaterAd()){this.debug("Position code FOUND : TheaterAd")}else{this.debug("Position code not found : TheaterAd")}},setTheaterAd:function(A){if(!this.hasTheaterAd()){return }$$("body").first().addClassName("theater_video_page");for(param in this.theaterAd){A.addVariable(param,this.theaterAd[param])}A.addVariable("hide",A.getVariable("hide")+"%40fullscreen%40")},render:function(F,A,G,H,B,I,C,D){if(DM_Widget_PageItem_Masscast.noFrame===true){document.write('<div style="width: 300px; height: 250px;"></div>')}else{Element.extend(document.body);document.body.update(new Element("div").setStyle({height:"250px",width:"300px"}))}var E=$H({"title":F,"videoURI":A,"targetURL":G,"linkTargetParam":H,"playURL":B,"VSTag":(!I)?"":I,"autoMute":(!D)?"1":D,"autoPlay":(!C)?"0":C});ajax_call("masscast","get_video_player",E.toJSON(),DM_Widget_PageItem_Masscast.render_callback)},render_callback:function(B){var D=B.evalJSON();if(D.title){var C=$("mc_title");if(C){var E="";if(C.hasClassName("mc_vertical_title")){for(var A=0;A<D.title.length;A++){E+=D.title.charAt(A)+"<br>"}}else{E=D.title}C.update(E)}}if(DM_Widget_PageItem_Masscast.noFrame===true){$("mc_Middle").update(D.content)}else{document.body.down().update(D.content)}},render_skin:function(A){ajax_call("masscast","get_skin",A,DM_Widget_PageItem_Masscast.callbackSelectSkin)},callbackSelectSkin:function(D){var A=new Date();D=D.evalJSON(true);var C=D.css;var B=C+"?"+Math.round((A.getTime()/1000));if($("css_skin")){$("css_skin").setAttribute("href",B)}var E=document.createElement("link");E.setAttribute("href","/css/gen/widget/pack/base.css?"+Math.round((A.getTime()/1000)));E.setAttribute("rel","stylesheet");E.setAttribute("id","css_base_skin");$$("head").shift().appendChild(E);var E=document.createElement("link");E.setAttribute("href",B);E.setAttribute("rel","stylesheet");E.setAttribute("id","css_skin");$$("head").shift().appendChild(E);if($("top_banner")){$("top_banner").remove()}if($$("div.subheader").length>0){$$("div.subheader")[0].remove()}if($$("a.subheader").length>0){$$("a.subheader")[0].remove()}if($("bottom_banner")){$("bottom_banner").remove()}if($$("div.bottom_banner").length>0){$$("div.bottom_banner")[0].remove()}if($$("a.bottom_banner").length>0){$$("a.bottom_banner")[0].remove()}if($("center_banner")){$("center_banner").remove()}if($("header_sub_nav")&&(D.topBannerHeight||D.topBannerImage||D.topBannerLink)){options={"class":"subheader",id:"top_banner"};if(D.topBannerLink){options.href=D.topBannerLink}$("header_sub_nav").insert({after:new Element("a",options)})}if($$("div.dmpi_subheader").length>0&&(D.topBannerHeight||D.topBannerImage||D.topBannerLink)){options={"class":"subheader",id:"top_banner"};if(D.topBannerLink){options.href=D.topBannerLink}$$("div.dmpi_subheader")[0].insert({top:new Element("a",options)})}else{if($("header")){$("header").setStyle({margin:"0 0 28px 0"})}}if(D.centerBannerHeight||D.centerBannerImage||D.centerBannerLink){if($("channels")){options={id:"center_banner","class":"home_center_banner"};if(D.centerBannerLink){options.href=D.centerBannerLink}$("channels").insert({after:new Element("a",options)})}}if(D.bottomBannerHeight||D.bottomBannerImage||D.bottomBannerLink){options={"class":"dmpi_bottombanner"};$("content").insert({bottom:new Element("div",options)});options={"class":"bottom_banner"};if(D.bottomBannerLink){options.href=D.bottomBannerLink}$$("div.dmpi_bottombanner")[0].insert({top:new Element("a",options)})}if(D.bodyLinkBlank){DM_Widget_PageItem_Masscast.bodyLinkBlank=D.bodyLinkBlank}if(D.bodyLink){DM_Widget_PageItem_Masscast.bodyLink=D.bodyLink}},getPositionCode:function(A){if(this.issetPositionCode(A)){return this.positionCode[A]}},issetPositionCode:function(A){if(this.positionCode[A]){return true}return false},renderAllPosition:function(){for(var A=0;A<this.allowedDerivated.length;A++){if(this.positionCalled.indexOf(this.allowedDerivated[A])!=-1){if(this.positionCalled.indexOf(this.allowedDerivated[A])!=-1&&this.issetPositionCode(this.allowedDerivated[A])){this.debug("Position code FOUND : "+this.allowedDerivated[A]);this.renderPosition(this.allowedDerivated[A])}else{this.debug("Position code not found : "+this.allowedDerivated[A])}}}},renderPosition:function(A,F){var B=$("mc_"+A);if(!B){this.debug("Position placeholder not found : "+A);return }window.clearTimeout(this.reloadTimeout[A]);var H=$H({"position":A});if(typeof F!="undefined"){H.set("call",F)}var E=new Element("iframe",{"src":"/middle?"+H.toQueryString(),"scrolling":"no","frameBorder":"0","allowTransparency":"true"});if(this.enableCrossFade){var G=B.childElements();var D=G[0];for(var C=1;C<G.length;C++){G[C].remove()}if(D){D.absolutize();Effect.Fade(D,{duration:this.crossFadeDuration,afterFinish:function(I){I.element.remove()}})}E.hide();$("mc_"+A).insert(E);Effect.Appear(E,{duration:this.crossFadeDuration})}else{$("mc_"+A).update(E)}},adjustPositionSize:function(B,A){A=A-(A%10);if(A!==0&&A<this.positionMinHeight[B]){A=this.positionMinHeight[B]}$("mc_"+B).setStyle({height:A+"px"});var C=$("mc_"+B).down("iframe");if(C){C.setStyle({height:A+"px"})}},forceSetReload:function(){for(var A=0;A<this.allowedDerivated.length;A++){if(this.positionCalled.indexOf(this.allowedDerivated[A])!=-1){this.setReload(this.allowedDerivated[A])}}},setReload:function(A){if(this.enableRotateAd===false){this.debug(A+" is Fixed (rotate ad not enable)");return false}var C=new Date().getTime();var B=null;if(typeof this.reloadMaxDuration[A]!="undefined"&&this.reloadMaxDuration[A]!==false&&this.reloadMaxDuration[A]>0){if(C-this.initDate.getTime()>this.reloadMaxDuration[A]*1000){this.debug("Fix "+A+" (no reload time forced by MAXDURATION)");return false}}if(typeof this.reloadTime[A]!="undefined"&&this.reloadTime[A]!==false){if(this.reloadTime[A]>0){B=this.reloadTime[A];this.debug("Reload "+A+" in "+B+"sc (forced by OAS)")}else{this.debug("Fix "+A+" (no reload time forced by OAS)");return false}}else{if(typeof this.defaultReloadTime[A]!="undefined"&&this.defaultReloadTime[A]!==false){if(this.defaultReloadTime[A]>0){B=this.defaultReloadTime[A];this.debug("Reload "+A+" in "+B+"sc (forced by CONF)")}else{this.debug("Fix "+A+" (no reload time forced by CONF)");return false}}else{this.debug("Fix "+A+" (no reload time was set)");return false}}this.reloadTimeout[A]=window.setTimeout(this.reload.bind(this,A),B*1000)},reload:function(){var A=arguments[0];var B=this.call;B=B.gsub("/masscast/[0-9]/","/masscast/2/");B=B.gsub("@([^?]+)?","@"+A);B=B.gsub("/[0-9]*@","/"+Math.floor(Math.random()*100000)+"@");this.renderPosition(A,B)},initialize:function(){Event.onDOMReady(function(){if(this.isMiddle===true){return }this.debug("DOM is Ready");this.richOAS();if(this.noFrame===true){this.forceSetReload()}else{this.renderAllPosition()}}.bind(this))}};DM_Widget_PageItem_Masscast.initialize();var DM_MassCast=DM_Widget_PageItem_Masscast;var DM_Widget_TheaterPlayer={rules:{"body":function(A){A.addClassName("theater_video_page")}},initialize:function(){EventSelectors.start(DM_Widget_TheaterPlayer.rules)}};player_proxy.firstplay=true;player_proxy.firststop=true;function player_proxy(A,B){if(typeof thefilter_enabled!="undefined"&&thefilter_enabled){if(B=="play"&&player_proxy.firstplay){player_proxy.firstplay=false;setTimeout(function(){if(thefilter_debug_enabled){dbg("DMFilterCapture_OnItemPlayStarted("+thefilter_videoId+", "+thefilter_userId+', "'+thefilter_userLocale+'", "'+thefilter_recommandation_enabled+'");')}DMFilterCapture_OnItemPlayStarted(thefilter_videoId,thefilter_userId,thefilter_userLocale,thefilter_recommandation_enabled)},1000)}if(B=="stop"&&player_proxy.firststop){player_proxy.firststop=false;if(thefilter_debug_enabled){dbg("DMFilterCapture_OnItemPlayEnded("+thefilter_videoId+", "+thefilter_userId+', "'+thefilter_userLocale+'", "'+thefilter_recommandation_enabled+'");')}DMFilterCapture_OnItemPlayEnded(thefilter_videoId,thefilter_userId,thefilter_userLocale,thefilter_recommandation_enabled)}}if(A=="advertising"||A=="instream"){return DM_Widget_PageItem_Masscast.playerCallback(A,B)}else{if(A=="progress"&&B=="complete"){window.location.reload(true)}else{if(A=="tools"&&B=="share"){if($$("a.name_share")[0]){DM_Widget_VideoTools.loadWidget("Share",$$("a.name_share")[0]);$("tools_container").scrollTo()}}else{if(A=="fullscreen"){if(B=="on"){zoomPlayer()}else{unzoomPlayer()}}else{if(A=="debug"){dbg(B)}else{if(A=="position"){if(typeof (DM_Widget_Page_SubtitleEditor)=="object"){DM_Widget_Page_SubtitleEditor.catchPlayerTime(B)}else{if(typeof (DM_Widget_Page_SubtitleTranslator)=="object"){DM_Widget_Page_SubtitleTranslator.catchPlayerTime(B)}}}else{if(A=="thefilter"){if(typeof (DM_Widget_PageItem_Video_Related)=="object"){DMFilterRecommendation_GetJSONRecommendation(thefilter_videoId,thefilter_recsCount,thefilter_userId,thefilter_userLocale,thefilter_channel,thefilter_publisherId,thefilter_familyFilter,DM_Widget_PageItem_Video_Related.getTheFilterResults);return DM_Widget_PageItem_Video_Related.theFilterVids}else{DMFilterRecommendation_GetJSONRecommendation(thefilter_videoId,thefilter_recsCount,thefilter_userId,thefilter_userLocale,thefilter_channel,thefilter_publisherId,thefilter_familyFilter,DM_Widget_VideoContext.getTheFilterResults);return DM_Widget_VideoContext.theFilterVids}}else{if(A=="redirection"){setTimeout(function(){window.location.href=B},50)}}}}}}}}return""}function setPageTitle(A){document.title=A}var DM_Widget_Rating={rules:{"a.dm_rate":function(B){var A=Request.getRequestURI();B.onclick=function(){var C=findParamInClass("rating",B);Element.addClassName($("rating_title"),"loading_top_right");ajax_call("video","rate",A,C,DM_Widget_Rating.updateRatings(C))};B.onmouseover=function(){$("rating_title").innerHTML=B.title};B.onmouseout=function(){$("rating_title").innerHTML=""}}},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_Rating.rules)})},updateRatings:function(rating){return function(status){if(status){try{data=eval(status)}catch(err){data=status}if(typeof data=="object"){if(isNaN(parseInt(data[1]))){return }$("current_rating").className="current-rating rate-"+rating;if($("avg_star_rating")){Element.setStyle("avg_star_rating",{width:Math.round(data[0]*80/5)+"px"})}if($("avg_rating_score")){$("avg_rating_score").innerHTML=data[0]}if($("avg_rating_nb_votes")){$("avg_rating_nb_votes").innerHTML=data[1]}if($("player_avg_rating_nb_votes")){$("player_avg_rating_nb_votes").innerHTML=data[1]}}else{if(!$("dm_rating_login")){new Insertion.After($("dm_widget_rating"),status);EventSelectors.assign(DM_Widget_VideoTools.rules)}toggleElement("dm_rating_login","show")}}Element.removeClassName($("rating_title"),"loading_top_right");if(typeof thefilter_enabled!="undefined"&&thefilter_enabled){if(thefilter_debug_enabled){dbg("DMFilterCapture_OnItemRated("+thefilter_videoId+", "+thefilter_userId+', "'+thefilter_userLocale+'", '+rating+', "'+thefilter_recommandation_enabled+'");')}DMFilterCapture_OnItemRated(thefilter_videoId,thefilter_userId,thefilter_userLocale,rating,thefilter_recommandation_enabled)}}}};DM_Widget_Rating.initialize();var DM_Widget_VideoTools={packLoader:new YAHOO.util.YUILoader({require:["pack_video_tools"]}),packLoaded:false,loadingLink:null,menuLinks:null,prevPopup:null,rules:{"a.get_widget":function(A){var B=findParamInClass("name",A).capitalize().dasherize().camelize();A.onclick=function(){var C=A;if(!DM_Widget_VideoTools.packLoaded){DM_Widget_VideoTools.packLoader.insert({onSuccess:function(){DM_Widget_VideoTools.packLoaded=true;DM_Widget_VideoTools.loadWidget(B,C)}})}else{DM_Widget_VideoTools.loadWidget(B,C)}return false}},"#close_tools_container":function(A){A.onclick=function(){toggleElement(A);toggleElement($("tools_container").firstDescendant());DM_Widget_VideoTools.resetTools()}},"#dm_rating_login img.close":function(A){A.onclick=function(){toggleElement(A.parentNode.parentNode)}},"a.dm_toggle_bookmark":function(A){A.onclick=function(){var B=findIdInClass(A);A.addClassName("dm_loading");ajax_call("video","toggle_bookmark",B,DM_Widget_VideoTools.callbackBookmarkToggle);DM_Widget_VideoTools.resetTools()}},"a#show_all_related":function(A){A.onclick=function(){toggleElement("all_related");if(hasClass(A,"off")){removeClass(A,"dm_action_link off");addClass(A,"dm_action_link on")}else{removeClass(A,"dm_action_link on");addClass(A,"dm_action_link off")}}},"a#map_link.show_map_preview":function(A){A.onclick=function(){if($("yahoo_geoloc_preview_iframe")){$("yahoo_geoloc_preview_iframe").toggle();return }var D=findParamInClass("id",A);var C="/widget/YahooGeolocPreview?video_id="+D+"&minimal=1";var B='<iframe id="yahoo_geoloc_preview_iframe" frameborder="0" scrolling="no"></iframe>';$("tools_container").insert({after:B});$("yahoo_geoloc_preview_iframe").writeAttribute({src:C})}},"a#show_more_subtitles":function(A){A.onclick=function(){$("video_data").select(".more_lang").each(function(B){B.toggle()});$("show_more_subtitles").hide()}},"a#hide_more_subtitles":function(A){A.onclick=function(){$("video_data").select(".more_lang").each(function(B){B.toggle()});$("show_more_subtitles").show()}}},loadWidget:function(C,B){var D=$($("tools_container").firstDescendant());if(!D.hasClassName("dm_widget_"+C.toLowerCase())||D.hasClassName("validated")){toggleElement(D,"show");toggleElement($("close_tools_container"),"show");var A=Request.getRequestURI();if(B.href.match("/")){A=Request.getRequestURI(B.href)}DM_Widget.get(C,A,D,null,B)}else{toggleElement($("close_tools_container"));toggleElement(D)}if(D.style.display=="none"){DM_Widget_VideoTools.resetTools()}else{DM_Widget_VideoTools.menuLinks.each(function(E){if(E!=B){Element.addClassName(E,"label_50")}else{Element.removeClassName(E,"label_50")}})}$("tools_container").scrollTo()},resetTools:function(){DM_Widget_VideoTools.menuLinks.each(function(A){Element.removeClassName(A,"label_50")})},callbackInviteInGroup:function(A,B){return function(C){var D=$(A).firstDescendant();D.select("span")[0].innerHTML=B;new Effect.Fade($(A))}},callbackBookmarkToggle:function(C){var E=$("dm_toggle_bookmark_link");Element.removeClassName(E,"dm_loading");var B=$("favorite_counter");var D=0;var A=0;if(B){D=parseInt(B.innerHTML)}if(C=="unlogged"){DM_Widget_VideoTools.loadWidget("Login",E);return false}else{if(C==1){Element.removeClassName(E,"add");Element.addClassName(E,"remove");E.innerHTML=DM_Widget_VideoTools.removeBookmarkLabel;A=1;if(typeof thefilter_enabled!="undefined"&&thefilter_enabled){if(thefilter_debug_enabled){dbg("DMFilterCapture_OnItemMarkAsFavorite("+thefilter_videoId+", "+thefilter_userId+', "'+thefilter_userLocale+'", "'+thefilter_recommandation_enabled+'");')}DMFilterCapture_OnItemMarkAsFavorite(thefilter_videoId,thefilter_userId,thefilter_userLocale,thefilter_recommandation_enabled)}}else{Element.removeClassName(E,"remove");Element.addClassName(E,"add");E.innerHTML=DM_Widget_VideoTools.addBookmarkLabel;A=-1}}if(B){B.innerHTML=D+A}},initialize:function(){DM_Widget_VideoTools.packLoader.addModule({name:"pack_video_tools",type:"js",fullpath:"/js/gen/pack/video_tools.js",varName:"DM_Widget_Share"});Event.onDOMReady(function(){if($$("div.dm_widget_videotools").size()>0){EventSelectors.start(DM_Widget_VideoTools.rules);DM_Widget_VideoTools.menuLinks=$$("div.dm_widget_videotools a.dm_action_link");if($("tools_container")&&(anchor=Request.getAnchor())){var B=anchor.capitalize().dasherize().camelize();var A=".name_"+anchor;var C=$("tools_container").previous(1);if(C.firstDescendant()){DM_Widget_VideoTools.loadWidget(B,C.firstDescendant().next(A))}}if($("addtoskype")&&(cookie=document.cookie.match(new RegExp("(^|;)\\s*has_skype=([^;\\s]*)")))){if(cookie[2]=="1"){$("addtoskype").show().setStyle({width:"159px"})}}else{if($("skypeDetectorContainer")){document.cookie="has_skype=0; path=/";var D=new SWFObject("/flash/dmmisc/skype-detection.swf","skd","1","1","6","#ffffff");D.skipDetect=true;D.addParam("allowScriptAccess","always");D.addVariable("callback","skypeDetection");D.write("skypeDetectorContainer")}}}})},toggleBox:function(B,A){var C=B.nextSibling;if(DM_Widget_VideoTools.prevPopup&&DM_Widget_VideoTools.prevPopup!=C){DM_Widget_VideoTools.prevPopup.style.display="none"}toggleElement(C);DM_Widget_VideoTools.prevPopup=C},startBigLoading:function(A){Element.addClassName(A,"dm_big_loading")},stopBigLoading:function(A){Element.removeClassName(A,"dm_big_loading")}};DM_Widget_VideoTools.initialize();function skypeDetection(A){if($("addtoskype")&&A&&parseFloat(A)>=3.5){$("addtoskype").show();document.cookie="has_skype=1; path=/"}}var DM_Widget_Comment={rules:{"div.comment_item_delete":function(A){A.onclick=function(){var B=findIdInClass(this.parentNode);ajax_call("comment","delete_comment",B,DM_Widget_Comment.commentDeleted(this.parentNode.parentNode))}},"div.comment_item_reply":function(A){A.onclick=function(){var C=findIdInClass(this.parentNode);var B='<div class="comment_info warning"></div><textarea class="comment_input ajax_comment_edit" id="comment_edit_'+C+'"></textarea>';B+='<br/><input class="button comment_ok" type="submit" onclick="DM_Widget_Comment.editCommentSend('+C+');" value="OK"/>';B+='<input class="button" type="submit" onclick="cancelEditComment('+C+');" value="Cancel" />';new Insertion.After(A,B)}},"div.comment_item_edit":function(A){A.onclick=function(){var E=findIdInClass(this.parentNode);var C=findParamInClass("url",this.parentNode);$(this.parentNode).setStyle({visibility:"hidden"});var D=this.parentNode.previousSibling;DM_Widget_Comment.comments[E]=D.innerHTML;var B=D.innerHTML.replace(/<br>/i,"\n");D.innerHTML='<div class="comment_info warning"></div><textarea class="comment_input">'+B+"</textarea>";D.innerHTML+='<input class="button comment_edit_send" type="submit" value="OK"/>';D.innerHTML+='<input class="button comment_edit_cancel" type="submit" value="Cancel" />';EventSelectors.start(DM_Widget_Comment.rules)}},"input.comment_edit_send":function(A){A.onclick=function(){var E=findIdInClass(this.parentNode.nextSibling);var D=this.previousSibling;var C=D.value;if(C.length==0){return }$(this.parentNode.nextSibling).setStyle({visibility:"visible"});var B=D.parentNode;D.parentNode.innerHTML='<img src="/images/wait_circle.gif" alt=""/>';ajax_call("comment","edit_comment",E,C,function(F){if(F.substr(0,6)=="error:"){F=F.substring(6,F.length);if($("warning_input")){$("warning_input").innerHTML=F}B.innerHTML=""}else{B.innerHTML=F}})}},"input.comment_edit_cancel":function(A){A.onclick=function(){var B=findIdInClass(this.parentNode.nextSibling);$(this.parentNode.nextSibling).setStyle({visibility:"visible"});this.parentNode.innerHTML=DM_Widget_Comment.comments[B]}}},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_Comment.rules)})},commentDeleted:function(A){Effect.Fade(A)},comments:{}};DM_Widget_Comment.initialize();var DM_Widget_CommentList={lock:false,rules:{".send_comment":function(A){A.onclick=function(){if(DM_Widget_CommentList.lock==true){return }DM_Widget_CommentList.lock=true;Element.setStyle(A,{"opacity":0.5});if($("commentinput").value!=""){Element.addClassName($("comment_input"),"loading")}var B=hex2str(findParamInClass("url",this));var E=hex2str(findParamInClass("id",this));var D=B;ajax_call("comment","comment",B,$("commentinput").value,$("commentlanguage").value,D,DM_Widget_CommentList.displayCommentList);$("commentinput").value="";var C=B.split(/[\/]+/).last();if(C!=""&&C!="1"&&!isNaN(C)){ajax_call("comment","get_comments","/comments/video/"+E+"",DM_Widget_CommentList.feedComments)}}},"input.send_video_comment":function(A){A.onclick=function(){var B=hex2str(findParamInClass("url",this));ajax_call("comment","video_comment",B,DM_Widget_CommentList.updateWebcam);$("commentinput").value=""}},"textarea.comment_input":function(A){A.onkeypress=function(){DM_Widget_CommentList.checkCommentAsTyping(this)};A.onkeyup=A.onkeypress;A.onclick=function(){$("comment_input_lang").style.display="block"}},"div.dm_widget_pagination.ajax a":function(A){A.onclick=function(){Element.addClassName(A.parentNode,"loading");var B=this.getAttribute("href");if(B.startsWith("http://")){B=B.substr(B.indexOf("/",7))}ajax_call("comment","get_comments",B,DM_Widget_CommentList.feedComments);return false}},"a.change_comment_input_size":function(A){A.onclick=function(){var C=50;var B=parseInt(Element.getHeight($("commentinput")));if(A.innerHTML=="-"){C=-C}if((A.innerHTML=="-"&&B>100)||(A.innerHTML=="+"&&B<=500)){new Effect.Morph("commentinput",{style:"height:"+(B+C)+"px",duration:0.2})}}}},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_CommentList.rules)})},switchCommentLang:function(A){Element.addClassName($("comment_input"),"loading");A=A.startsWith("/comments")?A.sub(/^\/comments/,""):A;A="/comments"+A;ajax_call("comment","get_comments",A,DM_Widget_CommentList.feedComments)},displayCommentList:function(A){if(A.substr(0,6)=="error:"){A=A.substring(6,A.length);if($("warning_input")){$("warning_input").innerHTML=A}}else{$("comment_list").replace(A)}DM_Widget_CommentList.lock=false;Element.setStyle($$("input.send_comment")[0],{"opacity":1});EventSelectors.assign(DM_Widget_CommentList.rules);EventSelectors.assign(DM_Widget_Comment.rules)},feedComments:function(A){$("comment_list").replace(A);EventSelectors.assign(DM_Widget_CommentList.rules);EventSelectors.assign(DM_Widget_Comment.rules)},updateWebcam:function(A){$("webcam_uploader").style.display="block";$("webcam_uploader").innerHTML=A},containsUrl:function(B){var A=B.match(/(http:\/\/|www\.)(\w+\.)+\w+/);if(A&&A.length>0){return true}return false},checkCommentAsTyping:function(C){var B=C.value.length;var A=DM_Widget_CommentList.maxCommentSize;var D=$("warning_input");if(B>=A){C.value=C.value.substring(0,A);D.innerHTML=DM_Widget_CommentList.maxCommentSizeLabel}else{if(B>A/1.3){D.innerHTML=A-B}else{D.innerHTML=""}}},comments:{}};DM_Widget_CommentList.initialize();var DM_Widget_VideoContext={rendering:false,firstTime:true,theFilterVids:null,theFilterUri:null,rules:{"div#video_context":function(B){if(DM_Widget_VideoContext.firstTime){DM_Widget_VideoContext.firstTime=false;switch(DM_Widget_VideoContext.currentContext){case"cluster":case"group":case"user":case"featured":case"playlist":case"search":if(DM_Widget_VideoContext.currentContext=="user"){DM_Widget_VideoContext.currentContext="member"}if(!$("tabs").select(".tab_"+DM_Widget_VideoContext.currentContext).length){if($("tabs").select(".tab_related").length){DM_Widget_VideoContext.currentContext="related"}}var A=$("tabs").select(".tab_"+DM_Widget_VideoContext.currentContext).last();break;default:var A=$("tabs").select(".context_tab").first();break}DM_Widget_VideoContext.selectTab(A)}},"div.context_group_list a.group_name,div.context_group_list a.group_icon":function(A){A.onclick=function(B){if(!DM_Widget_VideoContext.rendering){DM_Widget_VideoContext.showContext(str2hex(A.href.substr(A.href.indexOf("/",7)+1)))}return false}},"#tabs a.context_tab":function(A){A.onclick=function(){if(!DM_Widget_VideoContext.rendering){DM_Widget_VideoContext.selectTab(A)}return false}}},showContextCallback:function(A){return function(B){DM_Widget_VideoContext.stopLoading($("video_context"));new Insertion.Bottom($("contexts"),B);EventSelectors.assign(DM_Widget_VideoContext.rules);DM_Widget_VideoContext.rendering=false;if(typeof (vsContextInstrument)!="undefined"){vsContextInstrument()}}},selectTab:function(A){var B=(hex2str(A.id).indexOf("/related")!=-1&&DM_Widget_VideoContext.theFilterUri)?DM_Widget_VideoContext.theFilterUri:A.id;document.getElementsByClassName("context_tab_selected","a",$("tabs")).each(function(C){$(C).removeClassName("context_tab_selected")});$(A).addClassName("context_tab_selected");DM_Widget_VideoContext.rendering=true;DM_Widget_VideoContext.showContext(B)},showContext:function(A){document.getElementsByClassName("video_context_list","div",$("video_context")).each(function(B){$(B).hide()});if($("video_context_list_"+A)){$("video_context_list_"+A).show();DM_Widget_VideoContext.rendering=false}else{DM_Widget_VideoContext.startLoading();if(typeof thefilter_enabled!="undefined"&&thefilter_enabled&&typeof thefilter_recommandation_enabled!="undefined"&&thefilter_recommandation_enabled&&hex2str(A).indexOf("/related")!=-1){if(typeof thefilter_debug_enabled!="undefined"&&thefilter_debug_enabled){dbg("Recommandation SoftLaunch OK")}DMFilterRecommendation_GetJSONRecommendation(thefilter_videoId,thefilter_recsCount,thefilter_userId,thefilter_userLocale,thefilter_channel,thefilter_publisherId,thefilter_familyFilter,DM_Widget_VideoContext.theFilterCallback)}else{ajax_call("video_context","get_video_list",hex2str(A),DM_Widget_VideoContext.currentVideo,DM_Widget_PageItem_Masscast.getBuzzableVideoId(),DM_Widget_VideoContext.showContextCallback())}}},theFilterClickTracking:function(B){if(typeof thefilter_enabled!="undefined"&&thefilter_enabled){if(B.hasClassName("video_title")){var A=B.up().up()}else{var A=B.up()}var C=findParamInClass("id",A);DMFilterCapture_OnPageRecClicked(C,thefilter_userId,thefilter_userLocale,thefilter_videoId,thefilter_recommandation_enabled)}},theFilterCallback:function(A){var C=DM_Widget_VideoContext.getTheFilterResults(A);var B="/videos/vids/"+C;if(thefilter_debug_enabled){dbg("Recommendation response : ");dbg(A);dbg("Ajax request URI : "+B)}DM_Widget_VideoContext.theFilterUri=str2hex(B);ajax_call("video_context","get_video_list",B,DM_Widget_VideoContext.currentVideo,DM_Widget_PageItem_Masscast.getBuzzableVideoId(),DM_Widget_VideoContext.showContextCallback())},getTheFilterResults:function(A){var C="";var B=A.Videos;if(typeof B!="undefined"&&B.size()>0){B.each(function(D){C+=D["Id"]+"+"});C=C.substring(0,C.length-1)}DM_Widget_VideoContext.theFilterVids=C;if(C==""){DM_Widget_VideoContext.theFilterVids="none"}return C},startLoading:function(){Element.addClassName($("context_loading"),"dm_loading")},stopLoading:function(){Element.removeClassName($("context_loading"),"dm_loading")},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_VideoContext.rules)})}};DM_Widget_VideoContext.initialize();var DM_Widget_VideoEdit={lastChecked:null,rules:{"#DM_Widget_VideoEdit":function(A){A.onsubmit=function(){$(A).enable()}},"#submit":function(A){A.onclick=function(){$(A).value="Saving...";$(A).onclick=function(){return false};return true}},"#user-category":function(A){A.onclick=function(){if(A.checked){if(DM_Widget_VideoEdit.lastChecked){DM_Widget_VideoEdit.lastChecked.checked=false}DM_Widget_VideoEdit.lastChecked=A}}},"#lazy_tags":function(A){A.onclick=function(){if(typeof escape_utf8=="function"){var F=escape_utf8("/[W_¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ]+/g")}else{var F="/[W_¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ]+/g".escapeUtf8()}myregexp=new RegExp(F);var H=$F("video_title").replace(myregexp," ");H=H.toLowerCase();var E=H.split(" ");var C=$("tags");var I=$F("tags").toLowerCase().split(" ");for(var D=0;D<E.length;D++){if(E[D].length<=2){continue}var G=false;for(var B=0;B<I.length;B++){if(I[B]==E[D]){G=true;break}}if(!G){C.value+=" "+E[D]}}C.value=C.value.replace(/^\s+|\s+$/g,"")}},"input#creative_content":function(A){DM_Widget_VideoEdit.showPromoteOptions(A.checked);A.onclick=function(){DM_Widget_VideoEdit.showPromoteOptions(A.checked);if(A.checked){if($("public")){$("public").checked=true;DM_Widget_VideoEdit.showPrivateOptions(false)}}else{DM_Widget_VideoEdit.showPrivateOptions(false)}}},"a.channel_name":function(A){var B=$("channel_box");A.onmouseover=function(){var D=DM_Widget_VideoEdit.channelDescJSON.evalJSON();var C=DM_Widget_VideoEdit.channelTitleJSON.evalJSON();$("channel_description").innerHTML='<span class="title label"><h2>'+C[findParamInClass("title",A)]+'&nbsp;&raquo;</h2></span><br /><span class="foreground">'+D[findParamInClass("title",A)]+"</span>";B.style.display="block";return false};A.onmouseout=function(){B.style.display="none";return false}}},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_VideoEdit.rules);if($("private")&&$("private").checked){DM_Widget_VideoEdit.showPrivateOptions(true)}else{if($("public")&&$("public").checked){DM_Widget_VideoEdit.showPublicOptions()}}if($("creative_content")){var A=$("creative_content");if(!A.checked){DM_Widget_VideoEdit.showPromoteOptions(false)}}})},showPrivateOptions:function(C){var B=document.getElementsByClassName("relation_group");if(B){for(var A=0;A<B.length;A++){B[A].parentNode.parentNode.style.display=C?"":"none"}}},showPublicOptions:function(){DM_Widget_VideoEdit.showPrivateOptions(false)},showPromoteOptions:function(B){if($("rightsholder")){var A=$("rightsholder");A.parentNode.style.display=B?"":"none";if(!B){A.checked=false}}},validOptins:function(){var A=$("rightsholder");if($("creative_content")&&$("creative_content").checked){if(A){if(A.checked){return true}else{return false}}}return true}};DM_Widget_VideoEdit.initialize();var zoomed=false;var makeFullscreenBind;var origPlayerDimensions;function toggleZoom(){zoomed?unzoomPlayer():zoomPlayer()}function zoomPlayer(){if(zoomed){return }else{zoomed=true;origPlayerDimensions=Element.getDimensions(playerId)}makeFullscreen();makeFullscreenBind=makeFullscreen.bindAsEventListener();Event.observe(window,"resize",makeFullscreenBind);Event.observe(window,"scroll",makeFullscreenBind)}function makeFullscreen(){scroll(0,0);var D=getWindowDimensions();Element.setStyle($("bodyall"),{overflow:"hidden",height:D.height+"px",width:D.width+"px"});Element.setStyle(document.getElementsByTagName("html").item(0),{overflow:"hidden"});toggleAdsObjects("hidden");D=getWindowDimensions();var B=document.getElementById(playerId);var A=Position.cumulativeOffset(B);var C=Position.positionedOffset(B);Element.setStyle(B,{position:"absolute",zIndex:10,top:"-"+(A[1]-C[1])+"px",left:"-"+(A[0]-C[0])+"px",width:D.width+"px",height:D.height+"px"})}function toggleAdsObjects(A){$$("div.dm_widget_masscast, div.dm_widget_masscast embed, a, div.mc_container_iab, input, select").each(function(B){try{B.style.visibility=A}catch(C){}})}function unzoomPlayer(){if(!zoomed){return }else{zoomed=false}Event.stopObserving(window,"resize",makeFullscreenBind);Event.stopObserving(window,"scroll",makeFullscreenBind);Element.setStyle($("bodyall"),{overflow:"visible",height:null,width:null});Element.setStyle(document.getElementsByTagName("html").item(0),{overflow:"auto"});Element.setStyle(playerId,{top:"0px",left:"0px",width:origPlayerDimensions.width+"px",height:origPlayerDimensions.height+"px"});toggleAdsObjects("visible")}var DM_Widget_EmbedCode={packLoader:new YAHOO.util.YUILoader({require:["pack_extra"]}),packLoaded:false,colorPickers:{},previousParams:null,loadColorPicker:function(){if(!$("colorpicker")){$$(".color_picker").each(function(A){new Control.ColorPicker(A,{onClose:DM_Widget_EmbedCode.getEmbedPlayer,swatch:A.id+"_swatch"})})}if($("embed").style.display=="none"){Control.colorPickers.each(function(A){A.close()});toggleElement($("video_player_embed_preview"),"hide")}},rules:{"input.resize":function(A){A.onclick=function(){DM_Widget_EmbedCode.onClickInputsResize(A)}},"#embed_embedSize label":function(A){A.onclick=function(){DM_Widget_EmbedCode.onClickInputsResize(A.select("input")[0])}},"#preview_embed":function(A){A.onclick=function(){DM_Widget_EmbedCode.getEmbedPlayer();if($("video_player_embed_preview").innerHTML===""){$("video_player_embed_preview").innerHTML=$("video_player_embed_code_text").value}toggleElement($("video_player_embed_preview"));return false}},"#more_options":function(A){A.onclick=function(B){if($("embed").visible()){if(typeof DM_Widget_Page_Video=="undefined"){A.update(DM_Widget_EmbedCode.customizePlayer)}else{A.update(DM_Widget_Page_Video.customizePlayer)}}else{A.update(DM_CloseLabel)}toggleElement("embed");toggleElement("video_player_embed_preview");if(!$("colorpicker")){DM_Widget_EmbedCode.getEmbedPlayer()}if(!DM_Widget_EmbedCode.packLoaded){DM_Widget_EmbedCode.packLoader.insert({onSuccess:function(){DM_Widget_EmbedCode.packLoaded=true;DM_Widget_EmbedCode.loadColorPicker()}})}return false}},"#embed":function(A){A.onsubmit=function(){return false}},"#reset_defaults_colors":function(A){A.onclick=function(B){var D={"background":"DDDDDD","glow":"FFFFFF","foreground":"333333","special":"FFC300"};var C=$$(".color_picker");C.each(function(E){E.setValue(D[E.id])});Control.colorPickers.each(function(E){E.updateSwatch()});DM_Widget_EmbedCode.getEmbedPlayer()}},"input.related, #autoplay, #embed_related label, #embed_autoplay label":function(A){A.onclick=function(){DM_Widget_EmbedCode.getEmbedPlayer()}},"select#default_subtitle, #embed_default_subtitle":function(A){A.onchange=function(){DM_Widget_EmbedCode.getEmbedPlayer()}}},onClickInputsResize:function(B){var C=$("embed");var A=C["related"];if(A[0].checked==true){var D=A[0].value}else{if(A[1].checked==true){var D=A[1].value}}if(B.value==320){if($("embed_related_cont")){$("embed_related_cont").style.display="none"}else{if($("display_related")){$("display_related").style.display="none"}}}else{if($("embed_related_cont")){$("embed_related_cont").style.display="block"}else{if($("display_related")){$("display_related").style.display="block"}}}DM_Widget_EmbedCode.getEmbedPlayer()},callbackEmbedCode:function(A){$("video_player_embed_preview").removeClassName("dm_big_loading");$("video_player_embed_preview").style.width="";$("video_player_embed_preview").style.height="";$("video_player_embed_preview").innerHTML=A;$("video_player_embed_preview").down(0).setStyle({width:$("video_player_embed_preview").select("object").first().getWidth()+"px"});$("video_player_embed_code_text").setValue(A);new Effect.Highlight($("video_player_embed_code_text"),{duration:1})},startBigLoading:function(A){Element.addClassName(A,"dm_big_loading")},stopBigLoading:function(A){Element.removeClassName(A,"dm_big_loading")},getEmbedPlayer:function(){var B=$H(Form.serialize("embed",true));if(B.get("colorpicker-value")){B.set("colorpicker-value",null)}B=B.toJSON();if(!DM_Widget_EmbedCode.previousParams||DM_Widget_EmbedCode.previousParams!=B){DM_Widget_EmbedCode.previousParams=B;if($("video_player_embed_preview").hasClassName("dm_big_loading")){return false}var A=$("video_player_embed_preview");A.addClassName("dm_big_loading");ajax_call("video","get_embed_code",Request.getRequestURI(),B,DM_Widget_EmbedCode.callbackEmbedCode);$$(".color_picker").each(function(C){setCookie(C.id,C.value)})}},initialize:function(){DM_Widget_EmbedCode.packLoader.addModule({name:"pack_extra",type:"js",fullpath:"/js/gen/pack/extra.js",varName:"Control.ColorPicker.prototype"});Event.onDOMReady(function(){EventSelectors.start(DM_Widget_EmbedCode.rules)})}};DM_Widget_EmbedCode.initialize();var DM_Widget_Soundtrack={rules:{"div.soundtrack_partner img":function(F){if(F.fixed!=null){return }F.fixed=true;var G=navigator.appVersion.split("MSIE");var B=parseFloat(G[1]);if(!(B<=6&&(document.body.filters))){return }var E=F.src.toUpperCase();if(E.substring(E.length-3,E.length)=="PNG"){var D=(F.className)?"class='"+F.className+"' ":"";var C="display:block;";if(F.parentElement.href){C="cursor:hand;"+C}var A="<span "+D+' style="width:'+F.width+"px; height:"+F.height+"px;"+C+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F.src+"', sizingMethod='scale');\"></span>";F.outerHTML=A}}},initialize:function(){Event.onDOMReady(function(){EventSelectors.start(DM_Widget_Soundtrack.rules)})}};DM_Widget_Soundtrack.initialize();var filterCaptureCallback=null;function DMFilterCapture_OnItemPlayStarted(D,B,A,C){FilterCaptureRestCall("cmd=AddVideoEvidence&evidenceType=PlayStart&catalogid="+D+"&userLocale="+A+"&filterEnabled="+C,B)}function DMFilterCapture_OnItemPlayAborted(D,B,A,C){FilterCaptureRestCall("cmd=AddVideoEvidence&evidenceType=PlayAbort&catalogid="+D+"&userLocale="+A+"&filterEnabled="+C,B)}function DMFilterCapture_OnItemPlayEnded(D,B,A,C){FilterCaptureRestCall("cmd=AddVideoEvidence&evidenceType=PlayEnded&catalogid="+D+"&userLocale="+A+"&filterEnabled="+C,B)}function DMFilterCapture_OnItemRated(E,B,A,C,D){FilterCaptureRestCall("cmd=AddVideoEvidence&evidenceType=ItemRated&catalogid="+E+"&userLocale="+A+"&rating="+C+"&filterEnabled="+D,B)}function DMFilterCapture_OnItemShared(D,B,A,C){FilterCaptureRestCall("cmd=AddVideoEvidence&evidenceType=ItemShared&catalogid="+D+"&userLocale="+A+"&filterEnabled="+C,B)}function DMFilterCapture_OnPageRecClicked(E,B,A,D,C){var F="cmd=AddVideoEvidence&evidenceType=clickpagerec&catalogid="+E+"&userLocale="+A+"&referrer="+D+"&filterEnabled="+C;if(filterService_format=="IMG"){FilterCaptureIMGRestCall(F,B)}else{if(filterService_format=="JSON"){FilterCaptureJSONRestCall(F,B)}}}function DMFilterCapture_OnPlayerRecClicked(E,B,A,D,C){var F="cmd=AddVideoEvidence&evidenceType=clickflashrec&catalogid="+E+"&userLocale="+A+"&referrer="+D+"&filterEnabled="+C;if(filterService_format=="IMG"){FilterCaptureIMGRestCall(F,B)}else{if(filterService_format=="JSON"){FilterCaptureJSONRestCall(F,B)}}}function DMFilterCapture_OnItemMarkAsFavorite(D,B,A,C){FilterCaptureRestCall("cmd=AddVideoEvidence&evidenceType=MarkAsFavorite&catalogid="+D+"&userLocale="+A+"&filterEnabled="+C,B)}function DMFilterCapture_OnUserAddToChannel(A,C,B){FilterCaptureRestCall("cmd=AddUserEvidence&evidenceType=AddToChannel&otherId="+C+"&filterEnabled="+B,A)}function DMFilterCapture_OnUserRemoveFromChannel(A,C,B){FilterCaptureRestCall("cmd=AddUserEvidence&evidenceType=RemoveFromChannel&otherId="+C+"&filterEnabled="+B,A)}var filterCaptureCounter=1;var filterService_Location="http://partners.thefilter.com/DailyMotionService/CaptureRest.ashx?";var filterService_format="IMG";var filterService_allowDispatch=null;var filterService_dispatchRate=1;function FilterCaptureRestCall(B,A){if(filterService_allowDispatch==null){if(A==null){filterService_allowDispatch=false}else{filterService_allowDispatch=Math.random()<filterService_dispatchRate}}if(filterService_allowDispatch==true){if(filterService_format=="IMG"){FilterCaptureIMGRestCall(B,A)}else{if(filterService_format=="JSON"){FilterCaptureJSONRestCall(B,A)}}}}function FilterCaptureIMGRestCall(C,B){if(document.createElement){var A=new Image();if(B!=null){A.src=filterService_Location+C+"&fmt=IMG&anonId="+FilterCaptureAnonymousUserGuid()+"&userid="+B+"&refid="+new Date().getTime()}else{A.src=filterService_Location+C+"&fmt=IMG&anonId="+FilterCaptureAnonymousUserGuid()+"&refid="+new Date().getTime()}}}var filterService_Active=null;var filterService_QS=[];var filterService_UID=[];var filterService_Count=0;function FilterCaptureJSONRestCall(D,B){if(document.createElement){if(filterService_Active==null){FilterPing_Init();filterService_Active=-1}if(filterService_Active==-1){filterService_QS[filterService_Count]=D;filterService_UID[filterService_Count]=B;filterService_Count++}else{if(filterService_Active!=0){var A=document.createElement("script");A.setAttribute("type","text/javascript");A.setAttribute("charset","utf-8");var C="FilterEvidenceId"+filterCaptureCounter++;A.setAttribute("id",C);if(B!=null){A.setAttribute("src",filterService_Location+D+"&fmt=JSON&anonId="+FilterCaptureAnonymousUserGuid()+"&userid="+B+"&refid="+C)}else{A.setAttribute("src",filterService_Location+D+"&fmt=JSON&anonId="+FilterCaptureAnonymousUserGuid()+"&refid="+C)}document.getElementsByTagName("head").item(0).appendChild(A)}}}}function FilterCaptureAnonymousUserGuid(){var A=FilterCaptureGetCookie("FilterUserGuid");if(A==null){FilterCaptureSetCookie("FilterUserGuid",FilterCaptureGenerateGuid(),1000);A=FilterCaptureGetCookie("FilterUserGuid")}return A}function FilterCaptureGetCookie(B){if(document.cookie.length>0){var A=document.cookie.match("(^|;) ?"+B+"=([^;]*)(;|$)");if(A){return unescape(A[2])}}return null}function FilterCaptureSetCookie(B,C,D){if(D!=null){var A=new Date();A.setDate(A.getDate()+D);document.cookie=B+"="+escape(C)+"; expires="+A.toGMTString()+"; path=/"}else{document.cookie=B+"="+escape(C)+"; path=/"}}function FilterCaptureGenerateGuid(){var A=[];A[8]=A[13]=A[18]=A[23]="-";A[14]=4;var D;var C="0123456789ABCDEF".split("");for(var B=0;B<36;B++){if(!A[B]){D=0|Math.floor(Math.random()*16);A[B]=C[(B==19)?(D&3)|8:D&15]}}return A.join("")}function FilterPing_Init(){var A=new Image(1,1);A.onload=function(){filterService_Active=1;for(var B=0;B<filterService_Count;B++){FilterCaptureRestCall(filterService_QS[B],filterService_UID[B])}filterService_QS=[];filterService_UID=[];filterService_Count=0};A.onerror=function(){filterService_Active=0;filterService_QS=[];filterService_UID=[];filterService_Count=0};A.src=filterService_Location+"cmd=ping&fmt=IMG"}var filterRecommendationCallback=null;var filterRecommendationXMLCallback;var filterRecommendationJSONCallback;var filterRecCalled=false;var filterRecXML;var filterRecJSON;function DMFilterRecommendation_GetXMLRecommendation(H,E,C,A,D,B,F,G){filterRecommendationXMLCallback=G;filterRecCalled=true;FilterJSONRestCall("callback=DMFilterRecommendation_Callback&catalogid="+H+"&count="+E+"&userLocale="+A+"&channel="+D+"&publisherId="+B+"&familyFilter="+F,C)}function DMFilterRecommendation_GetJSONRecommendation(H,E,C,A,D,B,F,G){filterRecommendationJSONCallback=G;if(filterRecJSON!=undefined){filterRecommendationJSONCallback(filterRecJSON)}else{if(!filterRecCalled){filterRecCalled=true;FilterJSONRestCall("callback=DMFilterRecommendation_Callback&catalogid="+H+"&count="+E+"&userLocale="+A+"&channel="+D+"&publisherId="+B+"&familyFilter="+F,C)}}}function DMFilterRecommendation_GetRecommendation(H,E,C,A,D,B,G,F){if(F==undefined){FilterJSONRestCall("catalogid="+H+"&count="+E+"&userLocale="+A+"&channel="+D+"&publisherId="+B+"&familyFilter="+G,C)}else{FilterJSONRestCall("catalogid="+H+"&count="+E+"&userLocale="+A+"&channel="+D+"&publisherId="+B+"&familyFilter="+G+"&callback="+F,C)}}function DMFilterRecommendation_Callback(A){filterRecJSON=A;xmlRec='<?xml version="1.0" encoding="utf-16"?>';xmlRec+=' <DailyMotionDocumentResponse Version="'+A.Version+'" ResponseCode="'+A.ResponseCode+'">';var B=A.Videos;for(index in B){xmlRec+=' <Video Id="'+B[index].Id+'"/>'}xmlRec+=" </DailyMotionDocumentResponse>";filterRecXML=xmlRec;if(filterRecommendationXMLCallback!=undefined){filterRecommendationXMLCallback(filterRecXML)}if(filterRecommendationJSONCallback!=undefined){filterRecommendationJSONCallback(filterRecJSON)}}var filterRecCounter=1;var filterService_RecLocation="http://partners.thefilter.com/DailyMotionService/RecommendationRest.ashx?";var filterService_PingLocation="http://partners.thefilter.com/DailyMotionService/CaptureRest.ashx?";var filterService_Active=null;var filterService_QS=[];var filterService_UID=[];var filterService_Count=0;function FilterJSONRestCall(D,B){if(document.createElement){if(filterService_Active==null){FilterRecPing_Init();filterService_Active=-1}if(filterService_Active==-1){filterService_QS[filterService_Count]=D;filterService_UID[filterService_Count]=B;filterService_Count++}else{if(filterService_Active!=0){var A=document.createElement("script");A.setAttribute("type","text/javascript");A.setAttribute("charset","utf-8");var C="FilterId"+filterRecCounter++;A.setAttribute("id",C);if(B!=null){A.setAttribute("src",filterService_RecLocation+D+"&fmt=json&anonId="+FilterAnonymousUserGuid()+"&userid="+B+"&refid="+C)}else{A.setAttribute("src",filterService_RecLocation+D+"&fmt=json&anonId="+FilterAnonymousUserGuid()+"&refid="+C)}document.getElementsByTagName("head").item(0).appendChild(A)}}}}function FilterAnonymousUserGuid(){var A=FilterGetCookie("FilterUserGuid");if(A==null){FilterSetCookie("FilterUserGuid",FilterGenerateGuid(),1000);A=FilterGetCookie("FilterUserGuid")}return A}function FilterGetCookie(B){if(document.cookie.length>0){var A=document.cookie.match("(^|;) ?"+B+"=([^;]*)(;|$)");if(A){return unescape(A[2])}}return null}function FilterSetCookie(B,C,D){if(D!=null){var A=new Date();A.setDate(A.getDate()+D);document.cookie=B+"="+escape(C)+"; expires="+A.toGMTString()+"; path=/"}else{document.cookie=B+"="+escape(C)+"; path=/"}}function FilterGenerateGuid(){var A=[];A[8]=A[13]=A[18]=A[23]="-";A[14]=4;var D;var C="0123456789ABCDEF".split("");for(var B=0;B<36;B++){if(!A[B]){D=0|Math.floor(Math.random()*16);A[B]=C[(B==19)?(D&3)|8:D&15]}}return A.join("")}function FilterRecPing_Init(){var A=new Image(1,1);A.onload=function(){filterService_Active=1;for(var B=0;B<filterService_Count;B++){FilterJSONRestCall(filterService_QS[B],filterService_UID[B])}filterService_QS=[];filterService_UID=[];filterService_Count=0};A.onerror=function(){filterService_Active=0;filterService_QS=[];filterService_UID=[];filterService_Count=0};A.src=filterService_PingLocation+"cmd=ping&fmt=IMG"}