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 e=arguments[b];try{a=e();break}catch(g){}}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 e=null,g=$A(arguments);if(Object.isFunction(g[0]))e=g.shift();Object.extend(c,Class.Methods);c.superclass=e;c.subclasses=[];if(e){a.prototype=e.prototype;c.prototype=
new a;e.subclasses.push(c)}e=0;for(var i=g.length;e<i;e++)c.addMethods(g[e]);if(!c.prototype.initialize)c.prototype.initialize=Prototype.emptyFunction;return c.prototype.constructor=c},Methods:{addMethods:function(c){var e=this.superclass&&this.superclass.prototype,g=Object.keys(c);if(b){c.toString!=Object.prototype.toString&&g.push("toString");c.valueOf!=Object.prototype.valueOf&&g.push("valueOf")}for(var i=0,d=g.length;i<d;i++){var f=g[i],h=c[f];if(e&&Object.isFunction(h)&&h.argumentNames()[0]==
"$super"){var l=h;h=function(o){return function(){return e[o].apply(this,arguments)}}(f).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[f]=h}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 e("",{"":n},[])}function e(n,s,r){s=s[n];var k=typeof s;if(a(s)===O&&typeof s.toJSON==="function")s=s.toJSON(n);n=h.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=e(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=e(n,s,r);typeof C!=="undefined"&&t.push(n.inspect(true)+":"+C)}t="{"+t.join(",")+"}"}r.pop();return t}}function g(n){return JSON.stringify(n)}
function i(n){if(a(n)!==O)throw new TypeError;var s=[],r;for(r in n)n.hasOwnProperty(r)&&s.push(r);return s}function d(n){return h.call(n)===m}function f(n){return typeof n==="undefined"}var h=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({}))d=Array.isArray;b(Object,{extend:b,inspect:function(n){try{if(f(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?g:c,toQueryString:function(n){return $H(n).toQueryString()},toHTML:function(n){return n&&n.toHTML?n.toHTML():String.interpret(n)},keys:Object.keys||i,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:d,isHash:function(n){return n instanceof Hash},isFunction:function(n){return h.call(n)==="[object Function]"},isString:function(n){return h.call(n)===j},isNumber:function(n){return h.call(n)===N},isDate:function(n){return h.call(n)==="[object Date]"},isUndefined:f})})();
Object.extend(Function.prototype,function(){function a(e,g){for(var i=e.length,d=g.length;d--;)e[i+d]=g[d];return e}function b(e,g){e=c.call(e,0);return a(e,g)}var c=Array.prototype.slice;return{argumentNames:function(){var e=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return e.length==1&&!e[0]?[]:e},bind:function(e){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var g=this,i=c.call(arguments,
1);return function(){var d=b(i,arguments);return g.apply(e,d)}},bindAsEventListener:function(e){var g=this,i=c.call(arguments,1);return function(d){d=a([d||window.event],i);return g.apply(e,d)}},curry:function(){if(!arguments.length)return this;var e=this,g=c.call(arguments,0);return function(){var i=b(g,arguments);return e.apply(this,i)}},delay:function(e){var g=this,i=c.call(arguments,1);e*=1E3;return window.setTimeout(function(){return g.apply(g,i)},e)},defer:function(){return this.delay.apply(this,
a([0.01],arguments))},wrap:function(e){var g=this;return function(){var i=a([g.bind(this)],arguments);return e.apply(this,i)}},methodize:function(){if(this._methodized)return this._methodized;var e=this;return this._methodized=function(){var g=a([this],arguments);return e.apply(null,g)}}}}());
(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(d){if(Object.isFunction(d))return d;var f=new Template(d);return function(h){return f.evaluate(h)}}function b(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function c(d){var f=this.strip().match(/([^?#]*)(#.*)?$/);if(!f)return{};return f[1].split(d||"&").inject({},function(h,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 h){Object.isArray(h[o])||
(h[o]=[h[o]]);h[o].push(w)}else h[o]=w}return h})}function e(d){var f=this.unfilterJSON(),h=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(h.test(f))f=f.replace(h,function(o){return"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)});try{if(!d||f.isJSON())return eval("("+f+")")}catch(l){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());}function g(){var d=this.unfilterJSON();return JSON.parse(d)}var i=window.JSON&&
typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;return{gsub:function(d,f){var h="",l=this,o;f=a(f);if(Object.isString(d))d=RegExp.escape(d);if(!(d.length||d.source)){f=f("");return f+l.split("").join(f)+f}for(;l.length>0;)if(o=l.match(d)){h+=l.slice(0,o.index);h+=String.interpret(f(o));l=l.slice(o.index+o[0].length)}else{h+=l;l=""}return h},sub:function(d,f,h){f=a(f);h=Object.isUndefined(h)?1:h;return this.gsub(d,function(l){if(--h<0)return l[0];return f(l)})},scan:function(d,f){this.gsub(d,
f);return String(this)},truncate:function(d,f){d=d||30;f=Object.isUndefined(f)?"...":f;return this.length>d?this.slice(0,d-f.length)+f: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 d=RegExp(Prototype.ScriptFragment,"im");return(this.match(RegExp(Prototype.ScriptFragment,"img"))||[]).map(function(f){return(f.match(d)||
["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(d){return eval(d)})},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(d){return d<
1?"":Array(d+1).join(this)},camelize:function(){return this.replace(/-+(.)?/g,function(d,f){return f?f.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(d){var f=this.replace(/[\x00-\x1f\\]/g,function(h){if(h in
String.specialChar)return String.specialChar[h];return"\\u00"+h.charCodeAt().toPaddedString(2,16)});if(d)return'"'+f.replace(/"/g,'\\"')+'"';return"'"+f.replace(/'/g,"\\'")+"'"},unfilterJSON:function(d){return this.replace(d||Prototype.JSONFilter,"$1")},isJSON:function(){var d=this;if(d.blank())return false;d=d.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");d=d.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");d=d.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(d)},
evalJSON:i?g:e,include:function(d){return this.indexOf(d)>-1},startsWith:function(d){return this.lastIndexOf(d,0)===0},endsWith:function(d){var f=this.length-d.length;return f>=0&&this.indexOf(d,f)===f},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(d,f){return(new Template(this,f)).evaluate(d)}}}());
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 e=a,g=b[3],i=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;b=i.exec(g);if(b==null)return c;for(;b!=null;){var d=b[1].startsWith("[")?b[2].replace(/\\\\]/g,"]"):b[1];e=e[d];if(null==
e||""==b[3])break;g=g.substring("["==b[3]?b[1].length:b[0].length);b=i.exec(g)}return c+String.interpret(e)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={},Enumerable=function(){function a(f,h){f=f||Prototype.K;var l=true;this.each(function(o,w){l=l&&!!f.call(h,o,w);if(!l)throw $break;});return l}function b(f,h){f=f||Prototype.K;var l=false;this.each(function(o,w){if(l=!!f.call(h,o,w))throw $break;});return l}function c(f,h){f=f||Prototype.K;var l=[];this.each(function(o,w){l.push(f.call(h,o,w))});return l}function e(f,h){var l;this.each(function(o,w){if(f.call(h,o,w)){l=o;throw $break;}});return l}function g(f,h){var l=[];this.each(function(o,
w){f.call(h,o,w)&&l.push(o)});return l}function i(f){if(Object.isFunction(this.indexOf))if(this.indexOf(f)!=-1)return true;var h=false;this.each(function(l){if(l==f){h=true;throw $break;}});return h}function d(){return this.map()}return{each:function(f,h){var l=0;try{this._each(function(w){f.call(h,w,l++)})}catch(o){if(o!=$break)throw o;}return this},eachSlice:function(f,h,l){var o=-f,w=[],F=this.toArray();if(f<1)return F;for(;(o+=f)<F.length;)w.push(F.slice(o,o+f));return w.collect(h,l)},all:a,every:a,
any:b,some:b,collect:c,map:c,detect:e,findAll:g,select:g,filter:g,grep:function(f,h,l){h=h||Prototype.K;var o=[];if(Object.isString(f))f=RegExp(RegExp.escape(f));this.each(function(w,F){f.match(w)&&o.push(h.call(l,w,F))});return o},include:i,member:i,inGroupsOf:function(f,h){h=Object.isUndefined(h)?null:h;return this.eachSlice(f,function(l){for(;l.length<f;)l.push(h);return l})},inject:function(f,h,l){this.each(function(o,w){f=h.call(l,f,o,w)});return f},invoke:function(f){var h=$A(arguments).slice(1);
return this.map(function(l){return l[f].apply(l,h)})},max:function(f,h){f=f||Prototype.K;var l;this.each(function(o,w){o=f.call(h,o,w);if(l==null||o>=l)l=o});return l},min:function(f,h){f=f||Prototype.K;var l;this.each(function(o,w){o=f.call(h,o,w);if(l==null||o<l)l=o});return l},partition:function(f,h){f=f||Prototype.K;var l=[],o=[];this.each(function(w,F){(f.call(h,w,F)?l:o).push(w)});return[l,o]},pluck:function(f){var h=[];this.each(function(l){h.push(l[f])});return h},reject:function(f,h){var l=
[];this.each(function(o,w){f.call(h,o,w)||l.push(o)});return l},sortBy:function(f,h){return this.map(function(l,o){return{value:l,criteria:f.call(h,l,o)}}).sort(function(l,o){var w=l.criteria,F=o.criteria;return w<F?-1:w>F?1:0}).pluck("value")},toArray:d,entries:d,zip:function(){var f=Prototype.K,h=$A(arguments);if(Object.isFunction(h.last()))f=h.pop();var l=[this].concat(h).map($A);return this.map(function(o,w){return f(l.pluck(w))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+
this.toArray().inspect()+">"},find:e}}();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(h,l){for(var o=0,w=this.length>>>0;o<w;o++)o in this&&h.call(l,this[o],o,this)}function b(){return d.call(this,0)}function c(h,l){l||(l=0);var o=this.length;if(l<0)l=o+l;for(;l<o;l++)if(this[l]===h)return l;return-1}function e(h,l){l=isNaN(l)?this.length:(l<0?this.length+l:l)+1;var o=this.slice(0,l).reverse().indexOf(h);return o<0?o:l-o-1}function g(){for(var h=d.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++)h.push(l[F]);else h.push(l)}return h}var i=Array.prototype,d=i.slice,f=i.forEach;f||(f=a);Object.extend(i,Enumerable);if(!i._reverse)i._reverse=i.reverse;Object.extend(i,{_each:f,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(h){return h!=null})},flatten:function(){return this.inject([],function(h,l){if(Object.isArray(l))return h.concat(l.flatten());h.push(l);
return h})},without:function(){var h=d.call(arguments,0);return this.select(function(l){return!h.include(l)})},reverse:function(h){return(h===false?this.toArray():this)._reverse()},uniq:function(h){return this.inject([],function(l,o,w){if(0==w||(h?l.last()!=o:!l.include(o)))l.push(o);return l})},intersect:function(h){return this.uniq().findAll(function(l){return h.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))i.concat=g;if(!i.indexOf)i.indexOf=c;if(!i.lastIndexOf)i.lastIndexOf=e})();function $H(a){return new Hash(a)}
var Hash=Class.create(Enumerable,function(){function a(){return Object.clone(this._object)}function b(c,e){if(Object.isUndefined(e))return c;return c+"="+encodeURIComponent(String.interpret(e))}return{initialize:function(c){this._object=Object.isHash(c)?c.toObject():Object.clone(c)},_each:function(c){for(var e in this._object){var g=this._object[e],i=[e,g];i.key=e;i.value=g;c(i)}},set:function(c,e){return this._object[c]=e},get:function(c){if(this._object[c]!==Object.prototype[c])return this._object[c]},
unset:function(c){var e=this._object[c];delete this._object[c];return e},toObject:a,toTemplateReplacements:a,keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var e=this.detect(function(g){return g.value===c});return e&&e.key},merge:function(c){return this.clone().update(c)},update:function(c){return(new Hash(c)).inject(this,function(e,g){e.set(g.key,g.value);return e})},toQueryString:function(){return this.inject([],function(c,e){var g=encodeURIComponent(e.key),
i=e.value;if(i&&typeof i=="object"){if(Object.isArray(i)){for(var d=[],f=0,h=i.length,l;f<h;f++){l=i[f];d.push(b(g,l))}return c.concat(d)}}else c.push(b(g,i));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,e){this.each(function(g){if(Object.isFunction(g[a]))try{g[a].apply(g,[b,c,e])}catch(i){}})}};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,e=b.length;c<e;c+=2)a[b[c]]=b[c+1];else $H(b).each(function(i){a[i.key]=i.value})}for(var g in a)this.transport.setRequestHeader(g,a[g])},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 e=b.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&e&&e.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))this.evalResponse()}try{(this.options["on"+
a]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+a,this,b,b.headerJSON)}catch(g){this.dispatchException(g)}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,e){this.container={success:b.success||b,failure:b.failure||(b.success?null:b)};e=Object.clone(e);var g=e.onComplete;e.onComplete=function(i,d){this.updateContent(i.responseText);Object.isFunction(g)&&g(i,d)}.bind(this);$super(c,e)},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 e=
{};e[c.insertion]=a;b.insert(e)}else c.insertion(b,a);else b.update(a)}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,e){$super(e);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=[],e=arguments.length;b<e;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=[],e=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),g=0,i=e.snapshotLength;g<i;g++)c.push(Element.extend(e.snapshotItem(g)));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 e=document.createElement('<input name="x">');return e.tagName.toLowerCase()==="input"&&e.name==="x"}catch(g){return false}}(),c=a.Element;a.Element=function(e,g){g=g||{};e=e.toLowerCase();var i=Element.cache;if(b&&g.name){e="<"+e+' name="'+g.name+'">';delete g.name;return Element.writeAttribute(document.createElement(e),g)}i[e]||(i[e]=Element.extend(document.createElement(e)));i=(e==="select"?false:"type"in g?false:true)?i[e].cloneNode(false):document.createElement(e);
return Element.writeAttribute(i,g)};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 i=document.createElement("select"),d=true;i.innerHTML='<option value="test">test</option>';if(i.options&&i.options[0])d=i.options[0].nodeName.toUpperCase()!==
"OPTION";return d}(),b=function(){try{var i=document.createElement("table");if(i&&i.tBodies){i.innerHTML="<tbody><tr><td>test</td></tr></tbody>";return typeof i.tBodies[0]=="undefined"}}catch(d){return true}}(),c=function(){try{var i=document.createElement("div");i.innerHTML="<link>";return i.childNodes.length===0}catch(d){return true}}(),e=a||b||c,g=function(){var i=document.createElement("script"),d=false;try{i.appendChild(document.createTextNode(""));d=!i.firstChild||i.firstChild&&i.firstChild.nodeType!==
3}catch(f){d=true}return d}();return function(i,d){i=$(i);for(var f=Element._purgeElement,h=i.getElementsByTagName("*"),l=h.length;l--;)f(h[l]);if(d&&d.toElement)d=d.toElement();if(Object.isElement(d))return i.update().insert(d);d=Object.toHTML(d);f=i.tagName.toUpperCase();if(f==="SCRIPT"&&g){i.text=d;return i}if(e)if(f in Element._insertionTranslations.tags){for(;i.firstChild;)i.removeChild(i.firstChild);Element._getContentFromAnonymousElement(f,d.stripScripts()).each(function(o){i.appendChild(o)})}else if(c&&
Object.isString(d)&&d.indexOf("<link")>-1){for(;i.firstChild;)i.removeChild(i.firstChild);Element._getContentFromAnonymousElement(f,d.stripScripts(),true).each(function(o){i.appendChild(o)})}else i.innerHTML=d.stripScripts();else i.innerHTML=d.stripScripts();d.evalScripts.bind(d).defer();return i}}(),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,e,g,i;for(i in b){c=b[i];i=i.toLowerCase();e=Element._insertionTranslations[i];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c))e(a,c);else{c=Object.toHTML(c);g=(i=="before"||i=="after"?a.parentNode:a).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(g,c.stripScripts());if(i=="top"||i=="after")g.reverse();g.each(e.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 e=c.first();c=c.last();if(e=(a[e]||"").toString())b+=" "+c+"="+e.inspect(true)});return b+">"},recursivelyCollect:function(a,b,c){a=$(a);c=c||-1;for(var e=[];a=a[b];){a.nodeType==
1&&e.push(Element.extend(a));if(e.length==c)break}return e},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 e=Element.ancestors(a);return Object.isNumber(b)?e[b]:Prototype.Selector.find(e,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 e={},g=Element._attributeTranslations.write;if(typeof b=="object")e=b;else e[b]=Object.isUndefined(c)?true:c;for(var i in e){b=g.names[i]||i;c=e[i];if(g.values[i])b=g.values[i](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 e in b)if(e=="opacity")a.setOpacity(b[e]);else c[e=="float"||e=="cssFloat"?Object.isUndefined(c.styleFloat)?"cssFloat":"styleFloat":e]=b[e];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 e=Element.viewportOffset(b),g=[0,0],i=null;a=$(a);if(Element.getStyle(a,"position")=="absolute"){i=Element.getOffsetParent(a);g=Element.viewportOffset(i)}if(i==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=e[0]-g[0]+c.offsetLeft+"px";if(c.setTop)a.style.top=
e[1]-g[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 e=parseInt(a(b,c),10);if(e!==b["offset"+c.capitalize()])return e+"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(e,function(g,i){var d=a(b,i);return d===null?g:g-parseInt(d,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 e=a.style;if(b==1||b===""){(c=c.replace(/alpha\([^\)]*\)/gi,""))?e.filter=c:e.removeAttribute("filter");return a}else if(b<1.0E-5)b=0;e.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(e,g){return e.getAttribute(g)},_getAttr2:function(e,g){return e.getAttribute(g,2)},_getAttrNode:function(e,g){var i=e.getAttributeNode(g);
return i?i.value:""},_getEv:function(){var e=document.createElement("div"),g;e.onclick=Prototype.emptyFunction;e=e.getAttribute("onclick");if(String(e).indexOf("{")>-1)g=function(i,d){d=i.getAttribute(d);if(!d)return null;d=d.toString();d=d.split("{")[1];d=d.split("}")[0];return d.strip()};else if(e==="")g=function(i,d){d=i.getAttribute(d);if(!d)return null;return d.strip()};e=null;return g}(),_flag:function(e,g){return $(e).hasAttribute(g)?g:null},style:function(e){return e.style.cssText.toLowerCase()},
title:function(e){return e.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 e;if(Object.isNumber(b)){e=a.getElementsByTagName("*");for(var g=[],i=0,d;d=e[i];i++)d.tagName!=="!"&&g.push(d);e=g[b]}else e=Element.select(a,b)[c||0];return e}}()}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(e){}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,e=c.tagName.toUpperCase();if(Element._insertionTranslations.tags[e]){var g=a.next();e=Element._getContentFromAnonymousElement(e,b.stripScripts());c.removeChild(a);g?e.each(function(i){c.insertBefore(i,g)}):e.each(function(i){c.appendChild(i)})}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 e=new Element("div");a=Element._insertionTranslations.tags[a];var g=false;if(a)g=true;else if(c){g=true;a=["","",0]}if(g){e.innerHTML="&nbsp;"+a[0]+b+a[1];e.removeChild(e.firstChild);for(b=a[2];b--;)e=e.firstChild}else e.innerHTML=b;return $A(e.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(g,i){for(var d in i){var f=i[d];if(Object.isFunction(f)&&!(d in g))g[d]=f.methodize()}}var b=function(g){if(typeof window.Element!="undefined"){var i=window.Element.prototype;if(i){var d="_"+(Math.random()+"").slice(2);g=document.createElement(g);i[d]="x";g=g[d]!=="x";delete i[d];return g}}return false}("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(b)return function(g){if(g&&typeof g._extendedByPrototype=="undefined"){var i=g.tagName;if(i&&
/^(?:object|applet|embed)$/i.test(i)){a(g,Element.Methods);a(g,Element.Methods.Simulated);a(g,Element.Methods.ByTag[i.toUpperCase()])}}return g};return Prototype.K}var c={},e=Element.Methods.ByTag;b=Object.extend(function(g){if(!g||typeof g._extendedByPrototype!="undefined"||g.nodeType!=1||g==window)return g;var i=Object.clone(c),d=g.tagName.toUpperCase();e[d]&&Object.extend(i,e[d]);a(g,i);g._extendedByPrototype=Prototype.emptyFunction;return g},{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(h){h=h.toUpperCase();Element.Methods.ByTag[h]||(Element.Methods.ByTag[h]={});Object.extend(Element.Methods.ByTag[h],a)}function c(h,l,o){o=o||false;for(var w in h){var F=h[w];if(Object.isFunction(F))if(!o||!(w in l))l[w]=F.methodize()}}function e(h){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[h])l="HTML"+o[h]+"Element";if(window[l])return window[l];l="HTML"+h+"Element";if(window[l])return window[l];l="HTML"+h.capitalize()+"Element";if(window[l])return window[l];h=document.createElement(h);return h.__proto__||h.constructor.prototype}
var g=Prototype.BrowserFeatures,i=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 d=a;a=arguments[1]}if(d)Object.isArray(d)?d.each(b):b(d);else Object.extend(Element.Methods,
a||{});d=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(g.ElementExtensions){c(Element.Methods,d);c(Element.Methods.Simulated,d,true)}if(g.SpecificElementExtensions)for(var f in Element.Methods.ByTag){g=e(f);Object.isUndefined(g)||c(i[f],g.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(e.WebKit&&!g.evaluate)return document;if(e.Opera&&window.parseFloat(window.opera.version())<9.5)return document.body;return document.documentElement}function c(f){i||(i=b());d[f]="client"+f;a["get"+f]=function(){return i[d[f]]};return a["get"+f]()}var e=Prototype.Browser,g=document,i,d={};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 e=a.get(b);if(Object.isUndefined(e)){a.set(b,c);e=c}return e}},
clone:function(a,b){if(a=$(a)){var c=a.cloneNode(b);c._prototypeUID=void 0;if(b)for(var e=Element.select(c,"*"),g=e.length;g--;)e[g]._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(d,f,h){var l=null;if(Object.isElement(d)){l=d;d=l.getStyle(f)}if(d===null)return null;if(/^(?:-)?\d+(\.\d+)?(px)?$/i.test(d))return window.parseFloat(d);var o=d.include("%"),w=h===document.viewport;if(/\d/.test(d)&&l&&l.runtimeStyle&&!(o&&w)){h=l.style.left;f=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=d||0;d=l.style.pixelLeft;l.style.left=h;l.runtimeStyle.left=f;return d}if(l&&o){h=h||l.parentNode;d=(d=d.match(/^(\d+)%?$/i))?Number(d[1])/100:null;
o=null;l.getStyle("position");l=f.include("left")||f.include("right")||f.include("width");f=f.include("top")||f.include("bottom")||f.include("height");if(h===document.viewport)if(l)o=document.viewport.getWidth();else{if(f)o=document.viewport.getHeight()}else if(l)o=$(h).measure("width");else if(f)o=$(h).measure("height");return o===null?0:o*d}return 0}function b(d){d=$(d);if(d.nodeType===Node.DOCUMENT_NODE||g(d)||d.nodeName.toUpperCase()==="BODY"||d.nodeName.toUpperCase()==="HTML")return $(document.body);
if(Element.getStyle(d,"display")!=="inline"&&d.offsetParent)return $(d.offsetParent);for(;(d=d.parentNode)&&d!==document.body;)if(Element.getStyle(d,"position")!=="static")return d.nodeName.toUpperCase()==="HTML"?$(document.body):$(d);return $(document.body)}function c(d){d=$(d);var f=0,h=0;if(d.parentNode){do{f+=d.offsetTop||0;h+=d.offsetLeft||0;d=d.offsetParent}while(d)}return new Element.Offset(h,f)}function e(d){d=$(d);var f=d.getLayout(),h=0,l=0;do{h+=d.offsetTop||0;l+=d.offsetLeft||0;if(d=d.offsetParent){if(d.nodeName.toUpperCase()===
"BODY")break;if(Element.getStyle(d,"position")!=="static")break}}while(d);l-=f.get("margin-top");h-=f.get("margin-left");return new Element.Offset(l,h)}function g(d){return d!==document.body&&!Element.descendantOf(d,document.body)}var i=Prototype.K;if("currentStyle"in document.documentElement)i=function(d){if(!d.currentStyle.hasLayout)d.style.zoom=1;return d};Element.Layout=Class.create(Hash,{initialize:function($super,f,h){$super();this.element=$(f);Element.Layout.PROPERTIES.each(function(l){this._set(l,
null)},this);if(h){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(d,f){return Hash.prototype.set.call(this,d,f)},set:function(){throw"Properties of Element.Layout are read-only.";},get:function($super,f){var h=$super(f);return h===null?this._compute(f):h},_begin:function(){if(!this._prepared){var d=this.element,f;a:{for(f=d;f&&f.parentNode;){if(f.getStyle("display")==="none"){f=false;break a}f=$(f.parentNode)}f=
true}if(!f){d.store("prototype_original_styles",{position:d.style.position||"",width:d.style.width||"",visibility:d.style.visibility||"",display:d.style.display||""});f=d.getStyle("position");var h=d.getStyle("width");if(h==="0px"||h===null){d.style.display="block";h=d.getStyle("width")}var l=f==="fixed"?document.viewport:d.parentNode;d.setStyle({position:"absolute",visibility:"hidden",display:"block"});var o=d.getStyle("width");f=h&&o===h?a(d,"width",l):f==="absolute"||f==="fixed"?a(d,"width",l):
$(d.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");d.setStyle({width:f+"px"})}this._prepared=true}},_end:function(){var d=this.element,f=d.retrieve("prototype_original_styles");d.store("prototype_original_styles",null);d.setStyle(f);this._prepared=false},_compute:function(d){var f=Element.Layout.COMPUTATIONS;if(!(d in f))throw"Property not found.";return this._set(d,
f[d].call(this,this.element))},toObject:function(){var d=$A(arguments),f={};(d.length===0?Element.Layout.PROPERTIES:d.join(" ").split(" ")).each(function(h){if(Element.Layout.PROPERTIES.include(h)){var l=this.get(h);if(l!=null)f[h]=l}},this);return f},toHash:function(){var d=this.toObject.apply(this,arguments);return new Hash(d)},toCSS:function(){var d=$A(arguments),f={};(d.length===0?Element.Layout.PROPERTIES:d.join(" ").split(" ")).each(function(h){if(Element.Layout.PROPERTIES.include(h))if(!Element.Layout.COMPOSITE_PROPERTIES.include(h)){var l=
this.get(h);if(l!=null){if(h.include("border"))h+="-width";h=h.camelize();f[h]=l+"px"}}},this);return f},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 d=this.get("border-box-height");if(d<=0){this._preComputing||this._end();return 0}var f=this.get("border-top"),h=this.get("border-bottom"),l=this.get("padding-top"),o=this.get("padding-bottom");this._preComputing||this._end();return d-f-h-l-o},width:function(){this._preComputing||this._begin();var d=this.get("border-box-width");if(d<=0){this._preComputing||this._end();return 0}var f=this.get("border-left"),h=this.get("border-right"),
l=this.get("padding-left"),o=this.get("padding-right");this._preComputing||this._end();return d-f-h-l-o},"padding-box-height":function(){var d=this.get("height"),f=this.get("padding-top"),h=this.get("padding-bottom");return d+f+h},"padding-box-width":function(){var d=this.get("width"),f=this.get("padding-left"),h=this.get("padding-right");return d+f+h},"border-box-height":function(d){this._preComputing||this._begin();d=d.offsetHeight;this._preComputing||this._end();return d},"border-box-width":function(d){this._preComputing||
this._begin();d=d.offsetWidth;this._preComputing||this._end();return d},"margin-box-height":function(){var d=this.get("border-box-height"),f=this.get("margin-top"),h=this.get("margin-bottom");if(d<=0)return 0;return d+f+h},"margin-box-width":function(){var d=this.get("border-box-width"),f=this.get("margin-left"),h=this.get("margin-right");if(d<=0)return 0;return d+f+h},top:function(d){return d.positionedOffset().top},bottom:function(d){var f=d.positionedOffset();d=d.getOffsetParent().measure("height");
var h=this.get("border-box-height");return d-h-f.top},left:function(d){return d.positionedOffset().left},right:function(d){var f=d.positionedOffset();d=d.getOffsetParent().measure("width");var h=this.get("border-box-width");return d-h-f.left},"padding-top":function(d){return a(d,"paddingTop")},"padding-bottom":function(d){return a(d,"paddingBottom")},"padding-left":function(d){return a(d,"paddingLeft")},"padding-right":function(d){return a(d,"paddingRight")},"border-top":function(d){return a(d,"borderTopWidth")},
"border-bottom":function(d){return a(d,"borderBottomWidth")},"border-left":function(d){return a(d,"borderLeftWidth")},"border-right":function(d){return a(d,"borderRightWidth")},"margin-top":function(d){return a(d,"marginTop")},"margin-bottom":function(d){return a(d,"marginBottom")},"margin-left":function(d){return a(d,"marginLeft")},"margin-right":function(d){return a(d,"marginRight")}}});"getBoundingClientRect"in document.documentElement&&Object.extend(Element.Layout.COMPUTATIONS,{right:function(d){var f=
i(d.getOffsetParent());d=d.getBoundingClientRect();return(f.getBoundingClientRect().right-d.right).round()},bottom:function(d){var f=i(d.getOffsetParent());d=d.getBoundingClientRect();return(f.getBoundingClientRect().bottom-d.bottom).round()}});Element.Offset=Class.create({initialize:function(d,f){this.left=d.round();this.top=f.round();this[0]=this.left;this[1]=this.top},relativeTo:function(d){return new Element.Offset(this.left-d.left,this.top-d.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(d,f){f=$(f);if(f.nodeType===Node.DOCUMENT_NODE||g(f)||f.nodeName.toUpperCase()==="BODY"||f.nodeName.toUpperCase()==="HTML")return $(document.body);var h=f.getStyle("position");if(h!=="static")return d(f);f.setStyle({position:"relative"});var l=d(f);f.setStyle({position:h});return l});e=e.wrap(function(d,f){f=$(f);if(!f.parentNode)return new Element.Offset(0,
0);var h=f.getStyle("position");if(h!=="static")return d(f);var l=f.getOffsetParent();l&&l.getStyle("position")==="fixed"&&i(l);f.setStyle({position:"relative"});l=d(f);f.setStyle({position:h});return l})}else if(Prototype.Browser.Webkit)c=function(d){d=$(d);var f=0,h=0;do{f+=d.offsetTop||0;h+=d.offsetLeft||0;if(d.offsetParent==document.body)if(Element.getStyle(d,"position")=="absolute")break;d=d.offsetParent}while(d);return new Element.Offset(h,f)};Element.addMethods({getLayout:function(d,f){return new Element.Layout(d,
f)},measure:function(d,f){return $(d).getLayout().get(f)},getDimensions:function(d){d=$(d);var f=Element.getStyle(d,"display");if(f&&f!=="none")return{width:d.offsetWidth,height:d.offsetHeight};f=d.style;f={visibility:f.visibility,position:f.position,display:f.display};var h={visibility:"hidden",display:"block"};if(f.position!=="fixed")h.position="absolute";Element.setStyle(d,h);h={width:d.offsetWidth,height:d.offsetHeight};Element.setStyle(d,f);return h},getOffsetParent:b,cumulativeOffset:c,positionedOffset:e,
cumulativeScrollOffset:function(d){var f=0,h=0;do{f+=d.scrollTop||0;h+=d.scrollLeft||0;d=d.parentNode}while(d);return new Element.Offset(h,f)},viewportOffset:function(d){$(o);var f=0,h=0,l=document.body,o=d;do{f+=o.offsetTop||0;h+=o.offsetLeft||0;if(o.offsetParent==l&&Element.getStyle(o,"position")=="absolute")break}while(o=o.offsetParent);o=d;do if(o!=l){f-=o.scrollTop||0;h-=o.scrollLeft||0}while(o=o.parentNode);return new Element.Offset(h,f)},absolutize:function(d){d=$(d);if(Element.getStyle(d,
"position")==="absolute")return d;var f=b(d),h=d.viewportOffset();f=f.viewportOffset();h=h.relativeTo(f);f=d.getLayout();d.store("prototype_absolutize_original_styles",{left:d.getStyle("left"),top:d.getStyle("top"),width:d.getStyle("width"),height:d.getStyle("height")});d.setStyle({position:"absolute",top:h.top+"px",left:h.left+"px",width:f.get("width")+"px",height:f.get("height")+"px"});return d},relativize:function(d){d=$(d);if(Element.getStyle(d,"position")==="relative")return d;var f=d.retrieve("prototype_absolutize_original_styles");
f&&d.setStyle(f);return d}});"getBoundingClientRect"in document.documentElement&&Element.addMethods({viewportOffset:function(d){d=$(d);if(g(d))return new Element.Offset(0,0);d=d.getBoundingClientRect();var f=document.documentElement;return new Element.Offset(d.left-f.clientLeft,d.top-f.clientTop)}})})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};
Prototype.Selector=function(){function a(c){for(var e=0,g=c.length;e<g;e++)Element.extend(c[e]);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,e,g){g=g||0;var i=Prototype.Selector.match,d=c.length,f=0,h;for(h=0;h<d;h++)if(i(c[h],e)&&g==f++)return Element.extend(c[h])},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(f.filter(m,[t]).length>0){C=t;break}}t=t[j]}n[k]=C}}}var c=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,g=Object.prototype.toString,i=false,d=true;[0,0].sort(function(){d=false;return 0});var f=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&&h.relative[r[0]])v=N(r[0]+r[1],m);else for(v=h.relative[r[0]]?[m]:f(r.shift(),m);r.length;){j=r.shift();if(h.relative[j])j+=r.shift();v=N(j,v)}else{if(!n&&r.length>1&&m.nodeType===9&&!J&&h.match.ID.test(r[0])&&!h.match.ID.test(r[r.length-1])){k=f.find(r.shift(),m,J);m=k.expr?f.filter(k.expr,k.set)[0]:k.set[0]}if(m){k=
n?{expr:r.pop(),set:w(n)}:f.find(r.pop(),r.length===1&&(r[0]==="~"||r[0]==="+")&&m.parentNode?m.parentNode:m,J);v=k.expr?f.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(h.relative[I])k=r.pop();else I="";if(k==null)k=m;h.relative[I](t,k,J)}}else t=[]}t||(t=v);if(!t)throw"Syntax error, unrecognized expression: "+(I||j);if(g.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){f(C,s,p,n);f.uniqueSort(p)}return p};f.uniqueSort=function(j){if(M){i=d;j.sort(M);if(i)for(var m=1;m<j.length;m++)j[m]===j[m-1]&&j.splice(m--,1)}return j};f.matches=function(j,m){return f(j,null,null,m)};f.find=function(j,m,p){var n,s;if(!j)return[];for(var r=0,k=h.order.length;r<k;r++){var v=h.order[r];if(s=h.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=h.find[v](s,m,p);if(n!=null){j=j.replace(h.match[v],"");break}}}}n||(n=m.getElementsByTagName("*"));return{set:n,expr:j}};f.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 h.filter)if((v=h.match[D].exec(j))!=null){var J=h.filter[D],G,I;t=false;if(k==r)r=[];if(h.preFilter[D])if(v=h.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(h.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 h=f.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&&f.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&&f.filter(m,j,true)}},"":function(j,m,p){var n=e++,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=
e++,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]=e++;return j},ATTR:function(j,m,p,n,s,r){m=j[1].replace(/\\/g,"");if(!r&&h.attrMap[m])j[1]=h.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]=f(j[3],null,null,m);else{j=f.filter(j[3],m,p,true^s);p||n.push.apply(n,j);return false}else if(h.match.POS.test(j[0])||h.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!!f(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=h.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=h.attrHandle[p]?h.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=h.setFilters[m[2]];
if(s)return s(j,p,m,n)}}},l=h.match.POS,o;for(o in h.match){h.match[o]=RegExp(h.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source);h.leftMatch[o]=RegExp(/(^(?:.|\r|\n)*?)/.source+h.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(g.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)i=true;return 0}var p=j.compareDocumentPosition(m)&4?-1:j===m?0:1;if(p===0)i=true;return p};else if("sourceIndex"in document.documentElement)M=function(j,m){if(!j.sourceIndex||!m.sourceIndex){if(j==m)i=true;return 0}var p=j.sourceIndex-m.sourceIndex;if(p===0)i=true;return p};else if(document.createRange)M=
function(j,m){if(!j.ownerDocument||!m.ownerDocument){if(j==m)i=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)i=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)){h.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:[]};h.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)h.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")!=="#")h.attrHandle.href=function(m){return m.getAttribute("href",2)};j=null})();document.querySelectorAll&&function(){var j=f,m=document.createElement("div");m.innerHTML="<p class='TEST'></p>";if(!(m.querySelectorAll&&m.querySelectorAll(".TEST").length===
0)){f=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)f[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){h.order.splice(1,0,"CLASS");
h.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=h.match.PSEUDO.exec(j);){n+=
s[0];j=j.replace(h.match.PSEUDO,"")}j=h.relative[j]?j+"*":j;s=0;for(var k=r.length;s<k;s++)f(j,r[s],p);return f.filter(n,p)};window.Sizzle=f})();(function(a){var b=Prototype.Selector.extendElements;Prototype.Selector.engine=a;Prototype.Selector.select=function(c,e){return b(a(c,e||document))};Prototype.Selector.match=function(c,e){return a.matches(e,[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,e,g=false,i=b.submit,d,f;if(b.hash){f={};d=function(h,l,o){if(l in h){Object.isArray(h[l])||(h[l]=[h[l]]);h[l].push(o)}else h[l]=o;return h}}else{f="";d=function(h,l,o){return h+(h?"&":"")+encodeURIComponent(l)+"="+encodeURIComponent(o)}}return a.inject(f,function(h,l){if(!l.disabled&&l.name){c=l.name;e=$(l).getValue();if(e!=
null&&l.type!="file"&&(l.type!="submit"||!g&&i!==false&&(!i||c==i)&&(g=true)))h=d(h,c,e)}return h})}};
Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(a){a=$(a).getElementsByTagName("*");for(var b,c=[],e=Form.Element.Serializers,g=0;b=a[g];g++)c.push(b);return c.inject([],function(i,d){e[d.tagName.toLowerCase()]&&i.push(Element.extend(d));return i})},getInputs:function(a,b,c){a=$(a);a=a.getElementsByTagName("input");if(!b&&!c)return $A(a).map(Element.extend);for(var e=0,g=[],i=a.length;e<i;e++){var d=a[e];b&&d.type!=b||c&&d.name!=c||
g.push(Element.extend(d))}return g},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,e=a.readAttribute("action")||"";if(e.blank())e=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(e,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(i,d){if(Object.isUndefined(d))return i.checked?i.value:null;else i.checked=!!d}function b(i,d){if(Object.isUndefined(d))return i.value;else i.value=d}function c(i){var d=i.selectedIndex;return d>=0?g(i.options[d]):null}function e(i){var d,f=i.length;if(!f)return null;var h=0;for(d=[];h<f;h++){var l=i.options[h];l.selected&&d.push(g(l))}return d}function g(i){return Element.hasAttribute(i,"value")?i.value:i.text}return{input:function(i,d){switch(i.type.toLowerCase()){case "checkbox":case "radio":return a(i,
d);default:return b(i,d)}},inputSelector:a,textarea:b,select:function(i,d){if(Object.isUndefined(d))return(i.type==="select-one"?c:e)(i);for(var f,h,l=!Object.isArray(d),o=0,w=i.length;o<w;o++){f=i.options[o];h=this.optionValue(f);if(l){if(h==d){f.selected=true;break}}else f.selected=d.include(h)}},selectOne:c,selectMany:e,optionValue:g,button:b}}();
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,e){$super(e,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 e(k){var v=document.documentElement,t=document.body||{scrollLeft:0};return k.pageX||k.clientX+(v.scrollLeft||t.scrollLeft)-(v.clientLeft||0)}function g(k){var v=document.documentElement,t=document.body||{scrollTop:0};return k.pageY||
k.clientY+(v.scrollTop||t.scrollTop)-(v.clientTop||0)}function i(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 d(){for(var k=0,v=n.length;k<v;k++){w.stopObserving(n[k]);n[k]=null}}function f(k,v,t){k=$(k);t=i(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 h(k,v,t){k=$(k);var C=Element.retrieve(k,"prototype_event_registry");if(!C)return k;if(!v){C.each(function(I){h(k,I.key)});return k}var D=C.get(v);if(!D)return k;if(!t){D.each(function(I){h(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:e(k),y:g(k)}},pointerX:e,pointerY:g,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",d);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:f,stopObserving:h,on:o});Element.addMethods({fire:l,observe:f,stopObserving:h,on:o});Object.extend(document,{fire:l.methodize(),observe:f.methodize(),stopObserving:h.methodize(),on:o.methodize(),loaded:false});if(window.Event)Object.extend(window.Event,w);else window.Event=w})();
(function(){function a(){if(!document.loaded){e&&window.clearTimeout(e);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(g){e=c.defer();return}a()}var e;if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);else{document.observe("readystatechange",b);if(window==top)e=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 e=Element.cumulativeScrollOffset(a);this.xcomp=b+e[0]-this.deltaX;this.ycomp=c+e[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,e){e=e.toString().strip();var g=/\s/.test(e)?$w(e).map(b).join(""):b(e);return g?document._getElementsByXPath(".//*"+g,c):[]}:function(c,e){e=e.toString().strip();var g=[],i=/\s/.test(e)?$w(e):null;if(!i&&!e)return g;var d=$(c).getElementsByTagName("*");e=" "+e+" ";for(var f=
0,h,l;h=d[f];f++)if(h.className&&(l=" "+h.className+" ")&&(l.include(e)||i&&i.all(function(o){return!o.toString().blank()&&l.include(" "+o+" ")})))g.push(Element.extend(h));return g};return function(c,e){return $(e||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,e=[],g=0,i=a.length;g<i;g++){var d=a[g];c(d,b)&&e.push(Element.extend(d))}return e},
findElement:function(a,b,c){c=c||0;for(var e=0,g,i=0,d=a.length;i<d;i++){g=a[i];if(Prototype.Selector.match(g,b)&&c===e++)return Element.extend(g)}},findChildElements:function(a,b){var c=b.toArray().join(", ");return Prototype.Selector.select(c,a||document)}})})();
(function(){function a(g){var i=document.createElement("div");g="on"+g;var d=g in i;if(!d){i.setAttribute(g,"return;");d=typeof i[g]=="function"}return d}function b(g){var i,d,f;if(g.fire("ajax:before").stopped)return false;if(g.tagName.toLowerCase()==="form"){i=g.readAttribute("method")||"post";d=g.readAttribute("action");f=g.serialize()}else{i=g.readAttribute("data-method")||"get";d=g.readAttribute("href");f={}}new Ajax.Request(d,{method:i,parameters:f,evalScripts:true,onComplete:function(h){g.fire("ajax:complete",
h)},onSuccess:function(h){g.fire("ajax:success",h)},onFailure:function(h){g.fire("ajax:failure",h)}});g.fire("ajax:after")}var c=a("submit"),e=a("change");if(!c||!e)Event.Handler.prototype.initialize=Event.Handler.prototype.initialize.wrap(function(g,i,d,f,h){g(i,d,f,h);if(!(g=!c&&this.eventName=="submit"&&!(Object.isElement(this.element)&&this.element.nodeName.toUpperCase()=="FORM")))if(g=!e)if(g=this.eventName=="change"){g=this.element;if(Object.isElement(g)){g=g.nodeName.toUpperCase();g=g=="INPUT"||
g=="SELECT"||g=="TEXTAREA"}else g=false;g=!g}if(g)this.eventName="emulated:"+this.eventName});c||document.on("focusin","form",function(g,i){if(!i.retrieve("emulated:submit")){i.on("submit",function(d){i.fire("emulated:submit",d,true).returnValue===false&&d.preventDefault()});i.store("emulated:submit",true)}});e||document.on("focusin","input, select, texarea",function(g,i){if(!i.retrieve("emulated:change")){i.on("change",function(d){i.fire("emulated:change",d,true)});i.store("emulated:change",true)}});
document.on("click","*[data-confirm]",function(g,i){var d=i.readAttribute("data-confirm");confirm(d)||g.stop()});document.on("click","a[data-remote]",function(g,i){if(!g.stopped){b(i);g.stop()}});document.on("click","a[data-method]",function(g,i){if(!g.stopped){var d=i.readAttribute("data-method"),f=i.readAttribute("href"),h=$$("meta[name=csrf-param]")[0],l=$$("meta[name=csrf-token]")[0];f=new Element("form",{method:"POST",action:f,style:"display: none;"});i.parentNode.insert(f);if(d!=="post"){d=
new Element("input",{type:"hidden",name:"_method",value:d});f.insert(d)}if(h){h=h.readAttribute("content");l=l.readAttribute("content");d=new Element("input",{type:"hidden",name:h,value:l});f.insert(d)}f.submit();g.stop()}});document.on("submit",function(g){var i=g.findElement(),d=i.readAttribute("data-confirm");if(d&&!confirm(d)){g.stop();return false}i.select("input[type=submit][data-disable-with]").each(function(f){f.disabled=true;f.writeAttribute("data-original-value",f.value);f.value=f.readAttribute("data-disable-with")});
if(i=g.findElement("form[data-remote]")){b(i);g.stop()}});document.on("ajax:after","form",function(g,i){i.select("input[type=submit][disabled=true][data-disable-with]").each(function(d){d.value=d.readAttribute("data-original-value");d.removeAttribute("data-original-value");d.disabled=false})});Ajax.Responders.register({onCreate:function(g){var i=$$("meta[name=csrf-token]")[0];if(i){i=i.readAttribute("content");if(!g.options.requestHeaders)g.options.requestHeaders={};g.options.requestHeaders["X-CSRF-Token"]=
i}}})})();
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 e(){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;g()})()}else g()}function g(){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=i(y);z(A)}}else if(D[u].expressInstall&&d()){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");f(A,E,y,z)}else{h(H);z&&z(A)}}else{N(y,true);if(z){if((y=i(y))&&typeof y.SetVariable!=m){A.success=true;A.ref=y}z(A)}}}}function i(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 d(){return!X&&O("6.0.65")&&(B.win||B.mac)&&!(B.wk&&B.wk<312)}function f(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 h(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?e():g()}],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 i(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&&d()){T.data=H;f(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&&d()&&f(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,e,g,i,d,f){e=e||{allowScriptAccess:"always"};g=g||"";i=i||"0";d=d||"0";f=f||"9";createEmptyDiv(b,c);swfobject.embedSWF(unescape(a),c,i,d,f,"/widgets/expressinstall.swf","",e,g)}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,e,g){e||(e="/");if(c){var i=new Date;i.setTime(i.getTime()+c*1E3);c="; expires="+i.toGMTString()}else c="";a=a+"="+b+c+"; path="+e;if(g==null)document.cookie=a+"; domain=."+BaseDomain;else if(g=="")document.cookie=a}
function readCookie(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var e=b[c];e.charAt(0)==" ";)e=e.substring(1,e.length);if(e.indexOf(a)==0)return e.substring(a.length,e.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 e=0;e<c.childNodes.length;e++)a.appendChild($(c.childNodes[e]).remove());$(c).remove()}function set_volume(a){createCookie("volume",a,604800)}function get_volume(){return readCookie("volume")||100}
function limit_tags(a,b,c,e){for(a=$(a).getElementsByTagName(b);a.length>c;)if(e){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")],e=[_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday")],g=[_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec")],i=[_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")],d=a.getHours()<12?"am":"pm",f=mil_to_ampm(a.getHours()),
h=two_digit(a.getHours()),l=two_digit(a.getMinutes()),o=two_digit(a.getSeconds()),w=a.is_today(),F=a.is_tomorrow(),M=e[a.getDay()]+" "+i[a.getMonth()]+" "+ordinalize(a.getDate());c=[["%a",c[a.getDay()]],["%A",e[a.getDay()]],["%b",g[a.getMonth()]],["%B",i[a.getMonth()]],["%c",a.toString()],["%d",two_digit(a.getDate())],["$d",a.getDate()],["%H",h],["%I",two_digit(f)],["%m",two_digit(a.getMonth()+1)],["%M",l],["%p",d],["%P",d.toUpperCase()],["%S",o],["%w",a.getDay()],["%x",time_to_date_string(a)],["%X",
f+":"+l+":"+o+" "+d],["%y",two_digit(a.getYear()%100)],["%Y",a.getFullYear()],["$f",f+(a.getMinutes()?":"+l:"")],["$m",a.getMonth()+1],["$M",a.getMinutes()],["$S",a.getSeconds()],["$H",a.getHours()],["$I",f],["%i",f],["%o",ordinalize(a.getDate())],["%T",w?_("Today at"):F?_("Tomorrow at"):M]];for(e=0;e<c.length;e++)b=b.replace(c[e][0],c[e][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(e,g,i,d){e=/([0-9]+)/.exec(e)[1];var f=/([0-9]+)/.exec(g)[1];if(!d){if(!b){c();b=true}if(e>50&&f>50)MobileBrowser()?on_dom_load(function(){$(i).innerHTML='<div style="padding-top:'+(f/2-25)+'px;">'+s_("Your mobile device does not support Justin.tv.")+"</div>"}):on_dom_load(function(){$(i).innerHTML='<div style="padding-top:'+(f/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(e){var g=c;c=function(){g();e()}};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"),e=0;e<c.length;e++)if(c[e].type=="checkbox")c[e].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,e){return b[e]})}function l_(a,b){var c=$A(arguments).slice(2);return b.replace(/\$(.+?)\$/g,function(e,g){return a.apply(this,[g].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 e=new Image(1,1);if(c)e.onload=c;try{query_string=[encodeURIComponent(a),b.map(encodeURI),get_page_log_params().toQueryString()].flatten().join("&");e.src="http://stats.jtvnw.net/"+Math.round(Math.random()*1E4)+"?"+query_string;return e}catch(g){}}
function get_page_log_params(){var a=$H(),b=function(c,e){e&&e!==""&&a.set(c,e)};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 e=PP.user_id;if(new Date(2007,11,24,0,0,0)<new Date&&(e==7824||e==39980||e==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(i){return b[i].test(navigator.platform)})||"unknown";a.os=function(){return c};return c};a.is_os=function(i){if(Object.isArray(i))return $A(i).indexOf(a.os())!=-1;else if(Object.isString(i))return a.os()==i;return false};var e=["IE","Opera","WebKit","MobileSafari","Gecko"],g=null;a.browser=function(){g=$A(e).detect(function(i){return Prototype.Browser[i]})||"unknown";a.browser=
function(){return g};return g};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 e=c;if(a!==b){e=c.replace("://"+a+".","://"+b+".");if(e===c)e=c.match("www.")?c.replace("www",b):c.replace(LanguageBaseDomain,b+"."+LanguageBaseDomain)}redirect_respecting_analytics(e)})}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,e){growl('<a href="'+e+'" 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(g){return g.innerHTML.replace(/\s/,"")==a.replace(/\s/,"")})){var e="growl_"+growl.growl_id++;b=['<div class="notification_holder" id="',e,'"><div class="notification"><a href="#" class="close" onclick="$(\'',e,'\').hide(); return false;">X</a><div class="content ',b,'">',a,"</div></div></div>"].join("");appendHTML("growl_slider",b);$(e).onmouseover=function(){x=$(e).down("a.close");x.style.display="block"};$(e).onmouseout=
function(){x=$(e).down("a.close");x.style.display=""};$("growl_container").show();c||(c=7);new Effect.Fade(e,{duration:3,delay:c,queue:{scope:e},afterFinish:function(){var g=$(e).offsetHeight;new Effect.Move("growl_slider",{y:0-g,x:0,mode:"relative",afterFinish:function(){$(e).remove();if($("growl_slider").childElements().length==0)$("growl_slider").style.top="0px";else $("growl_slider").style.top=$("growl_slider").positionedOffset().top+g+"px"}})}})}}growl.growl_id=0;
function show_info_popup(a,b,c,e){$("info_popup_title").update(a);$("info_popup_body").update(b);try{b.evalScripts()}catch(g){}$("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(e?e:"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 e=b.match(/:uid=>"(\w+)"/);if(e)b=b.match(/:format=>"(\w+)"/);else{e=b.match(/:uid:\s*(\w+)/);b=b.match(/:format:\s*(\w+)/)}return"http://s.jtvnw.net/jtv_user_pictures/"+c+"-profile_image-"+e[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(e){e.apply(EventBank,b)});var c=EventBank.prefix_handlers[a.split(":")[0]]||[];$A(c).each(function(e){e.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,e=EventBank.backlog[a];c=e.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(e){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(e)},onFailure:function(e){delete sharing_login_callbacks[a];delete sharing_login_windows[a];log_stat("sharing/login_prompt",["status=failure","service="+
a]);return b.onFailure(e)}}};
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,e){a=["_trackEvent",a,b];c!=null&&a.push(c);e!=null&&a.push(e);_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(e){return e.split("=")}).findAll(function(e){return e[0]in{utm_source:1,utm_medium:1,utm_campaign:1,utm_term:1,utm_content:1}}).map(function(e){return e.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,e,g){if((e=="true"||e===true)&&g!="true"&&g!==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 e={allowScriptAccess:"always",allowNetworking:"all",flashvars:Mixpanel._build_flashvars(a,b)};addSWF("/widgets/mixpanel_beacon.swf","_mpq",c,e,{id:c,name:"left",bgcolor:"#000000"})},_build_flashvars:function(a,b){b=Object.clone(b);b.login=PP.login;var c,e,g,i=0,d=[];d[i++]="event="+a.toString();for(c in b)if(c)if(c!="event"){val=b[c];e=val==null?"":val.toString();
g=c;d[i++]=g+"="+e}return d.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)}}};window.$j!==undefined&&function(a){window.getGameInfo=function(b,c){a.ajax({url:"/discovery/game",dataType:"json",data:{name:b},success:function(e){c(e)},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(d){var f=$(d.id);if(f&&f.src!==d.src){var h=f.cumulativeOffset().top-
(f.cumulativeScrollOffset().top-a);if(b>=h-20&&f.clientWidth>0){f.src=d.src;return false}}return true});if(LateLoader.channel_about_me){var c=$("about_me_container"),e=c.cumulativeOffset();if(b>=e.top-20){c.innerHTML=LateLoader.channel_about_me;LateLoader.channel_about_me=null}if($("related")){var g=0;$$("#related_list .list_item").each(function(d){g+=d.getHeight()});c=-50;if($("clips"))c+=$("clips").getHeight();if($("about"))c+=$("about").getHeight();c=Math.min(g,c,400);e=$("related_list");if(c>
e.getHeight())e.style.height=c+"px"}}LateLoader.reposition_ad("ChanLeaderBottomv2");LateLoader.reposition_ad("Staging_ChanLeaderBottomv2");LateLoader.images=images;LateLoader.updating=false;if($$(".below_header")){var i=50-a;if(i<0)i=0;$$(".below_header").each(function(d){$(d).style.top=i+"px"})}if($$(".above_footer")&&$("footer")){i=b-$("footer").positionedOffset().top;if(i<0)i=0;$$(".above_footer").each(function(d){$(d).style.bottom=i+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 e=0,g=0;if(a.indexOf("Leaderv")>-1){LateLoader.leader_ad=true;e=b.getHeight();g=b.getWidth();e>0&&g>0&&show_header_banner()}var i={};if(typeof $j!="undefined"&&LateLoader.xarth){i=$j("#"+
a+"_holder").offset();var d=$j(".wrapper").offset();i.left-=d.left;i.top-=d.top}else i=c.positionedOffset();if(a.indexOf("Leaderv")>-1){if(e>0)b.style.top=i.top+(c.getHeight()-e)/2+"px";if(g>0)b.style.left=i.left+(c.getWidth()-g)/2+"px"}else{b.style.top=i.top+"px";b.style.left=i.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(e){if(e.tagName.toUpperCase()=="DIV"){var g=e.getStyle("clip");if(g)try{ss=g.split(",");if(ss.length<2)ss=g.split(" ");parseInt(ss[2])>0?e.setStyle({height:parseInt(ss[2])+"px"}):e.setStyle({height:null})}catch(i){}e=
e.getHeight();if(e>max_height)max_height=e}});$(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 e=$(b+c);if(e)new Effect.Move(e,{x:0,y:a,mode:"relative"});else(e=$("Staging_"+b+c))&&new Effect.Move(e,{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,e,g,i){c||(c=310);e||(e=320);g||(g="");if(b=="DirectoryMedRectBottomv2"&&document.getElementById("spotlight404"))g=true;if(!b&&LateLoader.companion_slot)b=LateLoader.companion_slot;var d=function(f){f='<iframe src="'+f+'" height="'+e+'" width="'+c+'" id="ad_iframe" scrolling="no"></iframe>';$(a).innerHTML=f;$(a).show();if(i){$(a).setStyle({width:c+"px",height:e+"px"});$(a).ancestors()[0].setStyle({width:c+35+"px",height:e+"px"})}LateLoader.reposition_all_ads()};url="/ad/iframe_ad?";
url+="ad_slot="+b+"&just_ad="+g+"&height="+e+"&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(g=0;g<Math.min(b.genres.length,3);g++)url+="&genre"+g+"="+encodeURIComponent(b.genres[g]);if(b.name)url+="&game_name="+encodeURIComponent(b.name)}else d(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(e){}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),e=get_coordinates(b);c={top:Math.max(c.top,e.top),left:Math.max(c.left,e.left),right:Math.min(c.right,e.right),bottom:Math.min(c.bottom,e.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,e,g){c=$(c);var i={pageX:0,pageY:0,timestamp:0},d=function(h){i.pageX=Event.pointerX(h);i.pageY=Event.pointerY(h)},f=function(h){if(!c.loading){c.loading=true;i.timestamp=(new Date).valueOf();d(h);Event.observe(document.body,"mousemove",d);new Ajax.Request(a,{method:"get",onSuccess:function(l){Event.stopObserving(c,"mouseover",f);Event.stopObserving(document.body,"mousemove",d);$(e).insert(l.responseText);l.responseText.evalScripts();l=dropmenus.push((new Tooltip.Fixed(b,g)).attach(c))-
1;g.on_load&&g.on_load(c,dropmenus[l]);dropmenus[l]._logEvent(i);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",f.bindAsEventListener(window))}function position_to_container(a,b,c){var e=a[0];a=a[1];b=$(b).positionedOffset();var g=$(a).getStyle("padding-left");b=b[0]-parseFloat(g)-1;$(a).setStyle({left:b+"px"});c=c=="right"?b-$(e).getWidth()+$(a).getWidth():b;$(e).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)};

