var Prototype={Version:"1.7",Browser:function(){var a=navigator.userAgent,b=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!b,Opera:b,WebKit:a.indexOf("AppleWebKit/")>-1,Gecko:a.indexOf("Gecko")>-1&&a.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(a)}}(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:function(){var a=window.Element||window.HTMLElement;return!!(a&&a.prototype)}(),SpecificElementExtensions:function(){if(typeof window.HTMLDivElement!==
"undefined")return true;var a=document.createElement("div"),b=document.createElement("form"),c=false;if(a.__proto__&&a.__proto__!==b.__proto__)c=true;return c}()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false;
var Abstract={},Try={these:function(){for(var a,b=0,c=arguments.length;b<c;b++){var d=arguments[b];try{a=d();break}catch(f){}}return a}},Class=function(){function a(){}var b=function(){for(var c in{toString:1})if(c==="toString")return false;return true}();return{create:function(){function c(){this.initialize.apply(this,arguments)}var d=null,f=$A(arguments);if(Object.isFunction(f[0]))d=f.shift();Object.extend(c,Class.Methods);c.superclass=d;c.subclasses=[];if(d){a.prototype=d.prototype;c.prototype=
new a;d.subclasses.push(c)}d=0;for(var h=f.length;d<h;d++)c.addMethods(f[d]);if(!c.prototype.initialize)c.prototype.initialize=Prototype.emptyFunction;return c.prototype.constructor=c},Methods:{addMethods:function(c){var d=this.superclass&&this.superclass.prototype,f=Object.keys(c);if(b){c.toString!=Object.prototype.toString&&f.push("toString");c.valueOf!=Object.prototype.valueOf&&f.push("valueOf")}for(var h=0,e=f.length;h<e;h++){var g=f[h],i=c[g];if(d&&Object.isFunction(i)&&i.argumentNames()[0]==
"$super"){var l=i;i=function(o){return function(){return d[o].apply(this,arguments)}}(g).wrap(l);i.valueOf=l.valueOf.bind(l);i.toString=l.toString.bind(l)}this.prototype[g]=i}return this}}}}();
(function(){function a(n){switch(n){case null:return l;case void 0:return o}switch(typeof n){case "boolean":return w;case "number":return F;case "string":return M}return O}function b(n,s){for(var r in s)n[r]=s[r];return n}function c(n){return d("",{"":n},[])}function d(n,s,r){s=s[n];var k=typeof s;if(a(s)===O&&typeof s.toJSON==="function")s=s.toJSON(n);n=i.call(s);switch(n){case N:case P:case j:s=s.valueOf()}switch(s){case null:return"null";case true:return"true";case false:return"false"}k=typeof s;
switch(k){case "string":return s.inspect(true);case "number":return isFinite(s)?String(s):"null";case "object":k=0;for(var v=r.length;k<v;k++)if(r[k]===s)throw new TypeError;r.push(s);var t=[];if(n===m){k=0;for(v=s.length;k<v;k++){var C=d(k,s,r);t.push(typeof C==="undefined"?"null":C)}t="["+t.join(",")+"]"}else{var D=Object.keys(s);k=0;for(v=D.length;k<v;k++){n=D[k];C=d(n,s,r);typeof C!=="undefined"&&t.push(n.inspect(true)+":"+C)}t="{"+t.join(",")+"}"}r.pop();return t}}function f(n){return JSON.stringify(n)}
function h(n){if(a(n)!==O)throw new TypeError;var s=[],r;for(r in n)n.hasOwnProperty(r)&&s.push(r);return s}function e(n){return i.call(n)===m}function g(n){return typeof n==="undefined"}var i=Object.prototype.toString,l="Null",o="Undefined",w="Boolean",F="Number",M="String",O="Object",P="[object Boolean]",N="[object Number]",j="[object String]",m="[object Array]",p=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";if(typeof Array.isArray==
"function"&&Array.isArray([])&&!Array.isArray({}))e=Array.isArray;b(Object,{extend:b,inspect:function(n){try{if(g(n))return"undefined";if(n===null)return"null";return n.inspect?n.inspect():String(n)}catch(s){if(s instanceof RangeError)return"...";throw s;}},toJSON:p?f:c,toQueryString:function(n){return $H(n).toQueryString()},toHTML:function(n){return n&&n.toHTML?n.toHTML():String.interpret(n)},keys:Object.keys||h,values:function(n){var s=[],r;for(r in n)s.push(n[r]);return s},clone:function(n){return b({},
n)},isElement:function(n){return!!(n&&n.nodeType==1)},isArray:e,isHash:function(n){return n instanceof Hash},isFunction:function(n){return i.call(n)==="[object Function]"},isString:function(n){return i.call(n)===j},isNumber:function(n){return i.call(n)===N},isDate:function(n){return i.call(n)==="[object Date]"},isUndefined:g})})();
Object.extend(Function.prototype,function(){function a(d,f){for(var h=d.length,e=f.length;e--;)d[h+e]=f[e];return d}function b(d,f){d=c.call(d,0);return a(d,f)}var c=Array.prototype.slice;return{argumentNames:function(){var d=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return d.length==1&&!d[0]?[]:d},bind:function(d){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var f=this,h=c.call(arguments,
1);return function(){var e=b(h,arguments);return f.apply(d,e)}},bindAsEventListener:function(d){var f=this,h=c.call(arguments,1);return function(e){e=a([e||window.event],h);return f.apply(d,e)}},curry:function(){if(!arguments.length)return this;var d=this,f=c.call(arguments,0);return function(){var h=b(f,arguments);return d.apply(this,h)}},delay:function(d){var f=this,h=c.call(arguments,1);d*=1E3;return window.setTimeout(function(){return f.apply(f,h)},d)},defer:function(){return this.delay.apply(this,
a([0.01],arguments))},wrap:function(d){var f=this;return function(){var h=a([f.bind(this)],arguments);return d.apply(this,h)}},methodize:function(){if(this._methodized)return this._methodized;var d=this;return this._methodized=function(){var f=a([this],arguments);return d.apply(null,f)}}}}());
(function(a){function b(){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"}function c(){return this.toISOString()}if(!a.toISOString)a.toISOString=b;if(!a.toJSON)a.toJSON=c})(Date.prototype);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*1E3)},execute:function(){this.callback(this)},stop:function(){if(this.timer){clearInterval(this.timer);this.timer=null}},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=
false;throw a;}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,function(){function a(e){if(Object.isFunction(e))return e;var g=new Template(e);return function(i){return g.evaluate(i)}}function b(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function c(e){var g=this.strip().match(/([^?#]*)(#.*)?$/);if(!g)return{};return g[1].split(e||"&").inject({},function(i,l){if((l=l.split("="))[0]){var o=decodeURIComponent(l.shift()),w=l.length>1?l.join("="):l[0];if(w!=undefined)w=decodeURIComponent(w);if(o in i){Object.isArray(i[o])||
(i[o]=[i[o]]);i[o].push(w)}else i[o]=w}return i})}function d(e){var g=this.unfilterJSON(),i=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(i.test(g))g=g.replace(i,function(o){return"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)});try{if(!e||g.isJSON())return eval("("+g+")")}catch(l){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());}function f(){var e=this.unfilterJSON();return JSON.parse(e)}var h=window.JSON&&
typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;return{gsub:function(e,g){var i="",l=this,o;g=a(g);if(Object.isString(e))e=RegExp.escape(e);if(!(e.length||e.source)){g=g("");return g+l.split("").join(g)+g}for(;l.length>0;)if(o=l.match(e)){i+=l.slice(0,o.index);i+=String.interpret(g(o));l=l.slice(o.index+o[0].length)}else{i+=l;l=""}return i},sub:function(e,g,i){g=a(g);i=Object.isUndefined(i)?1:i;return this.gsub(e,function(l){if(--i<0)return l[0];return g(l)})},scan:function(e,g){this.gsub(e,
g);return String(this)},truncate:function(e,g){e=e||30;g=Object.isUndefined(g)?"...":g;return this.length>e?this.slice(0,e-g.length)+g:String(this)},strip:String.prototype.trim||b,stripTags:function(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")},stripScripts:function(){return this.replace(RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var e=RegExp(Prototype.ScriptFragment,"im");return(this.match(RegExp(Prototype.ScriptFragment,"img"))||[]).map(function(g){return(g.match(e)||
["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(e){return eval(e)})},escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")},toQueryParams:c,parseQuery:c,toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(e){return e<
1?"":Array(e+1).join(this)},camelize:function(){return this.replace(/-+(.)?/g,function(e,g){return g?g.toUpperCase():""})},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()},dasherize:function(){return this.replace(/_/g,"-")},inspect:function(e){var g=this.replace(/[\x00-\x1f\\]/g,function(i){if(i in
String.specialChar)return String.specialChar[i];return"\\u00"+i.charCodeAt().toPaddedString(2,16)});if(e)return'"'+g.replace(/"/g,'\\"')+'"';return"'"+g.replace(/'/g,"\\'")+"'"},unfilterJSON:function(e){return this.replace(e||Prototype.JSONFilter,"$1")},isJSON:function(){var e=this;if(e.blank())return false;e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(e)},
evalJSON:h?f:d,include:function(e){return this.indexOf(e)>-1},startsWith:function(e){return this.lastIndexOf(e,0)===0},endsWith:function(e){var g=this.length-e.length;return g>=0&&this.indexOf(e,g)===g},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(e,g){return(new Template(this,g)).evaluate(e)}}}());
var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements))a=a.toTemplateReplacements();return this.template.gsub(this.pattern,function(b){if(a==null)return b[1]+"";var c=b[1]||"";if(c=="\\")return b[2];var d=a,f=b[3],h=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;b=h.exec(f);if(b==null)return c;for(;b!=null;){var e=b[1].startsWith("[")?b[2].replace(/\\\\]/g,"]"):b[1];d=d[e];if(null==
d||""==b[3])break;f=f.substring("["==b[3]?b[1].length:b[0].length);b=h.exec(f)}return c+String.interpret(d)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={},Enumerable=function(){function a(g,i){g=g||Prototype.K;var l=true;this.each(function(o,w){l=l&&!!g.call(i,o,w);if(!l)throw $break;});return l}function b(g,i){g=g||Prototype.K;var l=false;this.each(function(o,w){if(l=!!g.call(i,o,w))throw $break;});return l}function c(g,i){g=g||Prototype.K;var l=[];this.each(function(o,w){l.push(g.call(i,o,w))});return l}function d(g,i){var l;this.each(function(o,w){if(g.call(i,o,w)){l=o;throw $break;}});return l}function f(g,i){var l=[];this.each(function(o,
w){g.call(i,o,w)&&l.push(o)});return l}function h(g){if(Object.isFunction(this.indexOf))if(this.indexOf(g)!=-1)return true;var i=false;this.each(function(l){if(l==g){i=true;throw $break;}});return i}function e(){return this.map()}return{each:function(g,i){var l=0;try{this._each(function(w){g.call(i,w,l++)})}catch(o){if(o!=$break)throw o;}return this},eachSlice:function(g,i,l){var o=-g,w=[],F=this.toArray();if(g<1)return F;for(;(o+=g)<F.length;)w.push(F.slice(o,o+g));return w.collect(i,l)},all:a,every:a,
any:b,some:b,collect:c,map:c,detect:d,findAll:f,select:f,filter:f,grep:function(g,i,l){i=i||Prototype.K;var o=[];if(Object.isString(g))g=RegExp(RegExp.escape(g));this.each(function(w,F){g.match(w)&&o.push(i.call(l,w,F))});return o},include:h,member:h,inGroupsOf:function(g,i){i=Object.isUndefined(i)?null:i;return this.eachSlice(g,function(l){for(;l.length<g;)l.push(i);return l})},inject:function(g,i,l){this.each(function(o,w){g=i.call(l,g,o,w)});return g},invoke:function(g){var i=$A(arguments).slice(1);
return this.map(function(l){return l[g].apply(l,i)})},max:function(g,i){g=g||Prototype.K;var l;this.each(function(o,w){o=g.call(i,o,w);if(l==null||o>=l)l=o});return l},min:function(g,i){g=g||Prototype.K;var l;this.each(function(o,w){o=g.call(i,o,w);if(l==null||o<l)l=o});return l},partition:function(g,i){g=g||Prototype.K;var l=[],o=[];this.each(function(w,F){(g.call(i,w,F)?l:o).push(w)});return[l,o]},pluck:function(g){var i=[];this.each(function(l){i.push(l[g])});return i},reject:function(g,i){var l=
[];this.each(function(o,w){g.call(i,o,w)||l.push(o)});return l},sortBy:function(g,i){return this.map(function(l,o){return{value:l,criteria:g.call(i,l,o)}}).sort(function(l,o){var w=l.criteria,F=o.criteria;return w<F?-1:w>F?1:0}).pluck("value")},toArray:e,entries:e,zip:function(){var g=Prototype.K,i=$A(arguments);if(Object.isFunction(i.last()))g=i.pop();var l=[this].concat(i).map($A);return this.map(function(o,w){return g(l.pluck(w))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+
this.toArray().inspect()+">"},find:d}}();function $A(a){if(!a)return[];if("toArray"in Object(a))return a.toArray();for(var b=a.length||0,c=Array(b);b--;)c[b]=a[b];return c}function $w(a){if(!Object.isString(a))return[];return(a=a.strip())?a.split(/\s+/):[]}Array.from=$A;
(function(){function a(i,l){for(var o=0,w=this.length>>>0;o<w;o++)o in this&&i.call(l,this[o],o,this)}function b(){return e.call(this,0)}function c(i,l){l||(l=0);var o=this.length;if(l<0)l=o+l;for(;l<o;l++)if(this[l]===i)return l;return-1}function d(i,l){l=isNaN(l)?this.length:(l<0?this.length+l:l)+1;var o=this.slice(0,l).reverse().indexOf(i);return o<0?o:l-o-1}function f(){for(var i=e.call(this,0),l,o=0,w=arguments.length;o<w;o++){l=arguments[o];if(Object.isArray(l)&&!("callee"in l))for(var F=0,
M=l.length;F<M;F++)i.push(l[F]);else i.push(l)}return i}var h=Array.prototype,e=h.slice,g=h.forEach;g||(g=a);Object.extend(h,Enumerable);if(!h._reverse)h._reverse=h.reverse;Object.extend(h,{_each:g,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(i){return i!=null})},flatten:function(){return this.inject([],function(i,l){if(Object.isArray(l))return i.concat(l.flatten());i.push(l);
return i})},without:function(){var i=e.call(arguments,0);return this.select(function(l){return!i.include(l)})},reverse:function(i){return(i===false?this.toArray():this)._reverse()},uniq:function(i){return this.inject([],function(l,o,w){if(0==w||(i?l.last()!=o:!l.include(o)))l.push(o);return l})},intersect:function(i){return this.uniq().findAll(function(l){return i.detect(function(o){return l===o})})},clone:b,toArray:b,size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+
"]"}});if(function(){return[].concat(arguments)[0][0]!==1}(1,2))h.concat=f;if(!h.indexOf)h.indexOf=c;if(!h.lastIndexOf)h.lastIndexOf=d})();function $H(a){return new Hash(a)}
var Hash=Class.create(Enumerable,function(){function a(){return Object.clone(this._object)}function b(c,d){if(Object.isUndefined(d))return c;return c+"="+encodeURIComponent(String.interpret(d))}return{initialize:function(c){this._object=Object.isHash(c)?c.toObject():Object.clone(c)},_each:function(c){for(var d in this._object){var f=this._object[d],h=[d,f];h.key=d;h.value=f;c(h)}},set:function(c,d){return this._object[c]=d},get:function(c){if(this._object[c]!==Object.prototype[c])return this._object[c]},
unset:function(c){var d=this._object[c];delete this._object[c];return d},toObject:a,toTemplateReplacements:a,keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var d=this.detect(function(f){return f.value===c});return d&&d.key},merge:function(c){return this.clone().update(c)},update:function(c){return(new Hash(c)).inject(this,function(d,f){d.set(f.key,f.value);return d})},toQueryString:function(){return this.inject([],function(c,d){var f=encodeURIComponent(d.key),
h=d.value;if(h&&typeof h=="object"){if(Object.isArray(h)){for(var e=[],g=0,i=h.length,l;g<i;g++){l=h[g];e.push(b(f,l))}return c.concat(e)}}else c.push(b(f,h));return c}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(c){return c.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:a,clone:function(){return new Hash(this)}}}());Hash.from=$H;
Object.extend(Number.prototype,function(){return{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(a,b){$R(0,this,true).each(a,b);return this},toPaddedString:function(a,b){var c=this.toString(b||10);return"0".times(a-c.length)+c},abs:function(){return Math.abs(this)},round:function(){return Math.round(this)},ceil:function(){return Math.ceil(this)},floor:function(){return Math.floor(this)}}}());function $R(a,b,c){return new ObjectRange(a,b,c)}
var ObjectRange=Class.create(Enumerable,function(){return{initialize:function(a,b,c){this.start=a;this.end=b;this.exclusive=c},_each:function(a){for(var b=this.start;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}}}()),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){this.include(a)||this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(a,b,c,d){this.each(function(f){if(Object.isFunction(f[a]))try{f[a].apply(f,[b,c,d])}catch(h){}})}};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.isHash(this.options.parameters))this.options.parameters=this.options.parameters.toObject()}});
Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,c){$super(c);this.transport=Ajax.getTransport();this.request(b)},request:function(a){this.url=a;this.method=this.options.method;a=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){a+=(a?"&":"")+"_method="+this.method;this.method="post"}if(a&&this.method==="get")this.url+=(this.url.include("?")?"&":"?")+a;this.parameters=
a.toQueryParams();try{var b=new Ajax.Response(this);this.options.onCreate&&this.options.onCreate(b);Ajax.Responders.dispatch("onCreate",this,b);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);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||a:null;this.transport.send(this.body);!this.options.asynchronous&&
this.transport.overrideMimeType&&this.onStateChange()}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;a>1&&!(a==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){a["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)a.Connection="close"}if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(Object.isFunction(b.push))for(var c=0,d=b.length;c<d;c+=2)a[b[c]]=b[c+1];else $H(b).each(function(h){a[h.key]=h.value})}for(var f in a)this.transport.setRequestHeader(f,a[f])},success:function(){var a=this.getStatus();return!a||a>=200&&a<300||a==304},getStatus:function(){try{if(this.transport.status===
1223)return 204;return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){a=Ajax.Request.Events[a];var b=new Ajax.Response(this);if(a=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(c){this.dispatchException(c)}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"+
a]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+a,this,b,b.headerJSON)}catch(f){this.dispatchException(f)}if(a=="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(a){this.dispatchException(a)}},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(a){this.request=a;a=this.transport=a.transport;var b=this.readyState=a.readyState;if(b>2&&!Prototype.Browser.IE||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(a.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){a=a.responseXML;this.responseXML=Object.isUndefined(a)?null:a;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,b,c,d){this.container={success:b.success||b,failure:b.failure||(b.success?null:b)};d=Object.clone(d);var f=d.onComplete;d.onComplete=function(h,e){this.updateContent(h.responseText);Object.isFunction(f)&&f(h,e)}.bind(this);$super(c,d)},updateContent:function(a){var b=this.container[this.success()?"success":"failure"],c=this.options;c.evalScripts||(a=a.stripScripts());if(b=$(b))if(c.insertion)if(Object.isString(c.insertion)){var d=
{};d[c.insertion]=a;b.insert(d)}else c.insertion(b,a);else b.update(a)}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,d){$super(d);this.onComplete=this.options.onComplete;this.frequency=this.options.frequency||2;this.decay=this.options.decay||1;this.updater={};this.container=b;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},
updateComplete:function(a){if(this.options.decay){this.decay=a.responseText==this.lastText?this.decay*this.options.decay:1;this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});
function $(a){if(arguments.length>1){for(var b=0,c=[],d=arguments.length;b<d;b++)c.push($(arguments[b]));return c}if(Object.isString(a))a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath)document._getElementsByXPath=function(a,b){for(var c=[],d=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),f=0,h=d.snapshotLength;f<h;f++)c.push(Element.extend(d.snapshotItem(f)));return c};window.Node||(Node={});
Node.ELEMENT_NODE||Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});
(function(a){var b=function(){try{var d=document.createElement('<input name="x">');return d.tagName.toLowerCase()==="input"&&d.name==="x"}catch(f){return false}}(),c=a.Element;a.Element=function(d,f){f=f||{};d=d.toLowerCase();var h=Element.cache;if(b&&f.name){d="<"+d+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(d),f)}h[d]||(h[d]=Element.extend(document.createElement(d)));h=(d==="select"?false:"type"in f?false:true)?h[d].cloneNode(false):document.createElement(d);
return Element.writeAttribute(h,f)};Object.extend(a.Element,c||{});if(c)a.Element.prototype=c.prototype})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(a){var b=a._prototypeUID;if(b){Element.stopObserving(a);a._prototypeUID=void 0;delete Element.Storage[b]}};
Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(){var a=function(){var h=document.createElement("select"),e=true;h.innerHTML='<option value="test">test</option>';if(h.options&&h.options[0])e=h.options[0].nodeName.toUpperCase()!==
"OPTION";return e}(),b=function(){try{var h=document.createElement("table");if(h&&h.tBodies){h.innerHTML="<tbody><tr><td>test</td></tr></tbody>";return typeof h.tBodies[0]=="undefined"}}catch(e){return true}}(),c=function(){try{var h=document.createElement("div");h.innerHTML="<link>";return h.childNodes.length===0}catch(e){return true}}(),d=a||b||c,f=function(){var h=document.createElement("script"),e=false;try{h.appendChild(document.createTextNode(""));e=!h.firstChild||h.firstChild&&h.firstChild.nodeType!==
3}catch(g){e=true}return e}();return function(h,e){h=$(h);for(var g=Element._purgeElement,i=h.getElementsByTagName("*"),l=i.length;l--;)g(i[l]);if(e&&e.toElement)e=e.toElement();if(Object.isElement(e))return h.update().insert(e);e=Object.toHTML(e);g=h.tagName.toUpperCase();if(g==="SCRIPT"&&f){h.text=e;return h}if(d)if(g in Element._insertionTranslations.tags){for(;h.firstChild;)h.removeChild(h.firstChild);Element._getContentFromAnonymousElement(g,e.stripScripts()).each(function(o){h.appendChild(o)})}else if(c&&
Object.isString(e)&&e.indexOf("<link")>-1){for(;h.firstChild;)h.removeChild(h.firstChild);Element._getContentFromAnonymousElement(g,e.stripScripts(),true).each(function(o){h.appendChild(o)})}else h.innerHTML=e.stripScripts();else h.innerHTML=e.stripScripts();e.evalScripts.bind(e).defer();return h}}(),replace:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();else if(!Object.isElement(b)){b=Object.toHTML(b);var c=a.ownerDocument.createRange();c.selectNode(a);b.evalScripts.bind(b).defer();b=c.createContextualFragment(b.stripScripts())}a.parentNode.replaceChild(b,
a);return a},insert:function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||b&&(b.toElement||b.toHTML))b={bottom:b};var c,d,f,h;for(h in b){c=b[h];h=h.toLowerCase();d=Element._insertionTranslations[h];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c))d(a,c);else{c=Object.toHTML(c);f=(h=="before"||h=="after"?a.parentNode:a).tagName.toUpperCase();f=Element._getContentFromAnonymousElement(f,c.stripScripts());if(h=="top"||h=="after")f.reverse();f.each(d.curry(a));c.evalScripts.bind(c).defer()}}return a},
wrap:function(a,b,c){a=$(a);if(Object.isElement(b))$(b).writeAttribute(c||{});else b=Object.isString(b)?new Element(b,c):new Element("div",b);a.parentNode&&a.parentNode.replaceChild(b,a);b.appendChild(a);return b},inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(c){var d=c.first();c=c.last();if(d=(a[d]||"").toString())b+=" "+c+"="+d.inspect(true)});return b+">"},recursivelyCollect:function(a,b,c){a=$(a);c=c||-1;for(var d=[];a=a[b];){a.nodeType==
1&&d.push(Element.extend(a));if(d.length==c)break}return d},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){for(a=$(a).firstChild;a&&a.nodeType!=1;)a=a.nextSibling;return $(a)},immediateDescendants:function(a){var b=[];for(a=$(a).firstChild;a;){a.nodeType===1&&b.push(Element.extend(a));a=a.nextSibling}return b},previousSiblings:function(a){return Element.recursivelyCollect(a,"previousSibling")},
nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(a,b){a=$(a);if(Object.isString(b))return Prototype.Selector.match(a,b);return b.match(a)},up:function(a,b,c){a=$(a);if(arguments.length==1)return $(a.parentNode);var d=Element.ancestors(a);return Object.isNumber(b)?d[b]:Prototype.Selector.find(d,b,c)},down:function(a,b,c){a=$(a);if(arguments.length==1)return Element.firstDescendant(a);
return Object.isNumber(b)?Element.descendants(a)[b]:Element.select(a,b)[c||0]},previous:function(a,b,c){a=$(a);if(Object.isNumber(b)){c=b;b=false}Object.isNumber(c)||(c=0);return b?Prototype.Selector.find(a.previousSiblings(),b,c):a.recursivelyCollect("previousSibling",c+1)[c]},next:function(a,b,c){a=$(a);if(Object.isNumber(b)){c=b;b=false}Object.isNumber(c)||(c=0);if(b)return Prototype.Selector.find(a.nextSiblings(),b,c);else{Object.isNumber(c);return a.recursivelyCollect("nextSibling",c+1)[c]}},
select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b)return b;do b="anonymous_element_"+Element.idCounter++;while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var c=
Element._attributeTranslations.read;if(c.values[b])return c.values[b](a,b);if(c.names[b])b=c.names[b];if(b.include(":"))return!a.attributes||!a.attributes[b]?null:a.attributes[b].value}return a.getAttribute(b)},writeAttribute:function(a,b,c){a=$(a);var d={},f=Element._attributeTranslations.write;if(typeof b=="object")d=b;else d[b]=Object.isUndefined(c)?true:c;for(var h in d){b=f.names[h]||h;c=d[h];if(f.values[h])b=f.values[h](a,c);if(c===false||c===null)a.removeAttribute(b);else c===true?a.setAttribute(b,
b):a.setAttribute(b,c)}return a},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(a=$(a)){var c=a.className;return c.length>0&&(c==b||RegExp("(^|\\s)"+b+"(\\s|$)").test(c))}},addClassName:function(a,b){if(a=$(a)){Element.hasClassName(a,b)||(a.className+=(a.className?" ":"")+b);return a}},removeClassName:function(a,b){if(a=$(a)){a.className=
a.className.replace(RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a}},toggleClassName:function(a,b){if(a=$(a))return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(a){a=$(a);for(var b=a.firstChild;b;){var c=b.nextSibling;b.nodeType==3&&!/\S/.test(b.nodeValue)&&a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(a,b){a=$(a);b=$(b);if(a.compareDocumentPosition)return(a.compareDocumentPosition(b)&
8)===8;if(b.contains)return b.contains(a)&&b!==a;for(;a=a.parentNode;)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);b=b=="float"?"cssFloat":b.camelize();var c=a.style[b];if(!c||c=="auto")c=(c=document.defaultView.getComputedStyle(a,null))?c[b]:null;if(b=="opacity")return c?parseFloat(c):1;return c=="auto"?null:c},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(a,
b){a=$(a);var c=a.style;if(Object.isString(b)){a.style.cssText+=";"+b;return b.include("opacity")?a.setOpacity(b.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var d in b)if(d=="opacity")a.setOpacity(b[d]);else c[d=="float"||d=="cssFloat"?Object.isUndefined(c.styleFloat)?"cssFloat":"styleFloat":d]=b[d];return a},setOpacity:function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=
true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden")a.style.overflow="hidden";return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=
a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(a,b,c){c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},c||{});b=$(b);var d=Element.viewportOffset(b),f=[0,0],h=null;a=$(a);if(Element.getStyle(a,"position")=="absolute"){h=Element.getOffsetParent(a);f=Element.viewportOffset(h)}if(h==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=d[0]-f[0]+c.offsetLeft+"px";if(c.setTop)a.style.top=
d[1]-f[1]+c.offsetTop+"px";if(c.setWidth)a.style.width=b.offsetWidth+"px";if(c.setHeight)a.style.height=b.offsetHeight+"px";return a}};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,b,c){switch(c){case "height":case "width":if(!Element.visible(b))return null;var d=parseInt(a(b,c),10);if(d!==b["offset"+c.capitalize()])return d+"px";return(c==="height"?["border-top-width","padding-top","padding-bottom","border-bottom-width"]:["border-left-width","padding-left","padding-right","border-right-width"]).inject(d,function(f,h){var e=a(b,h);return e===null?f:f-parseInt(e,10)})+"px";default:return a(b,
c)}});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.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(a,b){a=$(a);var c=a.currentStyle;if(c&&!c.hasLayout||!c&&a.style.zoom=="normal")a.style.zoom=1;c=a.getStyle("filter");var d=a.style;if(b==1||b===""){(c=c.replace(/alpha\([^\)]*\)/gi,""))?d.filter=c:d.removeAttribute("filter");return a}else if(b<1.0E-5)b=0;d.filter=c.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+b*100+")";return a};Element._attributeTranslations=function(){var a="className",b=
"for",c=document.createElement("div");c.setAttribute(a,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x")a="class"}c=null;c=document.createElement("label");c.setAttribute(b,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x")b="htmlFor"}c=null;return{read:{names:{"class":a,className:a,"for":b,htmlFor:b},values:{_getAttr:function(d,f){return d.getAttribute(f)},_getAttr2:function(d,f){return d.getAttribute(f,2)},_getAttrNode:function(d,f){var h=d.getAttributeNode(f);
return h?h.value:""},_getEv:function(){var d=document.createElement("div"),f;d.onclick=Prototype.emptyFunction;d=d.getAttribute("onclick");if(String(d).indexOf("{")>-1)f=function(h,e){e=h.getAttribute(e);if(!e)return null;e=e.toString();e=e.split("{")[1];e=e.split("}")[0];return e.strip()};else if(d==="")f=function(h,e){e=h.getAttribute(e);if(!e)return null;return e.strip()};d=null;return f}(),_flag:function(d,f){return $(d).hasAttribute(f)?f:null},style:function(d){return d.style.cssText.toLowerCase()},
title:function(d){return d.title}}}}}();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=
a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,
onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);Prototype.BrowserFeatures.ElementExtensions&&function(){Element.Methods.down=function(a,b,c){a=$(a);if(arguments.length==1)return a.firstDescendant();var d;if(Object.isNumber(b)){d=a.getElementsByTagName("*");for(var f=[],h=0,e;e=d[h];h++)e.tagName!=="!"&&f.push(e);d=f[b]}else d=Element.select(a,b)[c||0];return d}}()}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<1.0E-5?0:b;return a};else if(Prototype.Browser.WebKit)Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;if(b==1)if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else try{var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(d){}return a};
if("outerHTML"in document.documentElement)Element.Methods.replace=function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b)){a.parentNode.replaceChild(b,a);return a}b=Object.toHTML(b);var c=a.parentNode,d=c.tagName.toUpperCase();if(Element._insertionTranslations.tags[d]){var f=a.next();d=Element._getContentFromAnonymousElement(d,b.stripScripts());c.removeChild(a);f?d.each(function(h){c.insertBefore(h,f)}):d.each(function(h){c.appendChild(h)})}else a.outerHTML=b.stripScripts();
b.evalScripts.bind(b).defer();return a};Element._returnOffset=function(a,b){var c=[a,b];c.left=a;c.top=b;return c};Element._getContentFromAnonymousElement=function(a,b,c){var d=new Element("div");a=Element._insertionTranslations.tags[a];var f=false;if(a)f=true;else if(c){f=true;a=["","",0]}if(f){d.innerHTML="&nbsp;"+a[0]+b+a[1];d.removeChild(d.firstChild);for(b=a[2];b--;)d=d.firstChild}else d.innerHTML=b;return $A(d.childNodes)};
Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,b){b=Element._attributeTranslations.has[b]||b;var c=$(a).getAttributeNode(b);return!!(c&&c.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);
(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}})(document.createElement("div"));
Element.extend=function(){function a(f,h){for(var e in h){var g=h[e];if(Object.isFunction(g)&&!(e in f))f[e]=g.methodize()}}var b=function(f){if(typeof window.Element!="undefined"){var h=window.Element.prototype;if(h){var e="_"+(Math.random()+"").slice(2);f=document.createElement(f);h[e]="x";f=f[e]!=="x";delete h[e];return f}}return false}("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(b)return function(f){if(f&&typeof f._extendedByPrototype=="undefined"){var h=f.tagName;if(h&&
/^(?:object|applet|embed)$/i.test(h)){a(f,Element.Methods);a(f,Element.Methods.Simulated);a(f,Element.Methods.ByTag[h.toUpperCase()])}}return f};return Prototype.K}var c={},d=Element.Methods.ByTag;b=Object.extend(function(f){if(!f||typeof f._extendedByPrototype!="undefined"||f.nodeType!=1||f==window)return f;var h=Object.clone(c),e=f.tagName.toUpperCase();d[e]&&Object.extend(h,d[e]);a(f,h);f._extendedByPrototype=Prototype.emptyFunction;return f},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(c,
Element.Methods);Object.extend(c,Element.Methods.Simulated)}}});b.refresh();return b}();Element.hasAttribute=document.documentElement.hasAttribute?function(a,b){return a.hasAttribute(b)}:Element.Methods.Simulated.hasAttribute;
Element.addMethods=function(a){function b(i){i=i.toUpperCase();Element.Methods.ByTag[i]||(Element.Methods.ByTag[i]={});Object.extend(Element.Methods.ByTag[i],a)}function c(i,l,o){o=o||false;for(var w in i){var F=i[w];if(Object.isFunction(F))if(!o||!(w in l))l[w]=F.methodize()}}function d(i){var l,o={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(o[i])l="HTML"+o[i]+"Element";if(window[l])return window[l];l="HTML"+i+"Element";if(window[l])return window[l];l="HTML"+i.capitalize()+"Element";if(window[l])return window[l];i=document.createElement(i);return i.__proto__||i.constructor.prototype}
var f=Prototype.BrowserFeatures,h=Element.Methods.ByTag;if(!a){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),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var e=a;a=arguments[1]}if(e)Object.isArray(e)?e.each(b):b(e);else Object.extend(Element.Methods,
a||{});e=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(f.ElementExtensions){c(Element.Methods,e);c(Element.Methods.Simulated,e,true)}if(f.SpecificElementExtensions)for(var g in Element.Methods.ByTag){f=d(g);Object.isUndefined(f)||c(h[g],f.prototype)}Object.extend(Element,Element.Methods);delete Element.ByTag;Element.extend.refresh&&Element.extend.refresh();Element.cache={}};
document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};
(function(a){function b(){if(d.WebKit&&!f.evaluate)return document;if(d.Opera&&window.parseFloat(window.opera.version())<9.5)return document.body;return document.documentElement}function c(g){h||(h=b());e[g]="client"+g;a["get"+g]=function(){return h[e[g]]};return a["get"+g]()}var d=Prototype.Browser,f=document,h,e={};a.getWidth=c.curry("Width");a.getHeight=c.curry("Height")})(document.viewport);Element.Storage={UID:1};
Element.addMethods({getStorage:function(a){if(a=$(a)){if(a===window)a=0;else{if(typeof a._prototypeUID==="undefined")a._prototypeUID=Element.Storage.UID++;a=a._prototypeUID}Element.Storage[a]||(Element.Storage[a]=$H());return Element.Storage[a]}},store:function(a,b,c){if(a=$(a)){arguments.length===2?Element.getStorage(a).update(b):Element.getStorage(a).set(b,c);return a}},retrieve:function(a,b,c){if(a=$(a)){a=Element.getStorage(a);var d=a.get(b);if(Object.isUndefined(d)){a.set(b,c);d=c}return d}},
clone:function(a,b){if(a=$(a)){var c=a.cloneNode(b);c._prototypeUID=void 0;if(b)for(var d=Element.select(c,"*"),f=d.length;f--;)d[f]._prototypeUID=void 0;return Element.extend(c)}},purge:function(a){if(a=$(a)){var b=Element._purgeElement;b(a);a=a.getElementsByTagName("*");for(var c=a.length;c--;)b(a[c]);return null}}});
(function(){function a(e,g,i){var l=null;if(Object.isElement(e)){l=e;e=l.getStyle(g)}if(e===null)return null;if(/^(?:-)?\d+(\.\d+)?(px)?$/i.test(e))return window.parseFloat(e);var o=e.include("%"),w=i===document.viewport;if(/\d/.test(e)&&l&&l.runtimeStyle&&!(o&&w)){i=l.style.left;g=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=e||0;e=l.style.pixelLeft;l.style.left=i;l.runtimeStyle.left=g;return e}if(l&&o){i=i||l.parentNode;e=(e=e.match(/^(\d+)%?$/i))?Number(e[1])/100:null;
o=null;l.getStyle("position");l=g.include("left")||g.include("right")||g.include("width");g=g.include("top")||g.include("bottom")||g.include("height");if(i===document.viewport)if(l)o=document.viewport.getWidth();else{if(g)o=document.viewport.getHeight()}else if(l)o=$(i).measure("width");else if(g)o=$(i).measure("height");return o===null?0:o*e}return 0}function b(e){e=$(e);if(e.nodeType===Node.DOCUMENT_NODE||f(e)||e.nodeName.toUpperCase()==="BODY"||e.nodeName.toUpperCase()==="HTML")return $(document.body);
if(Element.getStyle(e,"display")!=="inline"&&e.offsetParent)return $(e.offsetParent);for(;(e=e.parentNode)&&e!==document.body;)if(Element.getStyle(e,"position")!=="static")return e.nodeName.toUpperCase()==="HTML"?$(document.body):$(e);return $(document.body)}function c(e){e=$(e);var g=0,i=0;if(e.parentNode){do{g+=e.offsetTop||0;i+=e.offsetLeft||0;e=e.offsetParent}while(e)}return new Element.Offset(i,g)}function d(e){e=$(e);var g=e.getLayout(),i=0,l=0;do{i+=e.offsetTop||0;l+=e.offsetLeft||0;if(e=e.offsetParent){if(e.nodeName.toUpperCase()===
"BODY")break;if(Element.getStyle(e,"position")!=="static")break}}while(e);l-=g.get("margin-top");i-=g.get("margin-left");return new Element.Offset(l,i)}function f(e){return e!==document.body&&!Element.descendantOf(e,document.body)}var h=Prototype.K;if("currentStyle"in document.documentElement)h=function(e){if(!e.currentStyle.hasLayout)e.style.zoom=1;return e};Element.Layout=Class.create(Hash,{initialize:function($super,g,i){$super();this.element=$(g);Element.Layout.PROPERTIES.each(function(l){this._set(l,
null)},this);if(i){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(e,g){return Hash.prototype.set.call(this,e,g)},set:function(){throw"Properties of Element.Layout are read-only.";},get:function($super,g){var i=$super(g);return i===null?this._compute(g):i},_begin:function(){if(!this._prepared){var e=this.element,g;a:{for(g=e;g&&g.parentNode;){if(g.getStyle("display")==="none"){g=false;break a}g=$(g.parentNode)}g=
true}if(!g){e.store("prototype_original_styles",{position:e.style.position||"",width:e.style.width||"",visibility:e.style.visibility||"",display:e.style.display||""});g=e.getStyle("position");var i=e.getStyle("width");if(i==="0px"||i===null){e.style.display="block";i=e.getStyle("width")}var l=g==="fixed"?document.viewport:e.parentNode;e.setStyle({position:"absolute",visibility:"hidden",display:"block"});var o=e.getStyle("width");g=i&&o===i?a(e,"width",l):g==="absolute"||g==="fixed"?a(e,"width",l):
$(e.parentNode).getLayout().get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right");e.setStyle({width:g+"px"})}this._prepared=true}},_end:function(){var e=this.element,g=e.retrieve("prototype_original_styles");e.store("prototype_original_styles",null);e.setStyle(g);this._prepared=false},_compute:function(e){var g=Element.Layout.COMPUTATIONS;if(!(e in g))throw"Property not found.";return this._set(e,
g[e].call(this,this.element))},toObject:function(){var e=$A(arguments),g={};(e.length===0?Element.Layout.PROPERTIES:e.join(" ").split(" ")).each(function(i){if(Element.Layout.PROPERTIES.include(i)){var l=this.get(i);if(l!=null)g[i]=l}},this);return g},toHash:function(){var e=this.toObject.apply(this,arguments);return new Hash(e)},toCSS:function(){var e=$A(arguments),g={};(e.length===0?Element.Layout.PROPERTIES:e.join(" ").split(" ")).each(function(i){if(Element.Layout.PROPERTIES.include(i))if(!Element.Layout.COMPOSITE_PROPERTIES.include(i)){var l=
this.get(i);if(l!=null){if(i.include("border"))i+="-width";i=i.camelize();g[i]=l+"px"}}},this);return g},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),
COMPUTATIONS:{height:function(){this._preComputing||this._begin();var e=this.get("border-box-height");if(e<=0){this._preComputing||this._end();return 0}var g=this.get("border-top"),i=this.get("border-bottom"),l=this.get("padding-top"),o=this.get("padding-bottom");this._preComputing||this._end();return e-g-i-l-o},width:function(){this._preComputing||this._begin();var e=this.get("border-box-width");if(e<=0){this._preComputing||this._end();return 0}var g=this.get("border-left"),i=this.get("border-right"),
l=this.get("padding-left"),o=this.get("padding-right");this._preComputing||this._end();return e-g-i-l-o},"padding-box-height":function(){var e=this.get("height"),g=this.get("padding-top"),i=this.get("padding-bottom");return e+g+i},"padding-box-width":function(){var e=this.get("width"),g=this.get("padding-left"),i=this.get("padding-right");return e+g+i},"border-box-height":function(e){this._preComputing||this._begin();e=e.offsetHeight;this._preComputing||this._end();return e},"border-box-width":function(e){this._preComputing||
this._begin();e=e.offsetWidth;this._preComputing||this._end();return e},"margin-box-height":function(){var e=this.get("border-box-height"),g=this.get("margin-top"),i=this.get("margin-bottom");if(e<=0)return 0;return e+g+i},"margin-box-width":function(){var e=this.get("border-box-width"),g=this.get("margin-left"),i=this.get("margin-right");if(e<=0)return 0;return e+g+i},top:function(e){return e.positionedOffset().top},bottom:function(e){var g=e.positionedOffset();e=e.getOffsetParent().measure("height");
var i=this.get("border-box-height");return e-i-g.top},left:function(e){return e.positionedOffset().left},right:function(e){var g=e.positionedOffset();e=e.getOffsetParent().measure("width");var i=this.get("border-box-width");return e-i-g.left},"padding-top":function(e){return a(e,"paddingTop")},"padding-bottom":function(e){return a(e,"paddingBottom")},"padding-left":function(e){return a(e,"paddingLeft")},"padding-right":function(e){return a(e,"paddingRight")},"border-top":function(e){return a(e,"borderTopWidth")},
"border-bottom":function(e){return a(e,"borderBottomWidth")},"border-left":function(e){return a(e,"borderLeftWidth")},"border-right":function(e){return a(e,"borderRightWidth")},"margin-top":function(e){return a(e,"marginTop")},"margin-bottom":function(e){return a(e,"marginBottom")},"margin-left":function(e){return a(e,"marginLeft")},"margin-right":function(e){return a(e,"marginRight")}}});"getBoundingClientRect"in document.documentElement&&Object.extend(Element.Layout.COMPUTATIONS,{right:function(e){var g=
h(e.getOffsetParent());e=e.getBoundingClientRect();return(g.getBoundingClientRect().right-e.right).round()},bottom:function(e){var g=h(e.getOffsetParent());e=e.getBoundingClientRect();return(g.getBoundingClientRect().bottom-e.bottom).round()}});Element.Offset=Class.create({initialize:function(e,g){this.left=e.round();this.top=g.round();this[0]=this.left;this[1]=this.top},relativeTo:function(e){return new Element.Offset(this.left-e.left,this.top-e.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},
toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});if(Prototype.Browser.IE){b=b.wrap(function(e,g){g=$(g);if(g.nodeType===Node.DOCUMENT_NODE||f(g)||g.nodeName.toUpperCase()==="BODY"||g.nodeName.toUpperCase()==="HTML")return $(document.body);var i=g.getStyle("position");if(i!=="static")return e(g);g.setStyle({position:"relative"});var l=e(g);g.setStyle({position:i});return l});d=d.wrap(function(e,g){g=$(g);if(!g.parentNode)return new Element.Offset(0,
0);var i=g.getStyle("position");if(i!=="static")return e(g);var l=g.getOffsetParent();l&&l.getStyle("position")==="fixed"&&h(l);g.setStyle({position:"relative"});l=e(g);g.setStyle({position:i});return l})}else if(Prototype.Browser.Webkit)c=function(e){e=$(e);var g=0,i=0;do{g+=e.offsetTop||0;i+=e.offsetLeft||0;if(e.offsetParent==document.body)if(Element.getStyle(e,"position")=="absolute")break;e=e.offsetParent}while(e);return new Element.Offset(i,g)};Element.addMethods({getLayout:function(e,g){return new Element.Layout(e,
g)},measure:function(e,g){return $(e).getLayout().get(g)},getDimensions:function(e){e=$(e);var g=Element.getStyle(e,"display");if(g&&g!=="none")return{width:e.offsetWidth,height:e.offsetHeight};g=e.style;g={visibility:g.visibility,position:g.position,display:g.display};var i={visibility:"hidden",display:"block"};if(g.position!=="fixed")i.position="absolute";Element.setStyle(e,i);i={width:e.offsetWidth,height:e.offsetHeight};Element.setStyle(e,g);return i},getOffsetParent:b,cumulativeOffset:c,positionedOffset:d,
cumulativeScrollOffset:function(e){var g=0,i=0;do{g+=e.scrollTop||0;i+=e.scrollLeft||0;e=e.parentNode}while(e);return new Element.Offset(i,g)},viewportOffset:function(e){$(o);var g=0,i=0,l=document.body,o=e;do{g+=o.offsetTop||0;i+=o.offsetLeft||0;if(o.offsetParent==l&&Element.getStyle(o,"position")=="absolute")break}while(o=o.offsetParent);o=e;do if(o!=l){g-=o.scrollTop||0;i-=o.scrollLeft||0}while(o=o.parentNode);return new Element.Offset(i,g)},absolutize:function(e){e=$(e);if(Element.getStyle(e,
"position")==="absolute")return e;var g=b(e),i=e.viewportOffset();g=g.viewportOffset();i=i.relativeTo(g);g=e.getLayout();e.store("prototype_absolutize_original_styles",{left:e.getStyle("left"),top:e.getStyle("top"),width:e.getStyle("width"),height:e.getStyle("height")});e.setStyle({position:"absolute",top:i.top+"px",left:i.left+"px",width:g.get("width")+"px",height:g.get("height")+"px"});return e},relativize:function(e){e=$(e);if(Element.getStyle(e,"position")==="relative")return e;var g=e.retrieve("prototype_absolutize_original_styles");
g&&e.setStyle(g);return e}});"getBoundingClientRect"in document.documentElement&&Element.addMethods({viewportOffset:function(e){e=$(e);if(f(e))return new Element.Offset(0,0);e=e.getBoundingClientRect();var g=document.documentElement;return new Element.Offset(e.left-g.clientLeft,e.top-g.clientTop)}})})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};
Prototype.Selector=function(){function a(c){for(var d=0,f=c.length;d<f;d++)Element.extend(c[d]);return c}var b=Prototype.K;return{select:function(){throw Error('Method "Prototype.Selector.select" must be defined.');},match:function(){throw Error('Method "Prototype.Selector.match" must be defined.');},find:function(c,d,f){f=f||0;var h=Prototype.Selector.match,e=c.length,g=0,i;for(i=0;i<e;i++)if(h(c[i],d)&&f==g++)return Element.extend(c[i])},extendElements:Element.extend===b?b:a,extendElement:Element.extend}}();
Prototype._original_property=window.Sizzle;
(function(){function a(j,m,p,n,s,r){s=j=="previousSibling"&&!r;for(var k=0,v=n.length;k<v;k++){var t=n[k];if(t){if(s&&t.nodeType===1){t.sizcache=p;t.sizset=k}t=t[j];for(var C=false;t;){if(t.sizcache===p){C=n[t.sizset];break}if(t.nodeType===1&&!r){t.sizcache=p;t.sizset=k}if(t.nodeName===m){C=t;break}t=t[j]}n[k]=C}}}function b(j,m,p,n,s,r){s=j=="previousSibling"&&!r;for(var k=0,v=n.length;k<v;k++){var t=n[k];if(t){if(s&&t.nodeType===1){t.sizcache=p;t.sizset=k}t=t[j];for(var C=false;t;){if(t.sizcache===
p){C=n[t.sizset];break}if(t.nodeType===1){if(!r){t.sizcache=p;t.sizset=k}if(typeof m!=="string"){if(t===m){C=true;break}}else if(g.filter(m,[t]).length>0){C=t;break}}t=t[j]}n[k]=C}}}var c=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,f=Object.prototype.toString,h=false,e=true;[0,0].sort(function(){e=false;return 0});var g=function(j,m,p,n){p=p||[];var s=m=m||document;if(m.nodeType!==1&&m.nodeType!==9)return[];
if(!j||typeof j!=="string")return p;for(var r=[],k,v,t,C,D=true,J=P(m),G=j;(c.exec(""),k=c.exec(G))!==null;){G=k[3];r.push(k[1]);if(k[2]){C=k[3];break}}if(r.length>1&&l.exec(j))if(r.length===2&&i.relative[r[0]])v=N(r[0]+r[1],m);else for(v=i.relative[r[0]]?[m]:g(r.shift(),m);r.length;){j=r.shift();if(i.relative[j])j+=r.shift();v=N(j,v)}else{if(!n&&r.length>1&&m.nodeType===9&&!J&&i.match.ID.test(r[0])&&!i.match.ID.test(r[r.length-1])){k=g.find(r.shift(),m,J);m=k.expr?g.filter(k.expr,k.set)[0]:k.set[0]}if(m){k=
n?{expr:r.pop(),set:w(n)}:g.find(r.pop(),r.length===1&&(r[0]==="~"||r[0]==="+")&&m.parentNode?m.parentNode:m,J);v=k.expr?g.filter(k.expr,k.set):k.set;if(r.length>0)t=w(v);else D=false;for(;r.length;){var I=r.pop();k=I;if(i.relative[I])k=r.pop();else I="";if(k==null)k=m;i.relative[I](t,k,J)}}else t=[]}t||(t=v);if(!t)throw"Syntax error, unrecognized expression: "+(I||j);if(f.call(t)==="[object Array]")if(D)if(m&&m.nodeType===1)for(j=0;t[j]!=null;j++){if(t[j]&&(t[j]===true||t[j].nodeType===1&&O(m,t[j])))p.push(v[j])}else for(j=
0;t[j]!=null;j++)t[j]&&t[j].nodeType===1&&p.push(v[j]);else p.push.apply(p,t);else w(t,p);if(C){g(C,s,p,n);g.uniqueSort(p)}return p};g.uniqueSort=function(j){if(M){h=e;j.sort(M);if(h)for(var m=1;m<j.length;m++)j[m]===j[m-1]&&j.splice(m--,1)}return j};g.matches=function(j,m){return g(j,null,null,m)};g.find=function(j,m,p){var n,s;if(!j)return[];for(var r=0,k=i.order.length;r<k;r++){var v=i.order[r];if(s=i.leftMatch[v].exec(j)){var t=s[1];s.splice(1,1);if(t.substr(t.length-1)!=="\\"){s[1]=(s[1]||"").replace(/\\/g,
"");n=i.find[v](s,m,p);if(n!=null){j=j.replace(i.match[v],"");break}}}}n||(n=m.getElementsByTagName("*"));return{set:n,expr:j}};g.filter=function(j,m,p,n){for(var s=j,r=[],k=m,v,t,C=m&&m[0]&&P(m[0]);j&&m.length;){for(var D in i.filter)if((v=i.match[D].exec(j))!=null){var J=i.filter[D],G,I;t=false;if(k==r)r=[];if(i.preFilter[D])if(v=i.preFilter[D](v,k,p,r,n,C)){if(v===true)continue}else t=G=true;if(v)for(var Q=0;(I=k[Q])!=null;Q++)if(I){G=J(I,v,Q,k);var V=n^!!G;if(p&&G!=null)if(V)t=true;else k[Q]=
false;else if(V){r.push(I);t=true}}if(G!==undefined){p||(k=r);j=j.replace(i.match[D],"");if(!t)return[];break}}if(j==s)if(t==null)throw"Syntax error, unrecognized expression: "+j;else break;s=j}return k};var i=g.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(j){return j.getAttribute("href")}},relative:{"+":function(j,m,p){var n=typeof m==="string",s=n&&!/\W/.test(m);n=n&&!s;if(s&&!p)m=m.toUpperCase();p=0;s=j.length;for(var r;p<s;p++)if(r=j[p]){for(;(r=r.previousSibling)&&
r.nodeType!==1;);j[p]=n||r&&r.nodeName===m?r||false:r===m}n&&g.filter(m,j,true)},">":function(j,m,p){var n=typeof m==="string";if(n&&!/\W/.test(m)){m=p?m:m.toUpperCase();p=0;for(var s=j.length;p<s;p++){var r=j[p];if(r){n=r.parentNode;j[p]=n.nodeName===m?n:false}}}else{p=0;for(s=j.length;p<s;p++)if(r=j[p])j[p]=n?r.parentNode:r.parentNode===m;n&&g.filter(m,j,true)}},"":function(j,m,p){var n=d++,s=b;if(!/\W/.test(m)){var r=m=p?m:m.toUpperCase();s=a}s("parentNode",m,n,j,r,p)},"~":function(j,m,p){var n=
d++,s=b;if(typeof m==="string"&&!/\W/.test(m)){var r=m=p?m:m.toUpperCase();s=a}s("previousSibling",m,n,j,r,p)}},find:{ID:function(j,m,p){if(typeof m.getElementById!=="undefined"&&!p)return(j=m.getElementById(j[1]))?[j]:[]},NAME:function(j,m){if(typeof m.getElementsByName!=="undefined"){for(var p=[],n=m.getElementsByName(j[1]),s=0,r=n.length;s<r;s++)n[s].getAttribute("name")===j[1]&&p.push(n[s]);return p.length===0?null:p}},TAG:function(j,m){return m.getElementsByTagName(j[1])}},preFilter:{CLASS:function(j,
m,p,n,s,r){j=" "+j[1].replace(/\\/g,"")+" ";if(r)return j;r=0;for(var k;(k=m[r])!=null;r++)if(k)if(s^(k.className&&(" "+k.className+" ").indexOf(j)>=0))p||n.push(k);else if(p)m[r]=false;return false},ID:function(j){return j[1].replace(/\\/g,"")},TAG:function(j,m){for(var p=0;m[p]===false;p++);return m[p]&&P(m[p])?j[1]:j[1].toUpperCase()},CHILD:function(j){if(j[1]=="nth"){var m=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(j[2]=="even"&&"2n"||j[2]=="odd"&&"2n+1"||!/\D/.test(j[2])&&"0n+"+j[2]||j[2]);j[2]=m[1]+(m[2]||
1)-0;j[3]=m[3]-0}j[0]=d++;return j},ATTR:function(j,m,p,n,s,r){m=j[1].replace(/\\/g,"");if(!r&&i.attrMap[m])j[1]=i.attrMap[m];if(j[2]==="~=")j[4]=" "+j[4]+" ";return j},PSEUDO:function(j,m,p,n,s){if(j[1]==="not")if((c.exec(j[3])||"").length>1||/^\w/.test(j[3]))j[3]=g(j[3],null,null,m);else{j=g.filter(j[3],m,p,true^s);p||n.push.apply(n,j);return false}else if(i.match.POS.test(j[0])||i.match.CHILD.test(j[0]))return true;return j},POS:function(j){j.unshift(true);return j}},filters:{enabled:function(j){return j.disabled===
false&&j.type!=="hidden"},disabled:function(j){return j.disabled===true},checked:function(j){return j.checked===true},selected:function(j){return j.selected===true},parent:function(j){return!!j.firstChild},empty:function(j){return!j.firstChild},has:function(j,m,p){return!!g(p[3],j).length},header:function(j){return/h\d/i.test(j.nodeName)},text:function(j){return"text"===j.type},radio:function(j){return"radio"===j.type},checkbox:function(j){return"checkbox"===j.type},file:function(j){return"file"===
j.type},password:function(j){return"password"===j.type},submit:function(j){return"submit"===j.type},image:function(j){return"image"===j.type},reset:function(j){return"reset"===j.type},button:function(j){return"button"===j.type||j.nodeName.toUpperCase()==="BUTTON"},input:function(j){return/input|select|textarea|button/i.test(j.nodeName)}},setFilters:{first:function(j,m){return m===0},last:function(j,m,p,n){return m===n.length-1},even:function(j,m){return m%2===0},odd:function(j,m){return m%2===1},
lt:function(j,m,p){return m<p[3]-0},gt:function(j,m,p){return m>p[3]-0},nth:function(j,m,p){return p[3]-0==m},eq:function(j,m,p){return p[3]-0==m}},filter:{PSEUDO:function(j,m,p,n){var s=m[1],r=i.filters[s];if(r)return r(j,p,m,n);else if(s==="contains")return(j.textContent||j.innerText||"").indexOf(m[3])>=0;else if(s==="not"){m=m[3];p=0;for(n=m.length;p<n;p++)if(m[p]===j)return false;return true}},CHILD:function(j,m){var p=m[1],n=j;switch(p){case "only":case "first":for(;n=n.previousSibling;)if(n.nodeType===
1)return false;if(p=="first")return true;n=j;case "last":for(;n=n.nextSibling;)if(n.nodeType===1)return false;return true;case "nth":p=m[2];var s=m[3];if(p==1&&s==0)return true;var r=m[0],k=j.parentNode;if(k&&(k.sizcache!==r||!j.nodeIndex)){var v=0;for(n=k.firstChild;n;n=n.nextSibling)if(n.nodeType===1)n.nodeIndex=++v;k.sizcache=r}n=j.nodeIndex-s;return p==0?n==0:n%p==0&&n/p>=0}},ID:function(j,m){return j.nodeType===1&&j.getAttribute("id")===m},TAG:function(j,m){return m==="*"&&j.nodeType===1||j.nodeName===
m},CLASS:function(j,m){return(" "+(j.className||j.getAttribute("class"))+" ").indexOf(m)>-1},ATTR:function(j,m){var p=m[1];p=i.attrHandle[p]?i.attrHandle[p](j):j[p]!=null?j[p]:j.getAttribute(p);var n=p+"",s=m[2],r=m[4];return p==null?s==="!=":s==="="?n===r:s==="*="?n.indexOf(r)>=0:s==="~="?(" "+n+" ").indexOf(r)>=0:!r?n&&p!==false:s==="!="?n!=r:s==="^="?n.indexOf(r)===0:s==="$="?n.substr(n.length-r.length)===r:s==="|="?n===r||n.substr(0,r.length+1)===r+"-":false},POS:function(j,m,p,n){var s=i.setFilters[m[2]];
if(s)return s(j,p,m,n)}}},l=i.match.POS,o;for(o in i.match){i.match[o]=RegExp(i.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source);i.leftMatch[o]=RegExp(/(^(?:.|\r|\n)*?)/.source+i.match[o].source)}var w=function(j,m){j=Array.prototype.slice.call(j,0);if(m){m.push.apply(m,j);return m}return j};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(F){w=function(j,m){var p=m||[];if(f.call(j)==="[object Array]")Array.prototype.push.apply(p,j);else if(typeof j.length==="number")for(var n=
0,s=j.length;n<s;n++)p.push(j[n]);else for(n=0;j[n];n++)p.push(j[n]);return p}}var M;if(document.documentElement.compareDocumentPosition)M=function(j,m){if(!j.compareDocumentPosition||!m.compareDocumentPosition){if(j==m)h=true;return 0}var p=j.compareDocumentPosition(m)&4?-1:j===m?0:1;if(p===0)h=true;return p};else if("sourceIndex"in document.documentElement)M=function(j,m){if(!j.sourceIndex||!m.sourceIndex){if(j==m)h=true;return 0}var p=j.sourceIndex-m.sourceIndex;if(p===0)h=true;return p};else if(document.createRange)M=
function(j,m){if(!j.ownerDocument||!m.ownerDocument){if(j==m)h=true;return 0}var p=j.ownerDocument.createRange(),n=m.ownerDocument.createRange();p.setStart(j,0);p.setEnd(j,0);n.setStart(m,0);n.setEnd(m,0);p=p.compareBoundaryPoints(Range.START_TO_END,n);if(p===0)h=true;return p};(function(){var j=document.createElement("div"),m="script"+(new Date).getTime();j.innerHTML="<a name='"+m+"'/>";var p=document.documentElement;p.insertBefore(j,p.firstChild);if(document.getElementById(m)){i.find.ID=function(n,
s,r){if(typeof s.getElementById!=="undefined"&&!r)return(s=s.getElementById(n[1]))?s.id===n[1]||typeof s.getAttributeNode!=="undefined"&&s.getAttributeNode("id").nodeValue===n[1]?[s]:undefined:[]};i.filter.ID=function(n,s){var r=typeof n.getAttributeNode!=="undefined"&&n.getAttributeNode("id");return n.nodeType===1&&r&&r.nodeValue===s}}p.removeChild(j);p=j=null})();(function(){var j=document.createElement("div");j.appendChild(document.createComment(""));if(j.getElementsByTagName("*").length>0)i.find.TAG=
function(m,p){var n=p.getElementsByTagName(m[1]);if(m[1]==="*"){for(var s=[],r=0;n[r];r++)n[r].nodeType===1&&s.push(n[r]);n=s}return n};j.innerHTML="<a href='#'></a>";if(j.firstChild&&typeof j.firstChild.getAttribute!=="undefined"&&j.firstChild.getAttribute("href")!=="#")i.attrHandle.href=function(m){return m.getAttribute("href",2)};j=null})();document.querySelectorAll&&function(){var j=g,m=document.createElement("div");m.innerHTML="<p class='TEST'></p>";if(!(m.querySelectorAll&&m.querySelectorAll(".TEST").length===
0)){g=function(n,s,r,k){s=s||document;if(!k&&s.nodeType===9&&!P(s))try{return w(s.querySelectorAll(n),r)}catch(v){}return j(n,s,r,k)};for(var p in j)g[p]=j[p];m=null}}();document.getElementsByClassName&&document.documentElement.getElementsByClassName&&function(){var j=document.createElement("div");j.innerHTML="<div class='test e'></div><div class='test'></div>";if(j.getElementsByClassName("e").length!==0){j.lastChild.className="e";if(j.getElementsByClassName("e").length!==1){i.order.splice(1,0,"CLASS");
i.find.CLASS=function(m,p,n){if(typeof p.getElementsByClassName!=="undefined"&&!n)return p.getElementsByClassName(m[1])};j=null}}}();var O=document.compareDocumentPosition?function(j,m){return j.compareDocumentPosition(m)&16}:function(j,m){return j!==m&&(j.contains?j.contains(m):true)},P=function(j){return j.nodeType===9&&j.documentElement.nodeName!=="HTML"||!!j.ownerDocument&&j.ownerDocument.documentElement.nodeName!=="HTML"},N=function(j,m){for(var p=[],n="",s,r=m.nodeType?[m]:m;s=i.match.PSEUDO.exec(j);){n+=
s[0];j=j.replace(i.match.PSEUDO,"")}j=i.relative[j]?j+"*":j;s=0;for(var k=r.length;s<k;s++)g(j,r[s],p);return g.filter(n,p)};window.Sizzle=g})();(function(a){var b=Prototype.Selector.extendElements;Prototype.Selector.engine=a;Prototype.Selector.select=function(c,d){return b(a(c,d||document))};Prototype.Selector.match=function(c,d){return a.matches(d,[c]).length==1}})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;
var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(a,b){if(typeof b!="object")b={hash:!!b};else if(Object.isUndefined(b.hash))b.hash=true;var c,d,f=false,h=b.submit,e,g;if(b.hash){g={};e=function(i,l,o){if(l in i){Object.isArray(i[l])||(i[l]=[i[l]]);i[l].push(o)}else i[l]=o;return i}}else{g="";e=function(i,l,o){return i+(i?"&":"")+encodeURIComponent(l)+"="+encodeURIComponent(o)}}return a.inject(g,function(i,l){if(!l.disabled&&l.name){c=l.name;d=$(l).getValue();if(d!=
null&&l.type!="file"&&(l.type!="submit"||!f&&h!==false&&(!h||c==h)&&(f=true)))i=e(i,c,d)}return i})}};
Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(a){a=$(a).getElementsByTagName("*");for(var b,c=[],d=Form.Element.Serializers,f=0;b=a[f];f++)c.push(b);return c.inject([],function(h,e){d[e.tagName.toLowerCase()]&&h.push(Element.extend(e));return h})},getInputs:function(a,b,c){a=$(a);a=a.getElementsByTagName("input");if(!b&&!c)return $A(a).map(Element.extend);for(var d=0,f=[],h=a.length;d<h;d++){var e=a[d];b&&e.type!=b||c&&e.name!=c||
f.push(Element.extend(e))}return f},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(a){a=$(a).getElements().findAll(function(c){return"hidden"!=c.type&&!c.disabled});var b=a.findAll(function(c){return c.hasAttribute("tabIndex")&&c.tabIndex>=0}).sortBy(function(c){return c.tabIndex}).first();return b?b:a.find(function(c){return/^(?:input|select|textarea)$/i.test(c.tagName)})},
focusFirstElement:function(a){a=$(a);var b=a.findFirstElement();b&&b.activate();return a},request:function(a,b){a=$(a);b=Object.clone(b||{});var c=b.parameters,d=a.readAttribute("action")||"";if(d.blank())d=window.location.href;b.parameters=a.serialize(true);if(c){if(Object.isString(c))c=c.toQueryParams();Object.extend(b.parameters,c)}if(a.hasAttribute("method")&&!b.method)b.method=a.method;return new Ajax.Request(d,b)}};
Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};
Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();
if(a.select&&(a.tagName.toLowerCase()!="input"||!/^(?:button|reset|submit)$/i.test(a.type)))a.select()}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element,$F=Form.Element.Methods.getValue;
Form.Element.Serializers=function(){function a(h,e){if(Object.isUndefined(e))return h.checked?h.value:null;else h.checked=!!e}function b(h,e){if(Object.isUndefined(e))return h.value;else h.value=e}function c(h){var e=h.selectedIndex;return e>=0?f(h.options[e]):null}function d(h){var e,g=h.length;if(!g)return null;var i=0;for(e=[];i<g;i++){var l=h.options[i];l.selected&&e.push(f(l))}return e}function f(h){return Element.hasAttribute(h,"value")?h.value:h.text}return{input:function(h,e){switch(h.type.toLowerCase()){case "checkbox":case "radio":return a(h,
e);default:return b(h,e)}},inputSelector:a,textarea:b,select:function(h,e){if(Object.isUndefined(e))return(h.type==="select-one"?c:d)(h);for(var g,i,l=!Object.isArray(e),o=0,w=h.length;o<w;o++){g=h.options[o];i=this.optionValue(g);if(l){if(i==e){g.selected=true;break}}else g.selected=e.include(i)}},selectOne:c,selectMany:d,optionValue:f,button:b}}();
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,d){$super(d,c);this.element=$(b);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();this.element.tagName.toLowerCase()=="form"?this.registerFormCallbacks():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))}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});
(function(){function a(k,v){return k.which?k.which===v+1:k.button===v}function b(k,v){return k.button===N[v]}function c(k,v){switch(v){case 0:return k.which==1&&!k.metaKey;case 1:return k.which==2||k.which==1&&k.metaKey;case 2:return k.which==3;default:return false}}function d(k){var v=document.documentElement,t=document.body||{scrollLeft:0};return k.pageX||k.clientX+(v.scrollLeft||t.scrollLeft)-(v.clientLeft||0)}function f(k){var v=document.documentElement,t=document.body||{scrollTop:0};return k.pageY||
k.clientY+(v.scrollTop||t.scrollTop)-(v.clientTop||0)}function h(k,v,t){var C=Element.retrieve(k,"prototype_event_registry");if(Object.isUndefined(C)){n.push(k);C=Element.retrieve(k,"prototype_event_registry",$H())}var D=C.get(v);if(Object.isUndefined(D)){D=[];C.set(v,D)}if(D.pluck("handler").include(t))return false;var J;if(v.include(":"))J=function(G){if(Object.isUndefined(G.eventName))return false;if(G.eventName!==v)return false;w.extend(G,k);t.call(k,G)};else if(!M&&(v==="mouseenter"||v==="mouseleave")){if(v===
"mouseenter"||v==="mouseleave")J=function(G){w.extend(G,k);for(var I=G.relatedTarget;I&&I!==k;)try{I=I.parentNode}catch(Q){I=k}I!==k&&t.call(k,G)}}else J=function(G){w.extend(G,k);t.call(k,G)};J.handler=t;D.push(J);return J}function e(){for(var k=0,v=n.length;k<v;k++){w.stopObserving(n[k]);n[k]=null}}function g(k,v,t){k=$(k);t=h(k,v,t);if(!t)return k;if(v.include(":"))if(k.addEventListener)k.addEventListener("dataavailable",t,false);else{k.attachEvent("ondataavailable",t);k.attachEvent("onlosecapture",
t)}else{v=s(v);k.addEventListener?k.addEventListener(v,t,false):k.attachEvent("on"+v,t)}return k}function i(k,v,t){k=$(k);var C=Element.retrieve(k,"prototype_event_registry");if(!C)return k;if(!v){C.each(function(I){i(k,I.key)});return k}var D=C.get(v);if(!D)return k;if(!t){D.each(function(I){i(k,v,I.handler)});return k}for(var J=D.length,G;J--;)if(D[J].handler===t){G=D[J];break}if(!G)return k;if(v.include(":"))if(k.removeEventListener)k.removeEventListener("dataavailable",G,false);else{k.detachEvent("ondataavailable",
G);k.detachEvent("onlosecapture",G)}else{t=s(v);k.removeEventListener?k.removeEventListener(t,G,false):k.detachEvent("on"+t,G)}C.set(v,D.without(G));return k}function l(k,v,t,C){k=$(k);if(Object.isUndefined(C))C=true;if(k==document&&document.createEvent&&!k.dispatchEvent)k=document.documentElement;var D;if(document.createEvent){D=document.createEvent("HTMLEvents");D.initEvent("dataavailable",C,true)}else{D=document.createEventObject();D.eventType=C?"ondataavailable":"onlosecapture"}D.eventName=v;
D.memo=t||{};document.createEvent?k.dispatchEvent(D):k.fireEvent(D.eventType,D);return w.extend(D)}function o(k,v,t,C){k=$(k);if(Object.isFunction(t)&&Object.isUndefined(C)){C=t;t=null}return(new w.Handler(k,v,t,C)).start()}var w={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}},F=document.documentElement,M="onmouseenter"in F&&"onmouseleave"in F,O=function(){return false};
if(window.attachEvent)O=window.addEventListener?function(k){return!(k instanceof window.Event)}:function(){return true};var P,N={0:1,1:4,2:2};P=window.attachEvent?window.addEventListener?function(k,v){return O(k)?b(k,v):a(k,v)}:b:Prototype.Browser.WebKit?c:a;w.Methods={isLeftClick:function(k){return P(k,0)},isMiddleClick:function(k){return P(k,1)},isRightClick:function(k){return P(k,2)},element:function(k){k=w.extend(k);var v=k.target,t=k.type;if((k=k.currentTarget)&&k.tagName)if(t==="load"||t===
"error"||t==="click"&&k.tagName.toLowerCase()==="input"&&k.type==="radio")v=k;if(v.nodeType==Node.TEXT_NODE)v=v.parentNode;return Element.extend(v)},findElement:function(k,v){var t=w.element(k);if(!v)return t;for(;t;){if(Object.isElement(t)&&Prototype.Selector.match(t,v))return Element.extend(t);t=t.parentNode}},pointer:function(k){return{x:d(k),y:f(k)}},pointerX:d,pointerY:f,stop:function(k){w.extend(k);k.preventDefault();k.stopPropagation();k.stopped=true}};var j=Object.keys(w.Methods).inject({},
function(k,v){k[v]=w.Methods[v].methodize();return k});if(window.attachEvent){var m=function(k){switch(k.type){case "mouseover":case "mouseenter":k=k.fromElement;break;case "mouseout":case "mouseleave":k=k.toElement;break;default:return null}return Element.extend(k)},p={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};w.extend=function(k,v){if(!k)return false;if(!O(k))return k;if(k._extendedByPrototype)return k;
k._extendedByPrototype=Prototype.emptyFunction;var t=w.pointer(k);Object.extend(k,{target:k.srcElement||v,relatedTarget:m(k),pageX:t.x,pageY:t.y});Object.extend(k,j);Object.extend(k,p);return k}}else w.extend=Prototype.K;if(window.addEventListener){w.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(w.prototype,j)}var n=[];Prototype.Browser.IE&&window.attachEvent("onunload",e);Prototype.Browser.WebKit&&window.addEventListener("unload",Prototype.emptyFunction,
false);var s=Prototype.K,r={mouseenter:"mouseover",mouseleave:"mouseout"};M||(s=function(k){return r[k]||k});w.Handler=Class.create({initialize:function(k,v,t,C){this.element=$(k);this.eventName=v;this.selector=t;this.callback=C;this.handler=this.handleEvent.bind(this)},start:function(){w.observe(this.element,this.eventName,this.handler);return this},stop:function(){w.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(k){var v=w.findElement(k,this.selector);
v&&this.callback.call(this.element,k,v)}});Object.extend(w,w.Methods);Object.extend(w,{fire:l,observe:g,stopObserving:i,on:o});Element.addMethods({fire:l,observe:g,stopObserving:i,on:o});Object.extend(document,{fire:l.methodize(),observe:g.methodize(),stopObserving:i.methodize(),on:o.methodize(),loaded:false});if(window.Event)Object.extend(window.Event,w);else window.Event=w})();
(function(){function a(){if(!document.loaded){d&&window.clearTimeout(d);document.loaded=true;document.fire("dom:loaded")}}function b(){if(document.readyState==="complete"){document.stopObserving("readystatechange",b);a()}}function c(){try{document.documentElement.doScroll("left")}catch(f){d=c.defer();return}a()}var d;if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);else{document.observe("readystatechange",b);if(window==top)d=c.defer()}Event.observe(window,"load",
a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}},$continue=Error('"throw $continue" is deprecated, use "return" instead'),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(a,b,c){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,b,c);this.xcomp=b;this.ycomp=c;this.offset=Element.cumulativeOffset(a);return c>=this.offset[1]&&c<this.offset[1]+a.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+a.offsetWidth},withinIncludingScrolloffsets:function(a,b,c){var d=Element.cumulativeScrollOffset(a);this.xcomp=b+d[0]-this.deltaX;this.ycomp=c+d[1]-this.deltaY;this.offset=Element.cumulativeOffset(a);return this.ycomp>=
this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth},overlap:function(a,b){if(!a)return 0;if(a=="vertical")return(this.offset[1]+b.offsetHeight-this.ycomp)/b.offsetHeight;if(a=="horizontal")return(this.offset[0]+b.offsetWidth-this.xcomp)/b.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,b,c){c=c||{};return Element.clonePosition(b,a,c)}};
if(!document.getElementsByClassName)document.getElementsByClassName=function(a){function b(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}a.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,d){d=d.toString().strip();var f=/\s/.test(d)?$w(d).map(b).join(""):b(d);return f?document._getElementsByXPath(".//*"+f,c):[]}:function(c,d){d=d.toString().strip();var f=[],h=/\s/.test(d)?$w(d):null;if(!h&&!d)return f;var e=$(c).getElementsByTagName("*");d=" "+d+" ";for(var g=
0,i,l;i=e[g];g++)if(i.className&&(l=" "+i.className+" ")&&(l.include(d)||h&&h.all(function(o){return!o.toString().blank()&&l.include(" "+o+" ")})))f.push(Element.extend(i));return f};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){this.include(a)||this.set($A(this).concat(a).join(" "))},remove:function(a){this.include(a)&&this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);
(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(a,b){for(var c=Prototype.Selector.match,d=[],f=0,h=a.length;f<h;f++){var e=a[f];c(e,b)&&d.push(Element.extend(e))}return d},
findElement:function(a,b,c){c=c||0;for(var d=0,f,h=0,e=a.length;h<e;h++){f=a[h];if(Prototype.Selector.match(f,b)&&c===d++)return Element.extend(f)}},findChildElements:function(a,b){var c=b.toArray().join(", ");return Prototype.Selector.select(c,a||document)}})})();
(function(){function a(f){var h=document.createElement("div");f="on"+f;var e=f in h;if(!e){h.setAttribute(f,"return;");e=typeof h[f]=="function"}return e}function b(f){var h,e,g;if(f.fire("ajax:before").stopped)return false;if(f.tagName.toLowerCase()==="form"){h=f.readAttribute("method")||"post";e=f.readAttribute("action");g=f.serialize()}else{h=f.readAttribute("data-method")||"get";e=f.readAttribute("href");g={}}new Ajax.Request(e,{method:h,parameters:g,evalScripts:true,onComplete:function(i){f.fire("ajax:complete",
i)},onSuccess:function(i){f.fire("ajax:success",i)},onFailure:function(i){f.fire("ajax:failure",i)}});f.fire("ajax:after")}var c=a("submit"),d=a("change");if(!c||!d)Event.Handler.prototype.initialize=Event.Handler.prototype.initialize.wrap(function(f,h,e,g,i){f(h,e,g,i);if(!(f=!c&&this.eventName=="submit"&&!(Object.isElement(this.element)&&this.element.nodeName.toUpperCase()=="FORM")))if(f=!d)if(f=this.eventName=="change"){f=this.element;if(Object.isElement(f)){f=f.nodeName.toUpperCase();f=f=="INPUT"||
f=="SELECT"||f=="TEXTAREA"}else f=false;f=!f}if(f)this.eventName="emulated:"+this.eventName});c||document.on("focusin","form",function(f,h){if(!h.retrieve("emulated:submit")){h.on("submit",function(e){h.fire("emulated:submit",e,true).returnValue===false&&e.preventDefault()});h.store("emulated:submit",true)}});d||document.on("focusin","input, select, texarea",function(f,h){if(!h.retrieve("emulated:change")){h.on("change",function(e){h.fire("emulated:change",e,true)});h.store("emulated:change",true)}});
document.on("click","*[data-confirm]",function(f,h){var e=h.readAttribute("data-confirm");confirm(e)||f.stop()});document.on("click","a[data-remote]",function(f,h){if(!f.stopped){b(h);f.stop()}});document.on("click","a[data-method]",function(f,h){if(!f.stopped){var e=h.readAttribute("data-method"),g=h.readAttribute("href"),i=$$("meta[name=csrf-param]")[0],l=$$("meta[name=csrf-token]")[0];g=new Element("form",{method:"POST",action:g,style:"display: none;"});h.parentNode.insert(g);if(e!=="post"){e=
new Element("input",{type:"hidden",name:"_method",value:e});g.insert(e)}if(i){i=i.readAttribute("content");l=l.readAttribute("content");e=new Element("input",{type:"hidden",name:i,value:l});g.insert(e)}g.submit();f.stop()}});document.on("submit",function(f){var h=f.findElement(),e=h.readAttribute("data-confirm");if(e&&!confirm(e)){f.stop();return false}h.select("input[type=submit][data-disable-with]").each(function(g){g.disabled=true;g.writeAttribute("data-original-value",g.value);g.value=g.readAttribute("data-disable-with")});
if(h=f.findElement("form[data-remote]")){b(h);f.stop()}});document.on("ajax:after","form",function(f,h){h.select("input[type=submit][disabled=true][data-disable-with]").each(function(e){e.value=e.readAttribute("data-original-value");e.removeAttribute("data-original-value");e.disabled=false})});Ajax.Responders.register({onCreate:function(f){var h=$$("meta[name=csrf-token]")[0];if(h){h=h.readAttribute("content");if(!f.options.requestHeaders)f.options.requestHeaders={};f.options.requestHeaders["X-CSRF-Token"]=
h}}})})();Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;Prototype.Browser.IE8=Prototype.Browser.IE&&!Prototype.Browser.IE6&&!Prototype.Browser.IE7;BaseDomain="justin.tv";typeof jQuery!=="undefined"&&jQuery&&jQuery.noConflict();try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}
function createCookie(a,b,c,d,f){d||(d="/");if(c){var h=new Date;h.setTime(h.getTime()+c*1E3);c="; expires="+h.toGMTString()}else c="";a=a+"="+b+c+"; path="+d;if(f==null)document.cookie=a+"; domain=."+BaseDomain;else if(f=="")document.cookie=a}function readCookie(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)==0)return d.substring(a.length,d.length)}return null}
function ajax_url_params(a){var b=[],c=window.location.hash.slice(2);c.length>0&&b.push(c);c=window.location.search.slice(1);c.length>0&&b.push(c);a&&b.push(Object.toQueryString(a));a=b.join("&");return a.length>0?"?"+a:""}function url_plus_params(a){a=ajax_url_params(a);return window.location.protocol+"//"+window.location.host+window.location.pathname+a}function eraseCookie(a,b){if(b==null){createCookie(a,"",-1);createCookie(a,"",-1,null,"")}else createCookie(a,"",-1,null,b)}
function setCookieTimeout(a,b,c){if(!readCookie(b)){createCookie(b,"true",c);a()}}function add_hash_param(a,b){var c=window.location.hash.slice(2).toQueryParams();c[a]=b;window.location.hash="!"+Object.toQueryString(c)}function iframe_request(a,b){var c=document.createElement("iframe");c.src=a;c.style.display="none";c.style.visibility="hidden";c.onload=function(){b(c.contentWindow.document.body.innerHTML);document.body.removeChild(c)};on_dom_load(function(){document.body.appendChild(c)})}
function getUrlParameter(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);if(a==null)return null;return a[1]}function appendHTML(a,b){a=$(a);var c=document.createElement("div");c.style.display="none";document.body.appendChild(c);c.innerHTML=b;for(var d=0;d<c.childNodes.length;d++)a.appendChild($(c.childNodes[d]).remove());$(c).remove()}function set_volume(a){createCookie("volume",a,604800)}
function get_volume(){return readCookie("volume")||100}function limit_tags(a,b,c,d){for(a=$(a).getElementsByTagName(b);a.length>c;)if(d){b=a[a.length-1];b.parentNode.removeChild(b)}else a[0].parentNode.removeChild(a[0])}function addEvent(a,b,c){if(a.addEventListener)a.addEventListener(b,c,false);else if(a.attachEvent){a["e"+b+c]=c;a[b+c]=function(){a["e"+b+c](window.event)};a.attachEvent("on"+b,a[b+c])}}
function safe_on_load(a){Prototype.Browser.IE?Event.observe(window,"load",a):document.observe("dom:loaded",a)}function swap(a,b){return a.parentNode.replaceChild(b,a)}function when(a,b){a()?b():window.setTimeout(function(){when(a,b)},10)}
var on_dom_load=function(){var a=function(b){if(a.already_loaded)b();else if(window.addEventListener)window.addEventListener("DOMContentLoaded",b,false);else document.attchEvent?document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){b();document.detachEvent("onreadystatechange",arguments.callee)}}):when(function(){try{document.documentElement.doScroll("left");return document.documentElement.doScroll&&window==window.top}catch(c){return false}},b)};a.already_loaded=
false;a(function(){a.already_loaded=true});return a}(),cursor=function(){var a=null,b=null;if(window.event){a=function(){return window.event.pageX};b=function(){return window.event.pageX}}else{a=function(){return document.documentElement.scrollLeft||document.body.scrollLeft};b=function(){return document.body.scrollTop||document.body.scrollTop}}var c=function(){return{x:a(),y:b()}};c.x=a;c.y=b;return c}(),shorten=function(a,b){new Ajax.Request("/sharing/shorten",{method:"get",parameters:{url:a},onSuccess:function(c){b(c.responseText)}})};
function is_blank(a){return $(a).value===""}function two_digit(a){return a<10?"0"+(a-0):a}function mil_to_ampm(a){if(a>12)a-=12;if(a==0)a=12;return a}function ordinalize(a){if(11<=a&&a<=13)return a+"th";switch(a%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd";default:return a+"th"}}String.prototype.reverse=function(){return this.split("").reverse().join("")};function commatize(a){return(a+"").reverse().match(/(?:\d*\.)?\d{1,3}-?/g).join(",").reverse()}
function sig_dig(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}function bound(a,b,c){if(a<b)return b;if(a>c)return c;return a}function length_as_clock(a){var b=Math.floor(a%60),c=Math.floor(a%3600/60);return(a=Math.floor(a/3600))?a+":"+two_digit(c)+":"+two_digit(b):c+":"+two_digit(b)}
function time_ago_in_words(a){a=((new Date).getTime()-a.getTime())/1E3;return a<60?_("Less than a minute"):a<1800?pluralsub(_("%d minute"),_("%d minutes"),Math.round(a/60)):a<86400?pluralsub(_("%d hour"),_("%d hours"),Math.round(a/3600)):a<2592E3?pluralsub(_("%d day"),_("%d days"),Math.round(a/86400)):pluralsub(_("%d month"),_("%d months"),Math.round(a/2592E3))}Date.prototype.on_date=function(a){return a.getFullYear()==this.getFullYear()&&a.getMonth()==this.getMonth()&&a.getDate()==this.getDate()};
Date.prototype.is_today=function(){return this.on_date(new Date)};Date.prototype.is_tomorrow=function(){return this.on_date(new Date((new Date).getTime()+864E5))};Date.prototype.is_day_after_tomorrow=function(){return this.on_date(new Date((new Date).getTime()+1728E5))};
function local_time_in_words(a){var b=null;if(a.is_today())if(a.getHours()>=17)b=_("Tonight");else{a.getHours();b=_("Today")}else b=a.is_tomorrow()?a.getHours()<5?_("Tonight"):a.getHours()<12?_("Tomorrow morning"):a.getHours()<17?_("Tomorrow afternoon"):_("Tomorrow night"):a.is_day_after_tomorrow()&&a.getHours()<5?_("Tomorrow night"):format_date(a,"%B %o");a=format_date(a,"$f%p");return b+" "+a}function time_to_date_string(a){return a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()}
function format_date(a,b){var c=[_("Sun"),_("Mon"),_("Tue"),_("Wed"),_("Thu"),_("Fri"),_("Sat")],d=[_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday")],f=[_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec")],h=[_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")],e=a.getHours()<12?"am":"pm",g=mil_to_ampm(a.getHours()),
i=two_digit(a.getHours()),l=two_digit(a.getMinutes()),o=two_digit(a.getSeconds()),w=a.is_today(),F=a.is_tomorrow(),M=d[a.getDay()]+" "+h[a.getMonth()]+" "+ordinalize(a.getDate());c=[["%a",c[a.getDay()]],["%A",d[a.getDay()]],["%b",f[a.getMonth()]],["%B",h[a.getMonth()]],["%c",a.toString()],["%d",two_digit(a.getDate())],["$d",a.getDate()],["%H",i],["%I",two_digit(g)],["%m",two_digit(a.getMonth()+1)],["%M",l],["%p",e],["%P",e.toUpperCase()],["%S",o],["%w",a.getDay()],["%x",time_to_date_string(a)],["%X",
g+":"+l+":"+o+" "+e],["%y",two_digit(a.getYear()%100)],["%Y",a.getFullYear()],["$f",g+(a.getMinutes()?":"+l:"")],["$m",a.getMonth()+1],["$M",a.getMinutes()],["$S",a.getSeconds()],["$H",a.getHours()],["$I",g],["%i",g],["%o",ordinalize(a.getDate())],["%T",w?_("Today at"):F?_("Tomorrow at"):M]];for(d=0;d<c.length;d++)b=b.replace(c[d][0],c[d][1]);return b}
function get_flash_version(){try{if(navigator.plugins!=null&&navigator.plugins.length>0){var a=navigator.plugins["Shockwave Flash"];if(typeof a=="object"){var b=/\d+\.\d+/.exec(a.description);if(b!=null)return parseFloat(b[0])}}return 0}catch(c){return 0}}
flash=function(){var a={},b=false,c=function(){};a.swfObjectCallback=function(d,f,h,e){d=/([0-9]+)/.exec(d)[1];var g=/([0-9]+)/.exec(f)[1];if(!e){if(!b){c();b=true}if(d>50&&g>50)MobileBrowser()?on_dom_load(function(){$(h).innerHTML='<div style="padding-top:'+(g/2-25)+'px;">'+s_("Your mobile device does not support Justin.tv.")+"</div>"}):on_dom_load(function(){$(h).innerHTML='<div style="padding-top:'+(g/2-25)+'px;">'+s_("Justin.tv requires Flash Player 9 or higher.")+"<br/>"+s_("Please %{download} and install Flash Player.").replace(/\%\{(.*?)\}/,
'<a href="http://get.adobe.com/flashplayer" style="color: #06c;">$1</a>')+"</div>"})}};a.onFail=function(d){var f=c;c=function(){f();d()}};return a}();function checkAll(a,b,c){a=$(a).getElementsByClassName(a,b);for(b=0;b<a.length;b++)a[b].checked=c}function checkAllBoxes(a,b){for(var c=$(a).getElementsByTagName("input"),d=0;d<c.length;d++)if(c[d].type=="checkbox")c[d].checked=b}
function showTab(a,b){for(var c=0;c<b.length;c++){Element.hide(b[c]+"_panel");Element.removeClassName(b[c]+"_tab","selected")}Element.show(a+"_panel");Element.addClassName(a+"_tab","selected")}function setClassForDuration(a,b,c){Element.addClassName(a,b);setTimeout(function(){Element.removeClassName(a,b)},c*1E3)}function not_in_frame(){try{return top.location==location?true:false}catch(a){}}
String.prototype.breaking=function(a){return this.replace(/\S+/g,function(b){return b.replace(RegExp("\\S{1,"+a+"}","g"),function(c){return c+"<wbr />"})})};function toggle_section(a){Element.toggleClassName(a,"closed");Element.toggleClassName(a+"_header","max");Element.toggleClassName(a+"_header","min");LateLoader.refresh();LateLoader.reposition_all_ads()}function toggle_description(a){Element.toggle(a+"_t");Element.toggle(a+"_f")}MENUOPEN="";
Event.observe(window,"load",function(){$$("a.dropmenu-trigger").each(function(a){$(a).observe("click",toggleDropmenu)})});
function toggleDropmenu(a){closeOpenMenus();var b=Element.hasClassName(Event.element(a),"dropmenu-trigger")?Element.identify(Event.element(a)):Element.identify(Element.up(Event.element(a)));$(b).toggleClassName("selected");Element.toggle(b+"_menu");Event.stop(a);MENUOPEN=b;a=window.document.body;$(MENUOPEN+"_menu").style.display==""?$(a).observe("click",observeDropmenu):$(a).stopObserving("click",observeDropmenu)}
function observeDropmenu(a){a=Element.identify(Event.element(a));if(a!=$(MENUOPEN)||a!=$(MENUOPEN+"_menu")){$(MENUOPEN).toggleClassName("selected");Element.toggle(MENUOPEN+"_menu");MENUOPEN=""}}function closeOpenMenus(){$$(".menu_box").each(function(a){if($(a).style.display==""){Element.toggle(a);mir=Element.identify(a).replace(/_menu/,"");$(mir).toggleClassName("selected");MENUOPEN=""}})}
function hideSearchText(){var a=$$("#search_tags input").first();a.value="";a.style.color="#000000";SEARCHTEXT=false;a.onclick=""}function setSiteViewerCount(a){$("site_viewer_count").innerHTML=commatize(a-0)}
function setChannelViewerCount(a){a-=0;if($("channel_viewer_count")){$("channel_viewer_count").innerHTML=commatize(a);if(a>0){$("channel_viewer_count_container")&&$("channel_viewer_count_container").show();$("channel_viewer_count").show()}else{$("channel_viewer_count_container")&&$("channel_viewer_count_container").hide();$("channel_viewer_count").hide()}}if(window.PP){PP.channel_live=a>0;PP.channel_viewers=a;EventBank.fire("PP_live_change")}}function setBroadcastIdPart(){}
function pluralsub(a,b,c){return(c==1?a:b).replace("%d",commatize(c))}function s_(a){for(var b=1;b<arguments.length;b++)a=a.replace(/%s/,arguments[b]);return a}function h_(a,b){return a.replace(/%\{(\w+)\}/g,function(c,d){return b[d]})}function l_(a,b){var c=$A(arguments).slice(2);return b.replace(/\$(.+?)\$/g,function(d,f){return a.apply(this,[f].concat(c))})}function enclose(a,b,c){return b+a+c}function get_username(){return PP.login}
function log_stat(a,b,c){b=b||[];var d=new Image(1,1);if(c)d.onload=c;try{query_string=[encodeURIComponent(a),b.map(encodeURI),get_page_log_params().toQueryString()].flatten().join("&");d.src="http://stats.jtvnw.net/"+Math.round(Math.random()*1E4)+"?"+query_string;return d}catch(f){}}
function get_page_log_params(){var a=$H(),b=function(c,d){d&&d!==""&&a.set(c,d)};b("unique_id",getUniqueId());b("unique_id_time",readCookie("guidtime"));b("browser_name",Platform.browser());b("operating_system",Platform.os());PP!==null&&$A(["login","page_type","language","channel","geo","category"]).each(function(c){b(c,PP[c])});return a}function log_stat_afterload(a,b,c){Event.observe(window,"load",function(){log_stat(a,b,c)})}
function ageFromBday(a){a=a.split("-");return Math.round(((new Date).getTime()-(new Date(a[0],a[1]-1,a[2])).getTime())/31536E6)}function formatYearsAgo(a){return format_date(new Date((new Date).getTime()+31536E6*a),"%Y-%m-%d")}function ageTierFromBday(a){if(!a)return"";return a<formatYearsAgo(18)?"13-17":a<formatYearsAgo(25)?"18-24":a<formatYearsAgo(35)?"25-34":"35+"}function get_ip(){return PP.ip}function get_geo(){return PP.geo}
function send_comscore_beacon(a){beacon_sent=true;COMSCORE.beacon({c1:a.c1,c2:a.c2,c3:a.c3,c4:"",c5:a.c5,c6:"",c15:get_comscore_15(readCookie("psHashedUserId"))})}function get_comscore_15(a){return a===null||a=="CXCXCXCX"?"":a}
function peerset_beacon_url(){if(typeof $psl!="undefined"){clearInterval(peerset_interval_id);var a=PP.birthday?Math.floor((new Date-Date.UTC.apply(null,PP.birthday.split("-").reverse()))/31536E6):"0",b=[];CatTracker.raw_list()&&b.push(CatTracker.raw_list());PP.channel_category&&b.push(PP.channel_category+"/"+PP.channel_subcategory);$psl.pid=58632;$psl.addAttr("uid",PP.user_id||"0");$psl.addAttr("age",a);$psl.addAttr("gender",{Male:"m",Female:"f"}[PP.sex]||"0");$psl.addAttr("categories",b.join(",").replace(/_/g,
"-")||"0");$psl.addAttr("interests",PP.interests);$psl.run()}}
CatTracker={push:function(a,b){var c=this.list().concat([[a,b]]).map(this.combine);c=c.slice(-4);createCookie("recent-cats",this.combine_all(c))},raw_list:function(){return readCookie("recent-cats")||""},list:function(){return this.split_all(this.raw_list()).map(this.split)},combine:function(a){return a.join("/")},split:function(a){return a.split("/",2)},combine_all:function(a){return a.join(",")},split_all:function(a){return a?$A(a.split(",")):$A([])}};
Date.prototype.to_chat_timestamp=function(){var a=isNaN(this.getHours())?new Date:this,b=a.getMinutes();if(b<10)b="0"+b;var c=a.getHours();if(c>12)c-=12;else if(c==0)c=12;var d=PP.user_id;if(new Date(2007,11,24,0,0,0)<new Date&&(d==7824||d==39980||d==6356))return c+":"+b+" "+(a.getHours()>11?"pm":"am");return c+":"+b};escape_html=function(a,b){return b?a:a.replace(/</g,"&lt;").replace(/>/g,"&gt;")};
MobileBrowser=function(){var a=false,b=function(){return a};b.iphone=/.* \((iPhone|iPod|iPad);.*/.test(navigator.appVersion);b.blackberry=/.*BlackBerry.*/.test(navigator.appName)||/.*BlackBerry.*/.test(navigator.appVersion);b.android=/.*Android.*/.test(navigator.appVersion);b.wince=/.*Windows CE.*/.test(navigator.appVersion);b.webos=/.*webOS.*/.test(navigator.appVersion);b.feature_phone=/.*(Nokia|MOT|NetFront|MDIP|SEMC|Symbian).*/.test(navigator.appVersion)||/.*LGE?[\/-].*/.test(navigator.appName);
a=b.iphone||b.blackberry||b.android||b.wince||b.webos||b.feature_phone;return b}();if(!MobileBrowser()&&!/static\/flash9ajax/gi.test(window.location.href))var flash9_updater=setInterval(function(){location.hash=="#flash9"&&show_flash_9()},300);
var Platform=function(){var a={},b={windows:/.*Win.*/,macos:/.*Mac.*/},c=null;a.os=function(){c=$H(b).keys().detect(function(h){return b[h].test(navigator.platform)})||"unknown";a.os=function(){return c};return c};a.is_os=function(h){if(Object.isArray(h))return $A(h).indexOf(a.os())!=-1;else if(Object.isString(h))return a.os()==h;return false};var d=["IE","Opera","WebKit","MobileSafari","Gecko"],f=null;a.browser=function(){f=$A(d).detect(function(h){return Prototype.Browser[h]})||"unknown";a.browser=
function(){return f};return f};return a}();
if(!window.skip_promo_redirect&&window.location.hostname.match(/justin/)&&(MobileBrowser.android||MobileBrowser.iphone)&&!readCookie("android_promo")&&!(window.sessionStorage&&window.sessionStorage.android_promo))if(MobileBrowser.android)redirect_respecting_analytics("/static/android_promo?dest="+escape(window.location.pathname+window.location.search+window.location.hash));else MobileBrowser.iphone&&redirect_respecting_analytics("/static/iphone_promo#"+escape(window.location.pathname+window.location.search+
window.location.hash));function show_flash_9(){var a=document.createElement("div");document.body.appendChild(a);a.style.position="absolute";a.style.height="100%";a.style.width="100%";a.style.left="0px";a.style.top="0px";a.id="flash9_dialog";a.style.backgroundColor="#FFFFFF";a.style.zIndex=11;var b=document.createElement("iframe");b.src="/static/flash9ajax";b.style.height="100%";b.style.width="100%";a.appendChild(b);(a=$("ChanHeader"))&&a.remove();clearInterval(flash9_updater)}
function change_language(a,b){change_language_internal(a,b,window.location.href,window.location.hostname)}function change_language_internal(a,b,c){log_stat("change_language_clicked",["current_language="+a,"new_language="+b,"logged_in="+(PP.login==null)],function(){var d=c;if(a!==b){d=c.replace("://"+a+".","://"+b+".");if(d===c)d=c.match("www.")?c.replace("www",b):c.replace(LanguageBaseDomain,b+"."+LanguageBaseDomain)}redirect_respecting_analytics(d)})}getUserLogin=function(){return PP.login};
getPasswordHash=function(){return PP.password_hash};getUserID=function(){return PP.user_id};function read_location_hash(){var a={};$A(location.hash.substr(1).split("&")).each(function(b){var c=[];if(b.startsWith("from-")){c.push("from");c.push(b.substr(5))}else if(b.startsWith("my")){c.push("chat");c.push(b.substr(2))}else c=b.split("=");if(c.length>=2)a[c[0]]=c[1]});return a}
function write_location_hash(a){window.location.replace([window.location.href.replace(/\#.*/i,""),"#",$H(a).toQueryString().replace("%2F","/")].join(""))}function modify_location_hash(a,b){hash=read_location_hash();hash[a]=b;write_location_hash(hash)}function remove_from_location_hash(a){hash=read_location_hash();delete hash[a];write_location_hash(hash)}
function growl_ad(a,b,c,d){growl('<a href="'+d+'" style="display:block;"><table><tr><td><img style="height:40px;width:40px" src="'+c+'" /></td><td style="padding-left:5px;vertical-align:top;"><h3>'+a+'</h3><p style="color:white;">'+b+"</p></td></table></tr></a>","growl_ad")}
function growl(a,b,c){if(!$$(".notification_holder .content").any(function(f){return f.innerHTML.replace(/\s/,"")==a.replace(/\s/,"")})){var d="growl_"+growl.growl_id++;b=['<div class="notification_holder" id="',d,'"><div class="notification"><a href="#" class="close" onclick="$(\'',d,'\').hide(); return false;">X</a><div class="content ',b,'">',a,"</div></div></div>"].join("");appendHTML("growl_slider",b);$(d).onmouseover=function(){x=$(d).down("a.close");x.style.display="block"};$(d).onmouseout=
function(){x=$(d).down("a.close");x.style.display=""};$("growl_container").show();c||(c=7);new Effect.Fade(d,{duration:3,delay:c,queue:{scope:d},afterFinish:function(){var f=$(d).offsetHeight;new Effect.Move("growl_slider",{y:0-f,x:0,mode:"relative",afterFinish:function(){$(d).remove();if($("growl_slider").childElements().length==0)$("growl_slider").style.top="0px";else $("growl_slider").style.top=$("growl_slider").positionedOffset().top+f+"px"}})}})}}growl.growl_id=0;
function show_info_popup(a,b,c,d){$("info_popup_title").update(a);$("info_popup_body").update(b);try{b.evalScripts()}catch(f){}$("info_popup_container").appear({duration:0.2});$("info_popup_cover").show();$("info_popup_close_link").onclick=function(){c&&c();hide_info_popup();return false};$("info_popup").removeClassName("single");$("info_popup").removeClassName("narrow");$("info_popup").removeClassName("double");$("info_popup").addClassName(d?d:"single")}
function hide_info_popup(){$("info_popup_container").hide();$("info_popup_cover").hide()}function user_profile_image(a){var b=PP.profile_image,c=PP.login;if(b){var d=b.match(/:uid=>"(\w+)"/);if(d)b=b.match(/:format=>"(\w+)"/);else{d=b.match(/:uid:\s*(\w+)/);b=b.match(/:format:\s*(\w+)/)}return"http://s.jtvnw.net/jtv_user_pictures/"+c+"-profile_image-"+d[1]+"-"+a+"."+b[1]}else return"/images/redesign/404_user_"+a+".png"}EventBank={handlers:{},prefix_handlers:{},backlog:{}};
EventBank.fire=function(a){var b=$A(arguments).slice(1);if(EventBank.handlers.hasOwnProperty(a)){$A(EventBank.handlers[a]||[]).each(function(d){d.apply(EventBank,b)});var c=EventBank.prefix_handlers[a.split(":")[0]]||[];$A(c).each(function(d){d.apply(EventBank,[a].concat(b))})}else{EventBank.backlog.hasOwnProperty(a)||(EventBank.backlog[a]=[]);EventBank.backlog[a].push(b)}};
EventBank.register_handler=function(a,b){EventBank.handlers[a]||(EventBank.handlers[a]=[]);EventBank.handlers[a].push(b);if(EventBank.backlog.hasOwnProperty(a))for(var c,d=EventBank.backlog[a];c=d.pop();)b.apply(EventBank,c)};EventBank.register_prefix_handler=function(a,b){EventBank.prefix_handlers[a]||(EventBank.prefix_handlers[a]=[]);EventBank.prefix_handlers[a].push(b)};function getUniqueId(){return readCookie("unique_id")}
function import_login_success(){flash_msg("import_login_message");$("youtube_login").value=""}function import_login_failure(){flash_msg("import_login_error")}function import_url_success(){flash_msg("import_url_message");$("youtube_url").value=""}function import_url_failure(){flash_msg("import_url_error")}function flash_msg(a){$(a).show();new Effect.Fade(a,{duration:8,from:1,to:0})}
function check_login_available(a,b){if(check_login_available.timeout){clearTimeout(check_login_available.timeout);check_login_available.timeout=null}$("login_validation").src="/images/redesign/spinner.gif";$("login_validation").show();if(a.length>3)check_login_available.timeout=setTimeout(function(){new Ajax.Request("/user/login_available",{parameters:"login="+encodeURIComponent(a),onSuccess:function(c){$("login_validation").src="/images/"+b+"-"+c.responseText+".png";$("login_validation").show()}});
check_login_available.timeout=null},500);else $("login_validation").hide()}function show_login_box(a){show_login_box=function(){return true};a||(a={});$("login_wrapper").show();new Ajax.Updater("login_wrapper","/user/login_popup",{method:"get",evalScripts:true,onComplete:function(b){if(b.status!=200)a.url?redirect_respecting_analytics(a.url):redirect_respecting_analytics("/user/signup");else window.setTimeout(function(){show_login_box(a)},50)}})}
show_reload_box=function(){var a=$("reload_subwindow"),b=$("cover");if(a&&b){hide_overlay_box();a.show();b.show();hide_flash_player();hide_embed_player();window.scrollTo(0,0)}};show_post_signup_subwindow=function(){Element.show("cover");Element.show("post_signup_subwindow");hide_flash_player();hide_embed_player()};
hide_overlay_box=function(){show_flash_player();show_embed_player();toggleManagedAds();$("cover")&&Element.hide("cover");$("login_subwindow")&&Element.hide("login_subwindow");$("post_signup_subwindow")&&Element.hide("post_signup_subwindow");$("email_window")&&Element.hide("email_window");$("broadcast_subwindow")&&Element.hide("broadcast_subwindow");$("reload_subwindow")&&Element.hide("reload_subwindow");$("chat_login")&&$("chat_login").hide();$("temp_cover")&&$("temp_cover").hide();$("login_wraper")&&
$("login_wrapper").hide()};show_flash_player=function(){if(video_player())video_player().style.visibility="visible";$$(".front_page_flash").each(function(a){a.style.visibility=""})};hide_flash_player=function(){if(video_player())video_player().style.visibility="hidden";$$(".front_page_flash").each(function(a){a.style.visibility="hidden"})};
video_player=function(){return $("live_site_player_flash")||$("archive_site_player_flash")||$("jtv_archive_flash")||$("live_embed_player_flash")||$("clip_site_player_flash")||$("clip_embed_player_flash")};show_embed_player=function(){if(embed_player())embed_player().parentNode.style.visibility="visible"};hide_embed_player=function(){if(embed_player())embed_player().parentNode.style.visibility="hidden"};embed_player=function(){return $("clip_embed_player_flash")};sharing_login_windows={};
sharing_login_callbacks={};
log_in_to_sharing_service=function(a,b){for(var c in sharing_login_windows)sharing_login_windows.hasOwnProperty(c)&&a!=c&&sharing_login_windows[c].close();for(c in sharing_login_windows)sharing_login_windows.hasOwnProperty(c)&&a!==c&&sharing_login_callbacks[c].onFailure({message:_("You started to log in to another messaging service.")});log_stat("sharing/login_prompt",["status=start","service="+a,"prompt_type="+b.type]);c=window.open("/sharing/begin_login?service="+a+"&login_prompt_type="+b.type,
"sharing_login_window","width=1024,height=400");sharing_login_windows[a]=c;if(!c.opener)c.opener=window;window.focus&&c.focus();sharing_login_callbacks[a]={onSuccess:function(d){delete sharing_login_callbacks[a];delete sharing_login_windows[a];log_stat("sharing/login_prompt",["status=success","service="+a,"prompt_type="+b.type]);return b.onSuccess(d)},onFailure:function(d){delete sharing_login_callbacks[a];delete sharing_login_windows[a];log_stat("sharing/login_prompt",["status=failure","service="+
a]);return b.onFailure(d)}}};
var share=function(a){if({twitter:readCookie("twitter_login"),facebook:readCookie("facebook_uid")}[a.service])new Ajax.Request("/sharing/share",{method:"post",parameters:{service:a.service,message:a.message,link:a.link,description:a.description,source:a.source,type:a.type,object_id:a.object_id},onSuccess:a.onSuccess,onFailure:a.onFailure||function(){}});else log_in_to_sharing_service(a.service,{onSuccess:function(){share(a)},onFailure:a.onFailure||function(){}})},popup_share_url=function(a){if(!a.link&&
!a.id)if(typeof broadcast_id_from_url!="undefined"&&typeof broadcast_part_from_url!="undefined"){var b=broadcast_id_from_url(),c=broadcast_part_from_url();if(b&&c){a.type="broadcast";a.id=PP.channel+":"+b+":"+c}else a.link=window.location.toString()}else a.link=window.location.toString();if(!a.title)a.title=document.title;return"/sharing/popup_share?"+Object.toQueryString(a)},require_login=function(a,b){if(PP.login){b&&b();return true}else{show_login_box(a||{});return false}};
Event.observe(window,"unload",function(){for(var a in sharing_login_callbacks)if(sharing_login_callbacks.hasOwnProperty(a)){sharing_login_callbacks[a].onFailure({error_message:_("You left the page.")});sharing_login_windows[a].close()}});window._gaq=window._gaq||[];function gaTrackEvent(a,b,c,d){a=["_trackEvent",a,b];c!=null&&a.push(c);d!=null&&a.push(d);_gaq.push(a);return true}function track_analytics_event(a){_gaq.push(["_trackPageview",a])}
function redirect_respecting_analytics(a){var b=/\?/.test(a)?"&":"?",c=$A(window.location.search.slice(1).split("&")).map(function(d){return d.split("=")}).findAll(function(d){return d[0]in{utm_source:1,utm_medium:1,utm_campaign:1,utm_term:1,utm_content:1}}).map(function(d){return d.join("=")}).join("&");if(c)a=a+b+c;window.location=a}
function populate_fields(a){if(a.facebook.token){$("user_facebook_access_token").value=a.facebook.token;$("user_facebook_uid").value=a.facebook.data.id}if(a.facebook.data.link&&!/.+\.php\?/.test(a.facebook.data.link))$("user_login").value=a.facebook.data.link.split("/").last().replace(/\W+/g,"");else if(a.facebook.data.name)$("user_login").value=a.facebook.data.name.replace(/\W+/g,"");if(a.facebook.data.name)$("user_name").value=a.facebook.data.name;if(a.facebook.data.email)$("user_email").value=
a.facebook.data.email;if(a.facebook.data.birthday){a=a.facebook.data.birthday.split("/");if(a.length>=1&&$("birthday_fields").childElements().length>=3){$("birthday_fields").childElements()[0].childElements()[parseInt(a[0],10)].selected=true;if(a.length>=2){$("birthday_fields").childElements()[1].childElements()[parseInt(a[1],10)].selected=true;if(a.length>=3){$("birthday_fields").childElements()[2].childElements()[parseInt(a[2],10)-1909].selected=true;$("birthday_div").hide()}}}}$("create_acount_facebook")&&
$("create_account_facebook").hide();$("signup_form").show();$("user_password").focus();check_login_available($("user_login").value)}function get_leaderboard(){var a=$("FPLeaderboard");if(location.host.include("staging"))a=$("Staging_FPLeaderboard");return a}
function toggle_header_notification(){if($("header_notification")&&$("header_notification").style.display=="none"){if($("iphone_banner").style.display==""){hn_height=$("header_notification").getHeight();ib_height=$("iphone_banner").getHeight();if(ib_height>0){ib_height=135;$("iphone_banner_in").morph("height:"+ib_height+"px;",{duration:0.1})}$("header_notification").setStyle({top:"-"+ib_height+"px"});$("header_notification").morph("margin-bottom:-"+hn_height+"px;",{duration:0.5})}Effect.SlideDown("header_notification",
{duration:0.5})}else{Effect.SlideUp("header_notification",{duration:0.3});if($("iphone_banner").style.display==""){$("header_notification").morph("margin-bottom:-21px;",{duration:0.3});setTimeout(function(){$("iphone_banner_in").morph("height:104px",{duration:0.3})},360)}}}
function RemovedRedirectionHandling(a,b,c,d,f){if((d=="true"||d===true)&&f!="true"&&f!==true){log_stat("emergency_paywall_redirect",["from="+window.location]);redirect_respecting_analytics("/payment/pro_account")}if(!(b=="false"||!b))if(b=="dmca")redirect_respecting_analytics(c+"/dmca_violation");else if(b=="tos")redirect_respecting_analytics(c+"/tos_violation");else if(b&&b!="directory_hidden")a=="archive"?redirect_respecting_analytics(c):redirect_respecting_analytics(c+"/dmca_violation")}
Mixpanel={track_with_swf:function(a,b){Mixpanel._init();var c="_mpq_"+window._mp.count;window._mp.count=(window._mp.count+1)%window._mp.cap;var d={allowScriptAccess:"always",allowNetworking:"all",flashvars:Mixpanel._build_flashvars(a,b)};addSWF("/widgets/mixpanel_beacon.swf","_mpq",c,d,{id:c,name:"left",bgcolor:"#000000"})},_build_flashvars:function(a,b){b=Object.clone(b);b.login=PP.login;var c,d,f,h=0,e=[];e[h++]="event="+a.toString();for(c in b)if(c)if(c!="event"){val=b[c];d=val==null?"":val.toString();
f=c;e[h++]=f+"="+d}return e.join("&")},_init:function(){if(!window._mp){window._mp={};window._mp.count=0;window._mp.cap=10;window._mp.q=document.createElement("div");window._mp.q.id="_mpq";window._mp.q.setStyle({height:"0px",width:"0px"});document.getElementsByTagName("body")[0].appendChild(window._mp.q)}}};
String.prototype.parseColor=function(a){var b="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(","),d=0;do b+=parseInt(c[d]).toColorPart();while(++d<3)}else if(this.slice(0,1)=="#"){if(this.length==4)for(d=1;d<4;d++)b+=(this.charAt(d)+this.charAt(d)).toLowerCase();if(this.length==7)b=this.toLowerCase()}return b.length==7?b:a||this};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return b.nodeType==3?b.nodeValue:b.hasChildNodes()?Element.collectTextNodes(b):""}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return c.nodeType==3?c.nodeValue:c.hasChildNodes()&&!Element.hasClassName(c,b)?Element.collectTextNodesIgnoreClass(c,b):""}).flatten().join("")};
Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:b/100+"em"});Prototype.Browser.WebKit&&window.scrollBy(0,0);return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var b=document.createTextNode(" ");a.appendChild(b);a.removeChild(b)}catch(c){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return-Math.cos(a*Math.PI)/2+0.5},reverse:function(a){return 1-a},flicker:function(a){a=-Math.cos(a*Math.PI)/4+0.75+Math.random()/4;return a>1?1:a},wobble:function(a){return-Math.cos(a*Math.PI*9*a)/2+0.5},pulse:function(a,b){return-Math.cos(a*((b||5)-0.5)*2*Math.PI)/2+0.5},spring:function(a){return 1-
Math.cos(a*4.5*Math.PI)*Math.exp(-a*6)},none:function(){return 0},full:function(){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE)b+=";zoom:1";a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore((new Element("span",{style:b})).update(d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(a,b,c){a=
(typeof a=="object"||Object.isFunction(a))&&a.length?a:$(a).childNodes;var d=Object.extend({speed:0.1,delay:0},c||{}),f=d.delay;$A(a).each(function(h,e){new b(h,Object.extend(d,{delay:e*d.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(a,b,c){a=$(a);b=(b||"appear").toLowerCase();return Effect[Effect.PAIRS[b][a.visible()?1:0]](a,Object.extend({queue:{position:"end",scope:a.id||"global",limit:1}},c||{}))}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=(new Date).getTime();switch(Object.isString(a.options.queue)?a.options.queue:a.options.queue.position){case "front":this.effects.findAll(function(c){return c.state=="idle"}).each(function(c){c.startOn+=a.finishOn;c.finishOn+=a.finishOn});break;case "with-last":b=this.effects.pluck("startOn").max()||b;break;case "end":b=this.effects.pluck("finishOn").max()||
b}a.startOn+=b;a.finishOn+=b;if(!a.options.queue.limit||this.effects.length<a.options.queue.limit)this.effects.push(a);if(!this.interval)this.interval=setInterval(this.loop.bind(this),15)},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){for(var a=(new Date).getTime(),b=0,c=this.effects.length;b<c;b++)this.effects[b]&&this.effects[b].loop(a)}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a))return a;return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue)}};Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){if(a&&a.transition===false)a.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1E3;this.finishOn=this.startOn+this.options.duration*1E3;this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=function(){function b(c,
d){c.options[d+"Internal"]&&c.options[d+"Internal"](c);c.options[d]&&c.options[d](c)}return function(c){if(this.state==="idle"){this.state="running";b(this,"beforeSetup");this.setup&&this.setup();b(this,"afterSetup")}if(this.state==="running"){this.position=c=this.options.transition(c)*this.fromToDelta+this.options.from;b(this,"beforeUpdate");this.update&&this.update(c);b(this,"afterUpdate")}}}();this.event("beforeStart");this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":
this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn)if(a>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");this.finish&&this.finish();this.event("afterFinish")}else{a=(a-this.startOn)/this.totalTime;var b=(a*this.totalFrames).round();if(b>this.currentFrame){this.render(a);this.currentFrame=b}}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);this.state="finished"},
event:function(a){this.options[a+"Internal"]&&this.options[a+"Internal"](this);this.options[a]&&this.options[a](this)},inspect:function(){var a=$H();for(property in this)Object.isFunction(this[property])||a.set(property,this[property]);return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a,b){this.effects=a||[];this.start(b)},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");b.finish&&b.finish(a);b.event("afterFinish")})}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(a,b,c){a=Object.isString(a)?$(a):a;var d=$A(arguments),f=d.last();d=d.length==5?d[3]:null;this.method=Object.isFunction(f)?f.bind(a):Object.isFunction(a[f])?a[f].bind(a):function(h){a[f]=h};this.start(Object.extend({from:b,to:c},d||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(a){this.start(Object.extend({duration:0},a||{}))},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});this.start(Object.extend({from:this.element.getOpacity()||0,to:1},b||{}))},update:function(a){this.element.setOpacity(a)}});
Effect.Move=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({x:0,y:0,mode:"relative"},b||{}))},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x-=this.originalLeft;this.options.y-=this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*
a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(a,b,c,d){return new Effect.Move(a,Object.extend({x:c,y:b},d||{}))};
Effect.Scale=Class.create(Effect.Base,{initialize:function(a,b,c){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:b},c||{}))},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=
this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box")this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=
[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){a=this.options.scaleFrom/100+this.factor*a;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*a+this.fontSizeType});this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var c={};
if(this.options.scaleX)c.width=b.round()+"px";if(this.options.scaleY)c.height=a.round()+"px";if(this.options.scaleFromCenter){var d=(a-this.dims[0])/2,f=(b-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY)c.top=this.originalTop-d+"px";if(this.options.scaleX)c.left=this.originalLeft-f+"px"}else{if(this.options.scaleY)c.top=-d+"px";if(this.options.scaleX)c.left=-f+"px"}}this.element.setStyle(c)}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({startcolor:"#ffff99"},b||{}))},setup:function(){if(this.element.getStyle("display")=="none")this.cancel();else{this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor)this.options.endcolor=
this.element.getStyle("background-color").parseColor("#ffffff");if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle("background-color");this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))}},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+
(this._base[d]+this._delta[d]*a).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(a,b){var c=b||{},d=document.viewport.getScrollOffsets(),f=$(a).cumulativeOffset();if(c.offset)f[1]+=c.offset;return new Effect.Tween(null,d.top,f[1],c,function(h){scrollTo(d.left,h.round())})};
Effect.Fade=function(a,b){a=$(a);var c=a.getInlineOpacity(),d=Object.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(f){f.options.to==0&&f.element.hide().setStyle({opacity:c})}},b||{});return new Effect.Opacity(a,d)};
Effect.Appear=function(a,b){a=$(a);var c=Object.extend({from:a.getStyle("display")=="none"?0:a.getOpacity()||0,to:1,afterFinishInternal:function(d){d.element.forceRerendering()},beforeSetup:function(d){d.element.setOpacity(d.options.from).show()}},b||{});return new Effect.Opacity(a,c)};
Effect.Puff=function(a,b){a=$(a);var c={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return new Effect.Parallel([new Effect.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(d){Position.absolutize(d.effects[0].element)},afterFinishInternal:function(d){d.effects[0].element.hide().setStyle(c)}},
b||{}))};Effect.BlindUp=function(a,b){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(c){c.element.hide().undoClipping()}},b||{}))};
Effect.BlindDown=function(a,b){a=$(a);var c=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(d){d.element.undoClipping()}},b||{}))};
Effect.SwitchOff=function(a,b){a=$(a);var c=a.getInlineOpacity();return new Effect.Appear(a,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(d){new Effect.Scale(d.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:c})}})}},b||{}))};
Effect.DropOut=function(a,b){a=$(a);var c={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(d){d.effects[0].element.makePositioned()},afterFinishInternal:function(d){d.effects[0].element.hide().undoPositioned().setStyle(c)}},b||{}))};
Effect.Shake=function(a,b){a=$(a);var c=Object.extend({distance:20,duration:0.5},b||{}),d=parseFloat(c.distance),f=parseFloat(c.duration)/10,h={top:a.getStyle("top"),left:a.getStyle("left")};return new Effect.Move(a,{x:d,y:0,duration:f,afterFinishInternal:function(e){new Effect.Move(e.element,{x:-d*2,y:0,duration:f*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:d*2,y:0,duration:f*2,afterFinishInternal:function(i){new Effect.Move(i.element,{x:-d*2,y:0,duration:f*2,afterFinishInternal:function(l){new Effect.Move(l.element,
{x:d*2,y:0,duration:f*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:-d,y:0,duration:f,afterFinishInternal:function(w){w.element.undoPositioned().setStyle(h)}})}})}})}})}})}})};
Effect.SlideDown=function(a,b){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom"),d=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();window.opera&&f.element.setStyle({top:""});f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:f.dims[0]-
f.element.clientHeight+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:c})}},b||{}))};
Effect.SlideUp=function(a,b){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom"),d=a.getDimensions();return new Effect.Scale(a,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();window.opera&&f.element.setStyle({top:""});f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:f.dims[0]-
f.element.clientHeight+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:c})}},b||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};
Effect.Grow=function(a,b){a=$(a);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},b||{}),d={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},f=a.getDimensions(),h,e,g,i;switch(c.direction){case "top-left":h=e=g=i=0;break;case "top-right":h=f.width;e=i=0;g=-f.width;break;case "bottom-left":h=g=0;e=f.height;i=-f.height;break;
case "bottom-right":h=f.width;e=f.height;g=-f.width;i=-f.height;break;case "center":h=f.width/2;e=f.height/2;g=-f.width/2;i=-f.height/2}return new Effect.Move(a,{x:h,y:e,duration:0.01,beforeSetup:function(l){l.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(l){new Effect.Parallel([new Effect.Opacity(l.element,{sync:true,to:1,from:0,transition:c.opacityTransition}),new Effect.Move(l.element,{x:g,y:i,sync:true,transition:c.moveTransition}),new Effect.Scale(l.element,100,
{scaleMode:{originalHeight:f.height,originalWidth:f.width},sync:true,scaleFrom:window.opera?1:0,transition:c.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(o){o.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(o){o.effects[0].element.undoClipping().undoPositioned().setStyle(d)}},c))}})};
Effect.Shrink=function(a,b){a=$(a);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},b||{}),d={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},f=a.getDimensions(),h,e;switch(c.direction){case "top-left":h=e=0;break;case "top-right":h=f.width;e=0;break;case "bottom-left":h=0;e=f.height;break;case "bottom-right":h=f.width;e=
f.height;break;case "center":h=f.width/2;e=f.height/2}return new Effect.Parallel([new Effect.Opacity(a,{sync:true,to:0,from:1,transition:c.opacityTransition}),new Effect.Scale(a,window.opera?1:0,{sync:true,transition:c.scaleTransition,restoreAfterFinish:true}),new Effect.Move(a,{x:h,y:e,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(d)}},
c))};Effect.Pulsate=function(a,b){a=$(a);var c=b||{},d=a.getInlineOpacity(),f=c.transition||Effect.Transitions.linear;return new Effect.Opacity(a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:d})}},c),{transition:function(h){return 1-f(-Math.cos(h*(c.pulses||5)*2*Math.PI)/2+0.5)}}))};
Effect.Fold=function(a,b){a=$(a);var c={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};a.makeClipping();return new Effect.Scale(a,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(){new Effect.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(c)}})}},b||{}))};
Effect.Morph=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;var c=Object.extend({style:{}},b||{});if(Object.isString(c.style))if(c.style.include(":"))this.style=c.style.parseStyle();else{this.element.addClassName(c.style);this.style=$H(this.element.getStyles());this.element.removeClassName(c.style);var d=this.element.getStyles();this.style=this.style.reject(function(f){return f.value==d[f.key]});c.afterFinishInternal=function(f){f.element.addClassName(f.options.style);
f.transforms.each(function(h){f.element.style[h.style]=""})}}else this.style=$H(c.style);this.start(c)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b))b="#ffffff";b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(b){var c=b[0];b=b[1];var d=null;if(b.parseColor("#zzzzzz")!="#zzzzzz"){b=b.parseColor();d="color"}else if(c=="opacity"){b=parseFloat(b);Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&
this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(b)){d=b.match(/^([\+\-]?[0-9\.]+)(.*)$/);b=parseFloat(d[1]);d=d.length==3?d[2]:null}var f=this.element.getStyle(c);return{style:c.camelize(),originalValue:d=="color"?a(f):parseFloat(f||0),targetValue:d=="color"?a(b):b,unit:d}}.bind(this)).reject(function(b){return b.originalValue==b.targetValue||b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))})},update:function(a){for(var b={},c,d=this.transforms.length;d--;)b[(c=this.transforms[d]).style]=
c.unit=="color"?"#"+Math.round(c.originalValue[0]+(c.targetValue[0]-c.originalValue[0])*a).toColorPart()+Math.round(c.originalValue[1]+(c.targetValue[1]-c.originalValue[1])*a).toColorPart()+Math.round(c.originalValue[2]+(c.targetValue[2]-c.originalValue[2])*a).toColorPart():(c.originalValue+(c.targetValue-c.originalValue)*a).toFixed(3)+(c.unit===null?"":c.unit);this.element.setStyle(b,true)}});
Effect.Transform=Class.create({initialize:function(a,b){this.tracks=[];this.options=b||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=a.get("ids"),c=a.get("effect"),d=a.get("options");return[$(b)||$$(b)].flatten().map(function(f){return new c(f,Object.extend({sync:true},
d))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var a,b=$H();if(Prototype.Browser.WebKit)a=(new Element("div",{style:this})).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';a=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){a[c]&&b.set(c,a[c])});Prototype.Browser.IE&&this.include("opacity")&&b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return b};
Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=document.defaultView.getComputedStyle($(a),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=b[d];return c})}:function(a){a=$(a);var b=a.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,f){d[f]=b[f];return d});if(!c.opacity)c.opacity=a.getOpacity();return c};
Effect.Methods={morph:function(a,b,c){a=$(a);new Effect.Morph(a,Object.extend({style:b},c||{}));return a},visualEffect:function(a,b,c){a=$(a);b=b.dasherize().camelize();b=b.charAt(0).toUpperCase()+b.substring(1);new Effect[b](a,c);return a},highlight:function(a,b){a=$(a);new Effect.Highlight(a,b);return a}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(b,c){b=$(b);Effect[a.charAt(0).toUpperCase()+a.substring(1)](b,c);return b}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);
var swfobject=function(){function a(){if(!U){try{var q=k.getElementsByTagName("body")[0].appendChild(k.createElement("span"));q.parentNode.removeChild(q)}catch(u){return}U=true;q=C.length;for(var y=0;y<q;y++)C[y]()}}function b(q){if(U)q();else C[C.length]=q}function c(q){if(typeof r.addEventListener!=m)r.addEventListener("load",q,false);else if(typeof k.addEventListener!=m)k.addEventListener("load",q,false);else if(typeof r.attachEvent!=m)M(r,"onload",q);else if(typeof r.onload=="function"){var u=
r.onload;r.onload=function(){u();q()}}else r.onload=q}function d(){var q=k.getElementsByTagName("body")[0],u=k.createElement(p);u.setAttribute("type",n);var y=q.appendChild(u);if(y){var z=0;(function(){if(typeof y.GetVariable!=m){var A=y.GetVariable("$version");if(A){A=A.split(" ")[1].split(",");B.pv=[parseInt(A[0],10),parseInt(A[1],10),parseInt(A[2],10)]}}else if(z<10){z++;setTimeout(arguments.callee,10);return}q.removeChild(u);y=null;f()})()}else f()}function f(){var q=D.length;if(q>0)for(var u=
0;u<q;u++){var y=D[u].id,z=D[u].callbackFn,A={success:false,id:y};if(B.pv[0]>0){var H=F(y);if(H)if(O(D[u].swfVersion)&&!(B.wk&&B.wk<312)){N(y,true);if(z){A.success=true;A.ref=h(y);z(A)}}else if(D[u].expressInstall&&e()){A={};A.data=D[u].expressInstall;A.width=H.getAttribute("width")||"0";A.height=H.getAttribute("height")||"0";if(H.getAttribute("class"))A.styleclass=H.getAttribute("class");if(H.getAttribute("align"))A.align=H.getAttribute("align");var E={};H=H.getElementsByTagName("param");for(var K=
H.length,L=0;L<K;L++)if(H[L].getAttribute("name").toLowerCase()!="movie")E[H[L].getAttribute("name")]=H[L].getAttribute("value");g(A,E,y,z)}else{i(H);z&&z(A)}}else{N(y,true);if(z){if((y=h(y))&&typeof y.SetVariable!=m){A.success=true;A.ref=y}z(A)}}}}function h(q){var u=null;if((q=F(q))&&q.nodeName=="OBJECT")if(typeof q.SetVariable!=m)u=q;else if(q=q.getElementsByTagName(p)[0])u=q;return u}function e(){return!X&&O("6.0.65")&&(B.win||B.mac)&&!(B.wk&&B.wk<312)}function g(q,u,y,z){X=true;V=z||null;ca=
{success:false,id:y};var A=F(y);if(A){if(A.nodeName=="OBJECT"){I=l(A);Q=null}else{I=A;Q=y}q.id=s;if(typeof q.width==m||!/%$/.test(q.width)&&parseInt(q.width,10)<310)q.width="310";if(typeof q.height==m||!/%$/.test(q.height)&&parseInt(q.height,10)<137)q.height="137";k.title=k.title.slice(0,47)+" - Flash Player Installation";z=B.ie&&B.win?"ActiveX":"PlugIn";z="MMredirectURL="+r.location.toString().replace(/&/g,"%26")+"&MMplayerType="+z+"&MMdoctitle="+k.title;if(typeof u.flashvars!=m)u.flashvars+="&"+
z;else u.flashvars=z;if(B.ie&&B.win&&A.readyState!=4){z=k.createElement("div");y+="SWFObjectNew";z.setAttribute("id",y);A.parentNode.insertBefore(z,A);A.style.display="none";(function(){A.readyState==4?A.parentNode.removeChild(A):setTimeout(arguments.callee,10)})()}o(q,u,y)}}function i(q){if(B.ie&&B.win&&q.readyState!=4){var u=k.createElement("div");q.parentNode.insertBefore(u,q);u.parentNode.replaceChild(l(q),u);q.style.display="none";(function(){q.readyState==4?q.parentNode.removeChild(q):setTimeout(arguments.callee,
10)})()}else q.parentNode.replaceChild(l(q),q)}function l(q){var u=k.createElement("div");if(B.win&&B.ie)u.innerHTML=q.innerHTML;else if(q=q.getElementsByTagName(p)[0])if(q=q.childNodes)for(var y=q.length,z=0;z<y;z++)!(q[z].nodeType==1&&q[z].nodeName=="PARAM")&&q[z].nodeType!=8&&u.appendChild(q[z].cloneNode(true));return u}function o(q,u,y){var z,A=F(y);if(B.wk&&B.wk<312)return z;if(A){if(typeof q.id==m)q.id=y;if(B.ie&&B.win){var H="",E;for(E in q)if(q[E]!=Object.prototype[E])if(E.toLowerCase()==
"data")u.movie=q[E];else if(E.toLowerCase()=="styleclass")H+=' class="'+q[E]+'"';else if(E.toLowerCase()!="classid")H+=" "+E+'="'+q[E]+'"';E="";for(var K in u)if(u[K]!=Object.prototype[K])E+='<param name="'+K+'" value="'+u[K]+'" />';A.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+H+">"+E+"</object>";J[J.length]=q.id;z=F(q.id)}else{K=k.createElement(p);K.setAttribute("type",n);for(var L in q)if(q[L]!=Object.prototype[L])if(L.toLowerCase()=="styleclass")K.setAttribute("class",
q[L]);else L.toLowerCase()!="classid"&&K.setAttribute(L,q[L]);for(H in u)if(u[H]!=Object.prototype[H]&&H.toLowerCase()!="movie"){q=K;E=H;L=u[H];y=k.createElement("param");y.setAttribute("name",E);y.setAttribute("value",L);q.appendChild(y)}A.parentNode.replaceChild(K,A);z=K}}return z}function w(q){var u=F(q);if(u&&u.nodeName=="OBJECT")if(B.ie&&B.win){u.style.display="none";(function(){if(u.readyState==4){var y=F(q);if(y){for(var z in y)if(typeof y[z]=="function")y[z]=null;y.parentNode.removeChild(y)}}else setTimeout(arguments.callee,
10)})()}else u.parentNode.removeChild(u)}function F(q){var u=null;try{u=k.getElementById(q)}catch(y){}return u}function M(q,u,y){q.attachEvent(u,y);G[G.length]=[q,u,y]}function O(q){var u=B.pv;q=q.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return u[0]>q[0]||u[0]==q[0]&&u[1]>q[1]||u[0]==q[0]&&u[1]==q[1]&&u[2]>=q[2]?true:false}function P(q,u,y,z){if(!(B.ie&&B.mac)){var A=k.getElementsByTagName("head")[0];if(A){y=y&&typeof y=="string"?y:"screen";if(z)ba=R=null;
if(!R||ba!=y){z=k.createElement("style");z.setAttribute("type","text/css");z.setAttribute("media",y);R=A.appendChild(z);if(B.ie&&B.win&&typeof k.styleSheets!=m&&k.styleSheets.length>0)R=k.styleSheets[k.styleSheets.length-1];ba=y}if(B.ie&&B.win)R&&typeof R.addRule==p&&R.addRule(q,u);else R&&typeof k.createTextNode!=m&&R.appendChild(k.createTextNode(q+" {"+u+"}"))}}}function N(q,u){if(da){var y=u?"visible":"hidden";if(U&&F(q))F(q).style.visibility=y;else P("#"+q,"visibility:"+y)}}function j(q){return/[\\\"<>\.;]/.exec(q)!=
null&&typeof encodeURIComponent!=m?encodeURIComponent(q):q}var m="undefined",p="object",n="application/x-shockwave-flash",s="SWFObjectExprInst",r=window,k=document,v=navigator,t=false,C=[function(){t?d():f()}],D=[],J=[],G=[],I,Q,V,ca,U=false,X=false,R,ba,da=true,B=function(){var q=typeof k.getElementById!=m&&typeof k.getElementsByTagName!=m&&typeof k.createElement!=m,u=v.userAgent.toLowerCase(),y=v.platform.toLowerCase(),z=y?/win/.test(y):/win/.test(u);y=y?/mac/.test(y):/mac/.test(u);u=/webkit/.test(u)?
parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var A=!+"\u000b1",H=[0,0,0],E=null;if(typeof v.plugins!=m&&typeof v.plugins["Shockwave Flash"]==p){if((E=v.plugins["Shockwave Flash"].description)&&!(typeof v.mimeTypes!=m&&v.mimeTypes[n]&&!v.mimeTypes[n].enabledPlugin)){t=true;A=false;E=E.replace(/^.*\s+(\S+\s+\S+$)/,"$1");H[0]=parseInt(E.replace(/^(.*)\..*$/,"$1"),10);H[1]=parseInt(E.replace(/^.*\.(.*)\s.*$/,"$1"),10);H[2]=/[a-zA-Z]/.test(E)?parseInt(E.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),
10):0}}else if(typeof r.ActiveXObject!=m)try{var K=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(K)if(E=K.GetVariable("$version")){A=true;E=E.split(" ")[1].split(",");H=[parseInt(E[0],10),parseInt(E[1],10),parseInt(E[2],10)]}}catch(L){}return{w3:q,pv:H,wk:u,ie:A,win:z,mac:y}}();(function(){if(B.w3){if(typeof k.readyState!=m&&k.readyState=="complete"||typeof k.readyState==m&&(k.getElementsByTagName("body")[0]||k.body))a();if(!U){typeof k.addEventListener!=m&&k.addEventListener("DOMContentLoaded",
a,false);if(B.ie&&B.win){k.attachEvent("onreadystatechange",function(){if(k.readyState=="complete"){k.detachEvent("onreadystatechange",arguments.callee);a()}});r==top&&function(){if(!U){try{k.documentElement.doScroll("left")}catch(q){setTimeout(arguments.callee,0);return}a()}}()}B.wk&&function(){U||(/loaded|complete/.test(k.readyState)?a():setTimeout(arguments.callee,0))}();c(a)}}})();(function(){B.ie&&B.win&&window.attachEvent("onunload",function(){for(var q=G.length,u=0;u<q;u++)G[u][0].detachEvent(G[u][1],
G[u][2]);q=J.length;for(u=0;u<q;u++)w(J[u]);for(var y in B)B[y]=null;B=null;for(var z in swfobject)swfobject[z]=null;swfobject=null})})();return{registerObject:function(q,u,y,z){if(B.w3&&q&&u){var A={};A.id=q;A.swfVersion=u;A.expressInstall=y;A.callbackFn=z;D[D.length]=A;N(q,false)}else z&&z({success:false,id:q})},getObjectById:function(q){if(B.w3)return h(q)},embedSWF:function(q,u,y,z,A,H,E,K,L,W){var Y={success:false,id:u};if(B.w3&&!(B.wk&&B.wk<312)&&q&&u&&y&&z&&A){N(u,false);b(function(){y+="";
z+="";var T={};if(L&&typeof L===p)for(var S in L)T[S]=L[S];T.data=q;T.width=y;T.height=z;S={};if(K&&typeof K===p)for(var Z in K)S[Z]=K[Z];if(E&&typeof E===p)for(var aa in E)if(typeof S.flashvars!=m)S.flashvars+="&"+aa+"="+E[aa];else S.flashvars=aa+"="+E[aa];if(O(A)){Z=o(T,S,u);T.id==u&&N(u,true);Y.success=true;Y.ref=Z}else if(H&&e()){T.data=H;g(T,S,u,W);return}else N(u,true);W&&W(Y)})}else W&&W(Y)},switchOffAutoHideShow:function(){da=false},ua:B,getFlashPlayerVersion:function(){return{major:B.pv[0],
minor:B.pv[1],release:B.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(q,u,y){if(B.w3)return o(q,u,y)},showExpressInstall:function(q,u,y,z){B.w3&&e()&&g(q,u,y,z)},removeSWF:function(q){B.w3&&w(q)},createCSS:function(q,u,y,z){B.w3&&P(q,u,y,z)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(q){var u=k.location.search||k.location.hash;if(u){if(/\?/.test(u))u=u.split("?")[1];if(q==null)return j(u);u=u.split("&");for(var y=0;y<u.length;y++)if(u[y].substring(0,u[y].indexOf("="))==q)return j(u[y].substring(u[y].indexOf("=")+
1))}return""},expressInstallCallback:function(){if(X){var q=F(s);if(q&&I){q.parentNode.replaceChild(I,q);if(Q){N(Q,true);if(B.ie&&B.win)I.style.display="block"}V&&V(ca)}X=false}}}}();function createEmptyDiv(a,b){if(!document.getElementById(b)){var c=document.createElement("div");c.id=b;document.getElementById(a).appendChild(c)}}
function addSWF(a,b,c,d,f,h,e,g){d=d||{allowScriptAccess:"always"};f=f||"";h=h||"0";e=e||"0";g=g||"9";createEmptyDiv(b,c);swfobject.embedSWF(unescape(a),c,h,e,g,"/widgets/expressinstall.swf","",d,f)}window.$j!==undefined&&function(a){window.getGameInfo=function(b,c){a.ajax({url:"/discovery/game",dataType:"json",data:{name:b},success:function(d){c(d)},error:function(){}})}}($j);
var LateLoader={initialized:false,images:[],updating:false,xarth:false,show_companion:true,companion_slot:"",leader_ad:false,init:function(){var a=LateLoader.ad_geos;if(a)for(var b=PP.geo||"US",c=a.length-1;c>=0;c--)if(a[c][1]=="white")a[c][2].indexOf(b)!=-1||LateLoader.prevent_ad(a[c][0]);else a[c][2].indexOf(b)!=-1&&LateLoader.prevent_ad(a[c][0]);LateLoader.reposition_all_ads();if(LateLoader.initialized)return false;LateLoader.prep_images();Event.observe(window,"scroll",LateLoader.refresh);Event.observe(window,
"resize",LateLoader.refresh);LateLoader.refresh();LateLoader.initialized=true},last_init:function(){$$(".lastload").each(function(a){Event.observe(a,"load",LateLoader.reposition_all_ads);a.src=a.getAttribute("src1")});$$(".panel").each(function(a){Event.observe(a,"scroll",LateLoader.refresh)});LateLoader.refresh()},prep_images:function(){$$(".lateload").each(function(a,b){if(a.id!=="lateload"+b){var c=a.getAttribute("src1");a.id="lateload"+b;LateLoader.images.push({id:a.id,src:c})}})},set_companion_flag:function(a,
b){LateLoader.companion_slot=b;LateLoader.show_companion=a&&a[PP.geo]&&Math.floor(Math.random()*101)<a[PP.geo]?true:false;LateLoader.show_companion&&b&&LateLoader.prevent_ad(b)},should_show_companion:function(){return LateLoader.show_companion},refresh:function(){if(!LateLoader.updating){LateLoader.updating=true;var a=document.viewport.getScrollOffsets().top,b=a+document.viewport.getHeight();images=LateLoader.images.select(function(e){var g=$(e.id);if(g&&g.src!==e.src){var i=g.cumulativeOffset().top-
(g.cumulativeScrollOffset().top-a);if(b>=i-20&&g.clientWidth>0){g.src=e.src;return false}}return true});if(LateLoader.channel_about_me){var c=$("about_me_container"),d=c.cumulativeOffset();if(b>=d.top-20){c.innerHTML=LateLoader.channel_about_me;LateLoader.channel_about_me=null}if($("related")){var f=0;$$("#related_list .list_item").each(function(e){f+=e.getHeight()});c=-50;if($("clips"))c+=$("clips").getHeight();if($("about"))c+=$("about").getHeight();c=Math.min(f,c,400);d=$("related_list");if(c>
d.getHeight())d.style.height=c+"px"}}LateLoader.reposition_ad("ChanLeaderBottomv2");LateLoader.reposition_ad("Staging_ChanLeaderBottomv2");LateLoader.images=images;LateLoader.updating=false;if($$(".below_header")){var h=50-a;if(h<0)h=0;$$(".below_header").each(function(e){$(e).style.top=h+"px"})}if($$(".above_footer")&&$("footer")){h=b-$("footer").positionedOffset().top;if(h<0)h=0;$$(".above_footer").each(function(e){$(e).style.bottom=h+10+"px"})}}},ads:[],prevented_ads:[],is_prevented:function(a){return $A(LateLoader.prevented_ads).include(a)},
fill_slot:function(a){LateLoader.is_prevented(a)||typeof GA_googleFillSlot!="undefined"&&GA_googleFillSlot(a)},fill_slot_and_treat:function(a){LateLoader.fill_slot(a);LateLoader.register_ad(a);LateLoader.reposition_ad(a)},register_ad:function(a){LateLoader.is_prevented(a)||LateLoader.ads.push(a)},prevent_ad:function(a){LateLoader.prevented_ads.push(a);$A(this.ads).reject(function(b){return b==a})},reposition_ad:function(a){if(!LateLoader.is_prevented(a)){var b=$(a),c=$(a+"_holder");if(b&&c)if(PP.is_pro||
PP.active_channel_subscriber||$("right_col")&&!$("right_col").hasClassName("ad")){if(!c.hidden){c.hide();c.hidden=true;log_stat("page_ad_skipped",["name="+a,"page_type="+PP.page_type,"is_subscriber="+PP.active_channel_subscriber,"is_pro="+PP.is_pro])}}else{$("go_pro_link")!=undefined&&$("go_pro_link").show();var d=0,f=0;if(a.indexOf("Leaderv")>-1){LateLoader.leader_ad=true;d=b.getHeight();f=b.getWidth();d>0&&f>0&&show_header_banner()}var h={};if(typeof $j!="undefined"&&LateLoader.xarth){h=$j("#"+
a+"_holder").offset();var e=$j(".wrapper").offset();h.left-=e.left;h.top-=e.top}else h=c.positionedOffset();if(a.indexOf("Leaderv")>-1){if(d>0)b.style.top=h.top+(c.getHeight()-d)/2+"px";if(f>0)b.style.left=h.left+(c.getWidth()-f)/2+"px"}else{b.style.top=h.top+"px";b.style.left=h.left+"px";b.style.width=c.offsetWidth+"px";if(b.offsetHeight>0)c.style.height=b.offsetHeight+"px";else Event.observe(window,"load",function(){if($(a).offsetHeight>0)c.style.height=$(a).offsetHeight+"px";LateLoader.leader_ad&&
LateLoader.reposition_all_ads()})}b.show();(b=$(a+"_load_text"))&&b.remove();c.removeClassName("ad_placeholder")}}},reposition_all_ads:function(){LateLoader.ads.each(function(a){LateLoader.reposition_ad(a)})},watch_height_change:function(a){var b=function(){var c=$(a);if(c){max_height=0;c.descendants().each(function(d){if(d.tagName.toUpperCase()=="DIV"){var f=d.getStyle("clip");if(f)try{ss=f.split(",");if(ss.length<2)ss=f.split(" ");parseInt(ss[2])>0?d.setStyle({height:parseInt(ss[2])+"px"}):d.setStyle({height:null})}catch(h){}d=
d.getHeight();if(d>max_height)max_height=d}});$(a+"_holder").setStyle({height:max_height+"px"})}setTimeout(b,75)};b()},watch_ad_changes:function(a){setInterval(function(){LateLoader.reposition_ad(a)},200)}};safe_on_load(LateLoader.init);Event.observe(window,"load",LateLoader.last_init);function pro_hide_ads(){if(PP.is_pro||PP.active_channel_subscriber)$$(".right_col").each(function(a){a.removeClassName("ad")})}toggleManagedAds=function(){$$(".managed_ad").invoke("toggle")};
function load_external_file(a){var b=/src="(.+?)"/;a.match(RegExp(Prototype.ScriptFragment,"img")).map(function(c){return c.match(b)[1]}).map(function(c){$$("body")[0].insert(new Element("script",{src:c}))});$$("body")[0].insert(a)}function setCompanionHTML(a){if(!(!LateLoader.is_prevented("ChanMedRectv2")&&PP.page_type=="channel"))$("adaptvcompanion_wrapper").innerHTML=a}function show_header_banner(){$("iphone_banner").show()}
function close_header_banner(a){$("iphone_banner").hide();createCookie(a,"true",86400)}function close_leaderboard_banner(){["ChanLeaderv2","ChanLeaderv3","ClipsTopLeaderv2","SearchLeaderv2","DirLeaderv2"].each(function(a){LateLoader.prevent_ad(a);LateLoader.prevent_ad("Staging_"+a);try{$(a).hide();$(a).remove()}catch(b){}try{$("Staging_"+a).hide();$("Staging_"+a).remove()}catch(c){}});close_header_banner("leaderboard_banner")}
function showFPopaBanner(){var a=$$(".fp_opa_pushdown").first();$(a).morph("height:66px;");a=get_leaderboard();var b=$("takeover_wrapper");b||(b=$("directory"));if(a){$(a).style.left="121px";b&&b.addClassName("takeover")}b&&b.addClassName("opa_pushdown");setTimeout(FPopaAnimation,3E3)}function FPopaAnimation(){Effect.Fade("FPopaBannerImage");Effect.SlideDown("FPopaBannerFull");var a=$$(".fp_opa_pushdown").first();$(a).morph("height:300px;");move_dir_ads_to(352);setTimeout(hideFPopaBanner,7E3)}
function hideFPopaBanner(){var a=$$(".fp_opa_pushdown").first();$(a).morph("height:66px;");Effect.SlideUp("FPopaBannerFull");Effect.Appear("FPopaBannerImage");move_dir_ads_to(-352)}function move_dir_ads_to(a){var b=LateLoader.xarth?"Twitch_":"";["DirectoryLeaderBottomv2","DirectoryMedRectv2","FPLeaderboard"].each(function(c){var d=$(b+c);if(d)new Effect.Move(d,{x:0,y:a,mode:"relative"});else(d=$("Staging_"+b+c))&&new Effect.Move(d,{x:0,y:a,mode:"relative"})})}
function doubleClickFormat(a){return a.replace(/['"=!+#*~;^()<>\[\],.&]/g,"").slice(0,10)}function setGoogleGameAttr(a){if(a.genres)for(var b=0;b<Math.min(a.genres.length,3);b++)GA_googleAddAttr("genre"+b,doubleClickFormat(a.genres[b]));a.name&&GA_googleAddAttr("gameName",doubleClickFormat(a.name))}
function fallback_ad(a,b,c,d,f,h){c||(c=310);d||(d=320);f||(f="");if(b=="DirectoryMedRectBottomv2"&&document.getElementById("spotlight404"))f=true;if(!b&&LateLoader.companion_slot)b=LateLoader.companion_slot;var e=function(g){g='<iframe src="'+g+'" height="'+d+'" width="'+c+'" id="ad_iframe" scrolling="no"></iframe>';$(a).innerHTML=g;$(a).show();if(h){$(a).setStyle({width:c+"px",height:d+"px"});$(a).ancestors()[0].setStyle({width:c+35+"px",height:d+"px"})}LateLoader.reposition_all_ads()};url="/ad/iframe_ad?";
url+="ad_slot="+b+"&just_ad="+f+"&height="+d+"&width="+c;if(PP.channel_category!=undefined)url+="&category="+encodeURIComponent(PP.channel_category);else if(PP.directory_category!=undefined)url+="&category="+encodeURIComponent(PP.directory_category);if(PP.channel_subcategory!=undefined)url+="&subcategory="+encodeURIComponent(PP.channel_subcategory);else if(PP.directory_subcategory!=undefined)url+="&subcategory="+encodeURIComponent(PP.directory_subcategory);if(PP.channel_is_featured!=undefined)url+=
"&channel_is_featured="+encodeURIComponent(PP.channel_is_featured);if(PP.channel!=undefined)url+="&channel="+encodeURIComponent(PP.channel);if(PP.game_info){b=PP.game_info;if(b.genres)for(f=0;f<Math.min(b.genres.length,3);f++)url+="&genre"+f+"="+encodeURIComponent(b.genres[f]);if(b.name)url+="&game_name="+encodeURIComponent(b.name)}else e(url)}function setExtraGoogleParams(a){PP.game_info&&setGoogleGameAttr(PP.game_info);a()}function fetchGoogleAds(){setExtraGoogleParams(GA_googleFetchAds)}
var Tooltips={load:function(){if(typeof Prototype==="undefined")throw"Prototype.js is required.";Event.observe(window,"load",function(){Event.observe(document.body,"click",this.closeAll.bindAsEventListener(this))}.bind(this))},closeAll:function(a){$A(Tooltips.tips).each(function(b){b._pointer.x=Event.pointerX(a);b._pointer.y=Event.pointerY(a);return b._check_and_hide()})},tips:[]};Tooltips.load();
var Tooltip=Class.create({initialize:function(a,b,c){this.disabled=c.disabled||false;this.options=c;this.activators=[];this.tip_parts=[];this.event_list=[];if(!this.options.show_delay)this.options.show_delay=this.options.delay||500;if(!this.options.hide_delay)this.options.hide_delay=this.options.delay||1500;this._reshow_delay=0;Object.isArray(b)||(b=[b]);for(a=b.length;a--;){if(Object.isString(b[a]))b[a]=this._loadElementFromString(b[a]);b[a]=$(b[a]);this._attachEvents(b[a],c.delay);this.tip_parts.push(b[a])}try{b[0].parentNode.show()}catch(d){}if(!this.options.delay)this.options.delay=
1E3;Tooltips.tips.push(this);this.hide()},hide:function(){$A(this.tip_parts).invoke("hide")},show:function(){this.disabled||$A(this.tip_parts).invoke("show")},appear:function(a){this.disabled||$A(this.tip_parts).invoke("appear",a)},popup:function(){this.show()},attach:function(a){Object.isArray(a)||(a=[a]);for(var b=a.length;b--;){if(Object.isString(a[b]))a[b]=this._loadElementFromString(a[b]);this._attachEvents(a[b],this.options.delay);a[b].observe("click",function(){this.visible()?this.hide():this.show()}.bind(this));
this.activators.push(a[b])}return this},visible:function(){return $A(this.tip_parts).any(function(a){return a.visible()})},moveToPointer:function(a,b){$A(this.tip_parts).each(function(c){c.style.position="absolute";c.style.left=this._pointer.x+a+"px";c.style.top=this._pointer.y+b+"px"}.bind(this))},_loadElementFromString:function(a){if(/[\<\>]/gi.test(a)){var b=(new Element("div")).insert(a).hide();$(document.body).insert(a);return b}else return $(a)},_set_hide_timeout:function(){this.timeout&&clearTimeout(this.timeout);
this.timeout=setTimeout(this._check_and_hide.bind(this),this.options.hide_delay)},_within:function(){var a=this._pointer.x,b=this._pointer.y;return $A([this.tip_parts,this.activators]).flatten().any(function(c){return Position.within(c,a,b)})&&b>0&&a>0},_check_and_hide:function(){this._within()?this._set_hide_timeout():this._run_hide()},_run_show:function(){this.options.showEffect?this.options.showEffect(this):this.show();this.options.onShow&&this.options.onShow(this);this.event_list=[];this._set_hide_timeout()},
_run_hide:function(){this.options.hideEffect?this.options.hideEffect(this):this.hide();this.options.onHide&&this.options.onHide(this);this.event_list=[];this._untrack_position()},_track_position:function(){if(!this.observing_position){this.observing_position=function(a){this._pointer=Event.pointer(a)}.bindAsEventListener(this);Event.observe(document,"mousemove",this.observing_position)}},_untrack_position:function(){if(this.observing_position){Event.stopObserving(document,"mousemove",this.observing_position);
this.observing_position=null}},_pointer:{x:0,y:0},_control:function(){this._track_position();var a=-1;if(this.event_list.length>0){if(!this._within())return;a=(new Date).valueOf()-this.event_list.last().timestamp-(this.options.show_delay+this._reshow_delay);if(a>=0&&!this.visible()){this._reshow_delay=0;this._run_show()}}if(a<0){this._control_timeout&&clearTimeout(this.control_timeout);this._control_timeout=setTimeout(this._control.bind(this),-a+5)}},_logEvent:function(a){a={pointerX:Event.pointerX(a),
pointerY:Event.pointerY(a),timestamp:a.timestamp||(new Date).valueOf()};this._pointer.x=a.pointerX;this._pointer.y=a.pointerY;this.event_list.push(a)},_attachEvents:function(a){var b=function(c){Event.pointer(c);this._logEvent(c);this._control()}.bindAsEventListener(this);a.observe("mouseover",b);b=a.select(".close");a.hasClassName("close")&&b.push(a);b.each(function(c){c.observe("click",function(){this.hide();this._reshow_delay=2E3}.bind(this))}.bind(this))}});
Tooltip.Fixed=Class.create(Tooltip,{initialize:function($super){$super.apply(this,arguments)}});var dropmenus=[];function hide_other_dropmenus(a){$A(dropmenus).invoke("hide");a.show()}function check_overlap(a,b){var c=get_coordinates(a),d=get_coordinates(b);c={top:Math.max(c.top,d.top),left:Math.max(c.left,d.left),right:Math.min(c.right,d.right),bottom:Math.min(c.bottom,d.bottom)};return c.right>c.left&&c.bottom>c.top}
function get_coordinates(a){var b=$(a).cumulativeOffset();a=$(a).getDimensions();return{top:b[1],left:b[0],bottom:b[1]+a.height,right:b[0]+a.width}}
var default_dropmenu_options={hide_delay:500,show_delay:150,showEffect:hide_other_dropmenus,onShow:function(a){window.isIE6?$$(".managed_ad").invoke("hide"):$$(".managed_ad").findAll(function(b){if(!$A(["embed","object","iframe"]).any(function(c){return b.getElementsByTagName(c).length>0}))return false;return $A(a.tip_parts).any(function(c){return check_overlap(b,c)})}).invoke("hide")},onHide:function(){$$(".managed_ad").invoke("show")}};
function ajaxMenu(a,b,c,d,f){c=$(c);var h={pageX:0,pageY:0,timestamp:0},e=function(i){h.pageX=Event.pointerX(i);h.pageY=Event.pointerY(i)},g=function(i){if(!c.loading){c.loading=true;h.timestamp=(new Date).valueOf();e(i);Event.observe(document.body,"mousemove",e);new Ajax.Request(a,{method:"get",onSuccess:function(l){Event.stopObserving(c,"mouseover",g);Event.stopObserving(document.body,"mousemove",e);$(d).insert(l.responseText);l.responseText.evalScripts();l=dropmenus.push((new Tooltip.Fixed(b,f)).attach(c))-
1;f.on_load&&f.on_load(c,dropmenus[l]);dropmenus[l]._logEvent(h);dropmenus[l]._control()},onComplete:function(){if($(c).identify()=="usermgmt_dropmenu_toggle"||$(c).identify()=="header_language_dropmenu_toggle")position_to_container(b,c,"right");else if($(c).identify()=="category_dropmenu_toggle"||$(c).identify()=="subcategory_dropmenu_toggle"||$(c).identify()=="language_filter_dropmenu_toggle"){var l=1,o=$("DiropaBanner_holder");o||(o=$("Staging_DiropaBanner_holder"));if(o)l+=o.offsetHeight+13;l>
0&&b[0].setStyle({marginTop:l+"px"});b[1].setStyle({marginTop:l+"px"})}$("header_dropmenus")&&$("header_dropmenus").show()}})}};Event.observe(c,"mouseover",g.bindAsEventListener(window))}function position_to_container(a,b,c){var d=a[0];a=a[1];b=$(b).positionedOffset();var f=$(a).getStyle("padding-left");b=b[0]-parseFloat(f)-1;$(a).setStyle({left:b+"px"});c=c=="right"?b-$(d).getWidth()+$(a).getWidth():b;$(d).setStyle({left:c+"px"})}
load_dropmenus=function(){var a=default_dropmenu_options;$("header_channels_dropmenu_toggle")&&ajaxMenu("/dropmenu/channels",["header_channels_dropmenu","channels_stem"],"header_channels_dropmenu_toggle","header_dropmenus",a);$("usermgmt_dropmenu_toggle")&&ajaxMenu("/dropmenu/usermgmt",["usermgmt_dropmenu","usermgmt_stem"],"usermgmt_dropmenu_toggle","header_dropmenus",a);$("header_language_dropmenu_toggle")&&ajaxMenu("/dropmenu/languages",["header_language_dropmenu","languages_stem"],"header_language_dropmenu_toggle",
"header_dropmenus",a)};

