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 B;for(var C=0,A=arguments.length;C<A;C++){var D=arguments[C];try{B=D();break}catch(E){}}return B}};var Class=(function(){function C(){}function B(){var E=null,F=$A(arguments);if(Object.isFunction(F[0])){E=F.shift()}function D(){this.initialize.apply(this,arguments)}Object.extend(D,Class.Methods);D.superclass=E;D.subclasses=[];if(E){C.prototype=E.prototype;D.prototype=new C;E.subclasses.push(D)}for(var G=0;G<F.length;G++){D.addMethods(F[G])}if(!D.prototype.initialize){D.prototype.initialize=Prototype.emptyFunction}D.prototype.constructor=D;return D}function A(E){var H=this.superclass&&this.superclass.prototype;var G=Object.keys(E);if(!Object.keys({toString:true}).length){if(E.toString!=Object.prototype.toString){G.push("toString")}if(E.valueOf!=Object.prototype.valueOf){G.push("valueOf")}}for(var I=0,F=G.length;I<F;I++){var D=G[I],J=E[D];if(H&&Object.isFunction(J)&&J.argumentNames().first()=="$super"){var K=J;J=(function(L){return function(){return H[L].apply(this,arguments)}})(D).wrap(K);J.valueOf=K.valueOf.bind(K);J.toString=K.toString.bind(K)}this.prototype[D]=J}return this}return{create:B,Methods:{addMethods:A}}})();(function(){var E=Object.prototype.toString;function A(S,R){for(var Q in R){S[Q]=R[Q]}return S}function N(Q){try{if(C(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 P(S){var T=typeof S;switch(T){case"undefined":case"function":case"unknown":return ;case"boolean":return S.toString()}if(S===null){return"null"}if(S.toJSON){return S.toJSON()}if(I(S)){return }var R=[];for(var Q in S){var U=P(S[Q]);if(!C(U)){R.push(Q.toJSON()+": "+U)}}return"{"+R.join(", ")+"}"}function G(Q){return $H(Q).toQueryString()}function D(Q){return Q&&Q.toHTML?Q.toHTML():String.interpret(Q)}function O(S){var R=[];for(var Q in S){R.push(Q)}return R}function M(S){var R=[];for(var Q in S){R.push(S[Q])}return R}function J(Q){return A({},Q)}function I(Q){return !!(Q&&Q.nodeType==1)}function F(Q){return E.call(Q)=="[object Array]"}function K(Q){return Q instanceof Hash}function B(Q){return typeof Q==="function"}function H(Q){return E.call(Q)=="[object String]"}function L(Q){return E.call(Q)=="[object Number]"}function C(Q){return typeof Q==="undefined"}A(Object,{extend:A,inspect:N,toJSON:P,toQueryString:G,toHTML:D,keys:O,values:M,clone:J,isElement:I,isArray:F,isHash:K,isFunction:B,isString:H,isNumber:L,isUndefined:C})})();Object.extend(Function.prototype,(function(){var K=Array.prototype.slice;function D(O,M){var N=O.length,L=M.length;while(L--){O[N+L]=M[L]}return O}function J(M,L){M=K.call(M,0);return D(M,L)}function C(){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(M){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var N=this,L=K.call(arguments,1);return function(){var O=J(L,arguments);return N.apply(M,O)}}function F(M){var N=this,L=K.call(arguments,1);return function(P){var O=D([P||window.event],L);return N.apply(M,O)}}function I(){if(!arguments.length){return this}var M=this,L=K.call(arguments,0);return function(){var N=J(L,arguments);return M.apply(this,N)}}function E(L){var N=this,M=K.call(arguments,1);L=L*1000;return window.setTimeout(function(){return N.apply(N,M)},L)}function A(){var L=D([0.01],arguments);return this.delay.apply(this,L)}function B(M){var L=this;return function(){var N=D([L.bind(this)],arguments);return M.apply(this,N)}}function G(){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:C,bind:H,bindAsEventListener:F,curry:I,delay:E,defer:A,wrap:B,methodize:G}})());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(A,B){this.callback=A;this.frequency=B;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(B,A){this.template=B.toString();this.pattern=A||Template.Pattern},evaluate:function(A){if(A&&Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(F){if(A==null){return(F[1]+"")}var C=F[1]||"";if(C=="\\"){return F[2]}var D=A,G=F[3];var B=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;F=B.exec(G);if(F==null){return C}while(F!=null){var E=F[1].startsWith("[")?F[2].replace(/\\\\]/g,"]"):F[1];D=D[E];if(null==D||""==F[3]){break}G=G.substring("["==F[3]?F[1].length:F[0].length);F=B.exec(G)}return C+String.interpret(D)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function D(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 O(W,Z,Y){var X=-W,a=[],b=this.toArray();if(W<1){return b}while((X+=W)<b.length){a.push(b.slice(X,X+W))}return a.collect(Z,Y)}function C(X,W){X=X||Prototype.K;var Y=true;this.each(function(a,Z){Y=Y&&!!X.call(W,a,Z);if(!Y){throw $break}});return Y}function I(X,W){X=X||Prototype.K;var Y=false;this.each(function(a,Z){if(Y=!!X.call(W,a,Z)){throw $break}});return Y}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 M(X,W){var Y;this.each(function(a,Z){if(X.call(W,a,Z)){Y=a;throw $break}});return Y}function B(Y,X){var W=[];this.each(function(a,Z){if(Y.call(X,a,Z)){W.push(a)}});return W}function H(W,Z,Y){Z=Z||Prototype.K;var X=[];if(Object.isString(W)){W=new RegExp(RegExp.escape(W))}this.each(function(b,a){if(W.match(b)){X.push(Z.call(Y,b,a))}});return X}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 P(W,X){X=Object.isUndefined(X)?null:X;return this.eachSlice(W,function(Y){while(Y.length<W){Y.push(X)}return Y})}function U(W,Y,X){this.each(function(a,Z){W=Y.call(X,W,a,Z)});return W}function K(X){var W=$A(arguments).slice(1);return this.map(function(Y){return Y[X].apply(Y,W)})}function Q(X,W){X=X||Prototype.K;var Y;this.each(function(a,Z){a=X.call(W,a,Z);if(Y==null||a>=Y){Y=a}});return Y}function N(X,W){X=X||Prototype.K;var Y;this.each(function(a,Z){a=X.call(W,a,Z);if(Y==null||a<Y){Y=a}});return Y}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(W){var X=[];this.each(function(Y){X.push(Y[W])});return X}function G(Y,X){var W=[];this.each(function(a,Z){if(!Y.call(X,a,Z)){W.push(a)}});return W}function T(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 R(){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 L(){return this.toArray().length}function V(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:D,eachSlice:O,all:C,every:C,any:I,some:I,collect:J,map:J,detect:M,findAll:B,select:B,filter:B,grep:H,include:A,member:A,inGroupsOf:P,inject:U,invoke:K,max:Q,min:N,partition:E,pluck:F,reject:G,sortBy:T,toArray:R,entries:R,zip:S,size:L,inspect:V,find:M}})();function $A(C){if(!C){return[]}if("toArray" in Object(C)){return C.toArray()}var A=C.length||0,B=new Array(A);while(A--){B[A]=C[A]}return B}function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}Array.from=$A;(function(){var M=Array.prototype,P=M.slice,R=M.forEach;function B(X){for(var W=0,V=this.length;W<V;W++){X(this[W])}}if(!R){R=B}function N(){this.length=0;return this}function D(){return this[0]}function G(){return this[this.length-1]}function J(){return this.select(function(V){return V!=null})}function I(){return this.inject([],function(W,V){if(Object.isArray(V)){return W.concat(V.flatten())}W.push(V);return W})}function H(){var V=P.call(arguments,0);return this.select(function(W){return !V.include(W)})}function F(V){return(V!==false?this:this.toArray())._reverse()}function L(V){return this.inject([],function(Y,X,W){if(0==W||(V?Y.last()!=X:!Y.include(X))){Y.push(X)}return Y})}function S(V){return this.uniq().findAll(function(W){return V.detect(function(X){return W===X})})}function T(){return P.call(this,0)}function K(){return this.length}function U(){return"["+this.map(Object.inspect).join(", ")+"]"}function O(){var V=[];this.each(function(W){var X=Object.toJSON(W);if(!Object.isUndefined(X)){V.push(X)}});return"["+V.join(", ")+"]"}function A(X,W){W||(W=0);var V=this.length;if(W<0){W=V+W}for(;W<V;W++){if(this[W]===X){return W}}return -1}function Q(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=P.call(this,0),Y;for(var X=0,V=arguments.length;X<V;X++){Y=arguments[X];if(Object.isArray(Y)&&!("callee" in Y)){for(var W=0,Z=Y.length;W<Z;W++){a.push(Y[W])}}else{a.push(Y)}}return a}Object.extend(M,Enumerable);if(!M._reverse){M._reverse=M.reverse}Object.extend(M,{_each:R,clear:N,first:D,last:G,compact:J,flatten:I,without:H,reverse:F,uniq:L,intersect:S,clone:T,toArray:T,size:K,inspect:U,toJSON:O});var E=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(E){M.concat=C}if(!M.indexOf){M.indexOf=A}if(!M.lastIndexOf){M.lastIndexOf=Q}})();function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function D(Q){this._object=Object.isHash(Q)?Q.toObject():Object.clone(Q)}function E(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 B(Q){if(this._object[Q]!==Object.prototype[Q]){return this._object[Q]}}function P(Q){var R=this._object[Q];delete this._object[Q];return R}function J(){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 C(Q){return new Hash(Q).inject(this,function(R,S){R.set(S.key,S.value);return R})}function A(Q,R){if(Object.isUndefined(R)){return Q}return Q+"="+encodeURIComponent(String.interpret(R))}function F(){return this.inject([],function(R,T){var Q=encodeURIComponent(T.key),S=T.value;if(S&&typeof S=="object"){if(Object.isArray(S)){return R.concat(S.map(A.curry(Q)))}}else{R.push(A(Q,S))}return R}).join("&")}function L(){return"#<Hash:{"+this.map(function(Q){return Q.map(Object.inspect).join(": ")}).join(", ")+"}>"}function N(){return Object.toJSON(this.toObject())}function H(){return new Hash(this)}return{initialize:D,_each:E,set:K,get:B,unset:P,toObject:J,toTemplateReplacements:J,keys:O,values:M,index:G,merge:I,update:C,toQueryString:F,inspect:L,toJSON:N,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(J,L){var K=this.toString(L||10);return"0".times(J-K.length)+K}function H(){return isFinite(this)?this.toString():"null"}function I(){return Math.abs(this)}function G(){return Math.round(this)}function F(){return Math.ceil(this)}function C(){return Math.floor(this)}return{toColorPart:D,succ:E,times:A,toPaddedString:B,toJSON:H,abs:I,round:G,ceil:F,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(C,B,D,A){this.each(function(E){if(Object.isFunction(E[C])){try{E[C].apply(E,[B,D,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,A,B){$super(B);this.transport=Ajax.getTransport();this.request(A)},request:function(A){this.url=A;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 B=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(B)}Ajax.Responders.dispatch("onCreate",this,B);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 B=this.options.requestHeaders;if(Object.isFunction(B.push)){for(var D=0,A=B.length;D<A;D+=2){E[B[D]]=B[D+1]}}else{$H(B).each(function(F){E[F.key]=F.value})}}for(var C in E){this.transport.setRequestHeader(C,E[C])}},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(E){this.dispatchException(E)}var D=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&D&&D.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(E){this.dispatchException(E)}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,C,A,B){this.container={success:(C.success||C),failure:(C.failure||(C.success?null:C))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(F,E){this.updateContent(F.responseText);if(Object.isFunction(D)){D(F,E)}}).bind(this);$super(A,B)},updateContent:function(D){var B=this.container[this.success()?"success":"failure"],C=this.options;if(!C.evalScripts){D=D.stripScripts()}if(B=$(B)){if(C.insertion){if(Object.isString(C.insertion)){var A={};A[C.insertion]=D;B.insert(A)}else{C.insertion(B,D)}}else{B.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,C,A,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=C;this.url=A;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 $(C){if(arguments.length>1){for(var D=0,A=[],B=arguments.length;D<B;D++){A.push($(arguments[D]))}return A}if(Object.isString(C)){C=document.getElementById(C)}return Element.extend(C)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,D){var C=[];var E=document.evaluate(F,$(D)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,A=E.snapshotLength;B<A;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(A){var B=(function(){var E=document.createElement("form");var F=document.createElement("input");var D=document.documentElement;F.setAttribute("name","test");E.appendChild(F);D.appendChild(E);var G=E.elements?(typeof E.elements.test=="undefined"):null;D.removeChild(E);E=F=null;return G})();var C=A.Element;A.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(A.Element,C||{});if(C){A.Element.prototype=C.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(D,F){D=$(D);if(Object.isString(F)||Object.isNumber(F)||Object.isElement(F)||(F&&(F.toElement||F.toHTML))){F={bottom:F}}var E,B,C,G;for(var A in F){E=F[A];A=A.toLowerCase();B=Element._insertionTranslations[A];if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){B(D,E);continue}E=Object.toHTML(E);C=((A=="before"||A=="after")?D.parentNode:D).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(C,E.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(B.curry(D));E.evalScripts.bind(E).defer()}return D},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(A){A=$(A);var B="<"+A.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(F){var C=F.first(),D=F.last();var E=(A[C]||"").toString();if(E){B+=" "+D+"="+E.inspect(true)}});return B+">"},recursivelyCollect:function(C,B){C=$(C);var A=[];while(C=C[B]){if(C.nodeType==1){A.push(Element.extend(C))}}return A},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(C,D,B){C=$(C);if(arguments.length==1){return $(C.parentNode)}var A=Element.ancestors(C);return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},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(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(B))}var C=Element.nextSiblings(B);return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},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(B,A){B=$(B);if(Prototype.Browser.IE){var C=Element._attributeTranslations.read;if(C.values[A]){return C.values[A](B,A)}if(C.names[A]){A=C.names[A]}if(A.include(":")){return(!B.attributes||!B.attributes[A])?null:B.attributes[A].value}}return B.getAttribute(A)},writeAttribute:function(D,C,F){D=$(D);var B={},E=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=E.names[A]||A;F=B[A];if(E.values[A]){C=E.values[A](D,F)}if(F===false||F===null){D.removeAttribute(C)}else{if(F===true){D.setAttribute(C,C)}else{D.setAttribute(C,F)}}}return D},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(B,A){if(!(B=$(B))){return }var C=B.className;return(C.length>0&&(C==A||new RegExp("(^|\\s)"+A+"(\\s|$)").test(C)))},addClassName:function(B,A){if(!(B=$(B))){return }if(!Element.hasClassName(B,A)){B.className+=(B.className?" ":"")+A}return B},removeClassName:function(B,A){if(!(B=$(B))){return }B.className=B.className.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ").strip();return B},toggleClassName:function(B,A){if(!(B=$(B))){return }return Element[Element.hasClassName(B,A)?"removeClassName":"addClassName"](B,A)},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(A,C){A=$(A);C=C=="float"?"cssFloat":C.camelize();var D=A.style[C];if(!D||D=="auto"){var B=document.defaultView.getComputedStyle(A,null);D=B?B[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(E,C){E=$(E);var B=E.style,D;if(Object.isString(C)){E.style.cssText+=";"+C;return C.include("opacity")?E.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):E}for(var A in C){if(A=="opacity"){E.setOpacity(C[A])}else{B[(A=="float"||A=="cssFloat")?(Object.isUndefined(B.styleFloat)?"cssFloat":"styleFloat"):A]=C[A]}}return E},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 E=C.style;var A=E.visibility;var B=E.position;var D=E.display;E.visibility="hidden";if(B!="fixed"){E.position="absolute"}E.display="block";var H=C.clientWidth;var F=C.clientHeight;E.display=D;E.position=B;E.visibility=A;return{width:H,height:F}},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(A){var B=0,C=0;do{B+=A.offsetTop||0;C+=A.offsetLeft||0;A=A.offsetParent}while(A);return Element._returnOffset(C,B)},positionedOffset:function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;A=A.offsetParent;if(A){if(A.tagName.toUpperCase()=="BODY"){break}var C=Element.getStyle(A,"position");if(C!=="static"){break}}}while(A);return Element._returnOffset(D,B)},absolutize:function(B){B=$(B);if(Element.getStyle(B,"position")=="absolute"){return B}var A=Element.positionedOffset(B);var F=A[1];var E=A[0];var C=B.clientWidth;var D=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=D+"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(A){var B=0,C=0;do{B+=A.scrollTop||0;C+=A.scrollLeft||0;A=A.parentNode}while(A);return Element._returnOffset(C,B)},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(C){var B=0,D=0;var A=C;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;if(A.offsetParent==document.body&&Element.getStyle(A,"position")=="absolute"){break}}while(A=A.offsetParent);A=C;do{if(!Prototype.Browser.Opera||(A.tagName&&(A.tagName.toUpperCase()=="BODY"))){B-=A.scrollTop||0;D-=A.scrollLeft||0}}while(A=A.parentNode);return Element._returnOffset(D,B)},clonePosition:function(C,A){var D=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var E=Element.viewportOffset(A);C=$(C);var F=[0,0];var B=null;if(Element.getStyle(C,"position")=="absolute"){B=Element.getOffsetParent(C);F=Element.viewportOffset(B)}if(B==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(D.setLeft){C.style.left=(E[0]-F[0]+D.offsetLeft)+"px"}if(D.setTop){C.style.top=(E[1]-F[1]+D.offsetTop)+"px"}if(D.setWidth){C.style.width=A.offsetWidth+"px"}if(D.setHeight){C.style.height=A.offsetHeight+"px"}return C}};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(A,C,D){switch(D){case"left":case"top":case"right":case"bottom":if(A(C,"position")==="static"){return null}case"height":case"width":if(!Element.visible(C)){return null}var E=parseInt(A(C,D),10);if(E!==C["offset"+D.capitalize()]){return E+"px"}var B;if(D==="height"){B=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{B=["border-left-width","padding-left","padding-right","border-right-width"]}return B.inject(E,function(G,F){var H=A(C,F);return H===null?G:G-parseInt(H,10)})+"px";default:return A(C,D)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(A,B,C){if(C==="title"){return B.title}return A(B,C)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(B,C){C=$(C);try{C.offsetParent}catch(E){return $(document.body)}var A=C.getStyle("position");if(A!=="static"){return B(C)}C.setStyle({position:"relative"});var D=B(C);C.setStyle({position:A});return D});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(C,D){D=$(D);try{D.offsetParent}catch(G){return Element._returnOffset(0,0)}var B=D.getStyle("position");if(B!=="static"){return C(D)}var E=D.getOffsetParent();if(E&&E.getStyle("position")==="fixed"){E.setStyle({zoom:1})}D.setStyle({position:"relative"});var F=C(D);D.setStyle({position:B});return F})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(A,B){try{B.offsetParent}catch(C){return Element._returnOffset(0,0)}return A(B)});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(C,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}C=$(C);var B=C.currentStyle;if((B&&!B.hasLayout)||(!B&&C.style.zoom=="normal")){C.style.zoom=1}var A=C.getStyle("filter"),D=C.style;if(E==1||E===""){(A=F(A))?D.filter=A:D.removeAttribute("filter");return C}else{if(E<0.00001){E=0}}D.filter=F(A)+"alpha(opacity="+(E*100)+")";return C};Element._attributeTranslations=(function(){var C="className";var B="for";var A=document.createElement("div");A.setAttribute(C,"x");if(A.className!=="x"){A.setAttribute("class","x");if(A.className==="x"){C="class"}}A=null;A=document.createElement("label");A.setAttribute(B,"x");if(A.htmlFor!=="x"){A.setAttribute("htmlFor","x");if(A.htmlFor==="x"){B="htmlFor"}}A=null;return{read:{names:{"class":C,"className":C,"for":B,"htmlFor":B},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(C){var B=C.getElementsByTagName("*"),E=[];for(var D=0,F;F=B[D];D++){if(F.tagName!=="!"){E.push(F)}}return E}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(A){var B=0,C=0;do{B+=A.offsetTop||0;C+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break}}A=A.offsetParent}while(A);return Element._returnOffset(C,B)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(E,F){E=$(E);if(F&&F.toElement){F=F.toElement()}if(Object.isElement(F)){E.parentNode.replaceChild(F,E);return E}F=Object.toHTML(F);var C=E.parentNode,D=C.tagName.toUpperCase();if(Element._insertionTranslations.tags[D]){var B=E.next();var A=Element._getContentFromAnonymousElement(D,F.stripScripts());C.removeChild(E);if(B){A.each(function(G){C.insertBefore(G,B)})}else{A.each(function(G){C.appendChild(G)})}}else{E.outerHTML=F.stripScripts()}F.evalScripts.bind(F).defer();return E}}Element._returnOffset=function(A,B){var C=[A,B];C.left=A;C.top=B;return C};Element._getContentFromAnonymousElement=function(A,C){var D=new Element("div"),B=Element._insertionTranslations.tags[A];if(B){D.innerHTML=B[0]+C+B[1];B[2].times(function(){D=D.firstChild})}else{D.innerHTML=C}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(I,H){for(var G in H){var J=H[G];if(Object.isFunction(J)&&!(G in I)){I[G]=J.methodize()}}}var A=C("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(A){return function(G){if(G&&typeof G._extendedByPrototype=="undefined"){var H=G.tagName;if(H&&(/^(?:object|applet|embed)$/i.test(H))){B(G,Element.Methods);B(G,Element.Methods.Simulated);B(G,Element.Methods.ByTag[H.toUpperCase()])}}return G}}return Prototype.K}var E={},D=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(E),H=I.tagName.toUpperCase();if(D[H]){Object.extend(G,D[H])}B(I,G);I._extendedByPrototype=Prototype.emptyFunction;return I},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(E,Element.Methods);Object.extend(E,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 G=C;C=arguments[1]}if(!G){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(G)){G.each(A)}else{A(G)}}function A(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function B(L,O,N){N=N||false;for(var F in L){var M=L[F];if(!Object.isFunction(M)){continue}if(!N||!(F in O)){O[F]=M.methodize()}}}function E(M){var F;var N={"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(N[M]){F="HTML"+N[M]+"Element"}if(window[F]){return window[F]}F="HTML"+M+"Element";if(window[F]){return window[F]}F="HTML"+M.capitalize()+"Element";if(window[F]){return window[F]}var L=document.createElement(M);var O=L["__proto__"]||L.constructor.prototype;L=null;return O}var I=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(J.ElementExtensions){B(Element.Methods,I);B(Element.Methods.Simulated,I,true)}if(J.SpecificElementExtensions){for(var K in Element.Methods.ByTag){var H=E(K);if(Object.isUndefined(H)){continue}B(D[K],H.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(D){var H=Prototype.Browser,G=document,E,C={};function A(){if(H.WebKit&&!G.evaluate){return document}if(H.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function F(B){if(!E){E=A()}C[B]="client"+B;D["get"+B]=function(){return E[C[B]]};return D["get"+B]()}D.getWidth=F.curry("Width");D.getHeight=F.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(A){if(!(A=$(A))){return }var B;if(A===window){B=0}else{if(typeof A._prototypeUID==="undefined"){A._prototypeUID=[Element.Storage.UID++]}B=A._prototypeUID[0]}if(!Element.Storage[B]){Element.Storage[B]=$H()}return Element.Storage[B]},store:function(A,B,C){if(!(A=$(A))){return }if(arguments.length===2){Element.getStorage(A).update(B)}else{Element.getStorage(A).set(B,C)}return A},retrieve:function(A,B,C){if(!(A=$(A))){return }var E=Element.getStorage(A),D=E.get(B);if(Object.isUndefined(D)){E.set(B,C);D=C}return D},clone:function(B,A){if(!(B=$(B))){return }var E=B.cloneNode(A);E._prototypeUID=void 0;if(A){var D=Element.select(E,"*"),C=D.length;while(C--){D[C]._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 C=document.createElement("div");C.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var B=".//*[local-name()='ul' or local-name()='UL']"+"//*[local-name()='li' or local-name()='LI']";var D=document.evaluate(B,C,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);E=(D.snapshotLength!==2);C=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(H){this.tokens=[];var M=this.expression,B=Selector.patterns,F=Selector.assertions;var A,D,E,L=B.length,C;while(M&&A!==M&&(/\S/).test(M)){A=M;for(var I=0;I<L;I++){D=B[I].re;C=B[I].name;if(E=M.match(D)){if(F[C]){this.tokens.push([C,Object.clone(E)]);M=M.replace(E[0],"")}else{return this.findElements(document).include(H)}}}}var K=true,C,J;for(var I=0,G;G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});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(D,B){var G,F=B[6],E;if(F=="even"){F="2n+0"}if(F=="odd"){F="2n+1"}if(G=F.match(/^(\d+)$/)){return"["+D+"= "+G[1]+"]"}if(G=F.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(G[1]=="-"){G[1]=-1}var C=G[1]?Number(G[1]):1;var A=G[2]?Number(G[2]):0;E="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(E).evaluate({fragment:D,a:C,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 C=document.createElement("div"),E=false,B="_countedByPrototype",D="x";C[B]=D;E=(C.getAttribute(B)===D);C=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(F,C,G){F._countedByPrototype=Prototype.emptyFunction;if(C){for(var A=F.childNodes,D=A.length-1,B=1;D>=0;D--){var E=A[D];if(E.nodeType==1&&(!G||E._countedByPrototype)){E.nodeIndex=B++}}}else{for(var D=0,B=1,A=F.childNodes;E=A[D];D++){if(E.nodeType==1&&(!G||E._countedByPrototype)){E.nodeIndex=B++}}}},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,F,G){var I=F.toUpperCase();var D=[],E=Selector.handlers;if(A){if(G){if(G=="descendant"){for(var C=0,B;B=A[C];C++){E.concat(D,B.getElementsByTagName(F))}return D}else{A=this[G](A)}if(F=="*"){return A}}for(var C=0,B;B=A[C];C++){if(B.tagName.toUpperCase()===I){D.push(B)}}return D}else{return H.getElementsByTagName(F)}},id:function(A,I,B,G){var H=$(B),F=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 D=0,C;C=A[D];D++){if(C.id===B){return[C]}}}}if(A){if(G){if(G=="child"){for(var E=0,C;C=A[E];E++){if(H.parentNode==C){return[H]}}}else{if(G=="descendant"){for(var E=0,C;C=A[E];E++){if(Element.descendantOf(H,C)){return[H]}}}else{if(G=="adjacent"){for(var E=0,C;C=A[E];E++){if(Selector.handlers.previousElementSibling(H)==C){return[H]}}}else{A=F[G](A)}}}}for(var E=0,C;C=A[E];E++){if(C==H){return[H]}}return[]}return(H&&Element.descendantOf(H,I))?[H]:[]},className:function(D,B,C,A){if(D&&A){D=this[A](D)}return Selector.handlers.byClassName(D,B,C)},byClassName:function(C,A,B){if(!C){C=Selector.handlers.descendant([A])}var H=" "+B+" ";for(var E=0,D=[],G,F;G=C[E];E++){F=G.className;if(F.length==0){continue}if(F==B||(" "+F+" ").include(H)){D.push(G)}}return D},attrPresence:function(D,C,A,B){if(!D){D=C.getElementsByTagName("*")}if(D&&B){D=this[B](D)}var F=[];for(var E=0,G;G=D[E];E++){if(Element.hasAttribute(G,A)){F.push(G)}}return F},attr:function(A,I,H,J,G,F){if(!A){A=I.getElementsByTagName("*")}if(A&&F){A=this[F](A)}var K=Selector.operators[G],D=[];for(var C=0,B;B=A[C];C++){var E=Element.readAttribute(B,H);if(E===null){continue}if(K(E,J)){D.push(B)}}return D},pseudo:function(C,D,E,B,A){if(C&&A){C=this[A](C)}if(!C){C=B.getElementsByTagName("*")}return Selector.pseudos[D](C,E,B)}},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,B,N,L,K){if(A.length==0){return[]}if(B=="even"){B="2n+0"}if(B=="odd"){B="2n+1"}var J=Selector.handlers,I=[],C=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,L,K);C.push(D.parentNode)}}if(B.match(/^\d+$/)){B=Number(B);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==B){I.push(D)}}}else{if(E=B.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(C);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(A,G){var F=$$(G),E=Selector.handlers;E.mark(F);for(var D=0,C=[],B;B=A[D];D++){if(B._countedByPrototype){C.push(B)}}E.unmark(F);return C},findElement:function(A,C,B){if(Object.isNumber(C)){B=C;C=false}return Selector.matchElements(A,C||"*")[B||0]},findChildElements:function(C,G){G=Selector.split(G.join(","));var E=[],F=Selector.handlers;for(var D=0,B=G.length,A;D<B;D++){A=new Selector(G[D].strip());F.concat(E,A.findElements(C))}return(B>1)?F.unique(E):E}});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(C,E){if(typeof E!="object"){E={hash:!!E}}else{if(Object.isUndefined(E.hash)){E.hash=true}}var D,G,B=false,A=E.submit;var F=C.inject({},function(I,H){if(!H.disabled&&H.name){D=H.name;G=$(H).getValue();if(G!=null&&H.type!="file"&&(H.type!="submit"||(!B&&A!==false&&(!A||D==A)&&(B=true)))){if(D in I){if(!Object.isArray(I[D])){I[D]=[I[D]]}I[D].push(G)}else{I[D]=G}}}return I});return E.hash?F:Object.toQueryString(F)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(F){var B=$(F).getElementsByTagName("*"),D,A=[],C=Form.Element.Serializers;for(var E=0;D=B[E];E++){A.push(D)}return A.inject([],function(G,H){if(C[H.tagName.toLowerCase()]){G.push(Element.extend(H))}return G})},getInputs:function(G,E,C){G=$(G);var F=G.getElementsByTagName("input");if(!E&&!C){return $A(F).map(Element.extend)}for(var D=0,H=[],A=F.length;D<A;D++){var B=F[D];if((E&&B.type!=E)||(C&&B.name!=C)){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(C){var A=$(C).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var B=A.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return B?B:A.find(function(D){return/^(?:input|select|textarea)$/i.test(D.tagName)})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(C,B){C=$(C),B=Object.clone(B||{});var D=B.parameters,A=C.readAttribute("action")||"";if(A.blank()){A=window.location.href}B.parameters=C.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(B.parameters,D)}if(C.hasAttribute("method")&&!B.method){B.method=C.method}return new Ajax.Request(A,B)}};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(B,F){if(Object.isUndefined(F)){return this[B.type=="select-one"?"selectOne":"selectMany"](B)}else{var D,E,G=!Object.isArray(F);for(var C=0,A=B.length;C<A;C++){D=B.options[C];E=this.optionValue(D);if(G){if(E==F){D.selected=true;return }}else{D.selected=F.include(E)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(B){var E,A=B.length;if(!A){return null}for(var D=0,E=[];D<A;D++){var C=B.options[D];if(C.selected){E.push(this.optionValue(C))}}return E},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,C,B){$super(B,C);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 W={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 G=document.documentElement;var M="onmouseenter" in G&&"onmouseleave" in G;var R;if(Prototype.Browser.IE){var I={0:1,1:4,2:2};R=function(Y,X){return Y.button===I[X]}}else{if(Prototype.Browser.WebKit){R=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{R=function(Y,X){return Y.which?(Y.which===X+1):(Y.button===X)}}}function P(X){return R(X,0)}function Q(X){return R(X,1)}function L(X){return R(X,2)}function J(Z){Z=W.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 U(Z,a){var Y=W.element(Z);if(!a){return Y}var X=[Y].concat(Y.ancestors());return Selector.findElement(X,a,0)}function S(X){return{x:D(X),y:C(X)}}function D(Z){var Y=document.documentElement,X=document.body||{scrollLeft:0};return Z.pageX||(Z.clientX+(Y.scrollLeft||X.scrollLeft)-(Y.clientLeft||0))}function C(Z){var Y=document.documentElement,X=document.body||{scrollTop:0};return Z.pageY||(Z.clientY+(Y.scrollTop||X.scrollTop)-(Y.clientTop||0))}function O(X){W.extend(X);X.preventDefault();X.stopPropagation();X.stopped=true}W.Methods={isLeftClick:P,isMiddleClick:Q,isRightClick:L,element:J,findElement:U,pointer:S,pointerX:D,pointerY:C,stop:O};var T=Object.keys(W.Methods).inject({},function(X,Y){X[Y]=W.Methods[Y].methodize();return X});if(Prototype.Browser.IE){function F(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]"}});W.extend=function(Y,X){if(!Y){return false}if(Y._extendedByPrototype){return Y}Y._extendedByPrototype=Prototype.emptyFunction;var Z=W.pointer(Y);Object.extend(Y,{target:Y.srcElement||X,relatedTarget:F(Y),pageX:Z.x,pageY:Z.y});return Object.extend(Y,T)}}else{W.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(W.prototype,T);W.extend=Prototype.K}function B(Y,X,b){var a=Element.retrieve(Y,"prototype_event_registry");if(Object.isUndefined(a)){E.push(Y);a=Element.retrieve(Y,"prototype_event_registry",$H())}var c=a.get(X);if(Object.isUndefined(c)){c=[];a.set(X,c)}if(c.pluck("handler").include(b)){return false}var Z;if(X.include(":")){Z=function(d){if(Object.isUndefined(d.eventName)){return false}if(d.eventName!==X){return false}W.extend(d,Y);b.call(Y,d)}}else{if(!M&&(X==="mouseenter"||X==="mouseleave")){if(X==="mouseenter"||X==="mouseleave"){Z=function(f){W.extend(f,Y);var d=f.relatedTarget;while(d&&d!==Y){try{d=d.parentNode}catch(g){d=Y}}if(d===Y){return }b.call(Y,f)}}}else{Z=function(d){W.extend(d,Y);b.call(Y,d)}}}Z.handler=b;c.push(Z);return Z}function H(){for(var Y=0,X=E.length;Y<X;Y++){W.stopObserving(E[Y]);E[Y]=null}}var E=[];if(Prototype.Browser.IE){window.attachEvent("onunload",H)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var A=Prototype.K;if(!M){A=function(X){var Y={mouseenter:"mouseover",mouseleave:"mouseout"};return X in Y?Y[X]:X}}function N(Y,X,b){Y=$(Y);var a=B(Y,X,b);if(!a){return Y}if(X.include(":")){if(Y.addEventListener){Y.addEventListener("dataavailable",a,false)}else{Y.attachEvent("ondataavailable",a);Y.attachEvent("onfilterchange",a)}}else{var Z=A(X);if(Y.addEventListener){Y.addEventListener(Z,a,false)}else{Y.attachEvent("on"+Z,a)}}return Y}function K(Y,X,d){Y=$(Y);var c=Element.retrieve(Y,"prototype_event_registry");if(Object.isUndefined(c)){return Y}if(X&&!d){var Z=c.get(X);if(Object.isUndefined(Z)){return Y}Z.each(function(e){Element.stopObserving(Y,X,e.handler)});return Y}else{if(!X){c.each(function(g){var e=g.key,f=g.value;f.each(function(h){Element.stopObserving(Y,e,h.handler)})});return Y}}var Z=c.get(X);if(!Z){return }var b=Z.find(function(e){return e.handler===d});if(!b){return Y}var a=A(X);if(X.include(":")){if(Y.removeEventListener){Y.removeEventListener("dataavailable",b,false)}else{Y.detachEvent("ondataavailable",b);Y.detachEvent("onfilterchange",b)}}else{if(Y.removeEventListener){Y.removeEventListener(a,b,false)}else{Y.detachEvent("on"+a,b)}}c.set(X,Z.without(b));return Y}function V(Z,Y,X,b){Z=$(Z);if(Object.isUndefined(b)){b=true}if(Z==document&&document.createEvent&&!Z.dispatchEvent){Z=document.documentElement}var a;if(document.createEvent){a=document.createEvent("HTMLEvents");a.initEvent("dataavailable",true,true)}else{a=document.createEventObject();a.eventType=b?"ondataavailable":"onfilterchange"}a.eventName=Y;a.memo=X||{};if(document.createEvent){Z.dispatchEvent(a)}else{Z.fireEvent(a.eventType,a)}return W.extend(a)}Object.extend(W,W.Methods);Object.extend(W,{fire:V,observe:N,stopObserving:K});Element.addMethods({fire:V,observe:N,stopObserving:K});Object.extend(document,{fire:V.methodize(),observe:N.methodize(),stopObserving:K.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,W)}else{window.Event=W}})();(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(A,C,B){B=B||{};return Element.clonePosition(C,A,B)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(D,C){C=C.toString().strip();var E=/\s/.test(C)?$w(C).map(A).join(""):A(C);return E?document._getElementsByXPath(".//*"+E,D):[]}:function(F,E){E=E.toString().strip();var C=[],H=(/\s/.test(E)?$w(E):null);if(!H&&!E){return C}var D=$(F).getElementsByTagName("*");E=" "+E+" ";for(var G=0,J,I;J=D[G];G++){if(J.className&&(I=" "+J.className+" ")&&(I.include(E)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){C.push(Element.extend(J))}}return C};return function(C,D){return $(D||document.body).getElementsByClassName(C)}}(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);var Jamendo=Class.create();Jamendo.prototype={Version:"0.1",initialize:function(){this.activeSerials={};this.ajaxSemaphore=0;this.nextSerial=0;this.observers=[];this.domReady=false;this.forms={};this.formElements={};this.classes={};this.onReady(Prototype.emptyFunction);this.ajaxFeedbackElements=[];this.i18n={}},getStr:function(A){return Jamendo.i18n[A]?Jamendo.i18n[A]:"??"+A+"??"},getEnv:function(A){return{"USERID":Jamendo_ENV["USERID"]||0,"AUTH":(Jamendo_ENV["USERID"]>0),"LANG":Jamendo_ENV["LANG"]||"en","GMAPS_KEY":Jamendo_ENV["GMAPS_KEY"]||"ABQIAAAACQNZjYy0Iy0nQ5vLbXfm5BQWecC8V4p8CO_SECQLRybVH7QL5xRpjsbcv3pCduXiFULF1vFo8LlFkw","USERNAME":Jamendo_ENV["USERNAME"]||"","HTTPHOST":Jamendo_ENV["HTTPHOST"]||"http://www.jamendo.com/","HTTPHOSTI18N":Jamendo_ENV["HTTPHOSTI18N"]||"http://www.jamendo.com/","IMGJAM":Jamendo_ENV["IMGJAM"]||"http://imgjam.com/","PREFS":Jamendo_ENV["PREFS"]||{"stream":"","download":""},"TZOFFSET":Jamendo_ENV["TZOFFSET"]||"","REMOTEPLAYER_URL":Jamendo_ENV["REMOTEPLAYER_URL"]||false,"INTERRUPTS":Jamendo_ENV["INTERRUPTS"]||{},"USER_AGENT":Jamendo_ENV["USER_AGENT"]||"","LISTENERIDSTR":Jamendo_ENV["LISTENERIDSTR"]||"0","NOCACHE":Jamendo_ENV["NOCACHE"]||"0","MOD":Jamendo_ENV["MOD"]||"www","CURRENCY":Jamendo_ENV["CURRENCY"]||"EUR","FACEBOOK_CONNECTED":Jamendo_ENV["FACEBOOK_CONNECTED"]||false,"LOCALE":Jamendo_ENV["LOCALE"]||"en_US"}[A]},fixObjectLeaks:function(){if(Prototype.Browser.IE){Event.observe(window,"unload",function(){var C=document.getElementsByTagName("object");if(C){var A=C.length;for(var B=0;B<A;B++){for(j in C[B]){if(Object.isFunction(C[B].j)){C[B].j=Prototype.K}}C[B].style.display="none";C[B].parentNode.innerHTML=""}}})}},log:function(D){var B=this.debug;if(Prototype.Browser.Gecko){try{B=false}catch(C){}}if(B){if(Jamendo.debug){var E=$("Jamendo_log");if(!E){var A=document.getElementsByTagName("body")[0];A.innerHTML='<div id="Jamendo_log"></div>'+A.innerHTML;var E=$("Jamendo_log");E.setStyle("position:absolute;bottom:0;right:0;background:lightyellow;border-top:4px double red;height:120px;width:100%;overflow:auto;")}E.innerHTML=D+"<br />"+E.innerHTML}}},setupAjaxFeedbackElement:function(B,A){B=$(B);var C=new Jamendo.DelayedSwitch(B.show.bind(B),B.hide.bind(B),A);this.addObserver(["ajax","semaphore"],function(E,D){if(D>0){C.on()}else{C.off()}});this.ajaxFeedbackElements.push([B,A,C])},ajaxAbortAllRequests:function(){this.activeSerials={};this.ajaxSemaphore=0;this.sendEvent(["ajax","semaphore"],0)},ajaxAbortRequest:function(A){try{if(A in this.activeSerials){delete this.activeSerials[A];this.sendEvent(["ajax","semaphore"],--this.ajaxSemaphore)}}catch(B){}},ajaxRequest:function(B){B=Object.extend({"url":"","params":{},"method":"post","callback":false,"tryback":function(){return true},"errback":false,"serial":true,"timeout":7000,"timeoutId":false,"timeouted":false,"retryDelay":3000,"retryCount":5,"showFeedback":false,"onLoading":Prototype.K,"asynchronous":true},B);if(B.serial){B.serial=(++this.nextSerial);this.activeSerials[B.serial]=true}this.sendEvent(["ajax","semaphore"],++this.ajaxSemaphore);var C={};$H(B.params).each(function(G){C[G.key]=G.value});var A=function(G){if((G.status==401)||(G.status==403)||(G.status==404)||(G.status==500)){B.retryCount=0}clearTimeout(B.timeoutId);delete this.activeSerials[B.serial];if((--B.retryCount)>=0&&B.tryback(B.retryCount)){this.ajaxSemaphore--;setTimeout(function(){this.ajaxRequest(B)}.bind(this),B.retryDelay)}else{this.sendEvent(["ajax","semaphore"],--this.ajaxSemaphore);if(B.errback){B.errback()}Jamendo.page.updateFeedbacks([{"type":"warning","text":Jamendo.getStr("FEEDBACK_NOCONNECT")}])}}.bind(this);var E=function(I){clearTimeout(B.timeoutId);if(!B.serial||(B.serial in this.activeSerials)){delete this.activeSerials[B.serial];this.sendEvent(["ajax","semaphore"],--this.ajaxSemaphore);if(B.callback){try{B.callback(I.responseText,I)}catch(H){Jamendo.log("error in callback: "+H.name+" => "+H.message);if(console&&console.trace){console.trace(H)}if(false){if(!$("errordiv")){var G=$("page");G.insert({bottom:'<div id="errordiv" style="width:1000px;height:200px;visibility:hidden;"></div>'})}$("errordiv").update(H.message.gsub(/\\n/,""));SuperBox.call("localdiv","errordiv")}}}}}.bind(this);_success=false;try{if((typeof ClickTaleIsPlayback=="function")&&ClickTaleIsPlayback()){B.url=B.url.replace(new RegExp("^(http://([^/]+))?/"),Jamendo.getEnv("HTTPHOST"))}var D=new Ajax.Request(B.url,{asynchronous:B.asynchronous,method:B.method,parameters:C,onFailure:A,onSuccess:E,onLoading:B.onLoading});_success=true}catch(F){if(!B.asynchronous){A(D.transport)}}if(!B.asynchronous){E(D.transport)}if(B.timeout&&B.asynchronous){B.timeoutId=setTimeout(function(){B.timeouted=true;if(D.transport.readyState>0&&D.transport.readyState<4){D.options["onFailure"](D.transport,D.json)}},B.timeout)}return{"options":B,"serial":B.serial,"abort":function(){this.ajaxAbortRequest(B.serial)}.bind(this)}},prependObject:function(C,D,B){var A={};A[D]=C;$H(B).each(function(E){A[E.key]=E.value});return A},jsonRequest:function(A,D,C,B){B=Object.extend(B||{},{"callback":function(F,G){var E=F.evalJSON();if(this.showFeedback&&E&&E.feedback){Jamendo.page.updateFeedbacks(E.feedback)}if(C){C(E,G)}},"params":D||{},"url":A});return this.ajaxRequest(B)},writeApi:function(G,C,I,B,H){try{if(!H){H={}}var A={};if(C){$A(C).each(function(K,J){if(typeof (K)=="number"){A["p"+J]=K}else{A["p"+J]=Object.toJSON(K)}})}if(Jamendo.getEnv("NOCACHE")=="1"&&G.substring(0,7)=="cached "){G=G.substring(7)}if(G.indexOf("jscached")!=-1){G=G.gsub("jscached ","");if(Jamendo.getEnv("NOCACHE")!="1"){if(typeof (this._cached_writeapi_results)=="undefined"){this._cached_writeapi_results=$H()}var F=G+"__"+Object.toJSON(C).gsub(/[\n \"\']/,"");if(typeof (this._cached_writeapi_results.get(F))!="undefined"){I(Jamendo._cached_writeapi_results.get(F));return true}else{var D=I;I=function(J){Jamendo._cached_writeapi_results.set(F,J);D(J)}}}}if(typeof (B)=="function"){H.errback=B}return this.jsonRequest("/"+Jamendo.getEnv("HTTPHOSTI18N").replace(/.*\.[a-z]+\//,"")+"set/"+G+"/postjson/json",A,I,H)}catch(E){Jamendo.log(E);if(B){B()}return false}},writeApiWithFeedback:function(F,G,E,B,A){A=Object.extend({"showFeedback":true},A);try{var D={};if(G){$A(G).each(function(I,H){if(typeof (I)=="number"){D["p"+H]=I}else{D["p"+H]=Object.toJSON(I)}})}if(typeof (B)=="function"){A.errback=B}return this.jsonRequest("/"+Jamendo.getEnv("HTTPHOSTI18N").replace(/.*\.[a-z]+\//,"")+"set/"+F+"/postjson/jsonfeedback",D,E,A)}catch(C){Jamendo.log(C);if(B){B()}}},get2:function(B,F,E,D,C){C=C||{};F=F||{};if(D){C.errback=D}B=B.replace(/^[^\?]*\/?get2\//,"");var A=B.indexOf("?");if(A>=0){$H(B.substr(A+1).toQueryParams()).each(function(G){if(!$H(F).keys().include(G.key)){F[G.key]=G.value}});B=B.substr(0,A)}B=B.split("/");if(!B[2]){B[2]="json"}B=B.join("/");return Jamendo.jsonRequest("/get2/"+B,F,E,C)},get2parse:function(D){var C={"url":D,"relations":[],"targets":[],"format":"","params":$H(),"position":0};var A=D.indexOf("#");if(A>=0){C["position"]=parseInt("0"+D.substring(A+1));D=D.substring(0,A)}A=D.indexOf("?");if(A>=0){C["params"]=$H(D.substring(A+1).gsub(/\+/," ").toQueryParams());D=D.substring(0,A)}var B=D.split("/");C["unit"]=B[1];if(B[3]){C["relations"]=B[3].split(/\s+|\+/)}C["targets"]=B[0].split(/\s+|\+/);C["canonicalUrl"]=Jamendo.get2unparse(C);return C},get2unparse:function(B,A){if(A){if(A["params_merge"]){A["params"]=$H(B["params"]).merge(A["params_merge"])}B=Object.extend(B,A)}return B["targets"].uniq().join("+")+"/"+B["unit"]+"/"+B["format"]+"/"+B["relations"].uniq().join("+")+"?"+B["params"].toQueryString()+(B["position"]?"#"+B["position"]:"")},patchUrl:function(B,D){var C=B.substr(0,B.indexOf("?"));var A=B.substr(B.indexOf("?")+1,B.length).toQueryParams();$H(D).each(function(E){A[E.key]=E.value});return C+"?"+Object.toQueryString(D)},id2ml2:function(B){B=B.split("/");switch(B[0]){case"artist":var A=B[1].split("|");return"/artist//unique/?id="+A[0]+"|id/track//track_album+album_artist/?track_id="+A[1]+"&order=fromparams&n=all";case"tag":return"/tag//?tag_idstr="+B[1];case"radio":return"stream/track/m3u/radio_track_inradioplaylist/?order=numradio_asc&n=50&radio_id="+B[1];case"track_similar":var A=B[1].split("|");return"/track//track_album+album_artist/?order=similarity_desc&n=50&similarid="+A[0]+"."+A[1];default:return"/"+B[0]+"//?"+B[0]+"_id="+B[1]+"&order=num"+B[0]+"_asc&n=all"}return null},JSONCallback:function(B,A){},formatNumber:function(C,A){if(isNaN(C)){return 0}if(C==""){return 0}var H=new String(C);var D=H.split(".");var E=parseFloat(D[0]);var F="";if(D.length>1){var G=new String(D[1]);G=String(parseFloat(D[1])/Math.pow(10,(G.length-A)));G=String(E+Math.round(parseFloat(G))/Math.pow(10,A));var B=G.indexOf(".");if(B==-1){G+=".";B=G.indexOf(".")}while(G.length<=B+A){G+="0"}F=G}else{var B;var G=new String(E);G+=".";B=G.indexOf(".");while(G.length<=B+A){G+="0"}F=G}return F},logEvents:function(A){Jamendo.addObserver(A,function(B,C){var D="[";B.each(function(F,E){D+="'"+F+"'";if(E<B.length-1){D+=", "}});D+="] ";Jamendo.log("sendEvent : "+D+" with data: "+C)})},sendEvent:function(A,C){for(var B=0;B<this.observers.length;B++){if(this.eventIdMatches(A,this.observers[B][0])){try{this.observers[B][1](A,C)}catch(D){Jamendo.log("Error while calling event "+this.observers[B][0]+" with data "+this.observers[B][1]);Jamendo.log(D)}}}},sendEventDefered:function(A,B){(function(){Jamendo.sendEvent(A,B)}).defer()},observeOnce:function(A,B){Jamendo.forwardEvent(A,null,{"callback":B})},forwardEvent:function(G,D,B){if(!G){throw new Error("You have to provide an eventToObserve")}B=B||{};if(!D&&!B.callback){throw new Error("What are you doing ? give a callback or and event to forward !")}var F=B.permanent||false;var C=B.data||null;var A=B.callback||Prototype.K;var E=function(H,I){A(H,C||I);if(D){Jamendo.sendEvent(D,C||I)}if(!F){Jamendo.removeObserver(G,E)}};Jamendo.addObserver(G,E)},secondsToLabel:function(B){var A=Math.floor(B/60);var B=Math.floor(B-A*60);if(B<10){B="0"+B}return A+":"+B},addObserver:function(A,B){this.observers.push([A,B])},removeObserver:function(A,B){this.observers=this.observers.reject(function(C){return(this.eventIdEquals(A,C[0])&&B==C[1])}.bind(this))},removeObserversByEventId:function(A){this.observers=this.observers.reject(function(B){return this.eventIdEquals(A,B[0])}.bind(this))},eventIdMatches:function(C,B){for(var A=0;A<B.length;A++){if(C[A]!=B[A]){return false}}return true},eventIdEquals:function(A,B){return this.eventIdMatches(A,B)&&this.eventIdMatches(B,A)},onReady:function(A){if(this.domReady){return A()}document.observe("dom:loaded",A)},requestUri:function(A){var B=A.indexOf("jamendo.com/");if(B>=0){A=A.substr(B+11)}return A},insertScript:function(B,E){var C=document.createElement("script");C.type="text/javascript";C.charset="utf-8";C.defer=true;var D=function(){if(C.readyState&&C.readyState!="loaded"&&C.readyState!="complete"){return }C.onreadystatechange=C.onload=null;if(E){E()}$(C).remove()};C.onload=C.onreadystatechange=D;C.src=B;document.getElementsByTagName("head").item(0).appendChild(C);if(Prototype.Browser.WebKit&&E&&navigator.userAgent.match(/AppleWebKit\/([0-9]+)/)[1]<522){var A=document.createElement("iframe");A.style.width="0px";A.style.height="0px";A.setAttribute("src",B);document.getElementsByTagName("body").item(0).appendChild(A);A.onload=function(){D();try{$(A).remove()}catch(F){}}}},insertGoogleJsApi:function(A){Jamendo._googlejsapicalback=A;setTimeout(function(){Jamendo.insertScript("http://www.google.com/jsapi?key="+Jamendo.getEnv("GMAPS_KEY")+"&callback=Jamendo._googlejsapicalback")},250)},getTemplate:function(A){return new Template($(A).innerHTML,/(^|.|\r|\n)(\$([a-z0-9]+)\$)/)},isUrl:function(B){var A=/^(http\:\/\/|ftp\:\/\/|)\w+([\.\-]\w+)*\.\w{2,4}(\:\d+)*([\/\.\-\?\&\%\#]\w+)*\/?$/i;return A.test(B)},get_url_param:function(A){A=A.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var C="[\\?&]"+A+"=([^&#]*)";var D=new RegExp(C);var B=D.exec(window.location.href);if(B==null){return""}else{return B[1]}},errorUnimplemented:function(){Jamendo.log("Error : unimplemented")},sleep:function(B){var A=new Date().getTime();while(new Date().getTime()<A+B){}},stacktrace:function(){var I=[];var C=false;try{B.dont.exist+=0}catch(F){if(F.stack){var J=F.stack.split("\n");for(var B=0,E=J.length;B<E;B++){if(J[B].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){I.push(J[B])}}I.shift();C=true}else{if(window.opera&&F.message){var J=F.message.split("\n");for(var B=0,E=J.length;B<E;B++){if(J[B].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var H=J[B];if(J[B+1]){H+=" at "+J[B+1];B++}I.push(H)}}I.shift();C=true}}}if(!C){var D=arguments.callee.caller;while(D){var G=D.toString();var A=G.substring(G.indexOf("function")+8,G.indexOf(""))||"anonymous";I.push(A);D=D.caller}}return(I)}};Hash.prototype.diff=function(B){var A=[[],[]];for(key in this){if(this[key]!=B[key]){A[0].push(key)}}for(key in B){if(!(key in this)){A[1].push(key)}}return A};if(!Jamendo_ENV){var Jamendo_ENV={}}var Jamendo=new Jamendo();Jamendo.onReady(function(){Jamendo.domReady=true});Element.addMethods({"jamPosition":function(A,B){A=$(A);A.style.left=parseInt(B[0])+"px";A.style.top=parseInt(B[1])+"px";return A},"jamSize":function(A,B){A=$(A);A.style.width=parseInt(B[0])+"px";A.style.height=parseInt(B[1])+"px";return A}});Jamendo.DelayedSwitch=Class.create();Jamendo.DelayedSwitch.prototype={initialize:function(C,B,A){this._on=C;this._off=B;this.delayON=A;this.timer=false},on:function(){if(!this.delayON){if(this._on){this._on()}}else{if(!this.timer){this.timer=setTimeout(function(){this.timer=false;if(this._on){this._on()}}.bind(this),this.delayON)}}},off:function(){if(this.timer){clearTimeout(this.timer);this.timer=false}if(this._off){this._off()}},reset:function(){this.off();this.on()}};String.prototype.pad=function(A,C,B){return C||(C=" "),(A-=this.length)>0?(C=new Array(Math.ceil(A/C.length)+1).join(C)).substr(0,B=!B?A:B==1?0:Math.ceil(A/2))+this+C.substr(0,A-B):this};Jamendo.Queue=Class.create();Object.extend(Jamendo.Queue.prototype,Enumerable);Object.extend(Jamendo.Queue.prototype,{initialize:function(){this.queue=[];this.queueSpace=0;this.length=0},push:function(B,A){this.queue.push(B);return(++this.length)},shift:function(){if(this.queue.length){var A=this.queue[this.queueSpace];if(++this.queueSpace*2>=this.queue.length){for(var B=this.queueSpace;B<this.queue.length;B++){this.queue[B-this.queueSpace]=this.queue[B]}this.queue.length-=this.queueSpace;this.queueSpace=0}this.length--;return A}else{return undefined}},concat:function(A){return this.toArray().concat(A)},unshift:function(A){if(this.queueSpace>0){this.queue[--this.queueSpace]=A}else{this.queue.unshift(A)}return(++this.length)},pop:function(){this.length--;return this.queue.pop()},_each:function(C){for(var B=this.queueSpace,A=this.queue.length;B<A;B++){C(this.queue[B])}},pick:function(B){var A=this.queue[this.queueSpace+B];for(var C=(this.queueSpace+B);C>(this.queueSpace);C--){this.queue[C]=this.queue[C-1]}this.queue[this.queueSpace]=A;return this.shift()},pushArray:function(A){this.queue=this.queue.concat(A);this.length+=A.length;return this.toArray()},get:function(A){return this.queue[this.queueSpace+A]},set:function(B,A){this.queue[this.queueSpace+B]=A},toArray:function(){return this.queue.slice(this.queueSpace)},extendItem:function(A,B){Object.extend(this.queue[this.queueSpace+A],B)}});String.prototype.size=function(){return this.length};var Cookie={set:function(B,E,D){var C="";if(D!=undefined){var F=new Date();F.setTime(F.getTime()+(86400000*parseFloat(D)));C=";expires="+F.toGMTString()}var A=escape(B)+"="+escape(E||"")+C+";path=/;domain=.jamendo.com";return(document.cookie=A)},get:function(B){var A=document.cookie.match(new RegExp("(^|;)\\s*"+escape(B)+"=([^;\\s]*)"));return(A?unescape(A[2]):null)},erase:function(B){var A=Cookie.get(B)||true;Cookie.set(B,"",-1);return A},accept:function(){if(typeof (navigator.cookieEnabled)=="boolean"){return navigator.cookieEnabled}Cookie.set("_test","1");return(Cookie.erase("_test")=="1")},log:function(){document.cookie.split("; ").each(function(A,B){Jamendo.log("Cookie:"+A)})}};Jamendo.page={hasPlayedOnce:false,_fbPublish:null,players:$H({}),lastInstalledPlayer:null,defaultPlayer:false,updateFeedbacks:function(C,B){var A=$H({"ok":"ok","nok":"error","wait":"wait","warning":"warning","info":"info"});var E=$("page_content_inner");var D=".page_content_leftc";if($("splash_main")){E=$("page_content_outer");var D="#splash_columns"}if(!E){E=$("main-content");var B="#main-content";var D="div"}if(!E){E=$("page_content_outer");var D="#page_content_fit"}if(!E){E=$("main");var D=".contentsection"}var F=(!E);if(!F){if(B){B=$(B)}else{var B=E.down(".pageFeedbacks")}if(!B){B=new Element("div",{className:"pageFeedbacks"});B.addClassName("pageFeedbacks");if(!E.down(D)){E.insert({top:B})}else{E.down(D).insert({top:B})}}B.getElementsBySelector(".boxok, .boxerror, .boxwait, .boxinfo, .boxwarning").invoke("remove")}C.each(function(I){if(F){return alert(I.text)}var G="jamfeedback-"+(Math.random()*1000000);var H=new Element("div",{"class":"box"+A.get(I.type),"id":G}).update(I.text).insert({"top":new Element("a",{"href":"#","onclick":"$('"+G+"').remove(); return false;","style":"float:right;display:block;"}).update(Jamendo.getStr("SUPERBOX_CLOSE"))});H.addClassName("box"+A.get(I.type));if(I.help){var J=new Element("div",{"class":"feedback_help"});if(I.help.text){J.update(I.help.text)}else{if(I.help.link){J.update(new Element("a",I.help.link).update(I.help.link.text))}}H.insert(J)}B.insert({"top":H})})},clientSideInfos:function(){return{"TZOFFSET":(new Date()).getTimezoneOffset()}},fixClientSideInfos:function(){var A=Jamendo.page.clientSideInfos();if(Jamendo.getEnv("TZOFFSET")!==""&&Jamendo.getEnv("TZOFFSET")!=A.TZOFFSET){Jamendo.onReady(function(){Jamendo.writeApi("user_clientsideinfos",[A])})}},preloadImages:function(A){Event.observe(window,"load",function(){var C=new Image();for(var B=0;B<A.length;B++){C.src=A[B]}})},getPageSize:function(){var B=document.documentElement;var A=self.innerHeight||(B&&B.clientHeight)||document.body.clientHeight;if(document.body.offsetHeight>A){A=document.body.offsetHeight}return A},showLogin:function(C){if(C){var B=$("login_box").previous(".boxerror");if(B){B.hide()}}$("page_login").show();$("box_overlay").show();$("page_login").setStyle({opacity:1,zIndex:20005});var A=this.getPageSize();$("box_overlay").setStyle({opacity:0.5,backgroundColor:"#000",width:"100%",height:A+"px",position:"absolute",top:0,left:0,zIndex:10005});$("page_loginform_pseudo").focus();return false},logintabs:["page_loginform_pseudo","page_loginform_pass","loginbutton","resendpass","signuplink"],spLoginOnKeypress:function(B){var C=Event.element(B);if(B.keyCode==Event.KEY_RETURN){if($("page_loginform_pseudo").value!=""&&$("page_loginform_pass").value!=""){$("login_form").submit()}else{if(C.id=="page_loginform_pass"){$("loginerror").show()}}}else{if(B.keyCode==Event.KEY_ESC){$("loginerror").hide()}else{if(B.keyCode==Event.KEY_TAB){var A=Jamendo.page.logintabs.indexOf(C.id);if(Jamendo.page.logintabs[A+1]){$(Jamendo.page.logintabs[A+1]).focus()}else{$(Jamendo.page.logintabs.first()).focus()}}else{if(B.type=="click"&&C.up(".jambutton_bigaction_button")&&C.up(".jambutton_bigaction_button").id=="loginbutton"||B.type=="click"&&C.up(".jamactionbutton")){if($("page_loginform_pseudo").value!=""&&$("page_loginform_pass").value!=""){$("login_form").submit()}else{$("loginerror").show()}}else{return B}}}}return false},refresh:function(){if(typeof (window.location.reload)=="function"){window.location.reload(false)}else{window.location.href=unescape(window.location.pathname+window.location.search)}},refreshWithParams:function(D,A){if(A==null){A=false}else{if(A){A=true}else{A=false}}var B=window.location.toString().indexOf("?");if(A){var C="".toQueryParams()}else{var C=(B>0?window.location.toString().substring(B):"").toQueryParams()}C=Object.extend(C,D);window.location=(B>0?window.location.toString().substring(0,B):window.location)+"?"+$H(C).toQueryString()},popup:function(A){return window.open(A,"jamendopopup_"+Math.round(Math.random()*1000000),"menubar=yes,location=yes,toolbar=yes,directories=yes,personalbar=yes,status=yes,resizable=yes,scrollbars=yes")},download:function(C,E){if(!C||!E){Jamendo.writeApi("quicklog",["emptydownloadunitid",window.location.toString()]);return false}if(!Jamendo.getEnv("PREFS")["download"]||C!="album"){var B=Jamendo.getEnv("HTTPHOSTI18N").replace("torrents","www")+"download/"+C+"/"+E+"/";var D="width=920,height=400";if(C=="playlist"){D="width=750,height=400"}var A=function(){window.open(B+"?output=contentonly","jamdownload_"+Math.round(Math.random()*1000000),D+",menubar=no,location=no,toolbar=no,directories=no,personalbar=no,status=no,resizable=yes")};if(Jamendo.getEnv("INTERRUPTS")["download"]){Jamendo.getEnv("INTERRUPTS")["download"]=0;SuperBox.cb_remove.push(function(){SuperBox.cb_remove=[];A()});SuperBox.call("remote",Jamendo.getEnv("HTTPHOSTI18N")+"whysignup/download/?sbw=680&sbh=400&whysignup_redirect="+encodeURIComponent(B))}else{A()}}else{window.location=Jamendo.getEnv("HTTPHOSTI18N")+"get2/bittorrent/file/redirect/?type=archive&album_id="+E+"&class="+(Jamendo.getEnv("PREFS")["download"].split(/_/)[1])}return false},usePlayer:function(){return !Jamendo.getEnv("PREFS")["stream"]},parsePlayML2s:function(E,B){var A=Jamendo.getEnv("PREFS")["stream"].split(/_/);var D=Jamendo.parseStrId((B||E).replace(/^.*\|/,""));if(D["unit"]!="track"){if(D["unit"]=="album"){D["params"].set("order","numalbum_asc")}if(D["unit"]=="playlist"){D["params"].set("order","numplaylist_asc")}D["relations"].push("track9_"+D["unit"]);D["unit"]="track9"}var C=Jamendo.unparseStrId(D,{"format":A[0],"targets":["stream"],"params_merge":{"streamencoding":A[1]}});return C},play_old:function(E,A,D,C){Jamendo.page.hasPlayedOnce=true;if(C){var B=Jamendo.getEnv("HTTPHOSTI18N")+"widgets/create?url="+encodeURIComponent(E);if(C=="newwindow"){Jamendo.page.popup(B);return false}if(Prototype.Browser.Gecko&&Jamendo.getEnv("USER_AGENT").match(new RegExp(" Mac","g"))){document.location=B;return false}return SuperBox.call("remote",Jamendo.getEnv("HTTPHOSTI18N")+"get2/"+E,"",function(){SuperBox.setDim("200","300")})}else{if(!Jamendo.page.usePlayer()){if(E.substr(0,4)=="misc"){E="track"+E.substr(4)}var B=this.parsePlayML2s(Jamendo.id2ml2(E),A);window.location=Jamendo.getEnv("HTTPHOSTI18N")+"get2/"+B;return false}else{if(D){Jamendo.sendEvent(["jamplayer2","remote","control","play"],Jamendo.id2ml2(E));return false}else{return Jamendo.page.remoteplayer.command("play",E)}}}},play_retry:function(){},play:function(A,D,C){if(!C){C={}}Jamendo.page.play_retry=function(){C["wasQueued"]=true;return Jamendo.page.play(A,D,C)};if(Jamendo.page.players.size()==0){return true}var B=Jamendo.page.players.get(C.usePlayer||Jamendo.page.defaultPlayer);if(!B){B=Jamendo.page.players.get(Jamendo.page.lastInstalledPlayer)}if(B){if(!C["onlyFetch"]){B.guiWait()}return B.onReady(function(){B.stop();return B.play(A,D,C)})}else{setTimeout(Jamendo.page.play_retry,1000)}},installPlayer:function(A,B){Jamendo.page.players.set(A,B);B.playerName=A;Jamendo.page.lastInstalledPlayer=A},star:function(B,F,C,A,E){if(!B||!F){Jamendo.writeApi("quicklog",["emptystarunitid",window.location.toString()]);return false}var D=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},500,200);D.on();return Jamendo.writeApiWithFeedback("user_log",[B,"star",F,C],function(H,I,G,J){D.off();if(typeof (G.result)!="undefined"&&(G.result=="true"||G.result==true)){A.up(".jambutton").switchButton();if(H){Jamendo.writeApi("social_networks_action_enabled_networks",["star"],function(L,K,O,M,N){$A(N).each(function(R,Q,T,S,P){R.shareOnSocialNetworks(P,Q,T,"star",S,true)}.curry(L,K,O,M))}.curry(this,B,F,I),function(){D.off()})}}}.bind(this,C,E),function(){D.off()})},concertToggleUser:function(C,A,B){SuperBox.call("wait");return Jamendo.writeApiWithFeedback("concert_user",["toggle",C],function(D,E){if(typeof (D.result)!="undefined"){if(B){Jamendo.page.refresh()}else{if(parseInt(D.result)>0){$$("."+A).each(function(F){F.select("span").invoke("update",Jamendo.getStr("CONCERT_USER_dont_go"))})}else{$$("."+A).each(function(F){F.select("span").invoke("update",Jamendo.getStr("CONCERT_USER_go"))})}SuperBox.remove()}}else{SuperBox.remove()}},function(){feedbackSwitch.off()})},seenlive:function(E,B,A,D){if(!E){Jamendo.writeApi("quicklog",["emptyseenliveid",window.location.toString()]);return false}var C=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},200);C.on();return Jamendo.writeApiWithFeedback("user_log",["artist","seenlive",E,(B?1:0)],function(G,H,F,I){C.off();if(typeof (F.result)!="undefined"&&(F.result=="true"||F.result==true)){A.up(".jambutton").switchButton();if(G){Jamendo.writeApi("social_networks_action_enabled_networks",["seenlive"],function(J,M,K,L){$A(L).each(function(O,Q,P,N){O.shareOnSocialNetworks(N,"artist",Q,"seenlive",P,true)}.curry(J,M,K))}.curry(this,E,H),function(){C.off()})}}}.bind(this,B,D),function(){C.off()})},shareOnSocialNetworks:function(C,B,F,A,D,E){switch(C){case"facebook":return this.shareOnFacebook(B,F,A,D,E);case"twitter":return this.shareOnTwitter(B,F,A,D)}},shareOnFacebook:function(C,F,A,D,E){if(!this._fbPublish){this._fbPublish=new Jamendo.classes.FacebookPublishStory()}var B=function(G){G.auto=E;G.callback=this.shareCallback.bind(this,"facebook",C,F,A);this._fbPublish.publishOnMyWall(G)}.bind(this);Jamendo.writeApi("social_networks_facebook_story_formatter",[C,F,A,D],B,null,{"asynchronous":Jamendo.getEnv("FACEBOOK_CONNECTED")})},shareCallback:function(C,B,D,A){Jamendo.writeApi("social_networks_story_published",[C,B,D,A],function(){})},shareOnTwitter:function(B,D,A,C){Jamendo.writeApi("social_networks_share_on_twitter",[B,D,A,C],function(E){window.location.replace("http://twitter.com/share?text="+encodeURIComponent(E)+"&url="+(window.location))}.bind(this))},friendship:function(B,D,C,F){if(B&&D&&C>0){var A=({"asked":"user_addfriend","accepted":"user_addfriend","deleted":"user_deletefriend","refused":"user_deletefriend"})[B];var E=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},200);return Jamendo.writeApiWithFeedback(A,[D,C,true],function(G,H){E.off();if(typeof (F=="function")){F(G,H)}},function(){E.off()})}},usergroup:function(A,B){var C=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},200);C.on();Jamendo.writeApi("user_log",["usergroup","joined",A,B],function(D){var E=(D=="ok");C.off();alert(Jamendo.getStr((B?"FEEDBACK_usergroupjoin_ok":"FEEDBACK_usergroupleave_ok")));Jamendo.page.refresh()},function(){C.off()})},usergroupWithFeedback:function(A,B){var C=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},200);C.on();return Jamendo.writeApiWithFeedback("user_log",["usergroup","joined",A,B],function(D,E){C.off()},function(){C.off()})},deleteplaylist:function(A){if(confirm(Jamendo.getStr("PLAYLIST_DELETE_QUESTION"))){Jamendo.writeApi("playlist_set",[[["deleteplaylist",A]],true],function(B){Jamendo.page.refresh()},function(){feedbackSwitch.off()})}},agreeToReview:function(B,A,D){if(B>0){var C=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},200);C.on();Jamendo.writeApiWithFeedback("review_agree",[B,A],function(E,F){C.off();if(typeof (D)=="function"){D(E,F)}},function(){C.off()})}},newsAction:function(C,D,E,F,G){var B=({"hide":["viewed",1,{"ids":D}]})[C];var A=function(H,I){Jamendo.page.shiftNewsfeed(1,E);if(typeof (F=="function")){F(H,I)}};if(G){Jamendo.writeApi("news_setflag",B,F,function(){feedbackSwitch.off()})}else{Jamendo.writeApiWithFeedback("news_setflag",B,A,function(){feedbackSwitch.off()})}},newsActionWithoutFeedback:function(A,D,B,C){Jamendo.page.newsAction(A,[D],B,C,true)},shiftNewsfeed:function(B,A,C){var D=Jamendo.Newsfeed.displayedItems.sortBy(function(E){return E}).first();if(!D){return }Jamendo.writeApi("news_get",[D,B,A],function(E,F){$("newsfeed").insert(E);Jamendo.page.hideNewsFeedIfNeeded();if(typeof (C)=="function"){C(E,F)}},function(){feedbackSwitch.off()})},hideNewsFeedIfNeeded:function(){var B=$("newsfeed");var A=B.select(".itemnewsfeed").find(function(C){return C.visible()});if(typeof (A)=="undefined"){Jamendo.page.updateFeedbacks([]);B.update('<div class="noitems_message">'+Jamendo.getStr("NEWSFEEDVIEWER_NOITEMS")+"</div>")}},reviewReport:function(A){var B=prompt(Jamendo.getStr("REPORT_BAD_REVIEW_REASON")+" ?",Jamendo.getStr("REPORT_BAD_REVIEW_YOUR_REASON"));if(B){Jamendo.writeApiWithFeedback("review_report",[A,"alert",{"type":B}])}},initRemoteplayer:function(B){if(!swfobject.hasFlashPlayerVersion("8.0.0")){var A=$("player_no_flash");if(A){A.setStyle({"display":"block"})}Jamendo.page.remoteplayer=null}else{Jamendo.page.remoteplayer=new Jamendo.classes.remotePlayer(B)}},searchRedirect:function(B,C){if(typeof (C)=="undefined"){C=true}if(["!","~","*","'","(",")","/"].all(function(D){return !B.include(D)})){var A="search/all/"+encodeURIComponent(B);if(C){window.location=Jamendo.getEnv("HTTPHOSTI18N")+A;return false}else{return"/"+A}}return true},joinGroupFromNewsfeed:function(A,C,B){this.usergroupWithFeedback(C,1);if($("item_details"+A).down("ul").getElementsByTagName("li").length==1){this.newsAction("hide",[A],function(D){this.hide();Jamendo.Newsfeed.displayedItems=Jamendo.Newsfeed.displayedItems.without(A)}.bind($("itemnewsfeed"+A)),1)}else{$(B).up("li").remove()}},remoteplayer:null,flashCallback:function(B,A){Jamendo.sendEvent(["flashcallback",B],A)},showPopupInfo:function(){var B=$("popupblocker_info");if(B){B.scrollTo();return }if(Prototype.Browser.WebKit||Prototype.Browser.MobileSafari){var A=document.getElementsByTagName("body")[0];A.insert({before:'<div id="popupblocker_info">'+Jamendo.getStr("POPUPBLOCKER_INFO")+"</div>"});$("popupblocker_info").scrollTo()}},graph2:function(A,F,E,C,B){if(typeof (Jamendo.classes.Graph2)=="undefined"){Jamendo.log('It seems you hav not loaded the "Graph2" chart engine');return }if(typeof (Jamendo.page.graphobject)=="undefined"){var D=new Jamendo.classes.Graph2();Jamendo.page.graphobject=D}Jamendo.page.graphobject.insertGraph(A,F,E,C,B)},isMacOS:function(){return(Jamendo.getEnv("USER_AGENT").match(new RegExp(" Mac","g")))},toggleExpander:function(B,C,A){B.toggleClassName("expander_closed");B.toggleClassName("expander_opened");if(B.hasClassName("expander_opened")&&typeof (C)=="function"){C()}else{if(B.hasClassName("expander_closed")&&typeof (A)=="function"){A()}}},reportContent:function(C,B,A){var D=prompt(Jamendo.getStr("ALBUM_REPORT"));if(D===null||D===false){return }Jamendo.writeApiWithFeedback("album_moderation",[B,"report",D])},changeDeviceInstores:function(A){$("select_a_format").select("li a.active").invoke("removeClassName","active");$("select_a_format").select("div.display_product_zone").invoke("hide");$("li_"+A).addClassName("active");$("details_"+A).show();return true},load_artist_admin:function(B,F,D,C,A){var E=new Jamendo.DelayedSwitch(function(){SuperBox.call("wait")},function(){SuperBox.remove()},200);E.on();Jamendo.writeApi("artist_admin",[B,F,D,C],function(G){E.off();A(G)},function(){E.off()})},insertFacebookSdk:function(B,C,A){window.fbAsyncInit=function(){FB.init({appId:B,status:false,cookie:true,xfbml:true,oauth:true});FB.Event.subscribe("auth.sessionChange",function(D){if(!!D.session!=!!Jamendo.getEnv("FACEBOOK_CONNECTED")){Jamendo.page.updateFeedbacks([{"type":"ok","text":Jamendo.getStr("FACEBOOK_CONNECTED_RELOAD")}],"page_content_outer_withcolumn")}})};Jamendo.onReady(function(){var D=document.createElement("script");D.async=true;D.src=document.location.protocol+"//connect.facebook.net/"+C+"/all.js";$("fb-root").appendChild(D)})}};SM2_DEFER=true;(function(A){var C=null;function B(AY,c){this.flashVersion=8;this.debugMode=false;this.debugFlash=false;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="about:blank";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashPollingInterval=null;this.flashLoadTimeout=1000;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock=false;this.useHTML5Audio=false;this.html5Test=/^probably$/i;this.useGlobalHTML5Audio=true;this.requireFlash=false;this.audioFormats={"mp3":{"type":['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],"required":true},"mp4":{"related":["aac","m4a"],"type":['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],"required":true},"ogg":{"type":["audio/ogg; codecs=vorbis"],"required":false},"wav":{"type":['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],"required":false}};this.defaultOptions={"autoLoad":false,"stream":true,"autoPlay":false,"loops":1,"onid3":null,"onload":null,"whileloading":null,"onplay":null,"onpause":null,"onresume":null,"whileplaying":null,"onstop":null,"onfailure":null,"onfinish":null,"onbeforefinish":null,"onbeforefinishtime":5000,"onbeforefinishcomplete":null,"onjustbeforefinish":null,"onjustbeforefinishtime":200,"multiShot":true,"multiShotEvents":false,"position":null,"pan":0,"type":null,"usePolicyFile":false,"volume":100};this.flash9Options={"isMovieStar":null,"usePeakData":false,"useWaveformData":false,"useEQData":false,"onbufferchange":null,"ondataerror":null};this.movieStarOptions={"bufferTime":3,"serverURL":null,"onconnect":null,"duration":null};this.version=null;this.versionNumber="V2.97a.20110424";this.movieURL=null;this.url=(AY||null);this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.movieID="sm2-container";this.id=(c||"sm2movie");this.swfCSS={"swfBox":"sm2-object-box","swfDefault":"movieContainer","swfError":"swf_error","swfTimedout":"swf_timedout","swfLoaded":"swf_loaded","swfUnblocked":"swf_unblocked","sm2Debug":"sm2_debug","highPerf":"high_performance","flashDebug":"flash_debug"};this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.specialWmodeCase=false;this.didFlashBlock=false;this.filePattern=null;this.filePatterns={"flash8":/\.mp3(\?.*)?$/i,"flash9":/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features={"buffering":false,"peakData":false,"waveformData":false,"eqData":false,"movieStar":false};this.sandbox={};this.hasHTML5=null;this.html5={"usingFlash":null};this.ignoreFlash=false;var AH,At=this,AU="soundManager",AD=AU+"::",Ae="HTML5::",l,r=navigator.userAgent,L=A,M=L.location.href.toString(),D=this.flashVersion,Aa=document,s,AM,AA=[],As=true,t,AJ=false,Al=false,T=false,Y=false,R=false,V,U=0,AF,q,Ak,Aq,h,AK,y,Q,AQ,AX,g,b,Aj,P,AS,m,S,AR,o,i=["log","info","warn","error"],AL=8,AE,AC,H,An=null,AG=null,k,I,AP,Ad,z,Af,J,v,K=false,X=false,W,O,Ag,e,x=null,u,Ab,Ar=false,f,Am,d,Ao,Ai,G=Array.prototype.slice,Ah=false,F,N,n,AI=r.match(/pre\//i),AW=r.match(/(ipad|iphone|ipod)/i),AO=(r.match(/mobile/i)||AI||AW),E=r.match(/msie/i),Ap=r.match(/webkit/i),AZ=(r.match(/safari/i)&&!r.match(/chrome/i)),a=(r.match(/opera/i)),AB=(!M.match(/usehtml5audio/i)&&!M.match(/sm2\-ignorebadua/i)&&AZ&&r.match(/OS X 10_6_([3-9])/i)),Z=(typeof console!=="undefined"&&typeof console.log!=="undefined"),Ac=(typeof Aa.hasFocus!=="undefined"?Aa.hasFocus():null),w=(typeof Aa.hasFocus==="undefined"&&AZ),AT=!w;this._use_maybe=(M.match(/sm2\-useHTML5Maybe\=1/i));this._overHTTP=(Aa.location?Aa.location.protocol.match(/http/i):null);this._http=(!this._overHTTP?"http:":"");this.useAltURL=!this._overHTTP;this._global_a=null;if(AW||AI){At.useHTML5Audio=true;At.ignoreFlash=true;if(At.useGlobalHTML5Audio){Ah=true}}if(AI||this._use_maybe){At.html5Test=/^(probably|maybe)$/i}this.ok=function(){return(x?(T&&!Y):(At.useHTML5Audio&&At.hasHTML5))};this.supported=this.ok;this.getMovie=function(Au){return E?L[Au]:(AZ?l(Au)||Aa[Au]:l(Au))};this.createSound=function(Ax){var Az=AU+".createSound(): ",Ay=null,Aw=null,Av=null;if(!T||!At.ok()){J(Az+k(!T?"notReady":"notOK"));return false}if(arguments.length===2){Ax={"id":arguments[0],"url":arguments[1]}}Ay=q(Ax);Av=Ay;if(v(Av.id,true)){return At.sounds[Av.id]}function Au(){Ay=z(Ay);At.sounds[Av.id]=new AH(Av);At.soundIDs.push(Av.id);return At.sounds[Av.id]}if(Ab(Av)){Aw=Au();Aw._setup_html5(Av)}else{if(D>8&&At.useMovieStar){if(Av.isMovieStar===null){Av.isMovieStar=((Av.serverURL||(Av.type?Av.type.match(At.netStreamPattern):false)||Av.url.match(At.netStreamPattern))?true:false)}if(Av.isMovieStar){}if(Av.isMovieStar){if(Av.usePeakData){Av.usePeakData=false}if(Av.loops>1){}}}Av=Af(Av,Az);Aw=Au();if(D===8){At.o._createSound(Av.id,Av.onjustbeforefinishtime,Av.loops||1,Av.usePolicyFile)}else{At.o._createSound(Av.id,Av.url,Av.onjustbeforefinishtime,Av.usePeakData,Av.useWaveformData,Av.useEQData,Av.isMovieStar,(Av.isMovieStar?Av.bufferTime:false),Av.loops||1,Av.serverURL,Av.duration||null,Av.autoPlay,true,Av.autoLoad,Av.usePolicyFile);if(!Av.serverURL){Aw.connected=true;if(Av.onconnect){Av.onconnect.apply(Aw)}}}if((Av.autoLoad||Av.autoPlay)&&!Av.serverURL){Aw.load(Av)}}if(Av.autoPlay&&!Av.serverURL){Aw.play()}return Aw};this.destroySound=function(Au,Ax){if(!v(Au)){return false}var Aw=At.sounds[Au],Av;Aw._iO={};Aw.stop();Aw.unload();for(Av=0;Av<At.soundIDs.length;Av++){if(At.soundIDs[Av]===Au){At.soundIDs.splice(Av,1);break}}if(!Ax){Aw.destruct(true)}Aw=null;delete At.sounds[Au];return true};this.load=function(Au,Av){if(!v(Au)){return false}return At.sounds[Au].load(Av)};this.unload=function(Au){if(!v(Au)){return false}return At.sounds[Au].unload()};this.play=function(Au,Av){var Aw=AU+".play(): ";if(!T||!At.ok()){J(Aw+k(!T?"notReady":"notOK"));return false}if(!v(Au)){if(!(Av instanceof Object)){Av={url:Av}}if(Av&&Av.url){Av.id=Au;return At.createSound(Av).play()}else{return false}}return At.sounds[Au].play(Av)};this.start=this.play;this.setPosition=function(Au,Av){if(!v(Au)){return false}return At.sounds[Au].setPosition(Av)};this.stop=function(Au){if(!v(Au)){return false}return At.sounds[Au].stop()};this.stopAll=function(){for(var Au in At.sounds){if(At.sounds[Au] instanceof AH){At.sounds[Au].stop()}}};this.pause=function(Au){if(!v(Au)){return false}return At.sounds[Au].pause()};this.pauseAll=function(){for(var Au=At.soundIDs.length;Au--;){At.sounds[At.soundIDs[Au]].pause()}};this.resume=function(Au){if(!v(Au)){return false}return At.sounds[Au].resume()};this.resumeAll=function(){for(var Au=At.soundIDs.length;Au--;){At.sounds[At.soundIDs[Au]].resume()}};this.togglePause=function(Au){if(!v(Au)){return false}return At.sounds[Au].togglePause()};this.setPan=function(Au,Av){if(!v(Au)){return false}return At.sounds[Au].setPan(Av)};this.setVolume=function(Av,Au){if(!v(Av)){return false}return At.sounds[Av].setVolume(Au)};this.mute=function(Au){var Aw=AU+".mute(): ",Av=0;if(typeof Au!=="string"){Au=null}if(!Au){for(Av=At.soundIDs.length;Av--;){At.sounds[At.soundIDs[Av]].mute()}At.muted=true}else{if(!v(Au)){return false}return At.sounds[Au].mute()}return true};this.muteAll=function(){At.mute()};this.unmute=function(Au){var Aw=AU+".unmute(): ",Av;if(typeof Au!=="string"){Au=null}if(!Au){for(Av=At.soundIDs.length;Av--;){At.sounds[At.soundIDs[Av]].unmute()}At.muted=false}else{if(!v(Au)){return false}return At.sounds[Au].unmute()}return true};this.unmuteAll=function(){At.unmute()};this.toggleMute=function(Au){if(!v(Au)){return false}return At.sounds[Au].toggleMute()};this.getMemoryUse=function(){if(D===8){return 0}if(At.o){return parseInt(At.o._getMemoryUse(),10)}};this.disable=function(Av){if(typeof Av==="undefined"){Av=false}if(Y){return false}Y=true;for(var Au=At.soundIDs.length;Au--;){AE(At.sounds[At.soundIDs[Au]])}AF(Av);Ai.remove(L,"load",h);return true};this.canPlayMIME=function(Av){var Au;if(At.hasHTML5){Au=f({type:Av})}if(!x||Au){return Au}else{return(Av?(Av.match(At.mimePattern)?true:false):null)}};this.canPlayURL=function(Av){var Au;if(At.hasHTML5){Au=f(Av)}if(!x||Au){return Au}else{return(Av?(Av.match(At.filePattern)?true:false):null)}};this.canPlayLink=function(Au){if(typeof Au.type!=="undefined"&&Au.type){if(At.canPlayMIME(Au.type)){return true}}return At.canPlayURL(Au.href)};this.getSoundById=function(Au,Aw){if(!Au){throw new Error(AU+".getSoundById(): sID is null/undefined")}var Av=At.sounds[Au];if(!Av&&!Aw){}return Av};this.onready=function(Au,Av){var Aw="onready";if(Au&&Au instanceof Function){if(T){}if(!Av){Av=L}Ak(Aw,Au,Av);Aq();return true}else{throw k("needFunction",Aw)}};this.ontimeout=function(Au,Av){var Aw="ontimeout";if(Au&&Au instanceof Function){if(T){}if(!Av){Av=L}Ak(Aw,Au,Av);Aq({type:Aw});return true}else{throw k("needFunction",Aw)}};this.getMoviePercent=function(){return(At.o&&typeof At.o.PercentLoaded!=="undefined"?At.o.PercentLoaded():null)};this._writeDebug=function(Au,Aw,Av){return true};this._wD=this._writeDebug;this._debug=function(){};this.reboot=function(){if(At.soundIDs.length){}var Av,Au;for(Av=At.soundIDs.length;Av--;){At.sounds[At.soundIDs[Av]].destruct()}try{if(E){AG=At.o.innerHTML}An=At.o.parentNode.removeChild(At.o)}catch(Aw){}AG=An=null;At.enabled=T=K=X=AJ=Al=Y=At.swfLoaded=false;At.soundIDs=At.sounds=[];At.o=null;for(Av in AA){if(AA.hasOwnProperty(Av)){for(Au=AA[Av].length;Au--;){AA[Av][Au].fired=false}}}L.setTimeout(function(){At.beginDelayedInit()},20)};this.destruct=function(){At.disable(true)};this.beginDelayedInit=function(){R=true;P();setTimeout(g,20);y()};function AN(Au){return function(Av){if(!this._t||!this._t._a){if(this._t&&this._t.sID){}else{}return null}else{return Au.call(this,Av)}}}this._html5_events={abort:AN(function(Au){}),canplay:AN(function(Aw){this._t._onbufferchange(0);var Av=(!isNaN(this._t.position)?this._t.position/1000:null);this._t._html5_canplay=true;if(this._t.position&&this.currentTime!==Av){try{this.currentTime=Av}catch(Au){}}}),load:AN(function(Au){if(!this._t.loaded){this._t._onbufferchange(0);this._t._whileloading(this._t.bytesTotal,this._t.bytesTotal,this._t._get_html5_duration());this._t._onload(true)}}),emptied:AN(function(Au){}),ended:AN(function(Au){this._t._onfinish()}),error:AN(function(Au){this._t._onload(false)}),loadeddata:AN(function(Au){}),loadedmetadata:AN(function(Au){}),loadstart:AN(function(Au){this._t._onbufferchange(1)}),play:AN(function(Au){this._t._onbufferchange(0)}),playing:AN(function(Au){this._t._onbufferchange(0)}),progress:AN(function(Ay){if(this._t.loaded){return false}var Ax,Av,A0,A2=0,Aw=0,A3=(Ay.type==="progress"),Az=Ay.target.buffered,Au=(Ay.loaded||0),A1=(Ay.total||1);if(Az&&Az.length){for(Ax=Az.length;Ax--;){Aw=(Az.end(Ax)-Az.start(Ax))}Au=Aw/Ay.target.duration;if(A3&&!isNaN(Au)){}}if(!isNaN(Au)){this._t._onbufferchange(0);this._t._whileloading(Au,A1,this._t._get_html5_duration());if(Au&&A1&&Au===A1){At._html5_events.load.call(this,Ay)}}}),ratechange:AN(function(Au){}),suspend:AN(function(Au){At._html5_events.progress.call(this,Au)}),stalled:AN(function(Au){}),timeupdate:AN(function(Au){this._t._onTimer()}),waiting:AN(function(Au){this._t._onbufferchange(1)})};AH=function(Av){var Ax=this,Ay,Au,Aw;this.sID=Av.id;this.url=Av.url;this.options=q(Av);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this._a=null;this.id3={};this._debug=function(){};this._debug();this.load=function(Az){var A0=null;if(typeof Az!=="undefined"){Ax._iO=q(Az,Ax.options);Ax.instanceOptions=Ax._iO}else{Az=Ax.options;Ax._iO=Az;Ax.instanceOptions=Ax._iO;if(Ax._lastURL&&Ax._lastURL!==Ax.url){Ax._iO.url=Ax.url;Ax.url=null}}if(!Ax._iO.url){Ax._iO.url=Ax.url}if(Ax._iO.url===Ax.url&&Ax.readyState!==0&&Ax.readyState!==2){return Ax}Ax._lastURL=Ax.url;Ax.loaded=false;Ax.readyState=1;Ax.playState=0;if(Ab(Ax._iO)){A0=Ax._setup_html5(Ax._iO);if(!A0._called_load){A0.load();A0._called_load=true;if(Ax._iO.autoPlay){Ax.play()}}else{}}else{try{Ax.isHTML5=false;Ax._iO=Af(z(Ax._iO));if(D===8){At.o._load(Ax.sID,Ax._iO.url,Ax._iO.stream,Ax._iO.autoPlay,(Ax._iO.whileloading?1:0),Ax._iO.loops||1,Ax._iO.usePolicyFile)}else{At.o._load(Ax.sID,Ax._iO.url,Ax._iO.stream?true:false,Ax._iO.autoPlay?true:false,Ax._iO.loops||1,Ax._iO.autoLoad?true:false,Ax._iO.usePolicyFile)}}catch(A1){AR()}}return Ax};this.unload=function(){if(Ax.readyState!==0){if(!Ax.isHTML5){if(D===8){At.o._unload(Ax.sID,At.nullURL)}else{At.o._unload(Ax.sID)}}else{Au();if(Ax._a){Ax._a.pause();Ax._a.src=""}}Ay()}return Ax};this.destruct=function(Az){if(!Ax.isHTML5){Ax._iO.onfailure=null;At.o._destroySound(Ax.sID)}else{Au();if(Ax._a){Ax._a.pause();Ax._a.src="";if(!Ah){Ax._remove_html5_events()}}}if(!Az){At.destroySound(Ax.sID,true)}};this.play=function(Az,A2){var A0="SMSound.play(): ",A1;A2=A2===undefined?true:A2;if(!Az){Az={}}Ax._iO=q(Az,Ax._iO);Ax._iO=q(Ax._iO,Ax.options);Ax.instanceOptions=Ax._iO;if(Ax._iO.serverURL){if(!Ax.connected){if(!Ax.getAutoPlay()){Ax.setAutoPlay(true)}return Ax}}if(Ab(Ax._iO)){Ax._setup_html5(Ax._iO);Aw()}if(Ax.playState===1&&!Ax.paused){A1=Ax._iO.multiShot;if(!A1){return Ax}else{if(Ax.isHTML5){Ax.setPosition(Ax._iO.position)}}}if(!Ax.loaded){if(Ax.readyState===0){if(!Ax.isHTML5){Ax._iO.autoPlay=true;Ax.load(Ax._iO)}else{Ax.load(Ax._iO)}}else{if(Ax.readyState===2){return Ax}else{}}}else{}if(Ax.paused&&Ax.position&&Ax.position>0){Ax.resume()}else{Ax.playState=1;Ax.paused=false;if(!Ax.instanceCount||Ax._iO.multiShotEvents||(D>8&&!Ax.isHTML5&&!Ax.getAutoPlay())){Ax.instanceCount++}Ax.position=(typeof Ax._iO.position!=="undefined"&&!isNaN(Ax._iO.position)?Ax._iO.position:0);if(!Ax.isHTML5){Ax._iO=Af(z(Ax._iO))}if(Ax._iO.onplay&&A2){Ax._iO.onplay.apply(Ax);Ax._onplay_called=true}Ax.setVolume(Ax._iO.volume,true);Ax.setPan(Ax._iO.pan,true);if(!Ax.isHTML5){At.o._start(Ax.sID,Ax._iO.loops||1,(D===9?Ax.position:Ax.position/1000))}else{Aw();Ax._setup_html5().play()}}return Ax};this.start=this.play;this.stop=function(Az){if(Ax.playState===1){Ax._onbufferchange(0);Ax.resetOnPosition(0);if(!Ax.isHTML5){Ax.playState=0}Ax.paused=false;if(Ax._iO.onstop){Ax._iO.onstop.apply(Ax)}if(!Ax.isHTML5){At.o._stop(Ax.sID,Az);if(Ax._iO.serverURL){Ax.unload()}}else{if(Ax._a){Ax.setPosition(0);Ax._a.pause();Ax.playState=0;Ax._onTimer();Au();Ax.unload()}}Ax.instanceCount=0;Ax._iO={}}return Ax};this.setAutoPlay=function(Az){Ax._iO.autoPlay=Az;if(Ax.isHTML5){if(Ax._a&&Az){Ax.play()}}else{At.o._setAutoPlay(Ax.sID,Az)}if(Az){if(!Ax.instanceCount&&Ax.readyState===1){Ax.instanceCount++}}};this.getAutoPlay=function(){return Ax._iO.autoPlay};this.setPosition=function(A3,A1){if(A3===undefined){A3=0}var A2,Az,A0,A5=(Ax.isHTML5?Math.max(A3,0):Math.min(Ax.duration||Ax._iO.duration,Math.max(A3,0)));A2=Ax.position;Ax.position=A5;A0=Ax.position/1000;Ax.resetOnPosition(Ax.position);Ax._iO.position=A5;if(!Ax.isHTML5){Az=D===9?Ax.position:A0;if(Ax.readyState&&Ax.readyState!==2){At.o._setPosition(Ax.sID,Az,(Ax.paused||!Ax.playState))}}else{if(Ax._a){if(Ax._html5_canplay){if(Ax._a.currentTime!==A0){try{Ax._a.currentTime=A0}catch(A4){}}}else{}}}if(Ax.isHTML5){if(Ax.paused){Ax._onTimer(true)}}return Ax};this.pause=function(Az){if(Ax.paused||(Ax.playState===0&&Ax.readyState!==1)){return Ax}Ax.paused=true;if(!Ax.isHTML5){if(Az||Az===undefined){At.o._pause(Ax.sID)}}else{Ax._setup_html5().pause();Au()}if(Ax._iO.onpause){Ax._iO.onpause.apply(Ax)}return Ax};this.resume=function(){if(!Ax.paused){return Ax}Ax.paused=false;Ax.playState=1;if(!Ax.isHTML5){if(Ax._iO.isMovieStar){Ax.setPosition(Ax.position)}At.o._pause(Ax.sID)}else{Ax._setup_html5().play();Aw()}if(!Ax._onplay_called&&Ax._iO.onplay){Ax._iO.onplay.apply(Ax);Ax._onplay_called=true}else{if(Ax._iO.onresume){Ax._iO.onresume.apply(Ax)}}return Ax};this.togglePause=function(){if(Ax.playState===0){Ax.play({position:(D===9&&!Ax.isHTML5?Ax.position:Ax.position/1000)});return Ax}if(Ax.paused){Ax.resume()}else{Ax.pause()}return Ax};this.setPan=function(A0,Az){if(typeof A0==="undefined"){A0=0}if(typeof Az==="undefined"){Az=false}if(!Ax.isHTML5){At.o._setPan(Ax.sID,A0)}Ax._iO.pan=A0;if(!Az){Ax.pan=A0;Ax.options.pan=A0}return Ax};this.setVolume=function(Az,A0){if(typeof Az==="undefined"){Az=100}if(typeof A0==="undefined"){A0=false}if(!Ax.isHTML5){At.o._setVolume(Ax.sID,(At.muted&&!Ax.muted)||Ax.muted?0:Az)}else{if(Ax._a){Ax._a.volume=Math.max(0,Math.min(1,Az/100))}}Ax._iO.volume=Az;if(!A0){Ax.volume=Az;Ax.options.volume=Az}return Ax};this.mute=function(){Ax.muted=true;if(!Ax.isHTML5){At.o._setVolume(Ax.sID,0)}else{if(Ax._a){Ax._a.muted=true}}return Ax};this.unmute=function(){Ax.muted=false;var Az=typeof Ax._iO.volume!=="undefined";if(!Ax.isHTML5){At.o._setVolume(Ax.sID,Az?Ax._iO.volume:Ax.options.volume)}else{if(Ax._a){Ax._a.muted=false}}return Ax};this.toggleMute=function(){return(Ax.muted?Ax.unmute():Ax.mute())};this.onposition=function(A0,Az,A1){Ax._onPositionItems.push({position:A0,method:Az,scope:(typeof A1!=="undefined"?A1:Ax),fired:false});return Ax};this.processOnPosition=function(){var A0,A1,Az=Ax._onPositionItems.length;if(!Az||!Ax.playState||Ax._onPositionFired>=Az){return false}for(A0=Az;A0--;){A1=Ax._onPositionItems[A0];if(!A1.fired&&Ax.position>=A1.position){A1.method.apply(A1.scope,[A1.position]);A1.fired=true;At._onPositionFired++}}return true};this.resetOnPosition=function(A1){var A0,A2,Az=Ax._onPositionItems.length;if(!Az){return false}for(A0=Az;A0--;){A2=Ax._onPositionItems[A0];if(A2.fired&&A1<=A2.position){A2.fired=false;At._onPositionFired--}}return true};this._onTimer=function(A0){var A1,Az={};if(Ax._hasTimer||A0){if(Ax._a&&(A0||((Ax.playState>0||Ax.readyState===1)&&!Ax.paused))){Ax.duration=Ax._get_html5_duration();Ax.durationEstimate=Ax.duration;A1=Ax._a.currentTime?Ax._a.currentTime*1000:0;Ax._whileplaying(A1,Az,Az,Az,Az);return true}else{return false}}};this._get_html5_duration=function(){var Az=(Ax._a?Ax._a.duration*1000:(Ax._iO?Ax._iO.duration:undefined));return(Az&&!isNaN(Az)&&Az!==Infinity?Az:(Ax._iO?Ax._iO.duration:null))};Aw=function(){if(Ax.isHTML5){Ag(Ax)}};Au=function(){if(Ax.isHTML5){e(Ax)}};Ay=function(Az){Ax._onPositionItems=[];Ax._onPositionFired=0;Ax._hasTimer=null;Ax._onplay_called=false;Ax._a=null;Ax._html5_canplay=false;Ax.bytesLoaded=null;Ax.bytesTotal=null;Ax.position=null;Ax.duration=(Ax._iO&&Ax._iO.duration?Ax._iO.duration:null);Ax.durationEstimate=null;Ax.failures=0;Ax.loaded=false;Ax.playState=0;Ax.paused=false;Ax.readyState=0;Ax.muted=false;Ax.didBeforeFinish=false;Ax.didJustBeforeFinish=false;Ax.isBuffering=false;Ax.instanceOptions={};Ax.instanceCount=0;Ax.peakData={left:0,right:0};Ax.waveformData={left:[],right:[]};Ax.eqData=[];Ax.eqData.left=[];Ax.eqData.right=[]};Ay();this._setup_html5=function(A0){var Az=q(Ax._iO,A0),A4=decodeURI,A2=Ah?At._global_a:Ax._a,A3=A4(Az.url),A1=(A2&&A2._t?A2._t.instanceOptions:null);if(A2){if(A2._t&&A1.url===Az.url&&(!Ax._lastURL||(Ax._lastURL===A1.url))){return A2}if(Ah&&A2._t&&A2._t.playState&&Az.url!==A1.url){A2._t.stop()}Ay();A2.src=Az.url;Ax.url=Az.url;Ax._lastURL=Az.url;A2._called_load=false}else{A2=new Audio(Az.url);A2._called_load=false;if(Ah){At._global_a=A2}}Ax.isHTML5=true;Ax._a=A2;A2._t=Ax;Ax._add_html5_events();A2.loop=(Az.loops>1?"loop":"");if(Az.autoLoad||Az.autoPlay){A2.autobuffer="auto";A2.preload="auto";Ax.load();A2._called_load=true}else{A2.autobuffer=false;A2.preload="none"}A2.loop=(Az.loops>1?"loop":"");return A2};this._add_html5_events=function(){if(Ax._a._added_events){return false}var Az;function A0(A2,A1,A3){return Ax._a?Ax._a.addEventListener(A2,A1,A3||false):null}Ax._a._added_events=true;for(Az in At._html5_events){if(At._html5_events.hasOwnProperty(Az)){A0(Az,At._html5_events[Az])}}return true};this._remove_html5_events=function(){function A0(A2,A1,A3){return(Ax._a?Ax._a.removeEventListener(A2,A1,A3||false):null)}Ax._a._added_events=false;for(var Az in At._html5_events){if(At._html5_events.hasOwnProperty(Az)){A0(Az,At._html5_events[Az])}}};this._whileloading=function(A0,Az,A2,A1){Ax.bytesLoaded=A0;Ax.bytesTotal=Az;Ax.duration=Math.floor(A2);Ax.bufferLength=A1;if(!Ax._iO.isMovieStar){if(Ax._iO.duration){Ax.durationEstimate=(Ax.duration>Ax._iO.duration)?Ax.duration:Ax._iO.duration}else{Ax.durationEstimate=parseInt((Ax.bytesTotal/Ax.bytesLoaded)*Ax.duration,10)}if(Ax.durationEstimate===undefined){Ax.durationEstimate=Ax.duration}if(Ax.readyState!==3&&Ax._iO.whileloading){Ax._iO.whileloading.apply(Ax)}}else{Ax.durationEstimate=Ax.duration;if(Ax.readyState!==3&&Ax._iO.whileloading){Ax._iO.whileloading.apply(Ax)}}};this._onid3=function(A2,A1){var A3=[],A0,Az;for(A0=0,Az=A2.length;A0<Az;A0++){A3[A2[A0]]=A1[A0]}Ax.id3=q(Ax.id3,A3);if(Ax._iO.onid3){Ax._iO.onid3.apply(Ax)}};this._whileplaying=function(A1,Az,A4,A0,A3){if(isNaN(A1)||A1===null){return false}if(Ax.playState===0&&A1>0){A1=0}Ax.position=A1;Ax.processOnPosition();if(D>8&&!Ax.isHTML5){if(Ax._iO.usePeakData&&typeof Az!=="undefined"&&Az){Ax.peakData={left:Az.leftPeak,right:Az.rightPeak}}if(Ax._iO.useWaveformData&&typeof A4!=="undefined"&&A4){Ax.waveformData={left:A4.split(","),right:A0.split(",")}}if(Ax._iO.useEQData){if(typeof A3!=="undefined"&&A3&&A3.leftEQ){var A2=A3.leftEQ.split(",");Ax.eqData=A2;Ax.eqData.left=A2;if(typeof A3.rightEQ!=="undefined"&&A3.rightEQ){Ax.eqData.right=A3.rightEQ.split(",")}}}}if(Ax.playState===1){if(!Ax.isHTML5&&At.flashVersion===8&&!Ax.position&&Ax.isBuffering){Ax._onbufferchange(0)}if(Ax._iO.whileplaying){Ax._iO.whileplaying.apply(Ax)}if((Ax.loaded||(!Ax.loaded&&Ax._iO.isMovieStar))&&Ax._iO.onbeforefinish&&Ax._iO.onbeforefinishtime&&!Ax.didBeforeFinish&&Ax.duration-Ax.position<=Ax._iO.onbeforefinishtime){Ax._onbeforefinish()}}return true};this._onconnect=function(A0){var Az="SMSound._onconnect(): ";A0=(A0===1);Ax.connected=A0;if(A0){Ax.failures=0;if(v(Ax.sID)){if(Ax.getAutoPlay()){Ax.play(undefined,Ax.getAutoPlay())}else{if(Ax._iO.autoLoad){Ax.load()}}}if(Ax._iO.onconnect){Ax._iO.onconnect.apply(Ax,[A0])}}};this._onload=function(A1){var A0="SMSound._onload(): ",Az=(A1?true:false);Ax.loaded=Az;Ax.readyState=Az?3:2;Ax._onbufferchange(0);if(Ax._iO.onload){Ax._iO.onload.apply(Ax,[Az])}return true};this._onfailure=function(A0,A1,Az){Ax.failures++;if(Ax._iO.onfailure&&Ax.failures===1){Ax._iO.onfailure(Ax,A0,A1,Az)}else{}};this._onbeforefinish=function(){if(!Ax.didBeforeFinish){Ax.didBeforeFinish=true;if(Ax._iO.onbeforefinish){Ax._iO.onbeforefinish.apply(Ax)}}};this._onjustbeforefinish=function(Az){if(!Ax.didJustBeforeFinish){Ax.didJustBeforeFinish=true;if(Ax._iO.onjustbeforefinish){Ax._iO.onjustbeforefinish.apply(Ax)}}};this._onfinish=function(){var Az=Ax._iO.onfinish;Ax._onbufferchange(0);Ax.resetOnPosition(0);if(Ax._iO.onbeforefinishcomplete){Ax._iO.onbeforefinishcomplete.apply(Ax)}Ax.didBeforeFinish=false;Ax.didJustBeforeFinish=false;if(Ax.instanceCount){Ax.instanceCount--;if(!Ax.instanceCount){Ax.playState=0;Ax.paused=false;Ax.instanceCount=0;Ax.instanceOptions={};Ax._iO={};Au()}if(!Ax.instanceCount||Ax._iO.multiShotEvents){if(Az){Az.apply(Ax)}}}};this._onbufferchange=function(A0){var Az="SMSound._onbufferchange()";if(Ax.playState===0){return false}if((A0&&Ax.isBuffering)||(!A0&&!Ax.isBuffering)){return false}Ax.isBuffering=(A0===1);if(Ax._iO.onbufferchange){Ax._iO.onbufferchange.apply(Ax)}return true};this._ondataerror=function(Az){if(Ax.playState>0){if(Ax._iO.ondataerror){Ax._iO.ondataerror.apply(Ax)}}}};m=function(){return(Aa.body?Aa.body:(Aa._docElement?Aa.documentElement:Aa.getElementsByTagName("div")[0]))};l=function(Au){return Aa.getElementById(Au)};q=function(Av,Au){var Ay={},Aw,Ax,Az;for(Aw in Av){if(Av.hasOwnProperty(Aw)){Ay[Aw]=Av[Aw]}}Ax=(typeof Au==="undefined"?At.defaultOptions:Au);for(Az in Ax){if(Ax.hasOwnProperty(Az)&&typeof Ay[Az]==="undefined"){Ay[Az]=Ax[Az]}}return Ay};Ai=(function(){var Aw=(L.attachEvent),Av={add:(Aw?"attachEvent":"addEventListener"),remove:(Aw?"detachEvent":"removeEventListener")};function Au(A2){var A1=G.call(A2),A0=A1.length;if(Aw){A1[1]="on"+A1[1];if(A0>3){A1.pop()}}else{if(A0===3){A1.push(false)}}return A1}function Ax(A1,A3){var A0=A1.shift(),A2=[Av[A3]];if(Aw){A0[A2](A1[0],A1[1])}else{A0[A2].apply(A0,A1)}}function Az(){Ax(Au(arguments),"add")}function Ay(){Ax(Au(arguments),"remove")}return{"add":Az,"remove":Ay}}());Ab=function(Au){return(!Au.serverURL&&(Au.type?f({type:Au.type}):f(Au.url)||Ar))};f=function(Az){if(!At.useHTML5Audio||!At.hasHTML5){return false}var Ay,Ax,A0,Av,Aw,Au=At.audioFormats;if(!Am){Am=[];for(Aw in Au){if(Au.hasOwnProperty(Aw)){Am.push(Aw);if(Au[Aw].related){Am=Am.concat(Au[Aw].related)}}}Am=new RegExp("\\.("+Am.join("|")+")","i")}Ax=(typeof Az.type!=="undefined"?Az.type:null);Av=(typeof Az==="string"?Az.toLowerCase().match(Am):null);if(!Av||!Av.length){if(!Ax){return false}else{A0=Ax.indexOf(";");Av=(A0!==-1?Ax.substr(0,A0):Ax).substr(6)}}else{Av=Av[0].substr(1)}if(Av&&typeof At.html5[Av]!=="undefined"){return At.html5[Av]}else{if(!Ax){if(Av&&At.html5[Av]){return At.html5[Av]}else{Ax="audio/"+Av}}Ay=At.html5.canPlayType(Ax);At.html5[Av]=Ay;return Ay}};Ao=function(){if(!At.useHTML5Audio||typeof Audio==="undefined"){return false}var Av=(typeof Audio!=="undefined"?(a?new Audio(null):new Audio()):null),A0,Ay={},Ax,Az,Au=N();function Aw(A2){var A4,A5,A3,A1=false;if(!Av||typeof Av.canPlayType!=="function"){return false}if(A2 instanceof Array){for(A5=0,A3=A2.length;A5<A3&&!A1;A5++){if(At.html5[A2[A5]]||Av.canPlayType(A2[A5]).match(At.html5Test)){A1=true;At.html5[A2[A5]]=true}}return A1}else{A4=(Av&&typeof Av.canPlayType==="function"?Av.canPlayType(A2):false);return(A4&&(A4.match(At.html5Test)?true:false))}}Ax=At.audioFormats;for(A0 in Ax){if(Ax.hasOwnProperty(A0)){Ay[A0]=Aw(Ax[A0].type);if(Ax[A0]&&Ax[A0].related){for(Az=Ax[A0].related.length;Az--;){At.html5[Ax[A0].related[Az]]=Ay[A0]}}}}Ay.canPlayType=(Av?Aw:null);At.html5=q(At.html5,Ay);return true};b={};k=function(){};z=function(Au){if(D===8&&Au.loops>1&&Au.stream){Au.stream=false}return Au};Af=function(Av,Au){if(Av&&!Av.usePolicyFile&&(Av.onid3||Av.usePeakData||Av.useWaveformData||Av.useEQData)){Av.usePolicyFile=true}return Av};J=function(Au){if(typeof console!=="undefined"&&typeof console.warn!=="undefined"){console.warn(Au)}else{}};s=function(){return false};AE=function(Av){for(var Au in Av){if(Av.hasOwnProperty(Au)&&typeof Av[Au]==="function"){Av[Au]=s}}Au=null};AC=function(Au){if(typeof Au==="undefined"){Au=false}if(Y||Au){At.disable(Au)}};H=function(Au){var Av=null;if(Au){if(Au.match(/\.swf(\?.*)?$/i)){Av=Au.substr(Au.toLowerCase().lastIndexOf(".swf?")+4);if(Av){return Au}}else{if(Au.lastIndexOf("/")!==Au.length-1){Au=Au+"/"}}}return(Au&&Au.lastIndexOf("/")!==-1?Au.substr(0,Au.lastIndexOf("/")+1):"./")+At.movieURL};AQ=function(){if(D!==8&&D!==9){At.flashVersion=AL}var Au=(At.debugMode||At.debugFlash?"_debug.swf":".swf");if(At.useHTML5Audio&&!Ar&&At.audioFormats.mp4.required&&At.flashVersion<9){At.flashVersion=9}D=At.flashVersion;At.version=At.versionNumber+(Ar?" (HTML5-only mode)":(D===9?" (AS3/Flash 9)":" (AS2/Flash 8)"));if(D>8){At.defaultOptions=q(At.defaultOptions,At.flash9Options);At.features.buffering=true}if(D>8&&At.useMovieStar){At.defaultOptions=q(At.defaultOptions,At.movieStarOptions);At.filePatterns.flash9=new RegExp("\\.(mp3|"+At.netStreamTypes.join("|")+")(\\?.*)?$","i");At.mimePattern=At.netStreamMimeTypes;At.features.movieStar=true}else{At.useMovieStar=false;At.features.movieStar=false}At.filePattern=At.filePatterns[(D!==8?"flash9":"flash8")];At.movieURL=(D===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",Au);At.features.peakData=At.features.waveformData=At.features.eqData=(D>8)};o=function(Au,Av){if(!At.o||!At.allowPolling){return false}At.o._setPolling(Au,Av)};function AV(){if(At.debugURLParam.test(M)){At.debugMode=true}}S=function(A9,Az){var BC=null,A8=(Az?Az:At.url),A2=(At.altURL?At.altURL:A8),A4,Au,BA=m(),BD,A5,A1,A6=AP(),A0,Ax,A3,Av="100%",Aw=null,Ay=Aa.getElementsByTagName("html")[0];Aw=(Ay&&Ay.dir&&Ay.dir.match(/rtl/i));A9=(typeof A9==="undefined"?At.id:A9);if(AJ&&Al){return false}function A7(){}if(Ar){AQ();A7();At.oMC=l(At.movieID);AM();AJ=true;Al=true;return false}AJ=true;AQ();At.url=H(At._overHTTP?A8:A2);Az=At.url;At.wmode=(!At.wmode&&At.useHighPerformance&&!At.useMovieStar?"transparent":At.wmode);if(At.wmode!==null&&(r.match(/msie 8/i)||(!E&&!At.useHighPerformance))&&navigator.platform.match(/win32|win64/i)){At.specialWmodeCase=true;At.wmode=null}A4={"name":A9,"id":A9,"src":Az,"width":Av,"height":Av,"quality":"high","allowScriptAccess":At.allowScriptAccess,"bgcolor":At.bgColor,"pluginspage":At._http+"//www.macromedia.com/go/getflashplayer","type":"application/x-shockwave-flash","wmode":At.wmode,"hasPriority":"true"};if(At.debugFlash){A4.FlashVars="debug=1"}if(!At.wmode){delete A4.wmode}if(E){Au=Aa.createElement("div");A5='<object id="'+A9+'" data="'+Az+'" type="'+A4.type+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+At._http+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+A4.width+'" height="'+A4.height+'"><param name="movie" value="'+Az+'" /><param name="AllowScriptAccess" value="'+At.allowScriptAccess+'" /><param name="quality" value="'+A4.quality+'" />'+(At.wmode?'<param name="wmode" value="'+At.wmode+'" /> ':"")+'<param name="bgcolor" value="'+At.bgColor+'" />'+(At.debugFlash?'<param name="FlashVars" value="'+A4.FlashVars+'" />':"")+"</object>"}else{Au=Aa.createElement("embed");for(BD in A4){if(A4.hasOwnProperty(BD)){Au.setAttribute(BD,A4[BD])}}}AV();A6=AP();BA=m();if(BA){At.oMC=l(At.movieID)?l(At.movieID):Aa.createElement("div");if(!At.oMC.id){At.oMC.id=At.movieID;At.oMC.className=At.swfCSS.swfDefault+" "+A6;A0=null;A1=null;if(!At.useFlashBlock){if(At.useHighPerformance){A0={"position":"fixed","width":"8px","height":"8px","bottom":"0px","left":"0px","overflow":"hidden"}}else{A0={"position":"absolute","width":"6px","height":"6px","top":"-9999px","left":"-9999px"};if(Aw){A0.left=Math.abs(parseInt(A0.left,10))+"px"}}}if(Ap){At.oMC.style.zIndex=10000}if(!At.debugFlash){for(Ax in A0){if(A0.hasOwnProperty(Ax)){At.oMC.style[Ax]=A0[Ax]}}}try{if(!E){At.oMC.appendChild(Au)}BA.appendChild(At.oMC);if(E){A1=At.oMC.appendChild(Aa.createElement("div"));A1.className=At.swfCSS.swfBox;A1.innerHTML=A5}Al=true}catch(BB){throw new Error(k("appXHTML"))}}else{A3=At.oMC.className;At.oMC.className=(A3?A3+" ":At.swfCSS.swfDefault)+(A6?" "+A6:"");At.oMC.appendChild(Au);if(E){A1=At.oMC.appendChild(Aa.createElement("div"));A1.className=At.swfCSS.swfBox;A1.innerHTML=A5}Al=true}}if(BC){}A7();return true};v=this.getSoundById;Aj=function(){if(Ar){S();return false}if(At.o){return false}At.o=At.getMovie(At.id);if(!At.o){if(!An){S(At.id,At.url)}else{if(!E){At.oMC.appendChild(An)}else{At.oMC.innerHTML=AG}An=null;AJ=true}At.o=At.getMovie(At.id)}if(At.o){}if(At.oninitmovie instanceof Function){setTimeout(At.oninitmovie,1)}return true};AK=function(Au){if(Au){At.url=Au}Aj()};y=function(){setTimeout(Q,500)};Q=function(){if(K){return false}K=true;Ai.remove(L,"load",y);if(w&&!Ac){return false}var Au;if(!T){Au=At.getMoviePercent()}setTimeout(function(){Au=At.getMoviePercent();if(!T){if(!At._overHTTP&&Au){if(!At.debugFlash){}}if(Au===0){}}if(!T&&AT){if(Au===null){if(At.useFlashBlock||At.flashLoadTimeout===0){if(At.useFlashBlock){I()}}else{AC(true)}}else{if(At.flashLoadTimeout===0){}else{AC(true)}}}},At.flashLoadTimeout)};AK=function(Au){if(Au){At.url=Au}Aj()};AP=function(){var Au=[];if(At.debugMode){Au.push(At.swfCSS.sm2Debug)}if(At.debugFlash){Au.push(At.swfCSS.flashDebug)}if(At.useHighPerformance){Au.push(At.swfCSS.highPerf)}return Au.join(" ")};I=function(){var Au=k("fbHandler"),Aw=At.getMoviePercent(),Av=At.swfCSS;if(!At.ok()){if(x){At.oMC.className=AP()+" "+Av.swfDefault+" "+(Aw===null?Av.swfTimedout:Av.swfError)}At.didFlashBlock=true;Aq({type:"ontimeout",ignoreInit:true});if(At.onerror instanceof Function){At.onerror.apply(L)}}else{if(At.didFlashBlock){}if(At.oMC){At.oMC.className=[AP(),Av.swfDefault,Av.swfLoaded+(At.didFlashBlock?" "+Av.swfUnblocked:"")].join(" ")}}};AX=function(){function Au(){Ai.remove(L,"focus",AX);Ai.remove(L,"load",AX)}if(Ac||!w){Au();return true}AT=true;Ac=true;if(AZ&&w){Ai.remove(L,"mousemove",AX)}K=false;Au();return true};AF=function(Aw){if(T){return false}if(Ar){T=true;Aq();h();return true}var Av=At.oMC.className,Au=(At.useFlashBlock&&At.flashLoadTimeout&&!At.getMoviePercent());if(!Au){T=true}if(Y||Aw){if(At.useFlashBlock){At.oMC.className=AP()+" "+(At.getMoviePercent()===null?At.swfCSS.swfTimedout:At.swfCSS.swfError)}Aq({type:"ontimeout"});if(At.onerror instanceof Function){At.onerror.apply(L)}return false}else{}Ai.add(L,"unload",s);if(At.waitForWindowLoad&&!R){Ai.add(L,"load",h);return false}else{if(At.waitForWindowLoad&&R){}h()}return true};Ak=function(Aw,Au,Av){if(typeof AA[Aw]==="undefined"){AA[Aw]=[]}AA[Aw].push({"method":Au,"scope":(Av||null),"fired":false})};Aq=function(Aw){if(!Aw){Aw={type:"onready"}}if(!T&&Aw&&!Aw.ignoreInit){return false}var Az={success:(Aw&&Aw.ignoreInit?At.ok():!Y)},A0=(Aw&&Aw.type?AA[Aw.type]||[]:[]),Au=[],Ay,Av,Ax=(x&&At.useFlashBlock&&!At.ok());for(Ay=0;Ay<A0.length;Ay++){if(A0[Ay].fired!==true){Au.push(A0[Ay])}}if(Au.length){for(Ay=0,Av=Au.length;Ay<Av;Ay++){if(Au[Ay].scope){Au[Ay].method.apply(Au[Ay].scope,[Az])}else{Au[Ay].method(Az)}if(!Ax){Au[Ay].fired=true}}}return true};h=function(){L.setTimeout(function(){if(At.useFlashBlock){I()}Aq();if(At.onload instanceof Function){At.onload.apply(L)}if(At.waitForWindowLoad){Ai.add(L,"load",h)}},1)};N=function(){if(F!==undefined){return F}var Aw=false,A1=navigator,Ax=A1.plugins,A0,Av,Au,Az=L.ActiveXObject;if(Ax&&Ax.length){Av="application/x-shockwave-flash";Au=A1.mimeTypes;if(Au&&Au[Av]&&Au[Av].enabledPlugin&&Au[Av].enabledPlugin.description){Aw=true}}else{if(typeof Az!=="undefined"){try{A0=new Az("ShockwaveFlash.ShockwaveFlash")}catch(Ay){}Aw=(!!A0)}}F=Aw;return Aw};u=function(){var Au,Aw,Av=(r.match(/iphone os (1|2|3_0|3_1)/i)?true:false);if(Av){At.hasHTML5=false;Ar=true;if(At.oMC){At.oMC.style.display="none"}return false}if(At.useHTML5Audio){if(!At.html5||!At.html5.canPlayType){At.hasHTML5=false;return true}else{At.hasHTML5=true}if(AB){if(N()){return true}}}else{return true}for(Aw in At.audioFormats){if(At.audioFormats.hasOwnProperty(Aw)&&At.audioFormats[Aw].required&&!At.html5.canPlayType(At.audioFormats[Aw].type)){Au=true}}if(At.ignoreFlash){Au=false}Ar=(At.useHTML5Audio&&At.hasHTML5&&!Au&&!At.requireFlash);return(N()&&Au)};AM=function(){var Aw,Av=[];if(T){return false}function Au(){Ai.remove(L,"load",At.beginDelayedInit)}if(At.hasHTML5){for(Aw in At.audioFormats){if(At.audioFormats.hasOwnProperty(Aw)){Av.push(Aw+": "+At.html5[Aw])}}}if(Ar){if(!T){Au();At.enabled=true;AF()}return true}Aj();try{At.o._externalInterfaceTest(false);if(!At.allowPolling){}else{o(true,At.flashPollingInterval?At.flashPollingInterval:(At.useFastPolling?10:50))}if(!At.debugMode){At.o._disableDebug()}At.enabled=true}catch(Ax){AC(true);AF();return false}AF();Au();return true};g=function(){if(X){return false}S();Aj();X=true;return true};P=function(){if(AS){return false}AS=true;AV();if(!At.useHTML5Audio){if(!N()){At.useHTML5Audio=true}}Ao();At.html5.usingFlash=u();x=At.html5.usingFlash;AS=true;if(Aa.removeEventListener){Aa.removeEventListener("DOMContentLoaded",P,false)}AK();return true};Ag=function(Au){if(!Au._hasTimer){Au._hasTimer=true}};e=function(Au){if(Au._hasTimer){Au._hasTimer=false}};AR=function(){if(At.onerror instanceof Function){At.onerror()}At.disable()};n=function(){if(!AB||!N()){return false}var Au=At.audioFormats,Av,Aw;for(Aw in Au){if(Au.hasOwnProperty(Aw)){if(Aw==="mp3"||Aw==="mp4"){At.html5[Aw]=false;if(Au[Aw]&&Au[Aw].related){for(Av=Au[Aw].related.length;Av--;){At.html5[Au[Aw].related[Av]]=false}}}}}};this._setSandboxType=function(Au){};this._externalInterfaceOK=function(Au){if(At.swfLoaded){return false}var Av=new Date().getTime();At.swfLoaded=true;w=false;if(AB){n()}if(E){setTimeout(AM,100)}else{AM()}};d=function(){if(Aa.readyState==="complete"){P();Aa.detachEvent("onreadystatechange",d)}return true};if(!At.hasHTML5||x){Ai.add(L,"focus",AX);Ai.add(L,"load",AX);Ai.add(L,"load",y);if(AZ&&w){Ai.add(L,"mousemove",AX)}}if(Aa.addEventListener){Aa.addEventListener("DOMContentLoaded",P,false)}else{if(Aa.attachEvent){Aa.attachEvent("onreadystatechange",d)}else{AR()}}if(Aa.readyState==="complete"){setTimeout(P,100)}}if(typeof SM2_DEFER==="undefined"||!SM2_DEFER){C=new B()}A.SoundManager=B;A.soundManager=C}(window));if(!Control){var Control={}}Control.Slider=Class.create();Control.Slider.prototype={initialize:function(A,C,D){var B=this;if(A instanceof Array){this.handles=A.collect(function(E){return $(E)})}else{this.handles=[$(A)]}this.track=$(C);this.options=D||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(E){return $(E)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(F,E){E=B.handles.length-1-E;B.setValue(parseFloat((B.options.sliderValue instanceof Array?B.options.sliderValue[E]:B.options.sliderValue)||B.range.start),E);Element.makePositioned(F);Event.observe(F,"mousedown",B.eventMouseDown)});Event.observe(this.track,"mousedown",this.eventMouseDown);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var A=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(B){Event.stopObserving(B,"mousedown",A.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(A){if(this.allowedValues){if(A>=this.allowedValues.max()){return(this.allowedValues.max())}if(A<=this.allowedValues.min()){return(this.allowedValues.min())}var C=Math.abs(this.allowedValues[0]-A);var B=this.allowedValues[0];this.allowedValues.each(function(D){var E=Math.abs(D-A);if(E<=C){B=D;C=E}});return B}if(A>this.range.end){return this.range.end}if(A<this.range.start){return this.range.start}return A},setValue:function(B,A){if(!this.active){this.activeHandleIdx=A||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}A=A||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((A>0)&&(B<this.values[A-1])){B=this.values[A-1]}if((A<(this.handles.length-1))&&(B>this.values[A+1])){B=this.values[A+1]}}B=this.getNearestValue(B);this.values[A]=B;this.value=this.values[0];this.handles[A].style[this.isVertical()?"top":"left"]=this.translateToPx(B);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(B,A){this.setValue(this.values[A||this.activeHandleIdx||0]+B,A||this.activeHandleIdx||0)},translateToPx:function(A){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(A-this.range.start))+"px"},translateToValue:function(A){return((A/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(B){var A=this.values.sortBy(Prototype.K);B=B||0;return $R(A[B],A[B+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignY)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var A=this;if(this.spans){$R(0,this.spans.length-1).each(function(B){A.setSpan(A.spans[B],A.getRange(B))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(B,A){if(this.isVertical()){B.style.top=this.translateToPx(A.start);B.style.height=this.translateToPx(A.end-A.start+this.range.start)}else{B.style.left=this.translateToPx(A.start);B.style.width=this.translateToPx(A.end-A.start+this.range.start)}},updateStyles:function(){this.handles.each(function(A){Element.removeClassName(A,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(D){if(Event.isLeftClick(D)){if(!this.disabled){this.active=true;var A=Event.element(D);var E=[Event.pointerX(D),Event.pointerY(D)];var C=A;if(C==this.track){var B=Position.cumulativeOffset(this.track);this.event=D;this.setValue(this.translateToValue((this.isVertical()?E[1]-B[1]:E[0]-B[0])-(this.handleLength/2)));var B=Position.cumulativeOffset(this.activeHandle);this.offsetX=(E[0]-B[0]);this.offsetY=(E[1]-B[1])}else{while((this.handles.indexOf(A)==-1)&&A.parentNode){A=A.parentNode}if(this.handles.indexOf(A)!=-1){this.activeHandle=A;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var B=Position.cumulativeOffset(this.activeHandle);this.offsetX=(E[0]-B[0]);this.offsetY=(E[1]-B[1])}}}Event.stop(D)}},update:function(A){if(this.active){if(!this.dragging){this.dragging=true}this.draw(A);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(A)}},draw:function(B){var C=[Event.pointerX(B),Event.pointerY(B)];var A=Position.cumulativeOffset(this.track);C[0]-=this.offsetX+A[0];C[1]-=this.offsetY+A[1];this.event=B;this.setValue(this.translateToValue(this.isVertical()?C[1]:C[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(A){if(this.active&&this.dragging){this.finishDrag(A,true);Event.stop(A)}this.active=false;this.dragging=false},finishDrag:function(A,B){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}};Jamendo.classes.Player=Class.create({playlistIndex:0,volume:0.75,volumeSetFromSession:false,position:0,positionSeconds:0,trackData:{},onReadies:[],ajaxcall_lasttime:0,_isReady:false,lastPlayData:{},initialize:function(){this.isReady()},play:function(A,B){this.get2playlist=A;this.get2context=B;return true},isReady:function(){this._isReady=true;this.onReadies.each(function(A){A()});this.onReadies=[]},onReady:function(A){if(this._isReady){return A()}else{this.onReadies.push(A)}return false},pause:function(){Jamendo.sendEventDefered(["jamplayer3","pause"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex})},stop:function(){this.pause();this.setPosition(0);this.seek(0)},setVolume:function(A,B){this.volume=A;if(!B){this.rememberVolume()}},rememberVolume:function(){if(this.ajaxvolcall&&typeof (this.ajaxvolcall.abort)=="function"){this.ajaxvolcall.abort()}this.ajaxvolcall=Jamendo.writeApi("player_prefs",["volume",this.volume],Prototype.K,Prototype.K,{"timeout":10000})},restoreRememberedVolume:function(){if(this.ajaxvolcall&&typeof (this.ajaxvolcall.abort)=="function"){this.ajaxvolcall.abort()}this.ajaxvolcall=Jamendo.writeApi("player_prefs",["volume"],function(A){if(A!=""){this.volume=A}this.volumeSetFromSession=true}.bind(this),Prototype.K,{"timeout":10000})},setPosition:function(A){this.position=A;this.positionSeconds=A*this.trackData["duration"];Jamendo.sendEventDefered(["jamplayer3","seek"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex,"position":this.positionSeconds})},setPositionSeconds:function(A){this.setPosition(A/this.trackData["duration"])},seek:function(A){},playlistFetch:function(F,K,J,H,C){if(this.ajaxcall&&this.ajaxcall.abort){this.ajaxcall.abort()}var E=0;var D=/\#.*$/.exec(F);if(D&&D.length>0){E=D[0].sub("#","")}F=F.sub(/\#.*$/,"");if(K){var D=/\#.*$/.exec(K);if(D&&D.length>0){E=D[0].sub("#","")}K=K.sub(/\#.*$/,"")}if(!isNaN(parseInt(K))){E=parseInt(K)}var I=Jamendo.get2parse(F);var B=K?Jamendo.get2parse(K):false;I["position"]=E;if(J["targets"]){I["targets"]=J["targets"]}if(J["relations"]){I["relations"]=I["relations"].concat(J["relations"])}if(J["params"]){I["params"].update(J["params"])}if(B["unit"]=="radio"){I["targets"].push("radioposition")}var A=Jamendo.get2unparse(I);this.lastPlayData={"playlist":F,"context":K,"playlist_overwrite":J,"playlist_parsed":I,"context_parsed":B};var G={};this.ajaxcall_lasttime=new Date();this.ajaxcall=Jamendo.writeApi("jscached widget_data",["jamplayer3",A,K,"",G],function(L){H(L,I["position"])},C,{"timeout":15000})},playlistSet:function(A){this.playlist=A},playlistAdd:function(A){this.playlistSet(this.playlist.concat(A))},playlistSeek:function(A){this.playlistIndex=A;Jamendo.sendEventDefered(["jamplayer3","playlist","seek"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex});if(this.lastPlayData["context_parsed"]["unit"]=="radio"){if(this.playlistIndex+1==this.playlist.length){var B=this.lastPlayData["playlist_overwrite"];B["params"]["radioposition"]=this.playlist[this.playlistIndex]["radioposition"]+1;this.playlistFetch(this.lastPlayData["playlist"],this.lastPlayData["context"],B,function(D,C){this.playlistAdd(D.tracks)}.bind(this),function(C){Jamendo.log("widget_data radio error : "+C)})}}},playlistNext:function(){this.playlistStop();this.playlistSeek((this.playlistIndex+1)%this.playlist.length);this.playlistPlay()},playlistPrev:function(){this.playlistStop();this.playlistIndex=(this.playlist.length+this.playlistIndex-1)%this.playlist.length;this.playlistPlay()},playlistPlay:function(){this.trackData=this.playlist[this.playlistIndex];var A=this.playTrack(this.playlist[this.playlistIndex]);if(A){Jamendo.sendEventDefered(["jamplayer3","play"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex})}},playlistStop:function(){this.stop()},playlistPause:function(){this.pause()},getFallbackStream:function(B,A){return"http://api.jamendo.com/get2/stream/track/redirect/?id="+B+"&streamencoding="+(A||"mp31")},guiWait:function(){}});Jamendo.classes.Player_jamplayer3inpage=Class.create(Jamendo.classes.Player,{guiInserted:false,isPlaying:false,guiTrackData:{},guiVolume:0,guiPosition:0,guiIsPlaying:false,guiImageShown:false,blockPositionUpdate:false,broadcastEventsWhilePlaying:false,guiSerial:-1,sendGuiSerial:0,guiIsWaiting:false,sm2rebooted:false,volumeSetFromSession:false,settings:{"imageSize":100,"htmlElement":"","streamencoding":"mp31","templates":{},"autoNext":true,"swfUrl":Jamendo.getEnv("HTTPHOSTI18N")+"imgstatic/players/soundmanager2.swf","updateLocationHash":false,"fading":false,"useradionomy":false},initialize:function(A){this.settings=Object.extend(this.settings,A);this.initSoundManager()},guiRemove:function(){if(this.guiInserted){this.guiInserted=false;this.guiTrackData=false;this.guiIsPlaying=false;this.guiVolume=0;this.guiPosition=0;this.guiImageShown=false;$(this.insertContainerId).remove()}},chooseCodec:function(){},initSoundManager:function(B,A){if(window.soundManager&&!A){return }window.soundManager=new SoundManager();soundManager.url=this.settings["swfUrl"];soundManager.debugMode=false;soundManager.ready=false;soundManager.audioFormats.mp4.required=false;soundManager.audioFormats.mp3.required=true;soundManager.html5Test=/^(probably|maybe)$/i;if(this.settings.html5only||!swfobject||!swfobject.hasFlashPlayerVersion("8")){soundManager.useHTML5Audio=true;soundManager.audioFormats.mp3.required=false;soundManager.audioFormats.ogg.required=false}soundManager.onready(function(C){if(!C||C.success){if(soundManager.useHTML5Audio){if((!soundManager.html5.mp3||this.settings.html5only)&&soundManager.html5.ogg){this.settings.streamencoding="ogg2"}else{if(!soundManager.html5.mp3){this.playFallback({"message":"No HTML5 or Flash backend found"})}}}soundManager.ready=true;this.maybeReady()}else{this.settings.html5only=true;if(!A&&!this.sm2rebooted){this.sm2rebooted=true;soundManager.destruct();setTimeout(function(){this.initSoundManager(B,true)}.bind(this),100)}}}.bind(this));if(swfobject&&swfobject.hasFlashPlayerVersion("8")){soundManager.flashLoadTimeout=1000}},receiveAction:function(A,B){return this[A].apply(this,B||[])},sendAction:function(A,B){return this.sendActions([[A,B]])},sendActions:function(B){for(var A=0;A<B.length;A++){this.receiveAction(B[A][0],B[A][1])}},play:function(A,C,B){this.get2playlist=A;this.get2context=C;if(!B){B={}}this.sendAction("startPlaying",[A,C,!!B["onlyFetch"]]);return false},startPlaying:function(A,C,B,D){this.stop();if(!B){this.sendGui("guiWait",[]);if(!this.volumeSetFromSession){this.restoreRememberedVolume()}}this.playlistFetch(A,C,{"targets":["stream","id","name","album_name","artist_name","album_url","album_image","artist_url","duration","mixdescriptors"],"relations":["album_track","album_artist"],"params":{"streamencoding":this.settings.streamencoding,"album_imagesize":this.imageSize,"useradionomy":this.settings.useradionomy}},function(F,E){this.playlistSet(F.tracks);this.playlistSeek(E);if(!B){this.playlistPlay()}else{this.trackData=this.playlist[this.playlistIndex];this.guiEvent()}if(typeof (D)=="function"){D()}}.bind(this),function(E){Jamendo.log("widget_data error : "+E)});return false},maybeReady:function(){return this.isReady()},playpause:function(){if(this.isPlaying){this.pause()}else{this.resume()}},pause:function(){Jamendo.sendEventDefered(["jamplayer3","pause"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex});if(this.soundObject){this.soundObject.pause()}this.isPlaying=false;Jamendo.sendEventDefered(["jamplayer3","pause"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex});this.guiEvent()},stop:function(){if(this.soundObject){this.soundObject.stop()}this.isPlaying=false;this.guiEvent()},resume:function(){Jamendo.sendEventDefered(["jamplayer3","play"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex});if(this.soundObject){if(this.soundObject.paused){this.soundObject.resume();Jamendo.sendEventDefered(["jamplayer3","play"],{"track":this.playlist[this.playlistIndex],"index":this.playlistIndex});this.isPlaying=true;this.guiEvent();return }}this.playlistPlay()},createSound:function(B){var A=this;this.lastSound=soundManager.createSound({id:"jamplayer3-"+B["id"],volume:this.volume*100,type:"audio/"+this.settings.streamencoding.substring(0,3),url:B["stream"]||this.getFallbackStream(B["id"],this.settings.streamencoding),whileplaying:function(){A.setPosition((this.position/1000)/A.trackData["duration"]);Jamendo.sendEventDefered(["jamplayer3","playing"]);A.guiEvent(A.broadcastEventsWhilePlaying)},onfinish:function(){if(A.settings.autoNext){A.playlistNext()}else{A.playlistStop()}},onbeforefinish:function(){if(A.settings.fading){A.volume=10;A.soundObject.setVolume(60);A.fadeOutSound(null,A.volume)}},onbeforefinishtime:6000,onload:function(C){if(this.readyState!=3){if(this.isStarting){A.trackFailed()}}else{A.preloadNextTrack()}}});return this.lastSound},playTrack:function(C){var A=this;var B=function(D){if(D.success){if(A.soundObject&&A.soundObject.destruct){A.soundObject.destruct()}A.soundObject=A.createSound(C);A.soundObject.isStarting=true;Jamendo.sendEventDefered(["jamplayer3","play"],{"track":A.playlist[A.playlistIndex],"index":A.playlistIndex});A.soundObject.play();if(A.settings.fading){A.volume=60;A.soundObject.setVolume(10);A.fadeInSound(null,A.volume)}if(A.soundObject.readyState==2){A.trackFailed();return false}A.isPlaying=true;A.guiEvent();if(A.soundObject.readyState==3){A.preloadNextTrack()}}else{A.playFallback({"message":D})}return true};if(soundManager.supported()){return B({"success":true})}else{soundManager.onready(B)}return true},trackFailed:function(){var A=this;if(this.playlistIndex+1<this.playlist.length){setTimeout(function(){A.playlistNext()},2000)}else{A.playlistStop()}},fadeInSound:function(D,A){var C=this.soundObject;var B=C.volume;if(B>=90||B>=A){return false}C.setVolume(B+1);setTimeout(function(){this.fadeInSound(D,A)}.bind(this),50)},fadeOutSound:function(D,A){var C=this.soundObject;var B=C.volume;if(B<=0||B<=A){return false}C.setVolume(B-1);setTimeout(function(){this.fadeOutSound(D,A)}.bind(this),60)},preloadNextTrack:function(){if(this.playlistIndex+1>=this.playlist.length){return }var B=this.playlist[this.playlistIndex+1];var A=this.createSound(B);if(A){A.load()}},playFallback:function(A){var B;B=$("jamplayer3_error");if(B){B.show()}B=$("jamplayer3_container");if(B){B.hide()}B=$("jamplayer3_loading");if(B){B.hide()}},setVolume:function(A,B){this.volume=A;if(this.soundObject){this.soundObject.setVolume(A*100)}if(!B){this.rememberVolume()}this.guiEvent()},seek:function(A){if(this.soundObject){this.soundObject.setPosition(A*1000)}this.guiEvent()},sendGui:function(B,C,A){this.receiveAction(B,C)},guiEvent:function(A){this.sendGuiSerial++;this.sendGui("guiUpdate",[new Date(),this.trackData,this.isPlaying,this.position,this.volume],A)},guiRemove:function(){if(this.guiInserted){this.guiInserted=false;this.guiTrackData=false;this.guiIsPlaying=false;this.guiVolume=0;this.guiPosition=0;this.guiImageShown=false;$(this.insertContainerId).remove()}},guiUpdate:function(H,B,E,G,D){if(H<=this.guiSerial||this.fallbacked){return }this.guiSerial=H;this.guiInsert();if(!B||!B["id"]){$("jamplayer3_loading").show();$("jamplayer3_container").hide();return }if(this.guiTrackData["id"]!=B["id"]){if(this.settings["updateLocationHash"]){window.location=new String(window.location).gsub(/#.*$/,"")+"#"+this.get2playlist+"#"+this.get2context+"#"+this.playlistIndex}this.guiTrackData=B;var F=$("jamplayer3_framefacebook");F.hide();F.src="http://www.facebook.com/plugins/like.php?href="+Jamendo.getEnv("HTTPHOST")+"track/"+B["id"]+"&locale="+Jamendo.getEnv("LOCALE")+"&layout=button_count&show_faces=true&width=120&action=like&colorscheme=light&height=21";if($(this.insertContainerId).up("#page_content_right")){F.setStyle({width:"auto"})}$("jamplayer3_albumimage").alt=B["album_name"];var A=$("jamplayer3_albumimagelink");A.href=B["album_url"];A.title=B["album_name"];$("jamplayer3_artistname").update(new Element("a",{"href":B["artist_url"],"title":B["artist_name"],"target":"_blank"}).update(B["artist_name"]));$("jamplayer3_trackname").update(new Element("a",{"href":B["album_url"],"title":B["album_name"],"target":"_blank"}).update(B["name"].truncate(40,"...")));$("jamplayer3_buttontwitter").innerHTML=this.htmlTemplate("buttonTwitter",B);$("jamplayer3_buttonshare").innerHTML=this.htmlTemplate("buttonShare",B);$("jamplayer3_buttondownload").innerHTML=this.htmlTemplate("buttonDownload",B);$("jamplayer3_buttonplaylist").innerHTML=this.htmlTemplate("buttonPlaylist",B);$("jamplayer3_loading").hide();$("jamplayer3_container").show();$("jamplayer3_framefacebook").show();var C=$("jamplayer3_playlist_ul");if(C){C.childElements().each(function(J){J.removeClassName("played")})}var I=$("jamplayer3_playlist_line_"+this.playlistIndex);if(I){I.addClassName("played")}}if(this.guiIsPlaying!=E){this.guiIsPlaying=E;$("jamplayer3_button"+(E?"play":"pause")).hide();$("jamplayer3_button"+(E?"pause":"play")).show()}if(this.guiVolume!=D){this.guiVolume=D;this.guiChangeSliderValueSilently(this.volumeControl,D)}if(B&&this.guiImageShown!=B["album_image"]&&(!this.guiIsWaiting||(this.guiIsWaiting&&this.guiPosition!=G))){$("jamplayer3_albumimage").src=B["album_image"];$("jamplayer3_waitingimage").hide();$("jamplayer3_albumimage").show();this.guiIsWaiting=false;this.guiImageShown=B["album_image"]}if(this.guiPosition!=G){this.guiPosition=G;if(!this.blockPositionUpdate){this.guiChangeSliderValueSilently(this.positionControl,G)}$("jamplayer3_progress_min").innerHTML=Jamendo.secondsToLabel(G*this.guiTrackData["duration"]);$("jamplayer3_progress_max").innerHTML=Jamendo.secondsToLabel((1-G)*this.guiTrackData["duration"]);$("jamplayer3_progress").show()}},guiWait:function(){this.guiIsWaiting=true;if(!this.guiInserted){this.guiInsert()}else{$("jamplayer3_albumimage").hide();$("jamplayer3_waitingimage").show();this.guiImageShown=false}},guiChangeSliderValueSilently:function(A,B){var C=A.getNearestValue(B);A.values[0]=C;A.handles[0].style["left"]=A.translateToPx(C);A.drawSpans()},guiInsert:function(){if(!$(this.settings.htmlElement)||this.fallbacked){return false}if(this.guiInserted){return true}this.guiInserted=true;this.insertContainerId="jamplayer3_insert_"+parseInt(Math.random()*10000000);$(this.settings.htmlElement).insert({top:"<div id='"+this.insertContainerId+"'>"+this.settings["templates"]["container"]+"</div>"});$("jamplayer3_buttonplay").observe("click",function(A){this.sendAction("resume")}.bind(this));$("jamplayer3_buttonpause").observe("click",function(A){this.sendAction("playlistPause")}.bind(this));$("jamplayer3_buttonnext").observe("click",function(A){this.sendAction("playlistNext")}.bind(this));$("jamplayer3_buttonprev").observe("click",function(A){this.sendAction("playlistPrev")}.bind(this));this.volumeControl=new Control.Slider("jamplayer3_volume_handle","jamplayer3_volume_track",{"maximum":1,"sliderValue":this.guiVolume,"onChange":function(A){this.sendAction("setVolume",[A,true])}.bind(this)});this.positionControl=new Control.Slider("jamplayer3_progress_handle","jamplayer3_progress_track",{"maximum":1,"sliderValue":this.guiPosition,"onChange":function(A){this.blockPositionUpdate=true;setTimeout(function(){this.blockPositionUpdate=false}.bind(this),2100);this.sendAction("seek",[A*this.guiTrackData["duration"]])}.bind(this)});return true},htmlTemplate:function(A,B){return this.settings["templates"][A].gsub("XXXidXXX",B["id"]).gsub("XXXnameXXX","Jamendo.page.players.get('"+this.playerName+"').guiTrackData.name")},setTemplates:function(A){this.settings["templates"]=A}});Jamendo.classes.FacebookPublishStory=Class.create({publishOnMyWall:function(A){this._publishOnWall(A,null)},publishOnFriendsWall:function(B){var A=new Jamendo.classes.FacebookFriendSelector(this._publishOnWall,B);A.open()},_publishOnWall:function(A,B){if(!B){FB.ui({method:"stream.publish",message:A.message,attachment:A.attachment,action_links:A.actionLinks,user_message_prompt:A.prompt},this.publishCallback.curry(A.callback))}else{$A(B).each(function(C){FB.ui({method:"stream.publish",message:A.message,attachment:A.attachment,action_links:A.actionLinks,user_message_prompt:A.prompt,target_id:C},this.publishCallback.curry(A.callback))}.bind(this))}},publishCallback:function(D,B,A,C){if(A){alert(Jamendo.getStr("FACEBOOK_PUBLISH_EXCEPTION"))}else{if(B>0){D.apply()}else{}}}});var $PNGFIX=true;var _pngfix=function(){};if(typeof (Prototype)!="undefined"&&Prototype.Browser.IE){(function(){var E="DXImageTransform.Microsoft.AlphaImageLoader";var C="progid:"+E+"(src='%1',sizingMethod='scale')";var A=function(G){if(!G.filters){return }var H=G.filters[E];if(H){H.src=G.src;H.enabled=true}else{G.runtimeStyle.filter=C.replace(/%1/,G.src)}G.onload=function(){};G.src="http://img.jamendo.com/spacer.gif"};_pngfix=function(G){if(!$PNGFIX){return }var H=new Image();H.onload=function(){G.width=H.width;G.height=H.height;H=null};H.src=G.src;A(G)};var B=function(H){var G=H.currentStyle.backgroundImage;var I=G.substring(5,G.length-2);H.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+I+"', sizingMethod='crop')";H.style.backgroundImage="url(http://img.jamendo.com/spacer.gif)"};var D=function(){if(window.event.propertyName=="style.backgroundImage"){var H=window.event.srcElement;if(!H.currentStyle.backgroundImage.match(/x\.gif/i)){var G=H.currentStyle.backgroundImage;var I=G.substring(5,G.length-2);H.filters.item(0).src=I;H.style.backgroundImage="url(http://img.jamendo.com/spacer.gif)"}}};var F=function(){for(var G=document.all.length-1,H=null;(H=document.all[G]);G--){if(H.className.match(/pngfix/)&&H.currentStyle.backgroundImage.match(/\.png/i)!==null){B(H);H.attachEvent("onpropertychange",D)}}};document.observe("load",F)})()}var swfobject=function(){var AQ="undefined",Ac="object",AB="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",Ad="application/x-shockwave-flash",AC="SWFObjectExprInst",AW="onreadystatechange",AF=window,Ak=document,Aa=navigator,AA=false,Z=[Am],Af=[],AG=[],AL=[],Ai,AD,AP,AS,AK=false,At=false,Ag,AN,Ah=true,AH=function(){var A=typeof Ak.getElementById!=AQ&&typeof Ak.getElementsByTagName!=AQ&&typeof Ak.createElement!=AQ,E=Aa.userAgent.toLowerCase(),C=Aa.platform.toLowerCase(),H=C?/win/.test(C):/win/.test(E),J=C?/mac/.test(C):/mac/.test(E),G=/webkit/.test(E)?parseFloat(E.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,D=!+"\v1",F=[0,0,0],K=null;if(typeof Aa.plugins!=AQ&&typeof Aa.plugins[AB]==Ac){K=Aa.plugins[AB].description;if(K&&!(typeof Aa.mimeTypes!=AQ&&Aa.mimeTypes[Ad]&&!Aa.mimeTypes[Ad].enabledPlugin)){AA=true;D=false;K=K.replace(/^.*\s+(\S+\s+\S+$)/,"$1");F[0]=parseInt(K.replace(/^(.*)\..*$/,"$1"),10);F[1]=parseInt(K.replace(/^.*\.(.*)\s.*$/,"$1"),10);F[2]=/[a-zA-Z]/.test(K)?parseInt(K.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof AF.ActiveXObject!=AQ){try{var I=new ActiveXObject(X);if(I){K=I.GetVariable("$version");if(K){D=true;K=K.split(" ")[1].split(",");F=[parseInt(K[0],10),parseInt(K[1],10),parseInt(K[2],10)]}}}catch(B){}}}return{w3:A,pv:F,wk:G,ie:D,win:H,mac:J}}(),Aj=function(){if(!AH.w3){return }if((typeof Ak.readyState!=AQ&&Ak.readyState=="complete")||(typeof Ak.readyState==AQ&&(Ak.getElementsByTagName("body")[0]||Ak.body))){Ao()}if(!AK){if(typeof Ak.addEventListener!=AQ){Ak.addEventListener("DOMContentLoaded",Ao,false)}if(AH.ie&&AH.win){Ak.attachEvent(AW,function(){if(Ak.readyState=="complete"){Ak.detachEvent(AW,arguments.callee);Ao()}});if(AF==top){(function(){if(AK){return }try{Ak.documentElement.doScroll("left")}catch(A){setTimeout(arguments.callee,0);return }Ao()})()}}if(AH.wk){(function(){if(AK){return }if(!/loaded|complete/.test(Ak.readyState)){setTimeout(arguments.callee,0);return }Ao()})()}Ab(Ao)}}();function Ao(){if(AK){return }try{var B=Ak.getElementsByTagName("body")[0].appendChild(AR("span"));B.parentNode.removeChild(B)}catch(A){return }AK=true;var D=Z.length;for(var C=0;C<D;C++){Z[C]()}}function AJ(A){if(AK){A()}else{Z[Z.length]=A}}function Ab(A){if(typeof AF.addEventListener!=AQ){AF.addEventListener("load",A,false)}else{if(typeof Ak.addEventListener!=AQ){Ak.addEventListener("load",A,false)}else{if(typeof AF.attachEvent!=AQ){Al(AF,"onload",A)}else{if(typeof AF.onload=="function"){var B=AF.onload;AF.onload=function(){B();A()}}else{AF.onload=A}}}}}function Am(){if(AA){Y()}else{AM()}}function Y(){var D=Ak.getElementsByTagName("body")[0];var B=AR(Ac);B.setAttribute("type",Ad);var A=D.appendChild(B);if(A){var C=0;(function(){if(typeof A.GetVariable!=AQ){var E=A.GetVariable("$version");if(E){E=E.split(" ")[1].split(",");AH.pv=[parseInt(E[0],10),parseInt(E[1],10),parseInt(E[2],10)]}}else{if(C<10){C++;setTimeout(arguments.callee,10);return }}D.removeChild(B);A=null;AM()})()}else{AM()}}function AM(){var G=Af.length;if(G>0){for(var H=0;H<G;H++){var C=Af[H].id;var L=Af[H].callbackFn;var A={success:false,id:C};if(AH.pv[0]>0){var I=Ar(C);if(I){if(AO(Af[H].swfVersion)&&!(AH.wk&&AH.wk<312)){AX(C,true);if(L){A.success=true;A.ref=AU(C);L(A)}}else{if(Af[H].expressInstall&&AT()){var E={};E.data=Af[H].expressInstall;E.width=I.getAttribute("width")||"0";E.height=I.getAttribute("height")||"0";if(I.getAttribute("class")){E.styleclass=I.getAttribute("class")}if(I.getAttribute("align")){E.align=I.getAttribute("align")}var F={};var D=I.getElementsByTagName("param");var K=D.length;for(var J=0;J<K;J++){if(D[J].getAttribute("name").toLowerCase()!="movie"){F[D[J].getAttribute("name")]=D[J].getAttribute("value")}}AE(E,F,C,L)}else{Ae(I);if(L){L(A)}}}}}else{AX(C,true);if(L){var B=AU(C);if(B&&typeof B.SetVariable!=AQ){A.success=true;A.ref=B}L(A)}}}}}function AU(B){var D=null;var C=Ar(B);if(C&&C.nodeName=="OBJECT"){if(typeof C.SetVariable!=AQ){D=C}else{var A=C.getElementsByTagName(Ac)[0];if(A){D=A}}}return D}function AT(){return !At&&AO("6.0.65")&&(AH.win||AH.mac)&&!(AH.wk&&AH.wk<312)}function AE(F,D,H,E){At=true;AP=E||null;AS={success:false,id:H};var A=Ar(H);if(A){if(A.nodeName=="OBJECT"){Ai=An(A);AD=null}else{Ai=A;AD=H}F.id=AC;if(typeof F.width==AQ||(!/%$/.test(F.width)&&parseInt(F.width,10)<310)){F.width="310"}if(typeof F.height==AQ||(!/%$/.test(F.height)&&parseInt(F.height,10)<137)){F.height="137"}Ak.title=Ak.title.slice(0,47)+" - Flash Player Installation";var B=AH.ie&&AH.win?"ActiveX":"PlugIn",C="MMredirectURL="+AF.location.toString().replace(/&/g,"%26")+"&MMplayerType="+B+"&MMdoctitle="+Ak.title;if(typeof D.flashvars!=AQ){D.flashvars+="&"+C}else{D.flashvars=C}if(AH.ie&&AH.win&&A.readyState!=4){var G=AR("div");H+="SWFObjectNew";G.setAttribute("id",H);A.parentNode.insertBefore(G,A);A.style.display="none";(function(){if(A.readyState==4){A.parentNode.removeChild(A)}else{setTimeout(arguments.callee,10)}})()}AZ(F,D,H)}}function Ae(A){if(AH.ie&&AH.win&&A.readyState!=4){var B=AR("div");A.parentNode.insertBefore(B,A);B.parentNode.replaceChild(An(A),B);A.style.display="none";(function(){if(A.readyState==4){A.parentNode.removeChild(A)}else{setTimeout(arguments.callee,10)}})()}else{A.parentNode.replaceChild(An(A),A)}}function An(B){var D=AR("div");if(AH.win&&AH.ie){D.innerHTML=B.innerHTML}else{var E=B.getElementsByTagName(Ac)[0];if(E){var A=E.childNodes;if(A){var F=A.length;for(var C=0;C<F;C++){if(!(A[C].nodeType==1&&A[C].nodeName=="PARAM")&&!(A[C].nodeType==8)){D.appendChild(A[C].cloneNode(true))}}}}}return D}function AZ(E,G,C){var D,A=Ar(C);if(AH.wk&&AH.wk<312){return D}if(A){if(typeof E.id==AQ){E.id=C}if(AH.ie&&AH.win){var F="";for(var I in E){if(E[I]!=Object.prototype[I]){if(I.toLowerCase()=="data"){G.movie=E[I]}else{if(I.toLowerCase()=="styleclass"){F+=' class="'+E[I]+'"'}else{if(I.toLowerCase()!="classid"){F+=" "+I+'="'+E[I]+'"'}}}}}var H="";for(var J in G){if(G[J]!=Object.prototype[J]){H+='<param name="'+J+'" value="'+G[J]+'" />'}}A.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+F+">"+H+"</object>";AG[AG.length]=E.id;D=Ar(E.id)}else{var B=AR(Ac);B.setAttribute("type",Ad);for(var K in E){if(E[K]!=Object.prototype[K]){if(K.toLowerCase()=="styleclass"){B.setAttribute("class",E[K])}else{if(K.toLowerCase()!="classid"){B.setAttribute(K,E[K])}}}}for(var L in G){if(G[L]!=Object.prototype[L]&&L.toLowerCase()!="movie"){Ap(B,L,G[L])}}A.parentNode.replaceChild(B,A);D=B}}return D}function Ap(B,D,C){var A=AR("param");A.setAttribute("name",D);A.setAttribute("value",C);B.appendChild(A)}function AV(A){var B=Ar(A);if(B&&B.nodeName=="OBJECT"){if(AH.ie&&AH.win){B.style.display="none";(function(){if(B.readyState==4){As(A)}else{setTimeout(arguments.callee,10)}})()}else{B.parentNode.removeChild(B)}}}function As(A){var B=Ar(A);if(B){for(var C in B){if(typeof B[C]=="function"){B[C]=null}}B.parentNode.removeChild(B)}}function Ar(A){var C=null;try{C=Ak.getElementById(A)}catch(B){}return C}function AR(A){return Ak.createElement(A)}function Al(A,C,B){A.attachEvent(C,B);AL[AL.length]=[A,C,B]}function AO(A){var B=AH.pv,C=A.split(".");C[0]=parseInt(C[0],10);C[1]=parseInt(C[1],10)||0;C[2]=parseInt(C[2],10)||0;return(B[0]>C[0]||(B[0]==C[0]&&B[1]>C[1])||(B[0]==C[0]&&B[1]==C[1]&&B[2]>=C[2]))?true:false}function AY(B,F,A,C){if(AH.ie&&AH.mac){return }var E=Ak.getElementsByTagName("head")[0];if(!E){return }var G=(A&&typeof A=="string")?A:"screen";if(C){Ag=null;AN=null}if(!Ag||AN!=G){var D=AR("style");D.setAttribute("type","text/css");D.setAttribute("media",G);Ag=E.appendChild(D);if(AH.ie&&AH.win&&typeof Ak.styleSheets!=AQ&&Ak.styleSheets.length>0){Ag=Ak.styleSheets[Ak.styleSheets.length-1]}AN=G}if(AH.ie&&AH.win){if(Ag&&typeof Ag.addRule==Ac){Ag.addRule(B,F)}}else{if(Ag&&typeof Ak.createTextNode!=AQ){Ag.appendChild(Ak.createTextNode(B+" {"+F+"}"))}}}function AX(A,C){if(!Ah){return }var B=C?"visible":"hidden";if(AK&&Ar(A)){Ar(A).style.visibility=B}else{AY("#"+A,"visibility:"+B)}}function AI(B){var A=/[\\\"<>\.;]/;var C=A.exec(B)!=null;return C&&typeof encodeURIComponent!=AQ?encodeURIComponent(B):B}var Aq=function(){if(AH.ie&&AH.win){window.attachEvent("onunload",function(){var A=AL.length;for(var B=0;B<A;B++){AL[B][0].detachEvent(AL[B][1],AL[B][2])}var D=AG.length;for(var C=0;C<D;C++){AV(AG[C])}for(var E in AH){AH[E]=null}AH=null;for(var F in swfobject){swfobject[F]=null}swfobject=null})}}();return{registerObject:function(A,E,C,B){if(AH.w3&&A&&E){var D={};D.id=A;D.swfVersion=E;D.expressInstall=C;D.callbackFn=B;Af[Af.length]=D;AX(A,false)}else{if(B){B({success:false,id:A})}}},getObjectById:function(A){if(AH.w3){return AU(A)}},embedSWF:function(K,E,H,F,C,A,B,I,G,J){var D={success:false,id:E};if(AH.w3&&!(AH.wk&&AH.wk<312)&&K&&E&&H&&F&&C){AX(E,false);AJ(function(){H+="";F+="";var Q={};if(G&&typeof G===Ac){for(var O in G){Q[O]=G[O]}}Q.data=K;Q.width=H;Q.height=F;var N={};if(I&&typeof I===Ac){for(var P in I){N[P]=I[P]}}if(B&&typeof B===Ac){for(var L in B){if(typeof N.flashvars!=AQ){N.flashvars+="&"+L+"="+B[L]}else{N.flashvars=L+"="+B[L]}}}if(AO(C)){var M=AZ(Q,N,E);if(Q.id==E){AX(E,true)}D.success=true;D.ref=M}else{if(A&&AT()){Q.data=A;AE(Q,N,E,J);return }else{AX(E,true)}}if(J){J(D)}})}else{if(J){J(D)}}},switchOffAutoHideShow:function(){Ah=false},ua:AH,getFlashPlayerVersion:function(){return{major:AH.pv[0],minor:AH.pv[1],release:AH.pv[2]}},hasFlashPlayerVersion:AO,createSWF:function(A,B,C){if(AH.w3){return AZ(A,B,C)}else{return undefined}},showExpressInstall:function(B,A,D,C){if(AH.w3&&AT()){AE(B,A,D,C)}},removeSWF:function(A){if(AH.w3){AV(A)}},createCSS:function(B,A,C,D){if(AH.w3){AY(B,A,C,D)}},addDomLoadEvent:AJ,addLoadEvent:Ab,getQueryParamValue:function(B){var A=Ak.location.search||Ak.location.hash;if(A){if(/\?/.test(A)){A=A.split("?")[1]}if(B==null){return AI(A)}var C=A.split("&");for(var D=0;D<C.length;D++){if(C[D].substring(0,C[D].indexOf("="))==B){return AI(C[D].substring((C[D].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(At){var A=Ar(AC);if(A&&Ai){A.parentNode.replaceChild(Ai,A);if(AD){AX(AD,true);if(AH.ie&&AH.win){Ai.style.display="block"}}if(AP){AP(AS)}}At=false}}}}();Jamendo.classes.SuperBox=Class.create({closeWord:"close",loadImage:"http://img.jamendo.com/superboxloading.gif",widthParam:"sbw",heightParam:"sbh",addUrlParams:"output=superbox",cb_show:[],removable:true,cb_remove:[],defaultWidth:0,defaultHeight:0,mode:null,jamform:false,fastmode:false,initialize:function(){Jamendo.onReady(function(){if(!this.fastmode){this.cb_show.push(this.hideObjects.bind(this));this.cb_remove.push(this.showObjects.bind(this))}}.bind(this))},hideObjects:function(){var A=$A(document.getElementsByTagName("object"));A.each(function(B){B=$(B);if(!B.up("#SuperBox_ajaxContent")){B.setStyle({"visibility":"hidden"})}});if($("pro_page_bottomplayer")&&$("pro_page_bottomplayer").style.display!="none"){$("pro_page_bottomplayer")._hiddenBySuperbox=true;$("pro_page_bottomplayer").style.visibility="hidden"}},showObjects:function(){var A=$A(document.getElementsByTagName("object"));A.each(function(B){B=$(B);if(!B.up("#SuperBox_ajaxContent")){B.setStyle({"visibility":"visible"})}});if($("pro_page_bottomplayer")&&$("pro_page_bottomplayer")._hiddenBySuperbox){$("pro_page_bottomplayer")._hiddenBySuperbox=false;$("pro_page_bottomplayer").style.visibility="visible"}},reset:function(){this.w=this.defaultWidth;this.h=this.defaultHeight;this.t="";this.s=false;this.shown=false},registerNow:function(A,B){$$(A).each(function(C){SuperBox.registerElt(C,B)})},register:function(A,B){Jamendo.onReady(function(){this.registerNow(A,B)}.bind(this))},registerElt:function(B,A){B.onclick=function(){return false}.bindAsEventListener(B);Event.observe(B,"click",function(){var C=this.title||this.innerHTML||this.href;SuperBox.call("remote",A||this.href,C);this.blur()}.bindAsEventListener(B))},call:function(F,A,M,B,J,L,H){try{if(typeof ClickTaleExec=="function"){ClickTaleExec("SuperBox.call.apply(SuperBox,"+Object.toJSON($A(arguments))+");")}if(!F){F="remote"}this.jamform=(L===true);this._remove_cb=J;if(F=="remote"&&(typeof A)!="string"&&("href" in A)){this.url=A.href}else{this.url=A}this.mode=F;this.reset();this.caption=M;this.baseinsert();if(this.jamform&&Prototype.Browser.IE){this.show();$("SuperBox_window").setStyle({opacity:0})}if(Prototype.Browser.IE){$$("select").each(function(N){Element.hide(N)})}if(Prototype.Browser.Opera){$$("iframe").each(function(N){Element.hide(N)})}this.wro=this.position.bindAsEventListener(this);this.position();if(!this.fastmode){Event.observe(window,"resize",this.wro)}if(F=="remote"&&this.url.toLowerCase().match(/\.jpg|\.jpeg|\.png|\.gif|\.bmp/g)){this.t="img";this.img=new Image();this.img.onload=this.show.bindAsEventListener(this);this.img.src=this.url}else{if(F=="wait"){}else{this.t="html";if(F=="remote"){var I=this.url.replace(/^[^\?]+\??/,"");var C=this.parseQuery(I);if(C[this.widthParam]){this.setDim(C[this.widthParam],C[this.heightParam],true)}else{this.setDim(950,500,true)}}this.htmlinsert();if(F=="remote"){var K={"callback":function(N){if(!$("SuperBox_ajaxContent")){return this.remove()}$("SuperBox_ajaxContent").update(N);$("SuperBox_ajaxUrl").update(this.urlcat(this.url,this.addUrlParams));if(typeof (B)=="function"){B()}if(this.jamform&&Prototype.Browser.IE){$("SuperBox_load").hide();$("SuperBox_window").setStyle({opacity:1})}else{this.show()}}.bind(this),"url":this.urlcat(this.url,this.addUrlParams),"timeout":4000,"retryDelay":0,"errback":function(){this.remove()}.bind(this)};if(typeof (H)!="undefined"){K=Object.extend(K,H)}Jamendo.ajaxRequest(K);$("SuperBox_ajaxContent").addClassName("superbox_remote")}else{if(F=="localdiv"){var E=$(A).innerHTML;var D=$(A).getDimensions();if(!(D.width>0)){D={width:parseInt($(A).style.width),height:parseInt($(A).style.height)}}$(A).innerHTML="";$("SuperBox_ajaxContent").innerHTML=E;this.setDim(D.width,D.height);if(typeof (B)=="function"){B()}this.show()}}}}}catch(G){Jamendo.log(G);return true}return false},urlcat:function(A,B){if(A.indexOf("?")<0){return A+"?"+B}else{return A+"&"+B}},baseinsert:function(){if(this.fastmode){return new Insertion.Bottom($("body"),"<div id='SuperBox_global'><div id='SuperBox_window' style='display:none;'></div></div>")}else{return new Insertion.Bottom($$("body")[0],"<div id='SuperBox_global'><div id='SuperBox_overlay' onclick='return SuperBox.remove();'></div><div id='SuperBox_window' style='display:none;'></div><div id='SuperBox_load' onclick='return SuperBox.remove();'><div id='SuperBox_loadContent'><img src='"+this.loadImage+"' /></div></div></div>")}},htmlinsert:function(){return new Insertion.Bottom("SuperBox_window","<div id='SuperBox_closeAjaxWindow' ><a href='#' id='SuperBox_closeWindowButton' onclick='SuperBox.remove();return false;'>"+this.closeWord+"</a></div><div id='SuperBox_ajaxContent'></div><div style='background: none repeat scroll 0% 0% black; position: absolute; opacity: 0.6; display:none;' id='SuperBox_overlay_inner'><img style='position: absolute; right: 50%; top: 50%;' src='"+this.loadImage+"' /></div><div style='display:none;' id='SuperBox_ajaxUrl'></div>")},imginsert:function(){try{$("SuperBox_Img").remove()}catch(A){}return new Insertion.Bottom("SuperBox_window","<div id='SuperBox_Img'><a href='' onclick='return SuperBox.remove();' id='SuperBox_ImageOff' title='Close'><img id='SuperBox_Image' src='"+this.url+"' style='"+this.ciw+"px;height:"+this.cih+"px' alt='"+this.caption+"'/></a><div id='SuperBox_caption'>"+this.caption+"</div><div id='SuperBox_closeWindow' onclick='SuperBox.remove(); return false;'><a href='#' id='SuperBox_closeWindowButton'>"+this.closeWord+"</a></div></div>")},show:function(){this.s=true;if(this.t=="img"){this.iw=this.img.width;this.ih=this.img.height;this.position();this.imginsert()}else{this.position()}this.shown=true;if(this.w>0||this.jamform){if(!this.fastmode&&!(this.jamform&&Prototype.Browser.IE)){$("SuperBox_load").hide()}$("SuperBox_window").show()}this.cb_show.each(function(A){A()})},remove:function(C){if(!this.removable&&(C!==true)){return false}if(typeof ClickTaleExec=="function"){ClickTaleExec("SuperBox.remove(true);")}this.shown=false;var A=$("SuperBox_global");if(!A){return }this.cb_remove.each(function(D){D()});if(this._remove_cb){this._remove_cb()}A.hide();if(!this.fastmode){Event.stopObserving(window,"resize",this.wro)}if(this.mode=="localdiv"){var B=$("SuperBox_ajaxContent").innerHTML;$("SuperBox_ajaxContent").innerHTML="";new Insertion.Bottom(this.url,B)}A.remove();if(Prototype.Browser.IE){$$("select").each(function(D){Element.show(D)})}if(Prototype.Browser.Opera){$$("iframe").each(function(D){Element.show(D)})}return false},position:function(){if(this.fastmode){if(this.t=="img"){this.imgsize();this.imginsert()}else{if(this.t=="html"){if(!$("SuperBox_ajaxContent")){return this.remove()}$("SuperBox_window").setStyle({position:"fixed",top:"30px",left:"30px"});if(this.h==0){$("SuperBox_ajaxContent").setStyle({width:(this.w-30)+"px"})}else{$("SuperBox_ajaxContent").setStyle({width:(this.w-30)+"px",height:(this.h-49)+"px"})}}}}else{var A=this.getPageSize();if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight}else{yScroll=document.body.offsetHeight}}var B=this.getPageScrollTop();if(this.t=="img"){this.imgsize();this.imginsert()}else{if(this.t=="html"){if(!$("SuperBox_ajaxContent")){return this.remove()}if(this.h==0){$("SuperBox_ajaxContent").setStyle({width:(this.w-30)+"px"})}else{$("SuperBox_ajaxContent").setStyle({width:(this.w-30)+"px",height:(this.h-49)+"px"})}}}if(this.h==0){$("SuperBox_window").setStyle({width:this.w+"px",left:((A[0]-this.w)/2)+"px",top:(B[1]+30)+"px"});$("SuperBox_load").setStyle({top:(B[1]+40+((A[1])/2))+"px"})}else{$("SuperBox_window").setStyle({width:this.w+"px",height:this.h+"px",left:((A[0]-this.w)/2)+"px",top:(B[1]+((A[1]-this.h)/2))+"px"});$("SuperBox_load").setStyle({top:(B[1]+40+((A[1])/2))+"px"})}if(this.s&&$("SuperBox_overlay_inner")){$("SuperBox_overlay_inner").setStyle({width:this.w+"px",height:this.h+"px",left:0,top:0})}var C=0;if(typeof (window.innerHeight)=="number"){C=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){C=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){C=document.body.clientHeight}}}$("SuperBox_overlay").setStyle({"height":Math.max(C,yScroll)+"px"})}},setDim:function(A,B,C){this.w=A*1+30;if(!B){this.h=0}else{this.h=B*1+40}if(this.s&&!C){this.show()}},imgsize:function(){var B=this.getPageSize();var A=B[0]-100;var C=B[1]-100;this.ciw=this.iw;this.cih=this.ih;(2).times(function(){if(this.ciw>A){this.cih=this.cih*(A/this.ciw);this.ciw=A}if(this.cih>C){this.ciw=this.ciw*(C/this.cih);this.cih=C}}.bind(this));this.w=this.ciw+30;this.h=this.cih+60},getPageScrollTop:function(){var B;var A=document.documentElement;if(self.pageYOffset){B=self.pageYOffset}else{if(A&&A.scrollTop){B=A.scrollTop}else{if(document.body){B=document.body.scrollTop}}}arrayPageScroll=new Array("",B);return arrayPageScroll},getPageSize:function(){var C=document.documentElement;var A=self.innerWidth||(C&&C.clientWidth)||document.body.clientWidth;var B=self.innerHeight||(C&&C.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(A,B);return arrayPageSize},parseQuery:function(D){var G=new Object();if(!D){return G}var A=D.split(/[;&]/);for(var C=0;C<A.length;C++){var E=A[C].split("=");if(!E||E.length!=2){continue}var B=unescape(E[0]);var F=unescape(E[1]);F=F.replace(/\+/g," ");G[B]=F}return G}});var SuperBox=new Jamendo.classes.SuperBox();var Fx=fx={};Fx.Base=function(){};Fx.Base.prototype={setOptions:function(A){this.options=Object.extend({onStart:function(){},onComplete:function(){},transition:Fx.Transitions.sineInOut,duration:500,unit:"px",wait:true,fps:50},A||{})},step:function(){var A=new Date().getTime();if(A<this.time+this.options.duration){this.cTime=A-this.time;this.setNow()}else{setTimeout(this.options.onComplete.bind(this,this.element),10);this.clearTimer();this.now=this.to}this.increase()},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(C,B){var A=B-C;return this.options.transition(this.cTime,C,A,this.options.duration)},clearTimer:function(){clearInterval(this.timer);this.timer=null;return this},_start:function(B,A){if(!this.options.wait){this.clearTimer()}if(this.timer){return }setTimeout(this.options.onStart.bind(this,this.element),10);this.from=B;this.to=A;this.time=new Date().getTime();this.timer=setInterval(this.step.bind(this),Math.round(1000/this.options.fps));return this},custom:function(B,A){return this._start(B,A)},set:function(A){this.now=A;this.increase();return this},hide:function(){return this.set(0)},setStyle:function(C,B,A){if(B=="opacity"){if(A==0&&C.style.visibility!="hidden"){C.style.visibility="hidden"}else{if(C.style.visibility!="visible"){C.style.visibility="visible"}}if(window.ActiveXObject){C.style.filter="alpha(opacity="+A*100+")"}C.style.opacity=A}else{C.style[B]=A+this.options.unit}}};Fx.Style=Class.create();Fx.Style.prototype=Object.extend(new Fx.Base(),{initialize:function(C,A,B){this.element=$(C);this.setOptions(B);this.property=A.camelize()},increase:function(){this.setStyle(this.element,this.property,this.now)}});Fx.Styles=Class.create();Fx.Styles.prototype=Object.extend(new Fx.Base(),{initialize:function(B,A){this.element=$(B);this.setOptions(A);this.now={}},setNow:function(){for(p in this.from){this.now[p]=this.compute(this.from[p],this.to[p])}},custom:function(A){if(this.timer&&this.options.wait){return }var C={};var B={};for(p in A){C[p]=A[p][0];B[p]=A[p][1]}return this._start(C,B)},increase:function(){for(var A in this.now){this.setStyle(this.element,A,this.now[A])}}});Fx.Transitions={linear:function(B,A,D,C){return D*B/C+A},sineInOut:function(B,A,D,C){return -D/2*(Math.cos(Math.PI*B/C)-1)+A}}
