var DM_Hash=new Array();DM_Hash["widget/pack/extras.js"]="30b670e68aef5970";DM_Hash["widget/pack/popup.js"]="67d2ba8b43c22dee";DM_Hash["lib/protofarbastic/protofarbtastic.js"]="4b3521131f1bc130";DM_Hash["lib/thefilter/DailyMotionFilterCaptureService.js"]="28653b5332bd944b";DM_Hash["lib/essential_extension.js"]="b760ba85e9dcf4a3";var Prototype={Version:"1.6.1",Browser:(function(){var B=navigator.userAgent;var A=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!A,Opera:A,WebKit:B.indexOf("AppleWebKit/")>-1,Gecko:B.indexOf("Gecko")>-1&&B.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(B)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var A=window.Element||window.HTMLElement;return !!(A&&A.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var C=document.createElement("div");var B=document.createElement("form");var A=false;if(C["__proto__"]&&(C["__proto__"]!==B["__proto__"])){A=true}C=B=null;return A})()},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 Abstract={};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}};var Class=(function(){function A(){}function B(){var G=null,F=$A(arguments);if(Object.isFunction(F[0])){G=F.shift()}function D(){this.initialize.apply(this,arguments)}Object.extend(D,Class.Methods);D.superclass=G;D.subclasses=[];if(G){A.prototype=G.prototype;D.prototype=new A;G.subclasses.push(D)}for(var E=0;E<F.length;E++){D.addMethods(F[E])}if(!D.prototype.initialize){D.prototype.initialize=Prototype.emptyFunction}D.prototype.constructor=D;return D}function C(J){var F=this.superclass&&this.superclass.prototype;var E=Object.keys(J);if(!Object.keys({toString:true}).length){if(J.toString!=Object.prototype.toString){E.push("toString")}if(J.valueOf!=Object.prototype.valueOf){E.push("valueOf")}}for(var D=0,G=E.length;D<G;D++){var I=E[D],H=J[I];if(F&&Object.isFunction(H)&&H.argumentNames().first()=="$super"){var K=H;H=(function(L){return function(){return F[L].apply(this,arguments)}})(I).wrap(K);H.valueOf=K.valueOf.bind(K);H.toString=K.toString.bind(K)}this.prototype[I]=H}return this}return{create:B,Methods:{addMethods:C}}})();(function(){var D=Object.prototype.toString;function I(Q,S){for(var R in S){Q[R]=S[R]}return Q}function L(Q){try{if(E(Q)){return"undefined"}if(Q===null){return"null"}return Q.inspect?Q.inspect():String(Q)}catch(R){if(R instanceof RangeError){return"..."}throw R}}function K(Q){var S=typeof Q;switch(S){case"undefined":case"function":case"unknown":return ;case"boolean":return Q.toString()}if(Q===null){return"null"}if(Q.toJSON){return Q.toJSON()}if(H(Q)){return }var R=[];for(var U in Q){var T=K(Q[U]);if(!E(T)){R.push(U.toJSON()+": "+T)}}return"{"+R.join(", ")+"}"}function C(Q){return $H(Q).toQueryString()}function F(Q){return Q&&Q.toHTML?Q.toHTML():String.interpret(Q)}function O(Q){var R=[];for(var S in Q){R.push(S)}return R}function M(Q){var R=[];for(var S in Q){R.push(Q[S])}return R}function J(Q){return I({},Q)}function H(Q){return !!(Q&&Q.nodeType==1)}function G(Q){return D.call(Q)=="[object Array]"}function P(Q){return Q instanceof Hash}function B(Q){return typeof Q==="function"}function A(Q){return D.call(Q)=="[object String]"}function N(Q){return D.call(Q)=="[object Number]"}function E(Q){return typeof Q==="undefined"}I(Object,{extend:I,inspect:L,toJSON:K,toQueryString:C,toHTML:F,keys:O,values:M,clone:J,isElement:H,isArray:G,isHash:P,isFunction:B,isString:A,isNumber:N,isUndefined:E})})();Object.extend(Function.prototype,(function(){var K=Array.prototype.slice;function D(O,L){var N=O.length,M=L.length;while(M--){O[N+M]=L[M]}return O}function I(M,L){M=K.call(M,0);return D(M,L)}function G(){var L=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return L.length==1&&!L[0]?[]:L}function H(N){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var L=this,M=K.call(arguments,1);return function(){var O=I(M,arguments);return L.apply(N,O)}}function F(N){var L=this,M=K.call(arguments,1);return function(P){var O=D([P||window.event],M);return L.apply(N,O)}}function J(){if(!arguments.length){return this}var L=this,M=K.call(arguments,0);return function(){var N=I(M,arguments);return L.apply(this,N)}}function E(N){var L=this,M=K.call(arguments,1);N=N*1000;return window.setTimeout(function(){return L.apply(L,M)},N)}function A(){var L=D([0.01],arguments);return this.delay.apply(this,L)}function C(M){var L=this;return function(){var N=D([L.bind(this)],arguments);return M.apply(this,N)}}function B(){if(this._methodized){return this._methodized}var L=this;return this._methodized=function(){var M=D([this],arguments);return L.apply(null,M)}}return{argumentNames:G,bind:H,bindAsEventListener:F,curry:J,delay:E,defer:A,wrap:C,methodize:B}})());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"'};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();this.currentlyExecuting=false}catch(A){this.currentlyExecuting=false;throw A}}}});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,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern},evaluate:function(A){if(A&&Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(D){if(A==null){return(D[1]+"")}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].replace(/\\\\]/g,"]"):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=(function(){function C(Y,X){var W=0;try{this._each(function(a){Y.call(X,a,W++)})}catch(Z){if(Z!=$break){throw Z}}return this}function R(Z,Y,X){var W=-Z,a=[],b=this.toArray();if(Z<1){return b}while((W+=Z)<b.length){a.push(b.slice(W,W+Z))}return a.collect(Y,X)}function B(Y,X){Y=Y||Prototype.K;var W=true;this.each(function(a,Z){W=W&&!!Y.call(X,a,Z);if(!W){throw $break}});return W}function I(Y,X){Y=Y||Prototype.K;var W=false;this.each(function(a,Z){if(W=!!Y.call(X,a,Z)){throw $break}});return W}function J(Y,X){Y=Y||Prototype.K;var W=[];this.each(function(a,Z){W.push(Y.call(X,a,Z))});return W}function T(Y,X){var W;this.each(function(a,Z){if(Y.call(X,a,Z)){W=a;throw $break}});return W}function H(Y,X){var W=[];this.each(function(a,Z){if(Y.call(X,a,Z)){W.push(a)}});return W}function G(Z,Y,X){Y=Y||Prototype.K;var W=[];if(Object.isString(Z)){Z=new RegExp(RegExp.escape(Z))}this.each(function(b,a){if(Z.match(b)){W.push(Y.call(X,b,a))}});return W}function A(W){if(Object.isFunction(this.indexOf)){if(this.indexOf(W)!=-1){return true}}var X=false;this.each(function(Y){if(Y==W){X=true;throw $break}});return X}function Q(X,W){W=Object.isUndefined(W)?null:W;return this.eachSlice(X,function(Y){while(Y.length<X){Y.push(W)}return Y})}function L(W,Y,X){this.each(function(a,Z){W=Y.call(X,W,a,Z)});return W}function V(X){var W=$A(arguments).slice(1);return this.map(function(Y){return Y[X].apply(Y,W)})}function P(Y,X){Y=Y||Prototype.K;var W;this.each(function(a,Z){a=Y.call(X,a,Z);if(W==null||a>=W){W=a}});return W}function N(Y,X){Y=Y||Prototype.K;var W;this.each(function(a,Z){a=Y.call(X,a,Z);if(W==null||a<W){W=a}});return W}function E(Z,X){Z=Z||Prototype.K;var Y=[],W=[];this.each(function(b,a){(Z.call(X,b,a)?Y:W).push(b)});return[Y,W]}function F(X){var W=[];this.each(function(Y){W.push(Y[X])});return W}function D(Y,X){var W=[];this.each(function(a,Z){if(!Y.call(X,a,Z)){W.push(a)}});return W}function M(X,W){return this.map(function(Z,Y){return{value:Z,criteria:X.call(W,Z,Y)}}).sort(function(d,c){var Z=d.criteria,Y=c.criteria;return Z<Y?-1:Z>Y?1:0}).pluck("value")}function O(){return this.map()}function S(){var X=Prototype.K,W=$A(arguments);if(Object.isFunction(W.last())){X=W.pop()}var Y=[this].concat(W).map($A);return this.map(function(a,Z){return X(Y.pluck(Z))})}function K(){return this.toArray().length}function U(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:C,eachSlice:R,all:B,every:B,any:I,some:I,collect:J,map:J,detect:T,findAll:H,select:H,filter:H,grep:G,include:A,member:A,inGroupsOf:Q,inject:L,invoke:V,max:P,min:N,partition:E,pluck:F,reject:D,sortBy:M,toArray:O,entries:O,zip:S,size:K,inspect:U,find:T}})();function $A(C){if(!C){return[]}if("toArray" in Object(C)){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}Array.from=$A;(function(){var S=Array.prototype,M=S.slice,O=S.forEach;function B(W){for(var V=0,X=this.length;V<X;V++){W(this[V])}}if(!O){O=B}function L(){this.length=0;return this}function D(){return this[0]}function G(){return this[this.length-1]}function I(){return this.select(function(V){return V!=null})}function U(){return this.inject([],function(W,V){if(Object.isArray(V)){return W.concat(V.flatten())}W.push(V);return W})}function H(){var V=M.call(arguments,0);return this.select(function(W){return !V.include(W)})}function F(V){return(V!==false?this:this.toArray())._reverse()}function K(V){return this.inject([],function(Y,X,W){if(0==W||(V?Y.last()!=X:!Y.include(X))){Y.push(X)}return Y})}function P(V){return this.uniq().findAll(function(W){return V.detect(function(X){return W===X})})}function Q(){return M.call(this,0)}function J(){return this.length}function T(){return"["+this.map(Object.inspect).join(", ")+"]"}function R(){var V=[];this.each(function(W){var X=Object.toJSON(W);if(!Object.isUndefined(X)){V.push(X)}});return"["+V.join(", ")+"]"}function A(X,V){V||(V=0);var W=this.length;if(V<0){V=W+V}for(;V<W;V++){if(this[V]===X){return V}}return -1}function N(W,V){V=isNaN(V)?this.length:(V<0?this.length+V:V)+1;var X=this.slice(0,V).reverse().indexOf(W);return(X<0)?X:V-X-1}function C(){var a=M.call(this,0),Y;for(var W=0,X=arguments.length;W<X;W++){Y=arguments[W];if(Object.isArray(Y)&&!("callee" in Y)){for(var V=0,Z=Y.length;V<Z;V++){a.push(Y[V])}}else{a.push(Y)}}return a}Object.extend(S,Enumerable);if(!S._reverse){S._reverse=S.reverse}Object.extend(S,{_each:O,clear:L,first:D,last:G,compact:I,flatten:U,without:H,reverse:F,uniq:K,intersect:P,clone:Q,toArray:Q,size:J,inspect:T,toJSON:R});var E=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(E){S.concat=C}if(!S.indexOf){S.indexOf=A}if(!S.lastIndexOf){S.lastIndexOf=N}})();function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function E(Q){this._object=Object.isHash(Q)?Q.toObject():Object.clone(Q)}function F(R){for(var Q in this._object){var S=this._object[Q],T=[Q,S];T.key=Q;T.value=S;R(T)}}function K(Q,R){return this._object[Q]=R}function C(Q){if(this._object[Q]!==Object.prototype[Q]){return this._object[Q]}}function N(Q){var R=this._object[Q];delete this._object[Q];return R}function P(){return Object.clone(this._object)}function O(){return this.pluck("key")}function M(){return this.pluck("value")}function G(R){var Q=this.detect(function(S){return S.value===R});return Q&&Q.key}function I(Q){return this.clone().update(Q)}function D(Q){return new Hash(Q).inject(this,function(R,S){R.set(S.key,S.value);return R})}function B(Q,R){if(Object.isUndefined(R)){return Q}return Q+"="+encodeURIComponent(String.interpret(R))}function A(){return this.inject([],function(S,T){var R=encodeURIComponent(T.key),Q=T.value;if(Q&&typeof Q=="object"){if(Object.isArray(Q)){return S.concat(Q.map(B.curry(R)))}}else{S.push(B(R,Q))}return S}).join("&")}function L(){return"#<Hash:{"+this.map(function(Q){return Q.map(Object.inspect).join(": ")}).join(", ")+"}>"}function J(){return Object.toJSON(this.toObject())}function H(){return new Hash(this)}return{initialize:E,_each:F,set:K,get:C,unset:N,toObject:P,toTemplateReplacements:P,keys:O,values:M,index:G,merge:I,update:D,toQueryString:A,inspect:L,toJSON:J,clone:H}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function D(){return this.toPaddedString(2,16)}function E(){return this+1}function A(K,J){$R(0,this,true).each(K,J);return this}function B(L,K){var J=this.toString(K||10);return"0".times(L-J.length)+J}function F(){return isFinite(this)?this.toString():"null"}function I(){return Math.abs(this)}function H(){return Math.round(this)}function G(){return Math.ceil(this)}function C(){return Math.floor(this)}return{toColorPart:D,succ:E,times:A,toPaddedString:B,toJSON:F,abs:I,round:H,ceil:G,floor:C}})());function $R(C,A,B){return new ObjectRange(C,A,B)}var ObjectRange=Class.create(Enumerable,(function(){function B(F,D,E){this.start=F;this.end=D;this.exclusive=E}function C(D){var E=this.start;while(this.include(E)){D(E);E=E.succ()}}function A(D){if(D<this.start){return false}if(this.exclusive){return D<this.end}return D<=this.end}return{initialize:B,_each:C,include:A}})());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(C){var B=(function(){var F=document.createElement("form");var E=document.createElement("input");var D=document.documentElement;E.setAttribute("name","test");F.appendChild(E);D.appendChild(F);var G=F.elements?(typeof F.elements.test=="undefined"):null;D.removeChild(F);F=E=null;return G})();var A=C.Element;C.Element=function(F,E){E=E||{};F=F.toLowerCase();var D=Element.cache;if(B&&E.name){F="<"+F+' name="'+E.name+'">';delete E.name;return Element.writeAttribute(document.createElement(F),E)}if(!D[F]){D[F]=Element.extend(document.createElement(F))}return Element.writeAttribute(D[F].cloneNode(false),E)};Object.extend(C.Element,A||{});if(A){C.Element.prototype=A.prototype}})(this);Element.cache={};Element.idCounter=1;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(){var B=(function(){var E=document.createElement("select"),F=true;E.innerHTML='<option value="test">test</option>';if(E.options&&E.options[0]){F=E.options[0].nodeName.toUpperCase()!=="OPTION"}E=null;return F})();var A=(function(){try{var E=document.createElement("table");if(E&&E.tBodies){E.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var G=typeof E.tBodies[0]=="undefined";E=null;return G}}catch(F){return true}})();var D=(function(){var E=document.createElement("script"),G=false;try{E.appendChild(document.createTextNode(""));G=!E.firstChild||E.firstChild&&E.firstChild.nodeType!==3}catch(F){G=true}E=null;return G})();function C(F,G){F=$(F);if(G&&G.toElement){G=G.toElement()}if(Object.isElement(G)){return F.update().insert(G)}G=Object.toHTML(G);var E=F.tagName.toUpperCase();if(E==="SCRIPT"&&D){F.text=G;return F}if(B||A){if(E in Element._insertionTranslations.tags){while(F.firstChild){F.removeChild(F.firstChild)}Element._getContentFromAnonymousElement(E,G.stripScripts()).each(function(H){F.appendChild(H)})}else{F.innerHTML=G.stripScripts()}}else{F.innerHTML=G.stripScripts()}G.evalScripts.bind(G).defer();return F}return C})(),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 Element.recursivelyCollect(A,"parentNode")},descendants:function(A){return Element.select(A,"*")},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 Element.recursivelyCollect(A,"previousSibling")},nextSiblings:function(A){return Element.recursivelyCollect(A,"nextSibling")},siblings:function(A){A=$(A);return Element.previousSiblings(A).reverse().concat(Element.nextSiblings(A))},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=Element.ancestors(B);return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},down:function(B,C,A){B=$(B);if(arguments.length==1){return Element.firstDescendant(B)}return Object.isNumber(C)?Element.descendants(B)[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=Element.previousSiblings(B);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=Element.nextSiblings(C);return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},select:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B,A)},adjacent:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(A){A=$(A);var B=Element.readAttribute(A,"id");if(B){return B}do{B="anonymous_element_"+Element.idCounter++}while($(B));Element.writeAttribute(A,"id",B);return B},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 Element.getDimensions(A).height},getWidth:function(A){return Element.getDimensions(A).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(!Element.hasClassName(A,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 Element[Element.hasClassName(A,B)?"removeClassName":"addClassName"](A,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=Element.cumulativeOffset(A);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=Element.getStyle(C,"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";if(D!="fixed"){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(Element.getStyle(B,"position")=="absolute"){return B}var D=Element.positionedOffset(B);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(Element.getStyle(A,"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=Element.viewportOffset(D);B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=Element.getOffsetParent(B);F=Element.viewportOffset(C)}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}};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=(function(){var B="className";var A="for";var C=document.createElement("div");C.setAttribute(B,"x");if(C.className!=="x"){C.setAttribute("class","x");if(C.className==="x"){B="class"}}C=null;C=document.createElement("label");C.setAttribute(A,"x");if(C.htmlFor!=="x"){C.setAttribute("htmlFor","x");if(C.htmlFor==="x"){A="htmlFor"}}C=null;return{read:{names:{"class":B,"className":B,"for":A,"htmlFor":A},values:{_getAttr:function(D,E){return D.getAttribute(E)},_getAttr2:function(D,E){return D.getAttribute(E,2)},_getAttrNode:function(D,F){var E=D.getAttributeNode(F);return E?E.value:""},_getEv:(function(){var D=document.createElement("div");D.onclick=Prototype.emptyFunction;var F=D.getAttribute("onclick");var E;if(String(F).indexOf("{")>-1){E=function(G,H){H=G.getAttribute(H);if(!H){return null}H=H.toString();H=H.split("{")[1];H=H.split("}")[0];return H.strip()}}else{if(F===""){E=function(G,H){H=G.getAttribute(H);if(!H){return null}return H.strip()}}}D=null;return E})(),_flag:function(D,E){return $(D).hasAttribute(E)?E:null},style:function(D){return D.style.cssText.toLowerCase()},title:function(D){return D.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._getAttr2,src:A._getAttr2,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);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function A(E){var B=E.getElementsByTagName("*"),D=[];for(var C=0,F;F=B[C];C++){if(F.tagName!=="!"){D.push(F)}}return D}Element.Methods.down=function(C,D,B){C=$(C);if(arguments.length==1){return C.firstDescendant()}return Object.isNumber(D)?A(C)[D]:Element.select(C,D)[B||0]}})()}}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("outerHTML" in document.documentElement){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(){var A=Element._insertionTranslations.tags;Object.extend(A,{THEAD:A.TBODY,TFOOT:A.TBODY,TH:A.TD})})();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);(function(A){if(!Prototype.BrowserFeatures.ElementExtensions&&A["__proto__"]){window.HTMLElement={};window.HTMLElement.prototype=A["__proto__"];Prototype.BrowserFeatures.ElementExtensions=true}A=null})(document.createElement("div"));Element.extend=(function(){function C(G){if(typeof window.Element!="undefined"){var I=window.Element.prototype;if(I){var K="_"+(Math.random()+"").slice(2);var H=document.createElement(G);I[K]="x";var J=(H[K]!=="x");delete I[K];H=null;return J}}return false}function B(H,G){for(var J in G){var I=G[J];if(Object.isFunction(I)&&!(J in H)){H[J]=I.methodize()}}}var D=C("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(D){return function(H){if(H&&typeof H._extendedByPrototype=="undefined"){var G=H.tagName;if(G&&(/^(?:object|applet|embed)$/i.test(G))){B(H,Element.Methods);B(H,Element.Methods.Simulated);B(H,Element.Methods.ByTag[G.toUpperCase()])}}return H}}return Prototype.K}var A={},E=Element.Methods.ByTag;var F=Object.extend(function(I){if(!I||typeof I._extendedByPrototype!="undefined"||I.nodeType!=1||I==window){return I}var G=Object.clone(A),H=I.tagName.toUpperCase();if(E[H]){Object.extend(G,E[H])}B(I,G);I._extendedByPrototype=Prototype.emptyFunction;return I},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);Object.extend(A,Element.Methods.Simulated)}}});F.refresh();return F})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var J=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(M,L,F){F=F||false;for(var O in M){var N=M[O];if(!Object.isFunction(N)){continue}if(!F||!(O in L)){L[O]=N.methodize()}}}function E(N){var F;var M={"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(M[N]){F="HTML"+M[N]+"Element"}if(window[F]){return window[F]}F="HTML"+N+"Element";if(window[F]){return window[F]}F="HTML"+N.capitalize()+"Element";if(window[F]){return window[F]}var L=document.createElement(N);var O=L["__proto__"]||L.constructor.prototype;L=null;return O}var I=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(J.ElementExtensions){A(Element.Methods,I);A(Element.Methods.Simulated,I,true)}if(J.SpecificElementExtensions){for(var K in Element.Methods.ByTag){var G=E(K);if(Object.isUndefined(G)){continue}A(D[K],G.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(C){var H=Prototype.Browser,F=document,D,E={};function A(){if(H.WebKit&&!F.evaluate){return document}if(H.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function G(B){if(!D){D=A()}E[B]="client"+B;C["get"+B]=function(){return D[E[B]]};return C["get"+B]()}C.getWidth=G.curry("Width");C.getHeight=G.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(B){if(!(B=$(B))){return }var A;if(B===window){A=0}else{if(typeof B._prototypeUID==="undefined"){B._prototypeUID=[Element.Storage.UID++]}A=B._prototypeUID[0]}if(!Element.Storage[A]){Element.Storage[A]=$H()}return Element.Storage[A]},store:function(B,A,C){if(!(B=$(B))){return }if(arguments.length===2){Element.getStorage(B).update(A)}else{Element.getStorage(B).set(A,C)}return B},retrieve:function(C,B,A){if(!(C=$(C))){return }var E=Element.getStorage(C),D=E.get(B);if(Object.isUndefined(D)){E.set(B,A);D=A}return D},clone:function(C,A){if(!(C=$(C))){return }var E=C.cloneNode(A);E._prototypeUID=void 0;if(A){var D=Element.select(E,"*"),B=D.length;while(B--){D[B]._prototypeUID=void 0}}return Element.extend(E)}});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(){var A=(function(){var E=false;if(document.evaluate&&window.XPathResult){var D=document.createElement("div");D.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var C=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var B=document.evaluate(C,D,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);E=(B.snapshotLength!==2);D=null}return E})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var B=this.expression;if(Prototype.Browser.WebKit&&(B.include("-of-type")||B.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(B)){return false}if(A){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){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,len=ps.length,name;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=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).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 G=this.expression,H=Selector.patterns,C=Selector.xpath,F,B,A=H.length,D;if(Selector._cache[G]){this.xpath=Selector._cache[G];return }this.matcher=[".//*"];while(G&&F!=G&&(/\S/).test(G)){F=G;for(var E=0;E<A;E++){D=H[E].name;if(B=G.match(H[E].re)){this.matcher.push(Object.isFunction(C[D])?C[D](B):new Template(C[D]).evaluate(B));G=G.replace(B[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();E=E.replace(/([\.:])/g,"\\$1");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(I){this.tokens=[];var M=this.expression,A=Selector.patterns,E=Selector.assertions;var B,D,F,L=A.length,C;while(M&&B!==M&&(/\S/).test(M)){B=M;for(var H=0;H<L;H++){D=A[H].re;C=A[H].name;if(F=M.match(D)){if(E[C]){this.tokens.push([C,Object.clone(F)]);M=M.replace(F[0],"")}else{return this.findElements(document).include(I)}}}}var K=true,C,J;for(var H=0,G;G=this.tokens[H];H++){C=G[0],J=G[1];if(!Selector.assertions[C](I,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var C=document.createElement("div"),A=document.createElement("span");C.id="prototype_test_id";A.className="Test";C.appendChild(A);var B=(C.querySelector("#prototype_test_id .test")!==null);C=A=null;return B})()}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(E){var H=E[6],C=Selector.patterns,I=Selector.xpath,A,J,G=C.length,B;var D=[];while(H&&A!=H&&(/\S/).test(H)){A=H;for(var F=0;F<G;F++){B=C[F].name;if(E=H.match(C[F].re)){J=Object.isFunction(I[B])?I[B](E):new Template(I[B]).evaluate(E);D.push("("+J.substring(1,J.length-1)+")");H=H.replace(E[0],"");break}}}return"[not("+D.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:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\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(){var A=(function(){var B=document.createElement("div"),E=false,D="_countedByPrototype",C="x";B[D]=C;E=(B.getAttribute(D)===C);B=null;return E})();return A?function(B){for(var C=0,D;D=B[C];C++){D.removeAttribute("_countedByPrototype")}return B}:function(B){for(var C=0,D;D=B[C];C++){D._countedByPrototype=void 0}return B}})(),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(typeof (E=B[C])._countedByPrototype=="undefined"){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(A,I,B,C){var H=$(B),G=Selector.handlers;if(I==document){if(!H){return[]}if(!A){return[H]}}else{if(!I.sourceIndex||I.sourceIndex<1){var A=I.getElementsByTagName("*");for(var E=0,D;D=A[E];E++){if(D.id===B){return[D]}}}}if(A){if(C){if(C=="child"){for(var F=0,D;D=A[F];F++){if(H.parentNode==D){return[H]}}}else{if(C=="descendant"){for(var F=0,D;D=A[F];F++){if(Element.descendantOf(H,D)){return[H]}}}else{if(C=="adjacent"){for(var F=0,D;D=A[F];F++){if(Selector.handlers.previousElementSibling(H)==D){return[H]}}}else{A=G[C](A)}}}}for(var F=0,D;D=A[F];F++){if(D==H){return[H]}}return[]}return(H&&Element.descendantOf(H,I))?[H]:[]},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+" ").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}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){A=$(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(E){var F=$(E).getElementsByTagName("*"),D,A=[],C=Form.Element.Serializers;for(var B=0;D=F[B];B++){A.push(D)}return A.inject([],function(G,H){if(C[H.tagName.toLowerCase()]){G.push(Element.extend(H))}return G})},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)$/i.test(D.tagName)})},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)$/i.test(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)}});(function(){var V={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:{}};var E=document.documentElement;var W="onmouseenter" in E&&"onmouseleave" in E;var O;if(Prototype.Browser.IE){var H={0:1,1:4,2:2};O=function(Y,X){return Y.button===H[X]}}else{if(Prototype.Browser.WebKit){O=function(Y,X){switch(X){case 0:return Y.which==1&&!Y.metaKey;case 1:return Y.which==1&&Y.metaKey;default:return false}}}else{O=function(Y,X){return Y.which?(Y.which===X+1):(Y.button===X)}}}function R(X){return O(X,0)}function Q(X){return O(X,1)}function K(X){return O(X,2)}function C(Z){Z=V.extend(Z);var Y=Z.target,X=Z.type,a=Z.currentTarget;if(a&&a.tagName){if(X==="load"||X==="error"||(X==="click"&&a.tagName.toLowerCase()==="input"&&a.type==="radio")){Y=a}}if(Y.nodeType==Node.TEXT_NODE){Y=Y.parentNode}return Element.extend(Y)}function M(Y,a){var X=V.element(Y);if(!a){return X}var Z=[X].concat(X.ancestors());return Selector.findElement(Z,a,0)}function P(X){return{x:B(X),y:A(X)}}function B(Z){var Y=document.documentElement,X=document.body||{scrollLeft:0};return Z.pageX||(Z.clientX+(Y.scrollLeft||X.scrollLeft)-(Y.clientLeft||0))}function A(Z){var Y=document.documentElement,X=document.body||{scrollTop:0};return Z.pageY||(Z.clientY+(Y.scrollTop||X.scrollTop)-(Y.clientTop||0))}function N(X){V.extend(X);X.preventDefault();X.stopPropagation();X.stopped=true}V.Methods={isLeftClick:R,isMiddleClick:Q,isRightClick:K,element:C,findElement:M,pointer:P,pointerX:B,pointerY:A,stop:N};var T=Object.keys(V.Methods).inject({},function(X,Y){X[Y]=V.Methods[Y].methodize();return X});if(Prototype.Browser.IE){function G(Y){var X;switch(Y.type){case"mouseover":X=Y.fromElement;break;case"mouseout":X=Y.toElement;break;default:return null}return Element.extend(X)}Object.extend(T,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});V.extend=function(Y,X){if(!Y){return false}if(Y._extendedByPrototype){return Y}Y._extendedByPrototype=Prototype.emptyFunction;var Z=V.pointer(Y);Object.extend(Y,{target:Y.srcElement||X,relatedTarget:G(Y),pageX:Z.x,pageY:Z.y});return Object.extend(Y,T)}}else{V.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(V.prototype,T);V.extend=Prototype.K}function L(b,a,c){var Z=Element.retrieve(b,"prototype_event_registry");if(Object.isUndefined(Z)){D.push(b);Z=Element.retrieve(b,"prototype_event_registry",$H())}var X=Z.get(a);if(Object.isUndefined(X)){X=[];Z.set(a,X)}if(X.pluck("handler").include(c)){return false}var Y;if(a.include(":")){Y=function(d){if(Object.isUndefined(d.eventName)){return false}if(d.eventName!==a){return false}V.extend(d,b);c.call(b,d)}}else{if(!W&&(a==="mouseenter"||a==="mouseleave")){if(a==="mouseenter"||a==="mouseleave"){Y=function(f){V.extend(f,b);var d=f.relatedTarget;while(d&&d!==b){try{d=d.parentNode}catch(g){d=b}}if(d===b){return }c.call(b,f)}}}else{Y=function(d){V.extend(d,b);c.call(b,d)}}}Y.handler=c;X.push(Y);return Y}function F(){for(var X=0,Y=D.length;X<Y;X++){V.stopObserving(D[X]);D[X]=null}}var D=[];if(Prototype.Browser.IE){window.attachEvent("onunload",F)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var J=Prototype.K;if(!W){J=function(Y){var X={mouseenter:"mouseover",mouseleave:"mouseout"};return Y in X?X[Y]:Y}}function S(a,Z,b){a=$(a);var Y=L(a,Z,b);if(!Y){return a}if(Z.include(":")){if(a.addEventListener){a.addEventListener("dataavailable",Y,false)}else{a.attachEvent("ondataavailable",Y);a.attachEvent("onfilterchange",Y)}}else{var X=J(Z);if(a.addEventListener){a.addEventListener(X,Y,false)}else{a.attachEvent("on"+X,Y)}}return a}function I(c,a,d){c=$(c);var Z=Element.retrieve(c,"prototype_event_registry");if(Object.isUndefined(Z)){return c}if(a&&!d){var b=Z.get(a);if(Object.isUndefined(b)){return c}b.each(function(e){Element.stopObserving(c,a,e.handler)});return c}else{if(!a){Z.each(function(g){var e=g.key,f=g.value;f.each(function(h){Element.stopObserving(c,e,h.handler)})});return c}}var b=Z.get(a);if(!b){return }var Y=b.find(function(e){return e.handler===d});if(!Y){return c}var X=J(a);if(a.include(":")){if(c.removeEventListener){c.removeEventListener("dataavailable",Y,false)}else{c.detachEvent("ondataavailable",Y);c.detachEvent("onfilterchange",Y)}}else{if(c.removeEventListener){c.removeEventListener(X,Y,false)}else{c.detachEvent("on"+X,Y)}}Z.set(a,b.without(Y));return c}function U(a,Z,Y,X){a=$(a);if(Object.isUndefined(X)){X=true}if(a==document&&document.createEvent&&!a.dispatchEvent){a=document.documentElement}var b;if(document.createEvent){b=document.createEvent("HTMLEvents");b.initEvent("dataavailable",true,true)}else{b=document.createEventObject();b.eventType=X?"ondataavailable":"onfilterchange"}b.eventName=Z;b.memo=Y||{};if(document.createEvent){a.dispatchEvent(b)}else{a.fireEvent(b.eventType,b)}return V.extend(b)}Object.extend(V,V.Methods);Object.extend(V,{fire:U,observe:S,stopObserving:I});Element.addMethods({fire:U,observe:S,stopObserving:I});Object.extend(document,{fire:U.methodize(),observe:S.methodize(),stopObserving:I.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,V)}else{window.Event=V}})();(function(){var D;function A(){if(document.loaded){return }if(D){window.clearTimeout(D)}document.loaded=true;document.fire("dom:loaded")}function C(){if(document.readyState==="complete"){document.stopObserving("readystatechange",C);A()}}function B(){try{document.documentElement.doScroll("left")}catch(E){D=B.defer();return }A()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",A,false)}else{document.observe("readystatechange",C);if(window==top){D=B.defer()}}Event.observe(window,"load",A)})();Element.addMethods();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);Object.extend(Element.Methods,{show:function(A){A.style.display="block";return A},getHeight:function(B){try{var A=$(B).getDimensions().height}catch(C){var A=$(B).offsetHeight}return A},getWidth:function(A){try{var B=$(A).getDimensions().width}catch(C){var B=$(A).offsetWidth}return B},findIdInClass:function(A){var C=/id_([0-9a-z_-]+)/;var B=C.exec(A.className);return B[1]},findParamInClass:function(A,E){try{var C=new RegExp(E+"_([A-Za-z0-9/:?&-._]+)");var B=C.exec(A.className);if(B){return B[1]}}catch(D){dbg("erreur");dbg(D)}return false},findParamsInClass:function(C,G){try{var A=[];var E=new RegExp(G+"_([A-Za-z0-9/:?&-._]+)","g");var D=C.className.match(E);if(D){for(var B=0;B<D.length;B++){A.push(D[B].replace(G+"_",""))}return A}}catch(F){dbg("erreur");dbg(F)}return false},getInlineOpacity:function(A){return $(A).style.opacity||""},forceRerendering:function(A){try{A=$(A);var C=document.createTextNode(" ");A.appendChild(C);A.removeChild(C)}catch(B){}}});Object.extend(String.prototype,{escapeUtf8:function(){if(this==""||this==null){return""}var B="";for(var E=0;E<this.length;E++){var G=this.charCodeAt(E);var D=new Array();if(G>65536){D[0]=240|((G&1835008)>>>18);D[1]=128|((G&258048)>>>12);D[2]=128|((G&4032)>>>6);D[3]=128|(G&63)}else{if(G>2048){D[0]=224|((G&61440)>>>12);D[1]=128|((G&4032)>>>6);D[2]=128|(G&63)}else{if(G>128){D[0]=192|((G&1984)>>>6);D[1]=128|(G&63)}else{D[0]=G}}}chars="0123456789ABCDEF";for(var C=0;C<D.length;C++){var A=D[C];var F=chars.charAt((A&240)>>>4)+chars.charAt(A&15);B+="%"+F}}return B},querySeparator:function(){return this.indexOf("?")>=0?"&":"?"},htmlentity_decode:function(){return this.replace(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&circ;/g,"^").replace(/&lsquo;/g,"‘").replace(/&rsquo;/g,"’").replace(/&ldquo;/g,"“").replace(/&rdquo;/g,"”").replace(/&bull;/g,"•").replace(/&ndash;/g,"–").replace(/&mdash;/g,"—").replace(/&tilde;/g,"˜").replace(/&trade;/g,"™").replace(/&scaron;/g,"š").replace(/&rsaquo;/g,"›").replace(/&oelig;/g,"œ").replace(/&#357;/g,"").replace(/&#382;/g,"ž").replace(/&Yuml;/g,"Ÿ").replace(/&nbsp;/g," ").replace(/&iexcl;/g,"¡").replace(/&cent;/g,"¢").replace(/&pound;/g,"£").replace(/&curren;/g," ").replace(/&yen;/g,"¥").replace(/&brvbar;/g,"¦").replace(/&sect;/g,"§").replace(/&uml;/g,"¨").replace(/&copy;/g,"©").replace(/&ordf;/g,"ª").replace(/&laquo;/g,"«").replace(/&not;/g,"¬").replace(/&shy;/g,"").replace(/&reg;/g,"®").replace(/&macr;/g,"¯").replace(/&deg;/g,"°").replace(/&plusmn;/g,"±").replace(/&sup2;/g,"²").replace(/&sup3;/g,"³").replace(/&acute;/g,"´").replace(/&micro;/g,"µ").replace(/&para/g,"¶").replace(/&middot;/g,"·").replace(/&cedil;/g,"¸").replace(/&sup1;/g,"¹").replace(/&ordm;/g,"º").replace(/&raquo;/g,"»").replace(/&frac14;/g,"¼").replace(/&frac12;/g,"½").replace(/&frac34;/g,"¾").replace(/&iquest;/g,"¿").replace(/&Agrave;/g,"À").replace(/&Aacute;/g,"Á").replace(/&Acirc;/g,"Â").replace(/&Atilde;/g,"Ã").replace(/&Auml;/g,"Ä").replace(/&Aring;/g,"Å").replace(/&AElig;/g,"Æ").replace(/&Ccedil;/g,"Ç").replace(/&Egrave;/g,"È").replace(/&Eacute;/g,"É").replace(/&Ecirc;/g,"Ê").replace(/&Euml;/g,"Ë").replace(/&Igrave;/g,"Ì").replace(/&Iacute;/g,"Í").replace(/&Icirc;/g,"Î").replace(/&Iuml;/g,"Ï").replace(/&ETH;/g,"Ð").replace(/&Ntilde;/g,"Ñ").replace(/&Ograve;/g,"Ò").replace(/&Oacute;/g,"Ó").replace(/&Ocirc;/g,"Ô").replace(/&Otilde;/g,"Õ").replace(/&Ouml;/g,"Ö").replace(/&times;/g,"×").replace(/&Oslash;/g,"Ø").replace(/&Ugrave;/g,"Ù").replace(/&Uacute;/g,"Ú").replace(/&Ucirc;/g,"Û").replace(/&Uuml;/g,"Ü").replace(/&Yacute;/g,"Ý").replace(/&THORN;/g,"Þ").replace(/&szlig;/g,"ß").replace(/&agrave;/g,"à").replace(/&aacute;/g,"á").replace(/&acirc;/g,"â").replace(/&atilde;/g,"ã").replace(/&auml;/g,"ä").replace(/&aring;/g,"å").replace(/&aelig;/g,"æ").replace(/&ccedil;/g,"ç").replace(/&egrave;/g,"è").replace(/&eacute;/g,"é").replace(/&ecirc;/g,"ê").replace(/&euml;/g,"ë").replace(/&igrave;/g,"ì").replace(/&iacute;/g,"í").replace(/&icirc;/g,"î").replace(/&iuml;/g,"ï").replace(/&eth;/g,"ð").replace(/&ntilde;/g,"ñ").replace(/&ograve;/g,"ò").replace(/&oacute;/g,"ó").replace(/&ocirc;/g,"ô").replace(/&otilde;/g,"õ").replace(/&ouml;/g,"ö").replace(/&divide;/g,"÷").replace(/&oslash;/g,"ø").replace(/&ugrave;/g,"ù").replace(/&uacute;/g,"ú").replace(/&ucirc;/g,"û").replace(/&uuml;/g,"ü").replace(/&yacute;/g,"ý").replace(/&thorn;/g,"þ").replace(/&yuml;/g,"ÿ")}});function dbg(A){if(window.console){window.console.log(A)}else{alert(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 setCookieWithFormat(C,D,F,E){var A="";if(F){if(E=="d"){millisec=24*60*60*1000}else{if(E=="h"){millisec=60*60*1000}else{if(E=="m"){millisec=60*1000}}}var B=new Date();B.setTime(B.getTime()+(F*millisec));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)}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 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 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();querystring+="&from_request="+encodeURIComponent(window.location.pathname);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++){try{eval(json[j])}catch(e){}}}},on404:function(request){alert('Error 404: location "'+request.statusText+'" was not found.')},onFailure:function(request){alert("Error "+request.status+": "+request.statusText)}})}function findIdInClass(B){try{var C=/id_([0-9a-z_-]+)/;var A=C.exec(B.className);if(A){return A[1]}}catch(D){}return false}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 timeFormat(C){var B=Math.floor(C/3600);var A="";if(B>0){A=pad(B,2,"0")+":"}A+=pad(Math.floor(C/60),2,"0")+":"+pad(Math.floor(C%60),2,"0");return A}function pad(D,A,C){var B=D.toString();while(B.length<A){B=C+B}return B}function shuffleArray(D){for(var B,A,C=D.length;C;B=parseInt(Math.random()*C),A=D[--C],D[C]=D[B],D[B]=A){}return D}function ping(A){if($("vsTag")){$("vsTag").writeAttribute("src",A)}else{var B=new Element("img",{"src":A,"id":"vsTag","style":"display: none;"});if($("bodyall")){$("bodyall").insert(B)}else{if($$("body")[0]){$$("body")[0].insert(B)}}}}function clearTempStorage(){window.name=""}function getTempStorage(A){var C={};try{C=window.name.evalJSON()}catch(B){}if(typeof C[A]!="undefined"){return C[A]}return null}function setTempStorage(A,B){var D={};try{D=window.name.evalJSON()}catch(C){}D[A]=B;window.name=$H(D).toJSON()}if(Prototype.Browser.IE){window.IEVersion=parseFloat(navigator.appVersion.split(";")[1].strip().split(" ")[1]);try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}}Element.addMethods(Element.Methods);dom_is_ready=false;Object.extend(Event,{_domReady:function(){if(arguments.callee.done){return }arguments.callee.done=true;this._readyCallbacks.each(function(A){try{A()}catch(B){}});this._readyCallbacks=null;dom_is_ready=true},onDOMReady:function(B){if(!dom_is_ready){if(!this._readyCallbacks){var A=this._domReady.bind(this);document.observe("dom:loaded",A);Event._readyCallbacks=[]}Event._readyCallbacks.push(B)}else{try{B()}catch(C){}}}});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;DM_Player={onDailymotionPlayerReadyCallbacks:[],domReady:false,allowDebug:false,playerReady:false,playerIds:[],playerDisplayedIds:[],playerLogs:[],lazyPreviews:[],logContainer:null,logFilter:null,launchCallbacks:function(){if(DM_Player.playerReady==true&&DM_Player.domReady==true){var B=null;while(B=DM_Player.playerIds.pop()){for(var A=0;A<DM_Player.onDailymotionPlayerReadyCallbacks.length;A++){DM_Player.onDailymotionPlayerReadyCallbacks[A](B)}}}},addReadyCallback:function(A){try{DM_Player.onDailymotionPlayerReadyCallbacks.push(A)}catch(B){console.log(B)}},initLogs:function(){DM_Player.logContainer=$("dmplayerv4log");DM_Player.logFilter=$("dmplayerv4logfilter");for(var A=0;A<DM_Player.playerLogs.length;A++){DM_Player.log(DM_Player.playerLogs[A])}},log:function(B){if(DM_Player.domReady==true&&DM_Player.logContainer){if(DM_Player.logFilter&&DM_Player.logFilter.value!=""){var A=new RegExp(DM_Player.logFilter.value);if(!A.match(B)){return }}DM_Player.logContainer.insert(B.replace(/^\[(.+)\](.+)$/g,'<div class="$1"><strong>[$1]</strong>$2</div>'));DM_Player.logContainer.scrollTop=DM_Player.logContainer.scrollHeight}try{console.log(B)}catch(C){}},getHtml5Player:function(){return'<div class="dmpi_video_playerv4"><video  src="http://snapshot.opera.com/resources/BigBuckBunny.ogv" autoplay></video><div id="controls">toto</div></div>'},playLazyPlayer:function(id){var so=eval("so_"+id);so.write("container_"+id)},setLazyPreview:function(B,A){this.lazyPreviews.push({"id":B,"previewURL":A})},loadLazyPreviews:function(){for(var A=0;A<this.lazyPreviews.length;A++){var B=new Element("img",{"src":this.lazyPreviews[A].previewURL});this.loadImage(B,$(this.lazyPreviews[A].id+"_lazy_preview"))}},loadImage:function(A,B){if(!A.complete||(typeof A.naturalWidth!="undefined"&&A.naturalWidth===0)){setTimeout(function(){this.loadImage(A,B)}.bind(this),50)}else{B.insert(A);this.adjusteImage(A,B)}},adjusteImage:function(H,B){var A=H.getWidth();var E=H.getHeight();var D=B.getWidth();var G=B.getHeight();if(A!=D||E!=G){var F=0;var C=0;if(A/E>D/G){F=G;C=Math.round(G*(A/E))}else{C=D;F=Math.round(D*(E/A))}H.setStyle({"width":C+"px","height":F+"px","left":"-"+Math.round((C-D)/2)+"px","top":"-"+Math.round((F-G)/2)+"px"})}}};function onDailymotionPlayerReady(A){DM_Player.playerReady=true;DM_Player.playerIds.push(A);DM_Player.playerDisplayedIds.push(A);DM_Player.launchCallbacks();DM_Player.initLogs()}function dailymotionPlayerLog(A){if(DM_Player.allowDebug){DM_Player.playerLogs.push(A);DM_Player.log(A)}}Event.onDOMReady(function(){DM_Player.domReady=true;DM_Player.launchCallbacks();DM_Player.loadLazyPreviews();DM_Player.initLogs()});var DM_JS={loaded:{},templatePath:null,features:{"Extras":"/js/gen/widget/pack/extras.js","DM_Widget_Popup":"/js/gen/widget/pack/popup.js","TheFilterCaptureService":"/js/gen/lib/thefilter/DailyMotionFilterCaptureService.js"},empty:function(){},get:function(A,B){if(DM_JS.features[A]){DM_JS.load(DM_JS.features[A],A,B)}},getRealPath:function(D){var B=(Prototype.Browser.IE?("?dmr="+(new Date()).getTime()):""),C=D.match(/\.v[a-f0-9]+$/),A=DM_Hash[D.replace(/\/js\/gen\//,"")];if(!C&&!A){dbg('Wrong "file to hash" mapping with '+D)}return D+(C?"":(".v"+A+B))},load:function(F,B,G,A){var E=!!window[B];if(!E&&!DM_JS.loaded[B]){var D=$$("head")[0]||document.documentElement;var C=document.createElement("script");C.setAttribute("type","text/javascript");C.setAttribute("src",DM_JS.getRealPath(F));D.insertBefore(C,D.firstChild)}DM_JS.loaded[B]=(A&&!E?DM_JS.empty:G)||DM_JS.empty;if(E){DM_JS.loaded[B]()}},isLoaded:function(A){if(DM_JS.loaded[A]){DM_JS.loaded[A]()}else{DM_JS.loaded[A]=DM_JS.empty}}};var DM_Widget_PageItem_Masscast={allowDebug:false,enableCrossFade:false,enableRotateAd:false,debugLogs:[],crossFadeDuration:1,allowedDerivated:["Middle","Middle1","Middle2","Top","Top2","Right1","Right2","Right3","BottomLeft","x28"],allowedPosition:["Middle","Middle1","Middle2","Top","Top2","Top3","Right1","Right2","Right3","BottomLeft","Preroll","Midroll","Postroll","Frame1","x11","x13","x28"],positionMinHeight:{"Middle":250,"Middle1":75,"Middle2":75,"Top":90,"Top2":25,"Right1":100,"Right2":100,"Right3":100,"BottomLeft":300},positionCalled:[],positionOlded:[],defaultReloadTime:{},reloadTime:{},reloadMaxDuration:{},reloadTimeout:{},positionCode:{},theaterAd:{},initDate:new Date(),OAS_RICH:null,call:null,canCallOAS:true,richedOAS:false,noFrame:false,playerFirstPlay:true,isInIframe:false,auditudeRunning:false,auditudeReady:false,domeIsReady:false,mandatoryJS:"",baseJS:"",baseSkin:"",player:null,bodyLink:"",bodyLinkBlank:true,topBannerLink:false,debug:function(D){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();if(this.isInIframe){D=A+":"+C+":"+E+" - (from iframe) - "+D}else{D=A+":"+C+":"+E+" - (from site) - "+D}DM_Widget_PageItem_Masscast.debugLogs.push(D);if(this.allowDebug&&typeof console!="undefined"){console.log(D)}},showDebug:function(){$A(DM_Widget_PageItem_Masscast.debugLogs).each(function(A){console.log(A)})},callOAS:function(B){if(this.canCallOAS===false){return }this.canCallOAS=false;DM_Widget_PageItem_Masscast.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;DM_Widget_PageItem_Masscast.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();this.getPageSkin()},getSWF:function(B,A){return this.hasTheaterAd()?A:B},onAuditudeHasMiddle:function(){this.debug("AUDITUDE has middle");this.positionCode["Middle"]="// Default ad";this.positionOlded.push("Middle")},onAuditudeHasTop:function(){this.debug("AUDITUDE has top");this.positionCode["Top"]="// Default ad";this.positionOlded.push("Top")},onAuditudeReady:function(){this.debug("AUDITUDE ready");if(!this.auditudeReady&&this.domeIsReady&&this.auditudeRunning){this.renderAllPosition()}this.auditudeReady=true},onAuditudeDisplayBanner:function(C,B,A){this.debug("AUDITUDE displayBaneer "+B+"x"+A+" : "+C);if(B==728&&A==90&&$("mc_Top")){$("mc_Top").show();if(C.substr(0,7)=="http://"){C=C.replace(/\/\/ad.auditude.com/i,"//auditude.dailymotion.com");$("mc_Top").update(new Element("iframe",{"src":C,"width":B+"px","height":A+"px","scrolling":"no","frameBorder":"0","allowTransparency":"true","class":"masscast"}))}else{$("mc_Top").update(C)}}else{if(B==300&&A==250&&$("mc_Middle")){$("mc_Middle").show();if(C.substr(0,7)=="http://"){C=C.replace(/\/\/ad.auditude.com/i,"//auditude.dailymotion.com");$("mc_Middle").update(new Element("iframe",{"src":C,"width":B+"px","height":A+"px","scrolling":"no","frameBorder":"0","allowTransparency":"true","class":"masscast"}))}else{$("mc_Middle").update(C)}}}},forceDomain:function(){document.domain="dailymotion.com"},getBuzzableVideoId:function(){var code=eval(this.positionCode["x11"]);if(typeof code!="undefined"&&typeof code.videoId!="undefined"){return code.videoId}return false},getBuzzableTitle:function(){var code=eval(this.positionCode["x11"]);if(typeof code!="undefined"&&typeof code.title!="undefined"){return code.title}return false},getBuzzableVideoClickCount:function(){var code=eval(this.positionCode["x11"]);if(typeof code!="undefined"&&typeof code.clickCount!="undefined"){return code.clickCount}return false},redirectAfterClickCount:function(C,B){var A=document.createElement("img");A.src=C;$("bodyall").appendChild(A);setTimeout(function(){document.location.href=B},500);return false},hasTheaterAd:function(){return $H(this.theaterAd).values().length!==0},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|pauseDuration|accountingPath)\s*=\s*(.*)$/);if(B){DM_Widget_PageItem_Masscast.theaterAd[B[1]]=B[2]}};OAS_RICH("Frame1");document.write=A;if(this.hasTheaterAd()){DM_Widget_PageItem_Masscast.debug("Position code FOUND : TheaterAd")}else{DM_Widget_PageItem_Masscast.debug("Position code not found : TheaterAd")}},setTheaterAd:function(){if(!this.hasTheaterAd()){return }$$("body").first().addClassName("theater_video_page");$("bodyall").insert(new Element("img",{"src":this.theaterAd["accountingPath"],"id":"theater_accountingPath"}));var A={"class":"theater_curtain","style":"background-image: url("+this.theaterAd["curtainPath"]+")","href":this.theaterAd["clickTAG"],"target":this.theaterAd["clickTARGET"]};A["id"]="theater_curtain_left";$$(".dmpi_video_playerv4").first().insert({bottom:new Element("a",A)});A["id"]="theater_curtain_right";$$(".dmpi_video_playerv4").first().insert({bottom:new Element("a",A)});$$(".dmpi_video_playerv4").first().insert({bottom:new Element("a",{"id":"theater_background","class":"theater_background",style:"background-image: url("+this.theaterAd["backgroundPath"]+")",href:this.theaterAd["clickTAG"],target:this.theaterAd["clickTARGET"]})});setTimeout(function(){this.moveCurtain("theater_curtain_left",-1);this.moveCurtain("theater_curtain_right",1)}.bind(this),this.theaterAd["pauseDuration"]*1000)},moveCurtain:function(D,B){var C=parseInt($(D).getStyle("margin-left").substr(0,$(D).getStyle("margin-left").length-2),10);var A=C+(B*Math.ceil((Math.abs(C)+1)/10));$(D).setStyle({marginLeft:A.toString()+"px"});if(A*B<$(D).getWidth()){setTimeout(function(){this.moveCurtain(D,B)}.bind(this),33)}else{if(this.player){this.player.playVideo()}}},render:function(C,F){if(!F){var F="buzzpack"}switch(F){case"masthead":var E=960;var B=280;var A="Top";break;case"buzzpack":var E=300;var B=250;var A="Middle";break}var D={"masthead_clickURL":"","masthead_clickTarget":"_blank","masthead_clickTag":"","masthead_backgroundURL":"","masthead_playerX":530,"masthead_playerY":10,"masthead_playerWidth":420,"masthead_playerHeight":260,"skin":"/flash/dmplayerv4/default.swf","VSTag":"","videoURI":"","animatedTitle":"","autoPlay":0,"autoMute":1,"hideInfos":0,"chromeless":0,"expandVideo":0,"auditude":0,"hideVideoActions":0,"startOnRollOver":0,"clickThroughURL":"","clickThroughTarget":"_blank","clickThroughTag":"","complete_0":"","complete_25":"","complete_50":"","complete_75":"","complete_100":""};for(attribute in C){D[attribute]=C[attribute]}if(DM_Widget_PageItem_Masscast.noFrame===true){document.write('<div style="width: '+E+"px; height: "+B+'px;"></div>')}else{Element.extend(document.body);document.body.update(new Element("div").setStyle({width:E+"px",height:B+"px"}))}ajax_call("masscast","get_"+F+"_player",$H(D).toJSON(),function(G){if(DM_Widget_PageItem_Masscast.noFrame===true){if(F=="masthead"){$("wrapper").setStyle({padding:"0px"})}$("mc_"+A).update(G)}else{if(F=="masthead"){window.parent.$("wrapper").setStyle({padding:"0px"})}document.body.down().update(G)}if(window.parent!=window){try{window.parent.DM_Widget_PageItem_Masscast.adjustPositionSize(A,$("bodyall").getHeight())}catch(H){DM_Widget_PageItem_Masscast.debug("ERROR: "+H)}}})},renderSponsoredVideo:function(A){if(typeof A.videoId=="undefined"){return }ajax_call("masscast","get_sponsored_video",$H(A).toJSON(),function(B){if(DM_Widget_PageItem_Masscast.noFrame===true){if($("mc_Middle1")){$("mc_Middle1").update(B)}else{if($("mc_Middle2")){$("mc_Middle2").update(B)}}}else{var C=new Element("div").update(B);C.select("a").each(function(D){D.writeAttribute("target","_parent")});document.body.update(C.firstDescendant())}})},renderMiniPreview:function(options){var el=["right1","right2","right3"].indexOf(options.position)!=-1?$("mc_R"+options.position.substring(1)):null;if(!el){return }if(options.type=="image"){var html="<img src="+options.miniPreview+' border="0" width="300" height="100" />';el.insert(html)}else{if(options.type=="flash"){var html='<div id="miniPreview"></div>';el.insert(html);var o=new SWFObject(options.miniPreview,"miniPreview",300,100,"9.0.0");o.write($("miniPreview"))}}el.observe("mouseover",function(){if(!DM_Widget_PageItem_Masscast.showRightPlayer&&!DM_Widget_PageItem_Masscast.playingRightX&&!DM_Widget_PageItem_Masscast.mouseOverLock){DM_Widget_PageItem_Masscast.mouseOverLock=null;DM_Widget_PageItem_Masscast.showRightPlayer=function(){DM_Widget_PageItem_Masscast.playingRightX=true;var id=el.identify();ajax_call("masscast","get_buzzpack_player",$H(options).toJSON(),function(html){var contHtml='<div id="'+id+'_player" class="mc_right_player_box">';contHtml+='<div class="mc_right_player_close_cont background">';contHtml+='<a href="javascript:void(0);" class="dmco_simplelink" onclick="DM_Widget_PageItem_Masscast.removeRightPlayer(this);">';contHtml+=DM_CloseLabel;contHtml+="</a></div>"+html.replace(/dmpi_video_playerv4/,"dmpi_video_playerv4 background");contHtml+="</div>";el.ancestors()[0].hide().insert({after:contHtml})})};DM_Widget_PageItem_Masscast.showRightPlayer.timeout=setTimeout(DM_Widget_PageItem_Masscast.showRightPlayer,200)}});el.observe("mouseout",function(){with(DM_Widget_PageItem_Masscast){showRightPlayer&&showRightPlayer.timeout&&clearTimeout(showRightPlayer.timeout);showRightPlayer=mouseOverLock=null}})},removeRightPlayer:function(B){DM_Widget_PageItem_Masscast.playingRightX=false;DM_Widget_PageItem_Masscast.mouseOverLock=true;var A=$(B).ancestors()[1];A.previous().show();A.update("").remove()},context:function(B,E,D,C,F){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 A=$H({"context":B,"text1":E,"text2":D,"text3":C,"auto":(!F)?"1":F});ajax_call("masscast","get_context_player",A.toJSON(),DM_Widget_PageItem_Masscast.context_callback)},context_callback:function(A){var B=A.evalJSON();if(DM_Widget_PageItem_Masscast.noFrame===true){$("mc_Middle").update(B.content)}else{document.body.down().update(B.content)}if(window.parent!=window){try{window.parent.DM_Widget_PageItem_Masscast.adjustPositionSize("Middle",$("bodyall").getHeight())}catch(C){DM_Widget_PageItem_Masscast.debug("ERROR: "+C)}}},getPageSkin:function(){if(this.issetPositionCode("Top3")){var A=this.getPositionCode("Top3");render_skin(A)}},render_skin:function(A){render_skin(A)},getPlayerSkin:function(A){if(this.issetPositionCode("x13")){return this.getPositionCode("x13")}return A},getPositionCode:function(A){if(this.issetPositionCode(A)){return this.positionCode[A]}},issetPositionCode:function(A){if(!this.positionCode[A]||this.positionCode[A].indexOf("// Default ad")>=0){return false}return true},isPositionCalled:function(A){if(this.positionCalled.indexOf(A)!=-1){return true}return false},isPositionOlded:function(A){if(this.positionOlded.indexOf(A)!=-1){return true}return false},renderAllPosition:function(){this.debug("Render all positions");for(var A=0;A<this.allowedDerivated.length;A++){if(this.isPositionCalled(this.allowedDerivated[A])&&this.issetPositionCode(this.allowedDerivated[A])){DM_Widget_PageItem_Masscast.debug("Position code FOUND : "+this.allowedDerivated[A]);this.renderPosition(this.allowedDerivated[A])}else{if(this.isPositionOlded(this.allowedDerivated[A])){DM_Widget_PageItem_Masscast.debug("Position code olded : "+this.allowedDerivated[A])}else{if(this.isPositionCalled(this.allowedDerivated[A])){if($("mc_"+this.allowedDerivated[A])){$("mc_"+this.allowedDerivated[A]).remove()}DM_Widget_PageItem_Masscast.debug("Position code not found : "+this.allowedDerivated[A])}}}}},renderPosition:function(A,F){var B=$("mc_"+A);if(!B){DM_Widget_PageItem_Masscast.debug("Position placeholder not found : "+A);return }window.clearTimeout(this.reloadTimeout[A]);var H=$H({"position":A,"mandatoryJS":DM_Widget_PageItem_Masscast.mandatoryJS,"baseJS":DM_Widget_PageItem_Masscast.baseJS,"baseSkin":DM_Widget_PageItem_Masscast.baseSkin});if(typeof F!="undefined"){H.set("call",F)}var E=new Element("iframe",{"src":"/middle?"+H.toQueryString(),"scrolling":"no","frameBorder":"0","allowTransparency":"true","class":"masscast"});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().remove()}E.hide();$("mc_"+A).insert(E);E.show()}else{$("mc_"+A).update(E)}},adjustPositionSize:function(B,A){A=A-(A%10);if(A!==0&&A<this.positionMinHeight[B]){A=this.positionMinHeight[B]}if(A==0){A=250}if(B=="Middle1"){A=this.positionMinHeight.Middle1}else{if(B=="Middle2"){A=this.positionMinHeight.Middle2}}$("mc_"+B).setStyle({height:A+"px"});var C=$("mc_"+B).down("iframe");if(C){C.setStyle({height:A+"px"})}},overridePosition:function(A,B){if(DM_Widget_PageItem_Masscast.isPositionCalled(A)){DM_Widget_PageItem_Masscast.positionCode[A]=B;DM_Widget_PageItem_Masscast.renderPosition(A)}},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){DM_Widget_PageItem_Masscast.debug(A+" is Fixed (rotate ad not enable)");return }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){DM_Widget_PageItem_Masscast.debug("Fix "+A+" (no reload time forced by MAXDURATION)");return }}if(typeof this.reloadTime[A]!="undefined"&&this.reloadTime[A]!==false){if(this.reloadTime[A]>0){B=this.reloadTime[A];DM_Widget_PageItem_Masscast.debug("Reload "+A+" in "+B+"sc (forced by OAS)")}else{DM_Widget_PageItem_Masscast.debug("Fix "+A+" (no reload time forced by OAS)");return }}else{if(typeof this.defaultReloadTime[A]!="undefined"&&this.defaultReloadTime[A]!==false){if(this.defaultReloadTime[A]>0){B=this.defaultReloadTime[A];DM_Widget_PageItem_Masscast.debug("Reload "+A+" in "+B+"sc (forced by CONF)")}else{DM_Widget_PageItem_Masscast.debug("Fix "+A+" (no reload time forced by CONF)");return }}else{DM_Widget_PageItem_Masscast.debug("Fix "+A+" (no reload time was set)");return }}window.clearTimeout(this.reloadTimeout[A]);this.reloadTimeout[A]=window.setTimeout(this.reload.bind(this,A),B*1000);return },reload:function(){var A=arguments[0];var B=this.call;B=B.replace(/masscast\/[0-9]/g,"masscast/2");B=B.replace(/@([^?]+)?/g,"@"+A);B=B.replace(/\/[0-9]*@/g,"/"+Math.floor(Math.random()*100000)+"@");this.renderPosition(A,B)},moveHomeSlot5and6:function(){document.observe("dom:loaded",function(){var A=$$(".dm_page_html_home .dmpi_subbox.channels");if(A.size()){A[0].remove()}var B=$$(".dm_page_html_home .dmpi_slotitem_video");if(B.size()){B[3].insert({after:'<div class="dmpi_slotitem dmpi_slotitem_video column span-2 edition"><!--ie comment--></div><div class="dmpi_slotitem dmpi_slotitem_video column span-2 last edition"><!--ie comment--></div>'});[B[5],B[9],B[11]].invoke("toggleClassName","last")}})},onDailymotionPlayerReady:function(A){this.player=$(A);if(this.player){this.player.addEventListener("onStateChange","DM_Widget_PageItem_Masscast.playerStateChangeHandler")}},playerStateChangeHandler:function(A){if(A==5||A==1){if(this.hasTheaterAd()&&this.playerFirstPlay){this.playerFirstPlay=false;if(this.player){this.player.pauseVideo()}}}},initialize:function(){DM_Player.addReadyCallback(this.onDailymotionPlayerReady.bind(this));Event.onDOMReady(function(){if(this.isInIframe){return }DM_Widget_PageItem_Masscast.debug("DOM is Ready");this.richOAS();if(this.noFrame===true){this.forceSetReload()}else{if(this.auditudeRunning){if(this.auditudeReady){this.renderAllPosition()}}else{this.renderAllPosition()}}if(this.hasTheaterAd()){$$(".dmpi_video_playerv4")[0].setStyle({"height":"441px"})}this.domeIsReady=true}.bind(this))}};DM_Widget_PageItem_Masscast.initialize();var DM_MassCast=DM_Widget_PageItem_Masscast;var DM_Ajax={defaultLocation:null,enableEventListener:false,debugCallBack:true,debug:false,init:function(){this.initLoading();this.ajaxify(document)},debug:function(A){if(DM_Ajax.debug){dbg(A)}},initLoading:function(){if(!Ajax.clicked_obj){Ajax.clicked_obj=new Array;Ajax.loading_cnt=0}},ajaxify:function(A,C){if(typeof (A)=="undefined"){var A=document.body}A=A==document?$(document.body):$(A);try{if(A.tagName=="A"&&A.hasClassName("ajax")){DM_Ajax.ajaxifyLink(A);return }}catch(D){}A.select('a[name="ajax"]').each(function(E){DM_Ajax.ajaxifyLink(E)});var B=[];if(A.tagName&&A.tagName.toLowerCase()=="form"){B=new Array(A)}else{B=Object.isElement(A)?A.select("form.ajax"):$$("form.ajax")}B.each(function(E){DM_Ajax.addAjaxForm(E)})},needAjaxify:function(A){return A.name=="ajax"},addAjaxForm:function(A){A=$(A);if(typeof (A.alreadyObserved)=="undefined"){A.alreadyObserved=true;this.parseAction(A)}},parseAction:function(node){var actionRegex=new RegExp("action:(replace|insert|top|bottom|before|after|fade|hide|popup|redirect|update|toggleOrUpdate|cleanOrUpdate)");var i=0;var args=[];var action=null;var formAction=null;var doAjaxCall=true;if(node.nodeName=="FORM"&&!node.className.match(/form_edit_in_place/)){formAction="replace"}if(!formAction&&node.href&&node.className.match(/dmgetjsparam/)){var newArg=eval(hex2str($(node).findParamInClass("dmgetjsparam")));node.href=node.href.replace(/jsparam.*jsparam/,"jsparam"+encodeURIComponent(newArg)+"jsparam")}if(formAction||(action=node.className.match(actionRegex))){var actionToPerform=null;if(formAction){actionToPerform=formAction}else{actionToPerform=action[1]}while(arg=node.className.match(new RegExp("action:arg"+i+":([^ ]+)"))){args[args.length]=arg[1].sub("--"," ");i++}var targetElements=[node];if(args.length>0){if(args[0]=="parent"){targetElements=[node.parentNode]}else{targetElements=$$(args[0])}}switch(actionToPerform){case"top":case"bottom":case"before":case"after":var method=function(targetElement,callback){var options={};options[actionToPerform]=Ajax.XHR.responseText;targetElement.insert(options);if(callback){callback()}};break;case"fade":var method=function(targetElement,callback){DM_JS.get("Extras",function(){Effect.Fade(targetElement);if(callback){callback()}}.curry(targetElement,callback))};break;case"hide":var method=function(targetElement,callback){targetElement.hide();if(callback){callback()}};break;case"remove":var method=function(targetElement,callback){targetElement.remove();if(callback){callback()}};break;case"replace":var method=function(targetElement,callback){Element.replace(targetElement,Ajax.XHR.responseText);if(callback){callback()}};break;case"update":var method=function(targetElement,callback){Element.update(targetElement,Ajax.XHR.responseText);if(callback){callback()}};break;case"toggleOrUpdate":case"cleanOrUpdate":if(targetElements.length){targetElement=targetElements[0];if(targetElement.innerHTML.blank()){var method=function(targetElement,callback){Element.update(targetElement,Ajax.XHR.responseText).show();if(callback){callback()}}}else{doAjaxCall=false;if(actionToPerform=="toggleOrUpdate"){var method=function(targetElement,callback){targetElement.toggle();if(callback){callback()}}}else{var method=function(targetElement,callback){targetElement.update("").hide();if(callback){callback()}}}}}break;case"redirect":var method=function(targetElement,callback){Request.redirect(hex2str(findParamInClass("urlback",targetElement)));if(callback){callback()}};break;case"insert":var method=function(targetElement,callback){targetElement.update(Ajax.XHR.responseText);if(callback){callback()}};break;case"popup":var method=function(targetElement,callback){DM_JS.get("DM_Widget_Popup",function(){var options={};var customWidth=null;if(Prototype.Browser.IE&&targetElement.hasClassName("popup_ie_width")){options.custom_width=targetElement.findParamInClass("width")+"px";customWidth=options.custom_width+"px"}if(Ajax.XHR.responseText){if($("popupContent")){if(DM_Widget_Popup.readyForUpdate()){if(customWidth){$("popupContent").setStyle({width:customWidth})}DM_Widget_Popup.update(Ajax.XHR.responseText)}else{DM_Widget_Popup.close();var popup=new DM_Widget_Popup(options);popup.update(Ajax.XHR.responseText);popup.open()}}else{var popup=new DM_Widget_Popup(options);popup.update(Ajax.XHR.responseText);popup.open()}}if(callback){callback()}}.bind(this,targetElement,callback))};break}if(method){node.jsAction=function(callbackJsAction){var targetElements=[node];if(args.length>0){if(args[0]=="parent"){targetElements=[node.parentNode]}else{if(args[0]=="parent.parent"){targetElements=[node.parentNode.parentNode]}else{targetElements=$$(args[0])}}}if(targetElements.length>1){targetElements.each(function(targetElement,index){if(index==targetElements.length-1){method(targetElement,callbackJsAction)}})}else{method(targetElements.first(),callbackJsAction)}}}}return doAjaxCall},ajaxifyLink:function(A){A=$(A);if(typeof (A.alreadyObserved)=="undefined"){DM_Ajax.parseAction(A);A.alreadyObserved=true;if(!DM_Ajax.enableEventListener){A.onclick=function(){return DM_Ajax.clickWithOnClick(A)}}else{A.listener=DM_Ajax.clickWithEventListener.bindAsEventListener(DM_Ajax,A);A.observe("click",A.listener)}A.ajaxlink=A.href}},lockClickedObj:function(A){A.ajaxLock=true},isLockedClickedObj:function(A){return A.ajaxLock==true?true:false},unlockClickedObj:function(A){A.ajaxLock=false},getElementUniqueId:function(A){return $(A).identify()},clickWithOnClick:function(D,C){if(typeof D=="undefined"){D=this}var E=DM_Ajax.getElementUniqueId(D);Ajax.clicked_obj[E]=D;if(!DM_Ajax.isLockedClickedObj(D)){DM_Ajax.lockClickedObj(D);var B=findParamInClass("confirm",Ajax.clicked_obj[E]);if(B&&!confirm(hex2str(B).htmlentity_decode())){DM_Ajax.unlockClickedObj(D);return false}if(C){if(Ajax.clicked_obj[E].nodeName=="A"&&!Ajax.clicked_obj[E].hasClassName("no_icon_loading")){var A=D;if(A.down(".icon")){A=A.down(".icon")}if(A.down(".button_icon")){A=A.down(".button_icon")}A.addClassName("icon_loading")}DM_Ajax.request(Ajax.clicked_obj[E].ajaxlink,E)}else{if(Ajax.clicked_obj[E].jsAction){Ajax.clicked_obj[E].jsAction()}DM_Ajax.unlockClickedObj(D)}}return false},clickWithEventListener:function(B,A){B.stop();A=$(A);var C=DM_Ajax.getElementUniqueId(A);Ajax.clicked_obj[C]=A;DM_Ajax.request(Ajax.clicked_obj[C].href,C)},deAjaxifyLink:function(A){A.stopObserving("click",A.listener)},saveClientBodyHeight:function(){var A=document.getElementsByTagName("body");A[0].oldHeight=A[0].style.height;A[0].style.height=A[0].clientHeight+"px"},resetClientBodyHeight:function(){var A=document.getElementsByTagName("body");A[0].style.height=A[0].oldHeight},request:function(A,B){Ajax.loading_cnt++;new Ajax.Request(A,{method:"get",parameters:{from_request:window.location.pathname},onComplete:this.ajaxCallback.bind(this,B)})},ajaxCallback:function(B,A,C){Ajax.XHR=A;DM_Ajax.saveClientBodyHeight();DM_Ajax.tmpUniqueID=B;DM_Ajax.resetClientBodyHeight();if(Ajax.clicked_obj[B].jsAction){Ajax.clicked_obj[B].jsAction(function(){DM_Ajax.executeJSONS(C,B)})}else{DM_Ajax.executeJSONS(C,B)}},executeJSONS:function(eJSON,uniqueID){try{if(eJSON){if(typeof eJSON=="object"){if(!Object.isArray(eJSON)){eJSON=Object.values(eJSON)}var curLen=eJSON.length;for(var j=0;j<curLen;j++){try{eval(eJSON[j])}catch(e){if(DM_Ajax.debugCallBack){dbg("ajaxCallback error catched: "+e.message+" in "+eJSON[j])}}}}}DM_Ajax.afterAjaxCallBack(uniqueID)}catch(e){if(DM_Ajax.debugCallBack){dbg("CallBackError: "+e.message)}DM_Ajax.afterAjaxCallBack(uniqueID)}},afterAjaxCallBack:function(B){DM_Ajax.unlockClickedObj(Ajax.clicked_obj[B]);if(Ajax.clicked_obj[B]&&Ajax.clicked_obj[B].submited){Ajax.clicked_obj[B].submited=false}if(Ajax.loading_cnt>0){Ajax.loading_cnt--}if(Ajax.loading_cnt==0){var A=Ajax.clicked_obj[B];if(A.down(".icon")){A=A.down(".icon")}if(A.down(".button_icon")){A=A.down(".button_icon")}A.removeClassName("icon_loading");if(loading=A.down("div.loading")){loading.hide()}}},submitForm:function(A){var A=$(A);var C=DM_Ajax.getElementUniqueId(A);A.submited=true;Ajax.clicked_obj[C]=A;var B=A.down(".loading");if(B){B.show()}A.request({onComplete:this.ajaxCallback.bind(this,C),onException:function(E,D){}})},checkFormSubmit:function(B,A){Event.stop(B);A=$(A);if((!B.keyCode||B.keyCode==Event.KEY_RETURN)&&!A.submited){this.submitForm(A)}},replaceParentWidgetByReponse:function(){DM_Ajax.replaceWidgetByReponse("parent")},replacePageItemByReponse:function(){DM_Ajax.replaceWidgetByReponse("pageitem")},replaceComponentByReponse:function(){DM_Ajax.replaceWidgetByReponse("component")},replaceWidgetByReponse:function(A){var C=Ajax.clicked_obj[[DM_Ajax.tmpUniqueID]];if(A=="pageitem"){var E=/(dmpi)_(.*)/}else{if(A=="component"){var E=/(dmco)_(.*)/}else{var E=/(dmco|dmpi)_(.*)/}}if(A!="parent"){var D=E.exec(C.className)}if(D&&A!="parent"){var B=C}else{var F=C;while(F.parentNode){var D=E.exec(F.parentNode.className);if(D){var B=F.parentNode;break}var F=F.parentNode}}if(typeof (B)!="undefined"){DM_Ajax.replaceElementByReponse(B)}},link:function(B){DM_Ajax.initLoading();var A=DM_Ajax.parseAction(B);var C=(B.href.indexOf("?")===-1)?"?":"&";B.ajaxlink=B.href+C+"ajax_rnd="+new Date().getTime();if(!DM_Ajax.enableEventListener){DM_Ajax.clickWithOnClick(B,A)}}};Event.onDOMReady(function(){DM_Ajax.init()});var su_mode=false;var headerLoginDebug=false;var headerLoginDebugMsg=[];var facebook_infos_cookie=decodeURIComponent(getCookie("facebook_infos"));function HLDebug(A){if(headerLoginDebug){if(typeof A=="string"){A="HL DEBUG : "+A}else{dbg("HL DEBUG : <object_debug>")}dbg(A)}else{headerLoginDebugMsg.push(A)}}function showFBButtonIfNeeded(){if($("login_infos")&&$("login_infos").hasClassName("fb_no_infos")){HLDebug("Show FB login button");$("login_infos").setStyle({visibility:"visible"})}}function updateHeaderDMWay(){HLDebug('Call "updateHeaderDMWay"');try{var C=decodeURIComponent(getCookie(DM_LoginCookie)).evalJSON().login;var B="";if(typeof HitMapEnabled!="undefined"&&HitMapEnabled){B=HitMapLoginAnchor}$("login_infos").replace('<a class="dmco_simplelink dm_login_info dmco_simplelink dmco_link linkable" href="/'+C+B+'">'+C+"</a>");var A='<div class="dmco_html dmpi_facebook_connect dm_fb_button fb_no_infos" id="login_infos"><a onclick="DM_Widget_PageItem_Facebook_Connect.onLoginFacebook(); return false;" href="javascript:void(0);" class="fake_fb_login_button icon_facebook_short no_icon_loading"> </a></div>';$$(".header_login_info").first().insert({after:A})}catch(D){}}function updateHeaderFBWay(){HLDebug('Call "updateHeaderFBWay"');var A=decodeURIComponent(getCookie("facebook_infos"));HLDebug('Cookie "facebook_infos" value : '+A);if($("header")&&A&&A!="null"&&A!="None***None***None"){HLDebug('Cookie "facebook_infos" has VALID infos, INSERT them in header');A=A.split("***");var C=A[0],E=A[2];var D='<div class="fb_profile_pic_cont">';D+='<img src="'+A[1]+'" height="22"/>';D+='<span class="fb_very_short_icon icon_facebook_very_short"></span>';D+="</div>";D+='<a id="fb_login_id" href="'+DM_Widget_PageItem_Facebook_Connect_READER_URI+'" class="fb_id">'+C+"</a> ";$("login_infos").removeClassName("fb_no_infos").removeClassName("dm_fb_button").update(D);var B=$$(".header_login_info").shift();B.down(".dm_login_info").remove();B.insert({"top":$("login_infos").setStyle({visibility:"visible"}).remove()});HLDebug("Facebook infos inserted in header")}else{showFBButtonIfNeeded()}}function insertFBUserInfosInHeader(A){HLDebug('Call "insertFBUserInfosInHeader"');if(!su_mode){HLDebug('Not in "SU mode"');if(A){HLDebug("Check FB user login satus");FB.getLoginStatus(function(B){if(!B.session){HLDebug('User NOT logged on FB or NOT linked with "Daily FB Connect App"');showFBButtonIfNeeded();return }else{HLDebug('User logged on FB and linked with "Daily FB Connect App"');HLDebug(B.session);HLDebug("Try to UPDATE header");updateHeaderFBWay()}})}else{HLDebug("Do NOT check FB user login satus, try to UPDATE header");updateHeaderFBWay()}}else{HLDebug('Currently in "SU mode", NO header UPDATE')}}function loadLogin(){function A(G){HLDebug('Call "updateLoginInfo"');var F="";if(typeof HitMapEnabled!="undefined"&&HitMapEnabled){F=HitMapLoginAnchor}G=decodeURIComponent(G).evalJSON();G["url"]=encodeURIComponent(document.location.pathname+F);if(facebook_enabled){var H='<div id="login_infos" class="dmco_html dmpi_facebook_connect dm_fb_button fb_no_infos" style="visibility:hidden;"><a class="fake_fb_login_button icon_facebook_short no_icon_loading" href="javascript:void(0);" onclick="DM_Widget_PageItem_Facebook_Connect.onLoginFacebook(); return false;"></a></div>'}else{var H=""}var E="";if(typeof G["stats"]!="undefined"&&G["stats"]!=""){E='<li><a href="/stats/account'+F+'" name="dmpi_menu_user_account">#{stats}</a></li>'}var D=new Template('<span class="header_login_info"><a class="dmco_simplelink dm_login_info dmco_simplelink dmco_link linkable" href="/#{login}'+F+'">#{login}</a><span class="arrow">▾</span><ul class="dmco_menu dmpi_menu_user headerbox_nav" id="header_login_menu" style="display: none;"><li><a href="/#{login}/1'+F+'" name="dmpi_menu_user_videos">#{videos}</a></li><li><a href="/mychannel/#{login}/1'+F+'" name="dmpi_menu_user_subscriptions">#{subscriptions}</a></li><li><a href="/bookmarks/#{login}'+F+'" name="dmpi_menu_user_bookmarks">#{bookmarks}</a></li><li><a href="/playlists/#{login}'+F+'" name="dmpi_menu_user_playlists">#{playlists}</a></li><li><a href="/inbox'+F+'" name="dmpi_menu_user_inbox">#{inbox}</a></li><li><a href="/groups/#{login}'+F+'" name="dmpi_menu_user_groups">#{groups}</a></li><li><a href="/contests/#{login}'+F+'" name="dmpi_menu_user_contests">#{contests}</a></li><li><a href="/contacts/#{login}'+F+'" name="dmpi_menu_user_contacts">#{contacts}</a></li><li><a href="/users/subscribedto/#{login}'+F+'" name="dmpi_menu_user_fans">#{fans}</a></li><li><a href="/comments/#{login}'+F+'" name="dmpi_menu_user_comments">#{comments}</a></li>'+E+'<li><a href="/profile'+F+'" name="dmpi_menu_user_settings">#{settings}</a></li><li class=" last"><a href="/logout?urlback=#{url}">#{logout}</a></li></ul></span>'+H);$("login_info").update(D.evaluate(G));$$("#header_full .header_login_info .arrow").shift().observe("click",function(){DM_Widget_PageItem_Header.toggleLoginDropdown()});HLDebug("Header filled with DM user infos");if(facebook_enabled){HLDebug("DM FB Connect is enabled");DM_Widget_PageItem_Facebook_Connect_READER_URI="/"+G.login;DM_Widget_PageItem_Facebook_Connect_DM_USER_FUID=G.fbuid;if(!facebook_infos_cookie||facebook_infos_cookie=="null"){HLDebug("No cookie facebook_infos, SET DM_Widget_PageItem_Facebook_Connect_REQUIRE_UPDATE to true");DM_Widget_PageItem_Facebook_Connect_REQUIRE_UPDATE=true}else{HLDebug('cookie "facebook_infos" is filled');if(!G.su_mode){HLDebug('Not in "SU mode"');if(getCookie("fb_login_status_checked")){insertFBUserInfosInHeader()}}else{HLDebug('Currently in "SU mode"');su_mode=true}}}}var B=null;if(B=getCookie(DM_LoginCookie)){HLDebug("Has cookie "+DM_LoginCookie+' : call "updateLoginInfo"');A(B)}else{if(getCookie("sid")){HLDebug("No cookie "+DM_LoginCookie+" : do ajax call to /pageitem/user/login_info");var C="/pageitem/user/login_info?"+Math.floor(1000000*Math.random());new Ajax.Request(C,{method:"get",onSuccess:function(D){HLDebug("Ajax /pageitem/user/login_info SUCCEED");if(D.responseText!=""){HLDebug("Set cookie "+DM_LoginCookie+" with response Ajax : ");HLDebug(D.responseText);setCookie(DM_LoginCookie,D.responseText);HLDebug('Ajax response not empty, call "updateLoginInfo"');A(D.responseText)}}});delete (C)}}}DM_Widget_PageItem_Adsense={titleTemplate:new Template('<span class="title foreground2 background">#{title}</span>'),itemTemplate:new Template('<div class="item">  <a class="video_title" href="#{google_ads_url}">#{google_ads_line1}</a> <br />  <span class="foreground2">#{google_ads_line2} #{google_ads_line3}</span> <br />  <a class="name" href="#{google_ads_url}">#{google_ads_visible_url}</a></div>')};function google_ad_request_done(B){if(B.length==0){return }var H="";var J="";var G="";var E=$("adsense_300x250");var A=$("adsense_intercalated");var K=$("adsense_bottom");var I=DM_Widget_PageItem_Adsense.titleTemplate.evaluate(DM_Widget_PageItem_Adsense);var F=false;var C=window.location.search.toQueryParams();var F=(typeof C.mode!="undefined"&&C.mode=="playlist");F=F||$("bodyall").hasClassName("with_playlist");for(var D=0;D<B.length;D++){DM_Widget_PageItem_Adsense.google_ads_url=B[D].url;DM_Widget_PageItem_Adsense.google_ads_visible_url=B[D].visible_url;DM_Widget_PageItem_Adsense.google_ads_line1=B[D].line1;DM_Widget_PageItem_Adsense.google_ads_line2=B[D].line2;DM_Widget_PageItem_Adsense.google_ads_line3=B[D].line3;if(A&&K&&!E){if(D<2||F){J+=DM_Widget_PageItem_Adsense.itemTemplate.evaluate(DM_Widget_PageItem_Adsense)}else{G+=DM_Widget_PageItem_Adsense.itemTemplate.evaluate(DM_Widget_PageItem_Adsense)}}else{if(E&&!K&&!A){H+=DM_Widget_PageItem_Adsense.itemTemplate.evaluate(DM_Widget_PageItem_Adsense)}}}if(E&&H.length>0){E.innerHTML=I+H;E.show()}if(A&&J.length>0){A.innerHTML=I+J+'<div class="dmco_clear"></div>';if(F){$("dual_list").insert({after:A.remove()})}A.insert({before:'<div class="dmco_clear"></div>'});A.show()}if(K&&G.length>0){K.innerHTML=I+G+'<div class="dmco_clear"></div>';$$("#dual_list .dmpi_pagination").first().insert({before:K.remove()});K.insert({before:'<div class="dmco_clear"></div>'});K.show()}return }function google_afs_request_done(A){google_ad_request_done(A)}function render_skin(A){ajax_call("masscast","get_skin",A,this.callbackSelectSkin)}function callbackSelectSkin(D){var A=new Date();if(D.blank()){return }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=null;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);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;options.target="_blank"}$("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;options.target="_blank"}$$("div.dmpi_subheader")[0].insert({top:new Element("a",options)});$("wrapper").setStyle({padding:"0px"});if(D.topBannerImage.match(/\.swf(\.v[a-f0-9]+)?$/)){$("top_banner").setStyle({display:"inline"});$$("div.dmpi_subheader")[0].innerHTML='<object width="100%" height="'+D.topBannerHeight+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="always" name="allowScriptAccess"/><param value="'+D.topBannerImage+"?"+Math.round((A.getTime()/1000))+'" name="movie"/><param value="high" name="quality"/><param value="Transparent" name="wmode"/><embed width="100%" height="'+D.topBannerHeight+'" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="Transparent" quality="high" swliveconnect="true" src="'+D.topBannerImage+"?"+Math.round((A.getTime()/1000))+'" id="pub_Flash2372720" name="pub_Flash2372720"/></object>'}}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){if($$("div.dmpi_bottombanner").length===0){if(D.bottomBannerImage.match(/\.swf(\.v[a-f0-9]+)?$/)){$("content").insert({after:'<div class="dmco_box">  <div class="dmco_html dmpi_bottombanner" style="height: '+D.bottomBannerHeight+'px"><object width="100%" height="'+D.bottomBannerHeight+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="always" name="allowScriptAccess"/><param value="'+D.bottomBannerImage+"?"+Math.round((A.getTime()/1000))+'" name="movie"/><param value="high" name="quality"/><param value="Transparent" name="wmode"/><embed width="100%" height="'+D.bottomBannerHeight+'" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="Transparent" quality="high" swliveconnect="true" src="'+D.bottomBannerImage+"?"+Math.round((A.getTime()/1000))+'" id="pub_Flash2372720" name="pub_Flash2372720"/></object>  </div></div>'})}else{$("content").insert({after:'<div class="dmco_box">  <div class="dmco_html dmpi_bottombanner" style="height: '+D.bottomBannerHeight+'px">    <a target="_blank">      <img src="'+D.bottomBannerImage+'">    </a>  </div></div>'})}}}if(D.bodyLinkBlank){DM_Widget_PageItem_Masscast.bodyLinkBlank=D.bodyLinkBlank}if(D.bodyLink){DM_Widget_PageItem_Masscast.bodyLink=D.bodyLink}if(D.topBannerLink){DM_Widget_PageItem_Masscast.topBannerLink=D.topBannerLink}}
