var Prototype={Version:"1.6.0.2",Browser:(function(){var A=navigator.userAgent;return{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:/AppleWebKit\//.test(A),Gecko:/Gecko/.test(A)&&!/KHTML/.test(A),KHTML:/Konqueror/.test(A)&&/KHTML/.test(A),MobileSafari:!!A.match(/Apple.*Mobile.*Safari/)}})(),BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var B=null,C=$A(arguments);if(Object.isFunction(C[0])){B=C.shift()}function A(){this.initialize.apply(this,arguments)}Object.extend(A,Class.Methods);A.superclass=B;A.subclasses=[];if(B){var E=function(){};E.prototype=B.prototype;A.prototype=new E;B.subclasses.push(A)}for(var D=0;D<C.length;D++){A.addMethods(C[D])}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction}A.prototype.constructor=A;return A}};Class.Methods={addMethods:function(B){var E=this.superclass&&this.superclass.prototype;var D=Object.keys(B);if(!Object.keys({toString:true}).length){D.push("toString","valueOf")}for(var F=0,C=D.length;F<C;F++){var A=D[F],G=B[A];if(E&&Object.isFunction(G)&&G.argumentNames().first()=="$super"){var H=G,G=Object.extend((function(I){return function(){return E[I].apply(this,arguments)}})(A).wrap(H),{valueOf:function(){return H},toString:function(){return H.toString()}})}this.prototype[A]=G}return this}};var Abstract={};Object.extend=function(C,B){for(var A in B){C[A]=B[A]}return C};Object.extend(Object,{inspect:function(A){try{if(Object.isUndefined(A)){return"undefined"}if(A===null){return"null"}return A.inspect?A.inspect():String(A)}catch(B){if(B instanceof RangeError){return"..."}throw B}},toJSON:function(C){var D=typeof C;switch(D){case"undefined":case"function":case"unknown":return ;case"boolean":return C.toString()}if(C===null){return"null"}if(C.toJSON){return C.toJSON()}if(Object.isElement(C)){return }var B=[];for(var A in C){var E=Object.toJSON(C[A]);if(!Object.isUndefined(E)){B.push(A.toJSON()+": "+E)}}return"{"+B.join(", ")+"}"},toQueryString:function(A){return $H(A).toQueryString()},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A)},keys:function(B){var C=[];for(var A in B){C.push(A)}return C},values:function(B){var C=[];for(var A in B){C.push(B[A])}return C},clone:function(A){return Object.extend({},A)},isElement:function(A){return A&&A.nodeType==1},isArray:function(A){return A!=null&&typeof A=="object"&&"splice" in A&&"join" in A},isHash:function(A){return A instanceof Hash},isFunction:function(A){return typeof A=="function"},isString:function(A){return typeof A=="string"},isNumber:function(A){return typeof A=="number"},isUndefined:function(A){return typeof A=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return A.length==1&&!A[0]?[]:A},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var C=this,A=$A(arguments),B=A.shift();return function(){return C.apply(B,A.concat($A(arguments)))}},bindAsEventListener:function(){var C=this,A=$A(arguments),B=A.shift();return function(D){return C.apply(B,[D||window.event].concat(A))}},curry:function(){if(!arguments.length){return this}var B=this,A=$A(arguments);return function(){return B.apply(this,A.concat($A(arguments)))}},delay:function(){var C=this,B=$A(arguments),A=B.shift()*1000;return window.setTimeout(function(){return C.apply(C,B)},A)},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)))}}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var B;for(var C=0,A=arguments.length;C<A;C++){var D=arguments[C];try{B=D();break}catch(E){}}return B}};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()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(B,D){var E="",A=this,C;D=arguments.callee.prepareReplacement(D);while(A.length>0){if(C=A.match(B)){E+=A.slice(0,C.index);E+=String.interpret(D(C));A=A.slice(C.index+C[0].length)}else{E+=A,A=""}}return E},sub:function(A,B,C){B=this.gsub.prepareReplacement(B);C=Object.isUndefined(C)?1:C;return this.gsub(A,function(D){if(--C<0){return D[0]}return B(D)})},scan:function(A,B){this.gsub(A,B);return String(this)},truncate:function(A,B){A=A||30;B=Object.isUndefined(B)?"...":B;return this.length>A?this.slice(0,A-B.length)+B:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML},unescapeHTML:function(){var A=new Element("div");A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue}):A.childNodes[0].nodeValue):""},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A){return{}}return A[1].split(B||"&").inject({},function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift());var D=F.length>1?F.join("="):F[0];if(D!=undefined){D=decodeURIComponent(D)}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]]}E[C].push(D)}else{E[C]=D}}return E})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(A){return A<1?"":new Array(A+1).join(this)},camelize:function(){var D=this.split("-"),A=D.length;if(A==1){return D[0]}var B=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var C=1;C<A;C++){B+=D[C].charAt(0).toUpperCase()+D[C].substring(1)}return B},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]];return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16)});if(B){return'"'+A.replace(/"/g,'\\"')+'"'}return"'"+A.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}")},isJSON:function(){var A=this;if(A.blank()){return false}A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(A){return this.indexOf(A)>-1},startsWith:function(A){return this.indexOf(A)===0},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(B,A){return new Template(this,A).evaluate(B)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B}var A=new Template(B);return function(C){return A.evaluate(C)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text)}var Template=Class.create({initialize:function(B,A){this.template=B.toString();this.pattern=A||Template.Pattern},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(F){if(A==null){return""}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].gsub("\\\\]","]"):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={each:function(C,B){var A=0;C=C.bind(B);try{this._each(function(E){C(E,A++)})}catch(D){if(D!=$break){throw D}}return this},eachSlice:function(A,D,C){D=D?D.bind(C):Prototype.K;var B=-A,E=[],F=this.toArray();while((B+=A)<F.length){E.push(F.slice(B,B+A))}return E.collect(D,C)},all:function(B,A){B=B?B.bind(A):Prototype.K;var C=true;this.each(function(E,D){C=C&&!!B(E,D);if(!C){throw $break}});return C},any:function(B,A){B=B?B.bind(A):Prototype.K;var C=false;this.each(function(E,D){if(C=!!B(E,D)){throw $break}});return C},collect:function(C,B){C=C?C.bind(B):Prototype.K;var A=[];this.each(function(E,D){A.push(C(E,D))});return A},detect:function(B,A){B=B.bind(A);var C;this.each(function(E,D){if(B(E,D)){C=E;throw $break}});return C},findAll:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(C(E,D)){A.push(E)}});return A},grep:function(A,D,C){D=D?D.bind(C):Prototype.K;var B=[];if(Object.isString(A)){A=new RegExp(A)}this.each(function(F,E){if(A.match(F)){B.push(D(F,E))}});return B},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true}}var B=false;this.each(function(C){if(C==A){B=true;throw $break}});return B},inGroupsOf:function(A,B){B=Object.isUndefined(B)?null:B;return this.eachSlice(A,function(C){while(C.length<A){C.push(B)}return C})},inject:function(A,C,B){C=C.bind(B);this.each(function(E,D){A=C(A,E,D)});return A},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A)})},max:function(B,A){B=B?B.bind(A):Prototype.K;var C;this.each(function(E,D){E=B(E,D);if(C==null||E>=C){C=E}});return C},min:function(B,A){B=B?B.bind(A):Prototype.K;var C;this.each(function(E,D){E=B(E,D);if(C==null||E<C){C=E}});return C},partition:function(D,B){D=D?D.bind(B):Prototype.K;var C=[],A=[];this.each(function(F,E){(D(F,E)?C:A).push(F)});return[C,A]},pluck:function(A){var B=[];this.each(function(C){B.push(C[A])});return B},reject:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(!C(E,D)){A.push(E)}});return A},sortBy:function(B,A){B=B.bind(A);return this.map(function(D,C){return{value:D,criteria:B(D,C)}}).sort(function(F,E){var D=F.criteria,C=E.criteria;return D<C?-1:D>C?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop()}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(C){if(!C){return[]}if(C.toArray){return C.toArray()}var A=C.length||0,B=new Array(A);while(A--){B[A]=C[A]}return B}if(Prototype.Browser.WebKit){$A=function(C){if(!C){return[]}if(!(Object.isFunction(C)&&C=="[object NodeList]")&&C.toArray){return C.toArray()}var A=C.length||0,B=new Array(A);while(A--){B[A]=C[A]}return B}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(C){for(var B=0,A=this.length;B<A;B++){C(this[B])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(A){return A!=null})},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A])})},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B)})},reverse:function(A){return(A!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C)}return D})},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var A=[];this.each(function(B){var C=Object.toJSON(B);if(!Object.isUndefined(C)){A.push(C)}});return"["+A.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,B){B||(B=0);var A=this.length;if(B<0){B=A+B}for(;B<A;B++){if(this[B]===C){return B}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;var C=this.slice(0,A).reverse().indexOf(B);return(C<0)?C:A-C-1}}Array.prototype.toArray=Array.prototype.clone;function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[];for(var C=0,A=this.length;C<A;C++){E.push(this[C])}for(var C=0,A=arguments.length;C<A;C++){if(Object.isArray(arguments[C])){for(var B=0,D=arguments[C].length;B<D;B++){E.push(arguments[C][B])}}else{E.push(arguments[C])}}return E}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(A){$R(0,this,true).each(A);return this},toPaddedString:function(A,C){var B=this.toString(C||10);return"0".times(A-B.length)+B},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize()});function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function A(B,C){if(Object.isUndefined(C)){return B}return B+"="+encodeURIComponent(String.interpret(C))}return{initialize:function(B){this._object=Object.isHash(B)?B.toObject():Object.clone(B)},_each:function(C){for(var B in this._object){var D=this._object[B],E=[B,D];E.key=B;E.value=D;C(E)}},set:function(B,C){return this._object[B]=C},get:function(B){return this._object[B]},unset:function(B){var C=this._object[B];delete this._object[B];return C},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(C){var B=this.detect(function(D){return D.value===C});return B&&B.key},merge:function(B){return this.clone().update(B)},update:function(B){return new Hash(B).inject(this,function(C,D){C.set(D.key,D.value);return C})},toQueryString:function(){return this.map(function(D){var B=encodeURIComponent(D.key),C=D.value;if(C&&typeof C=="object"){if(Object.isArray(C)){return C.map(A.curry(B)).join("&")}}return A(B,C)}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C;this.end=A;this.exclusive=B},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ()}},include:function(A){if(A<this.start){return false}if(this.exclusive){return A<this.end}return A<=this.end}});var $R=function(C,A,B){return new ObjectRange(C,A,B)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(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(){var A=this.Element;this.Element=function(D,C){C=C||{};D=D.toLowerCase();var B=Element.cache;if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">';delete C.name;return Element.writeAttribute(document.createElement(D),C)}if(!B[D]){B[D]=Element.extend(document.createElement(D))}return Element.writeAttribute(B[D].cloneNode(false),C)};Object.extend(this.Element,A||{})}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){$(A).style.display="none";return A},show:function(A){$(A).style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement()}if(Object.isElement(B)){return A.update().insert(B)}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A},replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(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 $(A).recursivelyCollect("parentNode")},descendants:function(A){return $(A).select("*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling")},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling")},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings())},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(C,D,B){C=$(C);if(arguments.length==1){return $(C.parentNode)}var A=C.ancestors();return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},down:function(B,C,A){B=$(B);if(arguments.length==1){return B.firstDescendant()}return Object.isNumber(C)?B.descendants()[C]:B.select(C)[A||0]},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var C=B.previousSiblings();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},next:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(B))}var C=B.nextSiblings();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},select:function(){var B=$A(arguments),A=$(B.shift());return Selector.findChildElements(A,B)},adjacent:function(){var B=$A(arguments),A=$(B.shift());return Selector.findChildElements(A.parentNode,B).without(A)},identify:function(B){B=$(B);var C=B.readAttribute("id"),A=arguments.callee;if(C){return C}do{C="anonymous_element_"+A.counter++}while($(C));B.writeAttribute("id",C);return C},readAttribute:function(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 $(A).getDimensions().height},getWidth:function(A){return $(A).getDimensions().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(!B.hasClassName(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 B[B.hasClassName(A)?"removeClassName":"addClassName"](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(C,B){C=$(C),B=$(B);var F=B;if(C.compareDocumentPosition){return(C.compareDocumentPosition(B)&8)===8}if(C.sourceIndex&&!Prototype.Browser.Opera){var E=C.sourceIndex,A=B.sourceIndex,D=B.nextSibling;if(!D){do{B=B.parentNode}while(!(D=B.nextSibling)&&B.parentNode)}if(D&&D.sourceIndex){return(E>A&&E<D.sourceIndex)}}while(C=C.parentNode){if(C==F){return true}}return false},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();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){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=$(C).getStyle("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";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(window.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=="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(B.getStyle("position")=="absolute"){return }var A=B.positionedOffset();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(A.getStyle("position")=="relative"){return }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=="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=A.viewportOffset();C=$(C);var F=[0,0];var B=null;if(Element.getStyle(C,"position")=="absolute"){B=C.getOffsetParent();F=B.viewportOffset()}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}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(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);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);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.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={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2)},_getAttrNode:function(A,C){var B=A.getAttributeNode(C);return B?B.value:""},_getEv:function(A,B){B=A.getAttribute(B);return B?B.toString().slice(23,-2):null},_flag:function(A,B){return $(A).hasAttribute(B)?B:null},style:function(A){return A.style.cssText.toLowerCase()},title:function(A){return A.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex "+"encType maxLength readOnly longDesc").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName=="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(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}if(Object.isElement(C)){return B.update().insert(C)}C=Object.toHTML(C);var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D)});Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D)})}else{B.innerHTML=C.stripScripts()}C.evalScripts.bind(C).defer();return B}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(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(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return B&&B.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var B={},A=Element.Methods.ByTag;var C=Object.extend(function(G){if(!G||G._extendedByPrototype||G.nodeType!=1||G==window){return G}var E=Object.clone(B),F=G.tagName,D,H;if(A[F]){Object.extend(E,A[F])}for(D in E){H=E[D];if(Object.isFunction(H)&&!(D in G)){G[D]=H.methodize()}}G._extendedByPrototype=Prototype.emptyFunction;return G},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(B,Element.Methods);Object.extend(B,Element.Methods.Simulated)}}});C.refresh();return C})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)})}if(arguments.length==2){var 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(K,N,M){M=M||false;for(var F in K){var L=K[F];if(!Object.isFunction(L)){continue}if(!M||!(F in N)){N[F]=L.methodize()}}}function E(K){var F;var L={"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(L[K]){F="HTML"+L[K]+"Element"}if(window[F]){return window[F]}F="HTML"+K+"Element";if(window[F]){return window[F]}F="HTML"+K.capitalize()+"Element";if(window[F]){return window[F]}window[F]={};window[F].prototype=document.createElement(K).__proto__;return window[F]}if(I.ElementExtensions){B(Element.Methods,HTMLElement.prototype);B(Element.Methods.Simulated,HTMLElement.prototype,true)}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var H=E(J);if(Object.isUndefined(H)){continue}B(D[J],H.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var A={};var C=Prototype.Browser;$w("width height").each(function(E){var B=E.capitalize();A[E]=(C.WebKit&&!document.evaluate)?self["inner"+B]:(C.Opera)?document.body["client"+B]:document.documentElement["client"+B]});return A},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();this.compileMatcher()},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var A=this.expression;if(Prototype.Browser.WebKit&&(A.include("-of-type")||A.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false}return true},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher()}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return }this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A;if(Selector._cache[E]){this.xpath=Selector._cache[E];return }this.matcher=[".//*"];while(E&&D!=E&&(/\S/).test(E)){D=E;for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A));E=E.replace(A[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;if(this.xpath){return document._getElementsByXPath(this.xpath,A)}return this.matcher(A)},match:function(H){this.tokens=[];var L=this.expression,B=Selector.patterns,F=Selector.assertions;var A,D,E;while(L&&A!==L&&(/\S/).test(L)){A=L;for(var I in B){D=B[I];if(E=L.match(D)){if(F[I]){this.tokens.push([I,Object.clone(E)]);L=L.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()+">"}});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 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,C;var F=[];while(H&&E!=H&&(/\S/).test(H)){E=H;for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B);F.push("("+C.substring(1,C.length-1)+")");H=H.replace(B[0],"");break}}}return"[not("+F.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(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:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6])}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D)}return B},mark:function(A){var D=Prototype.emptyFunction;for(var B=0,C;C=A[B];B++){C._countedByPrototype=D}return A},unmark:function(A){for(var B=0,C;C=A[B];B++){C._countedByPrototype=undefined}return A},index:function(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(!(E=B[C])._countedByPrototype){E._countedByPrototype=Prototype.emptyFunction;D.push(Element.extend(E))}}return Selector.handlers.unmark(D)},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"))}return B},child:function(A){var E=Selector.handlers;for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G)}}}return C},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D)}}return B},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,H,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(C,B,H,A){var G=$(H),E=Selector.handlers;if(!G){return[]}if(!C&&B==document){return[G]}if(C){if(A){if(A=="child"){for(var D=0,F;F=C[D];D++){if(G.parentNode==F){return[G]}}}else{if(A=="descendant"){for(var D=0,F;F=C[D];D++){if(Element.descendantOf(G,F)){return[G]}}}else{if(A=="adjacent"){for(var D=0,F;F=C[D];D++){if(Selector.handlers.previousElementSibling(G)==F){return[G]}}}else{C=E[A](C)}}}}for(var D=0,F;F=C[D];D++){if(F==G){return[G]}}return[]}return(G&&Element.descendantOf(G,B))?[G]:[]},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&&!E.innerHTML.match(/^\s*$/))){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){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.startsWith(A)},"$=":function(B,A){return B.endsWith(A)},"*=":function(B,A){return B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+B.toUpperCase()+"-").include("-"+A.toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip())});return A},matchElements:function(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},unmark:function(A){for(var B=0,C;C=A[B];B++){C.removeAttribute("_countedByPrototype")}return A}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){$(A).reset();return A},serializeElements:function(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!="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(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C))}return B})},getInputs:function(G,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"].include(D.tagName.toLowerCase())})},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"].include(A.type))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.blur();A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(C,B){if(Object.isUndefined(B)){return this[C.type=="select-one"?"selectOne":"selectMany"](C)}else{var E,F,G=!Object.isArray(B);for(var D=0,A=C.length;D<A;D++){E=C.options[D];F=this.optionValue(E);if(G){if(F==B){E.selected=true;return }}else{E.selected=B.include(F)}}}},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)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null}return Element.extend(A)}});Event.Methods=(function(){var B;if(Prototype.Browser.IE){var A={0:1,1:4,2:2};B=function(D,C){return D.button==A[C]}}else{if(Prototype.Browser.WebKit){B=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;case 1:return D.which==1&&D.metaKey;default:return false}}}else{B=function(D,C){return D.which?(D.which===C+1):(D.button===C)}}}return{isLeftClick:function(C){return B(C,0)},isMiddleClick:function(C){return B(C,1)},isRightClick:function(C){return B(C,2)},element:function(D){var C=Event.extend(D).target;return Element.extend(C.nodeType==Node.TEXT_NODE?C.parentNode:C)},findElement:function(E,F){var D=Event.element(E);if(!F){return D}var C=[D].concat(D.ancestors());return Selector.findElement(C,F,0)},pointer:function(C){return{x:C.pageX||(C.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:C.pageY||(C.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}},pointerX:function(C){return Event.pointer(C).x},pointerY:function(C){return Event.pointer(C).y},stop:function(C){Event.extend(C);C.preventDefault();C.stopPropagation();C.stopped=true}}})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize();return B});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(B){if(!B){return false}if(B._extendedByPrototype){return B}B._extendedByPrototype=Prototype.emptyFunction;var C=Event.pointer(B);Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y});return Object.extend(B,A)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,A);return Prototype.K}})();Object.extend(Event,(function(){var A=Event.cache;function D(J){if(J._prototypeEventID){return J._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return J._prototypeEventID=[++arguments.callee.id]}function E(J){if(J&&J.include(":")){return"dataavailable"}if(!Prototype.Browser.IE){J={mouseenter:"mouseover",mouseleave:"mouseout"}[J]||J}return J}function G(J){return A[J]=A[J]||{}}function F(L,J){var K=G(L);return K[J]=K[J]||[]}function I(K,J,L){var O=D(K);var N=F(O,J);if(N.pluck("handler").include(L)){return false}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false}Event.extend(P);L.call(K,P)};if(!(Prototype.Browser.IE)&&["mouseenter","mouseleave"].include(J)){M=M.wrap(function(Q,R){var P=R.relatedTarget,S=R.currentTarget;if(P&&P.nodeType==Node.TEXT_NODE){P=P.parentNode}if(P&&P!=S&&!P.descendantOf(S)){return Q(R)}})}M.handler=L;N.push(M);return M}function H(M,J,K){var L=F(M,J);return L.find(function(N){return N.handler==K})}function B(M,J,K){var L=G(M);if(!L[J]){return false}L[J]=L[J].without(H(M,J,K))}function C(){for(var K in A){for(var J in A[K]){A[K][J]=null}}}if(window.attachEvent){window.attachEvent("onunload",C)}return{observe:function(L,J,M){L=$(L);var K=E(J);var N=I(L,J,M);if(!N){return L}if(L.addEventListener){L.addEventListener(K,N,false)}else{L.attachEvent("on"+K,N)}return L},stopObserving:function(L,J,M){L=$(L);var O=D(L),K=E(J);if(!M&&J){F(O,J).each(function(P){L.stopObserving(J,P.handler)});return L}else{if(!J){Object.keys(G(O)).each(function(P){L.stopObserving(P)});return L}}var N=H(O,J,M);if(!N){return L}if(L.removeEventListener){L.removeEventListener(K,N,false)}else{L.detachEvent("on"+K,N)}B(O,J,M);return L},fire:function(L,K,J){L=$(L);if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement}var M;if(document.createEvent){M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",true,true)}else{M=document.createEventObject();M.eventType="ondataavailable"}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M)}else{L.fireEvent(M.eventType,M)}return Event.extend(M)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var B;function A(){if(document.loaded){return }if(B){window.clearInterval(B)}document.fire("dom:loaded");document.loaded=true}if(Prototype.Browser.IE){document.write("<script id=__onDOMContentLoaded defer src=//:></"+"script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;A()}}}else{if(Prototype.Browser.Gecko||(Prototype.Browser.Opera&&parseFloat(window.opera.version())>=9)){document.addEventListener("DOMContentLoaded",A,false)}else{B=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A()}},0);Event.observe(window,"load",A)}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(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);Element.addMethods();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,"VISITORID":Jamendo_ENV["VISITORID"]||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"}[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{console.log(D);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(A){A=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},A);if(A.serial){A.serial=(++this.nextSerial);this.activeSerials[A.serial]=true}this.sendEvent(["ajax","semaphore"],++this.ajaxSemaphore);var B={};$H(A.params).each(function(D){B[D.key]=D.value});var C=new Ajax.Request(A.url,{asynchronous:A.asynchronous,method:A.method,parameters:B,onFailure:function(){clearTimeout(A.timeoutId);delete this.activeSerials[A.serial];if((--A.retryCount)>=0&&A.tryback(A.retryCount)){this.ajaxSemaphore--;setTimeout(function(){this.ajaxRequest(A)}.bind(this),A.retryDelay)}else{this.sendEvent(["ajax","semaphore"],--this.ajaxSemaphore);if(A.errback){A.errback()}}}.bind(this),onSuccess:function(F){clearTimeout(A.timeoutId);if(!A.serial||(A.serial in this.activeSerials)){delete this.activeSerials[A.serial];this.sendEvent(["ajax","semaphore"],--this.ajaxSemaphore);if(A.callback){try{A.callback(F.responseText,F)}catch(E){Jamendo.log("error in callback: "+E.name+" => "+E.message);if(false){if(!$("errordiv")){var D=$("page");D.insert({bottom:'<div id="errordiv" style="width:1000px;height:200px;visibility:hidden;"></div>'})}$("errordiv").update(E.message.gsub(/\\n/,""));SuperBox.call("localdiv","errordiv")}}}}}.bind(this),onLoading:A.onLoading});if(A.timeout){A.timeoutId=setTimeout(function(){A.timeouted=true;if(C.transport.readyState>0&&C.transport.readyState<4){C.options["onFailure"](C.transport,C.json)}},A.timeout)}return{"options":A,"serial":A.serial,"abort":function(){this.ajaxAbortRequest(A.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{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"){if(String(window.location).indexOf("debug=")!=-1){console.group("do not fetch [/set/"+G+"/postjson/json]");console.log("params=%o",C);console.log("options=%o",H);console.log("hashkey=%s",F);console.groupEnd()}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)}}}}return this.jsonRequest("/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)}})}return this.jsonRequest("/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)},parseStrId:function(D){var C={"originalStrId":D,"relations":[],"targets":[],"format":""};C["params"]=$H();var 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(" ")}C["strId"]=Jamendo.unparseStrId(C);return C},unparseStrId: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"].join(" ")+"/"+B["unit"]+"/"+B["format"]+"/"+B["relations"].join(" ")+"?"+B["params"].toQueryString()},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)},stripStrId:function(B){if(!B){return B}var A=null;var D=B.indexOf("|");if(D>0){A=Jamendo.stripStrId(B.substring(0,D));A+="|";A+=Jamendo.stripStrId(B.substr(D+1))}else{var C=null;var D=B.indexOf("#");if(D>0){C=B.substr(D+1);B=B.substring(0,D)}A=Jamendo.unparseStrId(Jamendo.parseStrId(B));if(C){A+="#"+C}}return A},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},musiclistFromHref:function(A,C){var B=this.musiclistParseHref(A);return this.musiclistFromParams(B["params1"],B["params2"],C)},musiclistFromParams:function(A,B,C){if(typeof (A)=="string"){A=A.split(/\//)}this.jsonRequest("/get/"+A.join("/"),B,C)},musiclistParams2Href:function(A,B){return(A.join("/"))+"/?"+$H(B).toQueryString()},musiclistParsed2Href:function(A){return(A["params1"].join("/"))+"/?"+$H(A["params2"]).toQueryString()},musiclistParseHref:function(A){var C={};C["strId"]=A.replace(/^[^\?]*\/?get\//,"");var B=C["strId"].indexOf("?");if(B==-1){C["params2str"]="";C["params1str"]=C["strId"]}else{C["params2str"]=C["strId"].slice(B);C["params1str"]=C["strId"].slice(0,B)}C["params1"]=C["params1str"].split(/\//);C["strId"]=C["params1str"]+C["params2str"];C["params2"]=$H();$H(C["params2str"].toQueryParams()).each(function(D){C["params2"].set(D.key,decodeURIComponent(D.value).replace(/\+/g," "))});return C},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,B){this.observers.each(function(D){if(this.eventIdMatches(A,D[0])){try{D[1](A,B)}catch(C){Jamendo.log("Error while calling event "+D[0]+" with data "+D[1]);Jamendo.log(C)}}}.bind(this))},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=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(B,A){return A.all(function(D,C){return B[C]==D})},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")}};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,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(!E){E=$("content");var D="#content_text"}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");E.down(D).insert({top:B})}B.getElementsBySelector(".boxok, .boxerror, .boxwait, .boxinfo, .boxwarning").invoke("remove")}C.each(function(H){if(F){return alert(H.text)}var G=new Element("div",{"class":"box"+A.get(H.type)}).update(H.text);G.addClassName("box"+A.get(H.type));if(H.help){var I=new Element("div",{"class":"feedback_help"});if(H.help.text){I.update(H.help.text)}else{if(H.help.link){I.update(new Element("a",H.help.link).update(H.help.link.text))}}G.insert(I)}B.insert({"top":G})})},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])})}},preloadJamButtons:function(A){Jamendo.onReady(function(){var B=new Image();A.each(function(C){B.src=C})})},showLogin:function(C){if(C){var B=$("login_box").previous(".boxerror");if(B){B.hide()}}var A=SuperBox.call("localdiv","page_login");$("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"){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: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)}}}},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))}}}.bind(this,C,E))},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()}})},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))}}}.bind(this,B,D))},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(B,E,A,C,D){if(!this._fbPublish){this._fbPublish=new Jamendo.classes.FacebookPublishStory()}Jamendo.writeApi("social_networks_facebook_story_formatter",[B,E,A,C],function(F){F.auto=D;F.callback=this.shareCallback.bind(this,"facebook",B,E,A);this._fbPublish.publishOnMyWall(F)}.bind(this))},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){if(E[0]){Jamendo.page.updateFeedbacks([{text:E[1],type:"info"}]);this.shareCallback.bind(this,"twitter",B,D,A)}else{window.location.replace(E[1])}}.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)}})}},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()})},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()})},deleteplaylist:function(A){if(confirm(Jamendo.getStr("PLAYLIST_DELETE_QUESTION"))){Jamendo.writeApi("playlist_set",[[["deleteplaylist",A]],true],function(B){Jamendo.page.refresh()})}},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)}})}},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)}else{Jamendo.writeApiWithFeedback("news_setflag",B,A)}},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)}})},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>")}},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()}}},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)})}};__Jamendo_AdHandlerClass=Class.create();__Jamendo_AdHandlerClass.prototype={initialize:function(){this.writeBuffer=[];this.pushedBackBuffer=[];this.flushTimer=false;this.reloadTimer=false;this.started=false;this.currentWriteTarget=false;this.ads=[];this.scriptQueue=[];this.autoFlush=true;this.externalLoadedCallbacks={};this.sas_tmstp=Math.round(Math.random()*10000000000);this.sas_masterflag=1},registerAdSpace:function(E,C,D,F){if(false&&Prototype.Browser.IE){this.sas_tmstp=Math.round(Math.random()*10000000000);this.sas_masterflag=1;var B="";if(this.sas_masterflag==1){this.sas_masterflag=0;B="M"}else{B="S"}var A="http://www.smartadserver.com/call/pubj/"+D+"/"+F+"/"+B+"/"+this.sas_tmstp+"/"+"?";document.write("<"+"script src='"+A+"' type='text/javascript'><"+"/script>")}else{this.ads.push([E,"jamendo_ad_"+C,D,F])}},documentWrite:function(C){if(C.indexOf("//EXECUTIVE")>0){return ;var B=C.match(/var url_download \= \"(.*?)\"\;/g);if(B){B=B[0].substr(B[0].indexOf('"')+1);B=B.substring(0,B.indexOf('"'))}else{return }var A=C.match(/var executive_js \= \"(.*?)\"\;/g);if(A){A=A[0].substr(A[0].indexOf('"')+1);A=A.substring(0,A.indexOf('"'))}else{return }C=C.replace("var ","window.");C=C.substring(0,C.indexOf("//EXECUTIVE"))+"<"+"/script><"+"script src='"+B+A+"'><"+"/script>"}if(this.writeBuffer.length==0){this.writeBuffer.push(C)}else{this.writeBuffer[this.writeBuffer.length-1]+=C}if(this.autoFlush){this.externalLoadedCallbacks[this.currentUrl]=false;clearTimeout(this.flushTimer);this.flushTimer=setTimeout(this.parseWriteBuffer.bind(this),50)}},parseWriteBuffer:function(){var cnt=true;while(cnt&&this.writeBuffer.length>0){var mayBeScriptElement=true;var buffer=this.writeBuffer.shift();if(buffer.indexOf("<"+"script")>=0){var split=buffer.split("<"+"script");buffer=split.shift();mayBeScriptElement=false;this.writeBuffer=split.concat(this.writeBuffer)}if(mayBeScriptElement&&buffer){var external=buffer.match(new RegExp("^([^¤<>]*?) src[ ]?=[ \"']?([^\"'\n>]+)([^¤>]*?)>(</"+"script>)?","i"));if(external){this.writeBuffer.unshift(buffer.substring(external[0].length));if((external[1]+external[3]).toLowerCase().indexOf("vbscript")==-1){var url=external[2];this.pushedBackBuffer=this.writeBuffer.concat(this.pushedBackBuffer);this.writeBuffer=[];this.insertScriptAndContinue(url,true);return }continue}var inline=buffer.match(new RegExp("^([^¤<>]*?)>([^¤]*?)</"+"script>","i"));if(inline){this.writeBuffer.unshift(buffer.substring(inline[0].length));if(inline[1].toLowerCase().indexOf("vbscript")==-1){this.pushedBackBuffer=this.writeBuffer.concat(this.pushedBackBuffer);this.writeBuffer=[];this.autoFlush=false;try{eval(inline[2])}catch(e){Jamendo.log("adhandler error : "+e)}this.autoFlush=true}continue}}if(buffer){$(this.currentWriteTarget).innerHTML+=buffer.replace(/\<noembed.*?\>[^¤>]*?\<\/noembed\>/i,"").replace(/\<noscript.*?\>[^¤>]*?\<\/noscript\>/i,"")}}if(this.writeBuffer.length==0){if(this.pushedBackBuffer.length>0){this.writeBuffer=this.pushedBackBuffer;this.pushedBackBuffer=[];this.parseWriteBuffer()}else{setTimeout(this.shiftScriptQueue.bind(this),50)}}},insertScriptAndContinue:function(A){clearTimeout(this.flushTimer);this.currentUrl=A;this.externalLoadedCallbacks[A]=true;Jamendo.insertScript(A,function(){if(this.externalLoadedCallbacks[A]){clearTimeout(this.flushTimer);this.parseWriteBuffer()}}.bind(this))},shiftScriptQueue:function(){var A=this.scriptQueue.shift();if(A){this.currentWriteTarget=A[1];this.insertScriptAndContinue(A[0])}},start:function(){if(this.started){return }this.started=true;document.write=this.documentWrite.bind(this);document.writeln=function(A){this.documentWrite(A+"\n")}.bind(this);this.reload()},next:function(){this.loadTimer=setTimeout(this.reload.bind(this),Math.random()*1000*60*20+30000)},SmartAdServer:function(C,A,D){var B="";if(this.sas_masterflag==1){this.sas_masterflag=0;B="M"}else{B="S"}document.write("<scr"+'ipt SRC="http://www.smartadserver.com/call/pubj/'+C+"/"+A+"/"+B+"/"+this.sas_tmstp+"/"+escape(D)+'?"></scr'+"ipt>")},addScriptToQueue:function(A,B){this.scriptQueue.push([A,B])},reload:function(){if(false&&Prototype.Browser.IE){return }this.sas_tmstp=Math.round(Math.random()*10000000000);this.sas_masterflag=1;this.ads.each(function(A){this.currentWriteTarget=A[1];$(this.currentWriteTarget).innerHTML="";if(A[0]=="proxyregie"){this.SmartAdServer(A[2],A[3],"")}else{if(A[0]=="test"){this.addScriptToQueue("fixtures/ads.php?id="+A[2]+"&_="+Math.random(),this.currentWriteTarget)}}}.bind(this));this.shiftScriptQueue();this.next()}};Jamendo.AdHandler=new __Jamendo_AdHandlerClass();Jamendo.onReady(function(){Jamendo.AdHandler.start()});Jamendo.classes.Autocompleter=Class.create({initialize:function(A){this.active=false;this.shown=false;this.hasFocus=false;this.currentHover=-1;this.currentRequest=false;this.o=Object.extend({"name":"jamAC_"+Math.random(),"delay":150,"minChars":2,"breakChars":[],"dataSource":"remote","cacheGroup":"","selectCallback":Prototype.K,"fixMenu":Prototype.K,"formatItem":function(B){return B[0]},"postFillMenu":Prototype.K,"autoSelect":false,"cached":true,"categs":[],"disableReturnSubmit":true,"autoSubmitOnBlur":false,"n":10,"input":false},A);this.buildInput();this.buildMenu()},getChoices:function(B,C){if(this.o.breakChars.length>0&&B.gsub("["+this.o.breakChars.join("")+"]*","")!=B){return setTimeout(function(){C([])},10)}if(B.length<this.o.minChars){return setTimeout(function(){C([])},10)}B=B.toLowerCase();if(this.o.dataSource=="remote"){if(this.currentRequest){this.currentRequest.abort()}this.currentRequest=Jamendo.writeApi((this.o.cached?"cached ":"")+"autocomplete",[B,this.o.categs,this.o.n,this.o.cacheGroup],C)}else{var A=(B?this.o.data.findAll(function(D){if(D[0].toLowerCase().indexOf(B)>=0){return true}}):this.o.data);setTimeout(function(){C({"r":A})},10)}},buildInput:function(){if(this.o.input){this.input=$(this.o.input)}if(!this.input){return }this.input.setAttribute("autocomplete","off");Event.observe(this.input,"keydown",this.onKeyDown.bindAsEventListener(this));Event.observe(this.input,"keypress",this.onKeyPress.bindAsEventListener(this));Event.observe(this.input,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.input,"focus",this.onFocus.bindAsEventListener(this))},buildMenu:function(){this.menu=document.createElement("div");this.menu.id="jamACMenu_"+this.o.name;this.menu.className="jamACMenu";this.menu.style.display="none";this.menu.style.position="absolute";$("jamBodyInsert").appendChild(this.menu);this.menu=$(this.menu);this.menuInner=document.createElement("div");this.menuInner.id="jamACMenuInner_"+this.o.name;this.menuInner.className="jamACMenuInner";this.menu.appendChild(this.menuInner);this.menuInner=$(this.menuInner)},fillMenu:function(A,B){this.currentHover=-1;this.menuInner.innerHTML="";this.choices=A.r||[];this.choices.each(function(C,D){this.choices[D]._e=document.createElement("div");this.choices[D]._e.className="jamACMenuItem";this.choices[D]._e.innerHTML=this.o.formatItem(C);Event.observe(this.choices[D]._e,"mouseover",this.hoverItemByIndex.bind(this,D));Event.observe(this.choices[D]._e,"mouseout",this.unhoverItemByIndex.bind(this,D));Event.observe(this.choices[D]._e,"mousedown",this.selectItemByIndex.bind(this,D));this.menuInner.appendChild(this.choices[D]._e);this.choices[D]._e=$(this.choices[D]._e)}.bind(this));this.o.postFillMenu(this);if(B){if(this.choices.length==0){this.hideMenu()}else{this.showMenu()}}},selectItemByIndex:function(B){var A=this.input.value;this.input.value=this.choices[B][0];this.hideMenu();this.o.selectCallback(this.choices[B],A)},hoverItemByIndex:function(A){if(this.choices.length==0){return }if(A==-2){A=-1}if(this.currentHover>=0){this.unhoverItemByIndex(this.currentHover)}this.currentHover=(A+this.choices.length)%(this.choices.length);this.choices[this.currentHover]._e.addClassName("jamACMenuItem_hover")},unhoverItemByIndex:function(A){this.choices[A]._e.removeClassName("jamACMenuItem_hover")},showMenu:function(){if(this.input){var B=this.input.getDimensions();var A=this.menu.getDimensions();if(this.menu.getDimensions().width>B.width){this.menu.clonePosition(this.input,{"offsetTop":B.height,"setWidth":false})}else{this.menu.clonePosition(this.input,{"offsetTop":B.height});this.o.fixMenu.bind(this)(this.menu)}}if(this.currentHover==-1&&this.o.autoSelect){this.hoverItemByIndex(0)}this.menu.show();this.shown=true},hideMenu:function(A){if(A&&this.currentRequest){this.currentRequest.abort()}this.shown=false;this.currentHover=-1;this.menu.hide()},onBlur:function(){if(this.o.autoSubmitOnBlur){if(this.currentHover>=0){this.selectItemByIndex(this.currentHover);this.needsKeyPressFix=true;Event.stop(event)}}else{if(this.currentRequest){this.currentRequest.abort()}}this.hideMenu();this.active=false;this.hasFocus=false},onFocus:function(){this.hideMenu();this.active=true;this.hasFocus=true;this.getChoicesFromInput()},onKeyPress:function(A){if(this.needsKeyPressFix&&A.keyCode==Event.KEY_RETURN&&this.o.disableReturnSubmit){Event.stop(A);this.needsKeyPressFix=false}},onKeyDown:function(A){this.needsKeyPressFix=false;if(!this.hasFocus){this.onFocus()}if(this.shown){switch(A.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:if(this.currentHover>=0){this.selectItemByIndex(this.currentHover);this.needsKeyPressFix=true;Event.stop(A)}else{if(A.keyCode==Event.KEY_TAB){return }}case Event.KEY_ESC:this.hideMenu();Event.stop(A);return ;case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;case 63232:case Event.KEY_UP:this.hoverItemByIndex(this.currentHover-1);if(Prototype.Browser.WebKit){Event.stop(A)}return ;case 63233:case Event.KEY_DOWN:this.hoverItemByIndex(this.currentHover+1);if(Prototype.Browser.WebKit){Event.stop(A)}return }}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return }}if(this.queryTimeout){clearTimeout(this.queryTimeout)}this.queryTimeout=setTimeout(this.getChoicesFromInput.bind(this),this.o.delay)},getChoicesFromInput:function(){this.getChoices(this.input.value,function(A){this.fillMenu(A,true)}.bind(this))}});var $PNGFIX=true;var _pngfix=function(){};if(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)}}};Jamendo.onReady(F)})()}var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF&&typeof doc.appendChild!=UNDEF&&typeof doc.replaceChild!=UNDEF&&typeof doc.removeChild!=UNDEF&&typeof doc.cloneNode!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return }addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<scr"+"ipt id=__ie_ondomload defer=true src=//:></scr"+"ipt>");var s=getElementById("__ie_ondomload");if(s){s.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);callDomLoadFunctions()}}}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function callDomLoadFunctions(){if(isDomLoaded){return }if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return }}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){win.attachEvent("onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName.toLowerCase()=="data"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName.toLowerCase()=="param"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function fixObjectLeaks(id){if(ua.ie&&ua.win&&hasPlayerVersion("8.0.0")){win.attachEvent("onunload",function(){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=function(){}}}obj.parentNode.removeChild(obj)}})}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";win.attachEvent("onload",function(){obj.parentNode.removeChild(obj)})}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";win.attachEvent("onload",function(){obj.parentNode.removeChild(obj)})}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName.toLowerCase()=="param")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";fixObjectLeaks(attObj.id);r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function getElementById(id){return doc.getElementById(id)}function createElement(el){return doc.createElement(el)}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return }var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return }var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom&&isDomLoaded){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return }widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att=(typeof attObj==OBJECT)?attObj:{};att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par=(typeof parObj==OBJECT)?parObj:{};if(typeof flashvarsObj==OBJECT){for(var i in flashvarsObj){if(flashvarsObj[i]!=Object.prototype[i]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+i+"="+flashvarsObj[i]}else{par.flashvars=i+"="+flashvarsObj[i]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom&&isDomLoaded){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return q}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=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"})}})},showObjects:function(){var A=$A(document.getElementsByTagName("object"));A.each(function(B){B=$(B);if(!B.up("#SuperBox_ajaxContent")){B.setStyle({"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(!F){F="remote"}if(L===true){this.jamform=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)}}this.htmlinsert();$("SuperBox_closeWindowButton").onclick=this.remove.bindAsEventListener(this);if(F=="remote"){var K={"callback":function(N){$("SuperBox_ajaxContent").update(N);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;if(typeof (B)=="function"){B()}this.setDim(D.width,D.height);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'>"+this.closeWord+"</a></div><div id='SuperBox_ajaxContent'></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='return SuperBox.remove();'><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}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"){$("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(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"})}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()