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 f=arguments[b];try{a=f();break}catch(h){}}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 f=null,h=$A(arguments);if(Object.isFunction(h[0]))f=h.shift();Object.extend(c,Class.Methods);c.superclass=f;c.subclasses=[];if(f){a.prototype=f.prototype;c.prototype=
new a;f.subclasses.push(c)}f=0;for(var n=h.length;f<n;f++)c.addMethods(h[f]);if(!c.prototype.initialize)c.prototype.initialize=Prototype.emptyFunction;return c.prototype.constructor=c},Methods:{addMethods:function(c){var f=this.superclass&&this.superclass.prototype,h=Object.keys(c);if(b){c.toString!=Object.prototype.toString&&h.push("toString");c.valueOf!=Object.prototype.valueOf&&h.push("valueOf")}for(var n=0,j=h.length;n<j;n++){var k=h[n],o=c[k];if(f&&Object.isFunction(o)&&o.argumentNames()[0]==
"$super"){var p=o;o=function(v){return function(){return f[v].apply(this,arguments)}}(k).wrap(p);o.valueOf=p.valueOf.bind(p);o.toString=p.toString.bind(p)}this.prototype[k]=o}return this}}}}();
(function(){function a(E){switch(E){case null:return p;case void 0:return v}switch(typeof E){case "boolean":return F;case "number":return V;case "string":return da}return sa}function b(E,N){for(var M in N)E[M]=N[M];return E}function c(E){return f("",{"":E},[])}function f(E,N,M){N=N[E];var y=typeof N;if(a(N)===sa&&typeof N.toJSON==="function")N=N.toJSON(E);E=o.call(N);switch(E){case Ba:case ya:case u:N=N.valueOf()}switch(N){case null:return"null";case true:return"true";case false:return"false"}y=typeof N;
switch(y){case "string":return N.inspect(true);case "number":return isFinite(N)?String(N):"null";case "object":y=0;for(var T=M.length;y<T;y++)if(M[y]===N)throw new TypeError;M.push(N);var Q=[];if(E===C){y=0;for(T=N.length;y<T;y++){var ja=f(y,N,M);Q.push(typeof ja==="undefined"?"null":ja)}Q="["+Q.join(",")+"]"}else{var R=Object.keys(N);y=0;for(T=R.length;y<T;y++){E=R[y];ja=f(E,N,M);typeof ja!=="undefined"&&Q.push(E.inspect(true)+":"+ja)}Q="{"+Q.join(",")+"}"}M.pop();return Q}}function h(E){return JSON.stringify(E)}
function n(E){if(a(E)!==sa)throw new TypeError;var N=[],M;for(M in E)E.hasOwnProperty(M)&&N.push(M);return N}function j(E){return o.call(E)===C}function k(E){return typeof E==="undefined"}var o=Object.prototype.toString,p="Null",v="Undefined",F="Boolean",V="Number",da="String",sa="Object",ya="[object Boolean]",Ba="[object Number]",u="[object String]",C="[object Array]",H=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({}))j=Array.isArray;b(Object,{extend:b,inspect:function(E){try{if(k(E))return"undefined";if(E===null)return"null";return E.inspect?E.inspect():String(E)}catch(N){if(N instanceof RangeError)return"...";throw N;}},toJSON:H?h:c,toQueryString:function(E){return $H(E).toQueryString()},toHTML:function(E){return E&&E.toHTML?E.toHTML():String.interpret(E)},keys:Object.keys||n,values:function(E){var N=[],M;for(M in E)N.push(E[M]);return N},clone:function(E){return b({},
E)},isElement:function(E){return!!(E&&E.nodeType==1)},isArray:j,isHash:function(E){return E instanceof Hash},isFunction:function(E){return o.call(E)==="[object Function]"},isString:function(E){return o.call(E)===u},isNumber:function(E){return o.call(E)===Ba},isDate:function(E){return o.call(E)==="[object Date]"},isUndefined:k})})();
Object.extend(Function.prototype,function(){function a(f,h){for(var n=f.length,j=h.length;j--;)f[n+j]=h[j];return f}function b(f,h){f=c.call(f,0);return a(f,h)}var c=Array.prototype.slice;return{argumentNames:function(){var f=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return f.length==1&&!f[0]?[]:f},bind:function(f){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var h=this,n=c.call(arguments,
1);return function(){var j=b(n,arguments);return h.apply(f,j)}},bindAsEventListener:function(f){var h=this,n=c.call(arguments,1);return function(j){j=a([j||window.event],n);return h.apply(f,j)}},curry:function(){if(!arguments.length)return this;var f=this,h=c.call(arguments,0);return function(){var n=b(h,arguments);return f.apply(this,n)}},delay:function(f){var h=this,n=c.call(arguments,1);f*=1E3;return window.setTimeout(function(){return h.apply(h,n)},f)},defer:function(){return this.delay.apply(this,
a([0.01],arguments))},wrap:function(f){var h=this;return function(){var n=a([h.bind(this)],arguments);return f.apply(this,n)}},methodize:function(){if(this._methodized)return this._methodized;var f=this;return this._methodized=function(){var h=a([this],arguments);return f.apply(null,h)}}}}());
(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(j){if(Object.isFunction(j))return j;var k=new Template(j);return function(o){return k.evaluate(o)}}function b(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function c(j){var k=this.strip().match(/([^?#]*)(#.*)?$/);if(!k)return{};return k[1].split(j||"&").inject({},function(o,p){if((p=p.split("="))[0]){var v=decodeURIComponent(p.shift()),F=p.length>1?p.join("="):p[0];if(F!=undefined)F=decodeURIComponent(F);if(v in o){Object.isArray(o[v])||
(o[v]=[o[v]]);o[v].push(F)}else o[v]=F}return o})}function f(j){var k=this.unfilterJSON(),o=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(o.test(k))k=k.replace(o,function(v){return"\\u"+("0000"+v.charCodeAt(0).toString(16)).slice(-4)});try{if(!j||k.isJSON())return eval("("+k+")")}catch(p){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());}function h(){var j=this.unfilterJSON();return JSON.parse(j)}var n=window.JSON&&
typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;return{gsub:function(j,k){var o="",p=this,v;k=a(k);if(Object.isString(j))j=RegExp.escape(j);if(!(j.length||j.source)){k=k("");return k+p.split("").join(k)+k}for(;p.length>0;)if(v=p.match(j)){o+=p.slice(0,v.index);o+=String.interpret(k(v));p=p.slice(v.index+v[0].length)}else{o+=p;p=""}return o},sub:function(j,k,o){k=a(k);o=Object.isUndefined(o)?1:o;return this.gsub(j,function(p){if(--o<0)return p[0];return k(p)})},scan:function(j,k){this.gsub(j,
k);return String(this)},truncate:function(j,k){j=j||30;k=Object.isUndefined(k)?"...":k;return this.length>j?this.slice(0,j-k.length)+k: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 j=RegExp(Prototype.ScriptFragment,"im");return(this.match(RegExp(Prototype.ScriptFragment,"img"))||[]).map(function(k){return(k.match(j)||
["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(j){return eval(j)})},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(j){return j<
1?"":Array(j+1).join(this)},camelize:function(){return this.replace(/-+(.)?/g,function(j,k){return k?k.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(j){var k=this.replace(/[\x00-\x1f\\]/g,function(o){if(o in
String.specialChar)return String.specialChar[o];return"\\u00"+o.charCodeAt().toPaddedString(2,16)});if(j)return'"'+k.replace(/"/g,'\\"')+'"';return"'"+k.replace(/'/g,"\\'")+"'"},unfilterJSON:function(j){return this.replace(j||Prototype.JSONFilter,"$1")},isJSON:function(){var j=this;if(j.blank())return false;j=j.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");j=j.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");j=j.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(j)},
evalJSON:n?h:f,include:function(j){return this.indexOf(j)>-1},startsWith:function(j){return this.lastIndexOf(j,0)===0},endsWith:function(j){var k=this.length-j.length;return k>=0&&this.indexOf(j,k)===k},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(j,k){return(new Template(this,k)).evaluate(j)}}}());
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 f=a,h=b[3],n=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;b=n.exec(h);if(b==null)return c;for(;b!=null;){var j=b[1].startsWith("[")?b[2].replace(/\\\\]/g,"]"):b[1];f=f[j];if(null==
f||""==b[3])break;h=h.substring("["==b[3]?b[1].length:b[0].length);b=n.exec(h)}return c+String.interpret(f)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={},Enumerable=function(){function a(k,o){k=k||Prototype.K;var p=true;this.each(function(v,F){p=p&&!!k.call(o,v,F);if(!p)throw $break;});return p}function b(k,o){k=k||Prototype.K;var p=false;this.each(function(v,F){if(p=!!k.call(o,v,F))throw $break;});return p}function c(k,o){k=k||Prototype.K;var p=[];this.each(function(v,F){p.push(k.call(o,v,F))});return p}function f(k,o){var p;this.each(function(v,F){if(k.call(o,v,F)){p=v;throw $break;}});return p}function h(k,o){var p=[];this.each(function(v,
F){k.call(o,v,F)&&p.push(v)});return p}function n(k){if(Object.isFunction(this.indexOf))if(this.indexOf(k)!=-1)return true;var o=false;this.each(function(p){if(p==k){o=true;throw $break;}});return o}function j(){return this.map()}return{each:function(k,o){var p=0;try{this._each(function(F){k.call(o,F,p++)})}catch(v){if(v!=$break)throw v;}return this},eachSlice:function(k,o,p){var v=-k,F=[],V=this.toArray();if(k<1)return V;for(;(v+=k)<V.length;)F.push(V.slice(v,v+k));return F.collect(o,p)},all:a,every:a,
any:b,some:b,collect:c,map:c,detect:f,findAll:h,select:h,filter:h,grep:function(k,o,p){o=o||Prototype.K;var v=[];if(Object.isString(k))k=RegExp(RegExp.escape(k));this.each(function(F,V){k.match(F)&&v.push(o.call(p,F,V))});return v},include:n,member:n,inGroupsOf:function(k,o){o=Object.isUndefined(o)?null:o;return this.eachSlice(k,function(p){for(;p.length<k;)p.push(o);return p})},inject:function(k,o,p){this.each(function(v,F){k=o.call(p,k,v,F)});return k},invoke:function(k){var o=$A(arguments).slice(1);
return this.map(function(p){return p[k].apply(p,o)})},max:function(k,o){k=k||Prototype.K;var p;this.each(function(v,F){v=k.call(o,v,F);if(p==null||v>=p)p=v});return p},min:function(k,o){k=k||Prototype.K;var p;this.each(function(v,F){v=k.call(o,v,F);if(p==null||v<p)p=v});return p},partition:function(k,o){k=k||Prototype.K;var p=[],v=[];this.each(function(F,V){(k.call(o,F,V)?p:v).push(F)});return[p,v]},pluck:function(k){var o=[];this.each(function(p){o.push(p[k])});return o},reject:function(k,o){var p=
[];this.each(function(v,F){k.call(o,v,F)||p.push(v)});return p},sortBy:function(k,o){return this.map(function(p,v){return{value:p,criteria:k.call(o,p,v)}}).sort(function(p,v){var F=p.criteria,V=v.criteria;return F<V?-1:F>V?1:0}).pluck("value")},toArray:j,entries:j,zip:function(){var k=Prototype.K,o=$A(arguments);if(Object.isFunction(o.last()))k=o.pop();var p=[this].concat(o).map($A);return this.map(function(v,F){return k(p.pluck(F))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+
this.toArray().inspect()+">"},find:f}}();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(o,p){for(var v=0,F=this.length>>>0;v<F;v++)v in this&&o.call(p,this[v],v,this)}function b(){return j.call(this,0)}function c(o,p){p||(p=0);var v=this.length;if(p<0)p=v+p;for(;p<v;p++)if(this[p]===o)return p;return-1}function f(o,p){p=isNaN(p)?this.length:(p<0?this.length+p:p)+1;var v=this.slice(0,p).reverse().indexOf(o);return v<0?v:p-v-1}function h(){for(var o=j.call(this,0),p,v=0,F=arguments.length;v<F;v++){p=arguments[v];if(Object.isArray(p)&&!("callee"in p))for(var V=0,
da=p.length;V<da;V++)o.push(p[V]);else o.push(p)}return o}var n=Array.prototype,j=n.slice,k=n.forEach;k||(k=a);Object.extend(n,Enumerable);if(!n._reverse)n._reverse=n.reverse;Object.extend(n,{_each:k,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(o){return o!=null})},flatten:function(){return this.inject([],function(o,p){if(Object.isArray(p))return o.concat(p.flatten());o.push(p);
return o})},without:function(){var o=j.call(arguments,0);return this.select(function(p){return!o.include(p)})},reverse:function(o){return(o===false?this.toArray():this)._reverse()},uniq:function(o){return this.inject([],function(p,v,F){if(0==F||(o?p.last()!=v:!p.include(v)))p.push(v);return p})},intersect:function(o){return this.uniq().findAll(function(p){return o.detect(function(v){return p===v})})},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))n.concat=h;if(!n.indexOf)n.indexOf=c;if(!n.lastIndexOf)n.lastIndexOf=f})();function $H(a){return new Hash(a)}
var Hash=Class.create(Enumerable,function(){function a(){return Object.clone(this._object)}function b(c,f){if(Object.isUndefined(f))return c;return c+"="+encodeURIComponent(String.interpret(f))}return{initialize:function(c){this._object=Object.isHash(c)?c.toObject():Object.clone(c)},_each:function(c){for(var f in this._object){var h=this._object[f],n=[f,h];n.key=f;n.value=h;c(n)}},set:function(c,f){return this._object[c]=f},get:function(c){if(this._object[c]!==Object.prototype[c])return this._object[c]},
unset:function(c){var f=this._object[c];delete this._object[c];return f},toObject:a,toTemplateReplacements:a,keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var f=this.detect(function(h){return h.value===c});return f&&f.key},merge:function(c){return this.clone().update(c)},update:function(c){return(new Hash(c)).inject(this,function(f,h){f.set(h.key,h.value);return f})},toQueryString:function(){return this.inject([],function(c,f){var h=encodeURIComponent(f.key),
n=f.value;if(n&&typeof n=="object"){if(Object.isArray(n)){for(var j=[],k=0,o=n.length,p;k<o;k++){p=n[k];j.push(b(h,p))}return c.concat(j)}}else c.push(b(h,n));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,f){this.each(function(h){if(Object.isFunction(h[a]))try{h[a].apply(h,[b,c,f])}catch(n){}})}};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,f=b.length;c<f;c+=2)a[b[c]]=b[c+1];else $H(b).each(function(n){a[n.key]=n.value})}for(var h in a)this.transport.setRequestHeader(h,a[h])},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 f=b.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&f&&f.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(h){this.dispatchException(h)}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,f){this.container={success:b.success||b,failure:b.failure||(b.success?null:b)};f=Object.clone(f);var h=f.onComplete;f.onComplete=function(n,j){this.updateContent(n.responseText);Object.isFunction(h)&&h(n,j)}.bind(this);$super(c,f)},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 f=
{};f[c.insertion]=a;b.insert(f)}else c.insertion(b,a);else b.update(a)}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,f){$super(f);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=[],f=arguments.length;b<f;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=[],f=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),h=0,n=f.snapshotLength;h<n;h++)c.push(Element.extend(f.snapshotItem(h)));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 f=document.createElement('<input name="x">');return f.tagName.toLowerCase()==="input"&&f.name==="x"}catch(h){return false}}(),c=a.Element;a.Element=function(f,h){h=h||{};f=f.toLowerCase();var n=Element.cache;if(b&&h.name){f="<"+f+' name="'+h.name+'">';delete h.name;return Element.writeAttribute(document.createElement(f),h)}n[f]||(n[f]=Element.extend(document.createElement(f)));n=(f==="select"?false:"type"in h?false:true)?n[f].cloneNode(false):document.createElement(f);
return Element.writeAttribute(n,h)};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 n=document.createElement("select"),j=true;n.innerHTML='<option value="test">test</option>';if(n.options&&n.options[0])j=n.options[0].nodeName.toUpperCase()!==
"OPTION";return j}(),b=function(){try{var n=document.createElement("table");if(n&&n.tBodies){n.innerHTML="<tbody><tr><td>test</td></tr></tbody>";return typeof n.tBodies[0]=="undefined"}}catch(j){return true}}(),c=function(){try{var n=document.createElement("div");n.innerHTML="<link>";return n.childNodes.length===0}catch(j){return true}}(),f=a||b||c,h=function(){var n=document.createElement("script"),j=false;try{n.appendChild(document.createTextNode(""));j=!n.firstChild||n.firstChild&&n.firstChild.nodeType!==
3}catch(k){j=true}return j}();return function(n,j){n=$(n);for(var k=Element._purgeElement,o=n.getElementsByTagName("*"),p=o.length;p--;)k(o[p]);if(j&&j.toElement)j=j.toElement();if(Object.isElement(j))return n.update().insert(j);j=Object.toHTML(j);k=n.tagName.toUpperCase();if(k==="SCRIPT"&&h){n.text=j;return n}if(f)if(k in Element._insertionTranslations.tags){for(;n.firstChild;)n.removeChild(n.firstChild);Element._getContentFromAnonymousElement(k,j.stripScripts()).each(function(v){n.appendChild(v)})}else if(c&&
Object.isString(j)&&j.indexOf("<link")>-1){for(;n.firstChild;)n.removeChild(n.firstChild);Element._getContentFromAnonymousElement(k,j.stripScripts(),true).each(function(v){n.appendChild(v)})}else n.innerHTML=j.stripScripts();else n.innerHTML=j.stripScripts();j.evalScripts.bind(j).defer();return n}}(),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,f,h,n;for(n in b){c=b[n];n=n.toLowerCase();f=Element._insertionTranslations[n];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c))f(a,c);else{c=Object.toHTML(c);h=(n=="before"||n=="after"?a.parentNode:a).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(h,c.stripScripts());if(n=="top"||n=="after")h.reverse();h.each(f.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 f=c.first();c=c.last();if(f=(a[f]||"").toString())b+=" "+c+"="+f.inspect(true)});return b+">"},recursivelyCollect:function(a,b,c){a=$(a);c=c||-1;for(var f=[];a=a[b];){a.nodeType==
1&&f.push(Element.extend(a));if(f.length==c)break}return f},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 f=Element.ancestors(a);return Object.isNumber(b)?f[b]:Prototype.Selector.find(f,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 f={},h=Element._attributeTranslations.write;if(typeof b=="object")f=b;else f[b]=Object.isUndefined(c)?true:c;for(var n in f){b=h.names[n]||n;c=f[n];if(h.values[n])b=h.values[n](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 f in b)if(f=="opacity")a.setOpacity(b[f]);else c[f=="float"||f=="cssFloat"?Object.isUndefined(c.styleFloat)?"cssFloat":"styleFloat":f]=b[f];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 f=Element.viewportOffset(b),h=[0,0],n=null;a=$(a);if(Element.getStyle(a,"position")=="absolute"){n=Element.getOffsetParent(a);h=Element.viewportOffset(n)}if(n==document.body){h[0]-=document.body.offsetLeft;h[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=f[0]-h[0]+c.offsetLeft+"px";if(c.setTop)a.style.top=
f[1]-h[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 f=parseInt(a(b,c),10);if(f!==b["offset"+c.capitalize()])return f+"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(f,function(h,n){var j=a(b,n);return j===null?h:h-parseInt(j,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 f=a.style;if(b==1||b===""){(c=c.replace(/alpha\([^\)]*\)/gi,""))?f.filter=c:f.removeAttribute("filter");return a}else if(b<1.0E-5)b=0;f.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(f,h){return f.getAttribute(h)},_getAttr2:function(f,h){return f.getAttribute(h,2)},_getAttrNode:function(f,h){var n=f.getAttributeNode(h);
return n?n.value:""},_getEv:function(){var f=document.createElement("div"),h;f.onclick=Prototype.emptyFunction;f=f.getAttribute("onclick");if(String(f).indexOf("{")>-1)h=function(n,j){j=n.getAttribute(j);if(!j)return null;j=j.toString();j=j.split("{")[1];j=j.split("}")[0];return j.strip()};else if(f==="")h=function(n,j){j=n.getAttribute(j);if(!j)return null;return j.strip()};f=null;return h}(),_flag:function(f,h){return $(f).hasAttribute(h)?h:null},style:function(f){return f.style.cssText.toLowerCase()},
title:function(f){return f.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 f;if(Object.isNumber(b)){f=a.getElementsByTagName("*");for(var h=[],n=0,j;j=f[n];n++)j.tagName!=="!"&&h.push(j);f=h[b]}else f=Element.select(a,b)[c||0];return f}}()}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(f){}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,f=c.tagName.toUpperCase();if(Element._insertionTranslations.tags[f]){var h=a.next();f=Element._getContentFromAnonymousElement(f,b.stripScripts());c.removeChild(a);h?f.each(function(n){c.insertBefore(n,h)}):f.each(function(n){c.appendChild(n)})}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 f=new Element("div");a=Element._insertionTranslations.tags[a];var h=false;if(a)h=true;else if(c){h=true;a=["","",0]}if(h){f.innerHTML="&nbsp;"+a[0]+b+a[1];f.removeChild(f.firstChild);for(b=a[2];b--;)f=f.firstChild}else f.innerHTML=b;return $A(f.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(h,n){for(var j in n){var k=n[j];if(Object.isFunction(k)&&!(j in h))h[j]=k.methodize()}}var b=function(h){if(typeof window.Element!="undefined"){var n=window.Element.prototype;if(n){var j="_"+(Math.random()+"").slice(2);h=document.createElement(h);n[j]="x";h=h[j]!=="x";delete n[j];return h}}return false}("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(b)return function(h){if(h&&typeof h._extendedByPrototype=="undefined"){var n=h.tagName;if(n&&
/^(?:object|applet|embed)$/i.test(n)){a(h,Element.Methods);a(h,Element.Methods.Simulated);a(h,Element.Methods.ByTag[n.toUpperCase()])}}return h};return Prototype.K}var c={},f=Element.Methods.ByTag;b=Object.extend(function(h){if(!h||typeof h._extendedByPrototype!="undefined"||h.nodeType!=1||h==window)return h;var n=Object.clone(c),j=h.tagName.toUpperCase();f[j]&&Object.extend(n,f[j]);a(h,n);h._extendedByPrototype=Prototype.emptyFunction;return h},{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(o){o=o.toUpperCase();Element.Methods.ByTag[o]||(Element.Methods.ByTag[o]={});Object.extend(Element.Methods.ByTag[o],a)}function c(o,p,v){v=v||false;for(var F in o){var V=o[F];if(Object.isFunction(V))if(!v||!(F in p))p[F]=V.methodize()}}function f(o){var p,v={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(v[o])p="HTML"+v[o]+"Element";if(window[p])return window[p];p="HTML"+o+"Element";if(window[p])return window[p];p="HTML"+o.capitalize()+"Element";if(window[p])return window[p];o=document.createElement(o);return o.__proto__||o.constructor.prototype}
var h=Prototype.BrowserFeatures,n=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 j=a;a=arguments[1]}if(j)Object.isArray(j)?j.each(b):b(j);else Object.extend(Element.Methods,
a||{});j=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(h.ElementExtensions){c(Element.Methods,j);c(Element.Methods.Simulated,j,true)}if(h.SpecificElementExtensions)for(var k in Element.Methods.ByTag){h=f(k);Object.isUndefined(h)||c(n[k],h.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(f.WebKit&&!h.evaluate)return document;if(f.Opera&&window.parseFloat(window.opera.version())<9.5)return document.body;return document.documentElement}function c(k){n||(n=b());j[k]="client"+k;a["get"+k]=function(){return n[j[k]]};return a["get"+k]()}var f=Prototype.Browser,h=document,n,j={};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 f=a.get(b);if(Object.isUndefined(f)){a.set(b,c);f=c}return f}},
clone:function(a,b){if(a=$(a)){var c=a.cloneNode(b);c._prototypeUID=void 0;if(b)for(var f=Element.select(c,"*"),h=f.length;h--;)f[h]._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(j,k,o){var p=null;if(Object.isElement(j)){p=j;j=p.getStyle(k)}if(j===null)return null;if(/^(?:-)?\d+(\.\d+)?(px)?$/i.test(j))return window.parseFloat(j);var v=j.include("%"),F=o===document.viewport;if(/\d/.test(j)&&p&&p.runtimeStyle&&!(v&&F)){o=p.style.left;k=p.runtimeStyle.left;p.runtimeStyle.left=p.currentStyle.left;p.style.left=j||0;j=p.style.pixelLeft;p.style.left=o;p.runtimeStyle.left=k;return j}if(p&&v){o=o||p.parentNode;j=(j=j.match(/^(\d+)%?$/i))?Number(j[1])/100:null;
v=null;p.getStyle("position");p=k.include("left")||k.include("right")||k.include("width");k=k.include("top")||k.include("bottom")||k.include("height");if(o===document.viewport)if(p)v=document.viewport.getWidth();else{if(k)v=document.viewport.getHeight()}else if(p)v=$(o).measure("width");else if(k)v=$(o).measure("height");return v===null?0:v*j}return 0}function b(j){j=$(j);if(j.nodeType===Node.DOCUMENT_NODE||h(j)||j.nodeName.toUpperCase()==="BODY"||j.nodeName.toUpperCase()==="HTML")return $(document.body);
if(Element.getStyle(j,"display")!=="inline"&&j.offsetParent)return $(j.offsetParent);for(;(j=j.parentNode)&&j!==document.body;)if(Element.getStyle(j,"position")!=="static")return j.nodeName.toUpperCase()==="HTML"?$(document.body):$(j);return $(document.body)}function c(j){j=$(j);var k=0,o=0;if(j.parentNode){do{k+=j.offsetTop||0;o+=j.offsetLeft||0;j=j.offsetParent}while(j)}return new Element.Offset(o,k)}function f(j){j=$(j);var k=j.getLayout(),o=0,p=0;do{o+=j.offsetTop||0;p+=j.offsetLeft||0;if(j=j.offsetParent){if(j.nodeName.toUpperCase()===
"BODY")break;if(Element.getStyle(j,"position")!=="static")break}}while(j);p-=k.get("margin-top");o-=k.get("margin-left");return new Element.Offset(p,o)}function h(j){return j!==document.body&&!Element.descendantOf(j,document.body)}var n=Prototype.K;if("currentStyle"in document.documentElement)n=function(j){if(!j.currentStyle.hasLayout)j.style.zoom=1;return j};Element.Layout=Class.create(Hash,{initialize:function($super,k,o){$super();this.element=$(k);Element.Layout.PROPERTIES.each(function(p){this._set(p,
null)},this);if(o){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(j,k){return Hash.prototype.set.call(this,j,k)},set:function(){throw"Properties of Element.Layout are read-only.";},get:function($super,k){var o=$super(k);return o===null?this._compute(k):o},_begin:function(){if(!this._prepared){var j=this.element,k;a:{for(k=j;k&&k.parentNode;){if(k.getStyle("display")==="none"){k=false;break a}k=$(k.parentNode)}k=
true}if(!k){j.store("prototype_original_styles",{position:j.style.position||"",width:j.style.width||"",visibility:j.style.visibility||"",display:j.style.display||""});k=j.getStyle("position");var o=j.getStyle("width");if(o==="0px"||o===null){j.style.display="block";o=j.getStyle("width")}var p=k==="fixed"?document.viewport:j.parentNode;j.setStyle({position:"absolute",visibility:"hidden",display:"block"});var v=j.getStyle("width");k=o&&v===o?a(j,"width",p):k==="absolute"||k==="fixed"?a(j,"width",p):
$(j.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");j.setStyle({width:k+"px"})}this._prepared=true}},_end:function(){var j=this.element,k=j.retrieve("prototype_original_styles");j.store("prototype_original_styles",null);j.setStyle(k);this._prepared=false},_compute:function(j){var k=Element.Layout.COMPUTATIONS;if(!(j in k))throw"Property not found.";return this._set(j,
k[j].call(this,this.element))},toObject:function(){var j=$A(arguments),k={};(j.length===0?Element.Layout.PROPERTIES:j.join(" ").split(" ")).each(function(o){if(Element.Layout.PROPERTIES.include(o)){var p=this.get(o);if(p!=null)k[o]=p}},this);return k},toHash:function(){var j=this.toObject.apply(this,arguments);return new Hash(j)},toCSS:function(){var j=$A(arguments),k={};(j.length===0?Element.Layout.PROPERTIES:j.join(" ").split(" ")).each(function(o){if(Element.Layout.PROPERTIES.include(o))if(!Element.Layout.COMPOSITE_PROPERTIES.include(o)){var p=
this.get(o);if(p!=null){if(o.include("border"))o+="-width";o=o.camelize();k[o]=p+"px"}}},this);return k},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 j=this.get("border-box-height");if(j<=0){this._preComputing||this._end();return 0}var k=this.get("border-top"),o=this.get("border-bottom"),p=this.get("padding-top"),v=this.get("padding-bottom");this._preComputing||this._end();return j-k-o-p-v},width:function(){this._preComputing||this._begin();var j=this.get("border-box-width");if(j<=0){this._preComputing||this._end();return 0}var k=this.get("border-left"),o=this.get("border-right"),
p=this.get("padding-left"),v=this.get("padding-right");this._preComputing||this._end();return j-k-o-p-v},"padding-box-height":function(){var j=this.get("height"),k=this.get("padding-top"),o=this.get("padding-bottom");return j+k+o},"padding-box-width":function(){var j=this.get("width"),k=this.get("padding-left"),o=this.get("padding-right");return j+k+o},"border-box-height":function(j){this._preComputing||this._begin();j=j.offsetHeight;this._preComputing||this._end();return j},"border-box-width":function(j){this._preComputing||
this._begin();j=j.offsetWidth;this._preComputing||this._end();return j},"margin-box-height":function(){var j=this.get("border-box-height"),k=this.get("margin-top"),o=this.get("margin-bottom");if(j<=0)return 0;return j+k+o},"margin-box-width":function(){var j=this.get("border-box-width"),k=this.get("margin-left"),o=this.get("margin-right");if(j<=0)return 0;return j+k+o},top:function(j){return j.positionedOffset().top},bottom:function(j){var k=j.positionedOffset();j=j.getOffsetParent().measure("height");
var o=this.get("border-box-height");return j-o-k.top},left:function(j){return j.positionedOffset().left},right:function(j){var k=j.positionedOffset();j=j.getOffsetParent().measure("width");var o=this.get("border-box-width");return j-o-k.left},"padding-top":function(j){return a(j,"paddingTop")},"padding-bottom":function(j){return a(j,"paddingBottom")},"padding-left":function(j){return a(j,"paddingLeft")},"padding-right":function(j){return a(j,"paddingRight")},"border-top":function(j){return a(j,"borderTopWidth")},
"border-bottom":function(j){return a(j,"borderBottomWidth")},"border-left":function(j){return a(j,"borderLeftWidth")},"border-right":function(j){return a(j,"borderRightWidth")},"margin-top":function(j){return a(j,"marginTop")},"margin-bottom":function(j){return a(j,"marginBottom")},"margin-left":function(j){return a(j,"marginLeft")},"margin-right":function(j){return a(j,"marginRight")}}});"getBoundingClientRect"in document.documentElement&&Object.extend(Element.Layout.COMPUTATIONS,{right:function(j){var k=
n(j.getOffsetParent());j=j.getBoundingClientRect();return(k.getBoundingClientRect().right-j.right).round()},bottom:function(j){var k=n(j.getOffsetParent());j=j.getBoundingClientRect();return(k.getBoundingClientRect().bottom-j.bottom).round()}});Element.Offset=Class.create({initialize:function(j,k){this.left=j.round();this.top=k.round();this[0]=this.left;this[1]=this.top},relativeTo:function(j){return new Element.Offset(this.left-j.left,this.top-j.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(j,k){k=$(k);if(k.nodeType===Node.DOCUMENT_NODE||h(k)||k.nodeName.toUpperCase()==="BODY"||k.nodeName.toUpperCase()==="HTML")return $(document.body);var o=k.getStyle("position");if(o!=="static")return j(k);k.setStyle({position:"relative"});var p=j(k);k.setStyle({position:o});return p});f=f.wrap(function(j,k){k=$(k);if(!k.parentNode)return new Element.Offset(0,
0);var o=k.getStyle("position");if(o!=="static")return j(k);var p=k.getOffsetParent();p&&p.getStyle("position")==="fixed"&&n(p);k.setStyle({position:"relative"});p=j(k);k.setStyle({position:o});return p})}else if(Prototype.Browser.Webkit)c=function(j){j=$(j);var k=0,o=0;do{k+=j.offsetTop||0;o+=j.offsetLeft||0;if(j.offsetParent==document.body)if(Element.getStyle(j,"position")=="absolute")break;j=j.offsetParent}while(j);return new Element.Offset(o,k)};Element.addMethods({getLayout:function(j,k){return new Element.Layout(j,
k)},measure:function(j,k){return $(j).getLayout().get(k)},getDimensions:function(j){j=$(j);var k=Element.getStyle(j,"display");if(k&&k!=="none")return{width:j.offsetWidth,height:j.offsetHeight};k=j.style;k={visibility:k.visibility,position:k.position,display:k.display};var o={visibility:"hidden",display:"block"};if(k.position!=="fixed")o.position="absolute";Element.setStyle(j,o);o={width:j.offsetWidth,height:j.offsetHeight};Element.setStyle(j,k);return o},getOffsetParent:b,cumulativeOffset:c,positionedOffset:f,
cumulativeScrollOffset:function(j){var k=0,o=0;do{k+=j.scrollTop||0;o+=j.scrollLeft||0;j=j.parentNode}while(j);return new Element.Offset(o,k)},viewportOffset:function(j){$(v);var k=0,o=0,p=document.body,v=j;do{k+=v.offsetTop||0;o+=v.offsetLeft||0;if(v.offsetParent==p&&Element.getStyle(v,"position")=="absolute")break}while(v=v.offsetParent);v=j;do if(v!=p){k-=v.scrollTop||0;o-=v.scrollLeft||0}while(v=v.parentNode);return new Element.Offset(o,k)},absolutize:function(j){j=$(j);if(Element.getStyle(j,
"position")==="absolute")return j;var k=b(j),o=j.viewportOffset();k=k.viewportOffset();o=o.relativeTo(k);k=j.getLayout();j.store("prototype_absolutize_original_styles",{left:j.getStyle("left"),top:j.getStyle("top"),width:j.getStyle("width"),height:j.getStyle("height")});j.setStyle({position:"absolute",top:o.top+"px",left:o.left+"px",width:k.get("width")+"px",height:k.get("height")+"px"});return j},relativize:function(j){j=$(j);if(Element.getStyle(j,"position")==="relative")return j;var k=j.retrieve("prototype_absolutize_original_styles");
k&&j.setStyle(k);return j}});"getBoundingClientRect"in document.documentElement&&Element.addMethods({viewportOffset:function(j){j=$(j);if(h(j))return new Element.Offset(0,0);j=j.getBoundingClientRect();var k=document.documentElement;return new Element.Offset(j.left-k.clientLeft,j.top-k.clientTop)}})})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};
Prototype.Selector=function(){function a(c){for(var f=0,h=c.length;f<h;f++)Element.extend(c[f]);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,f,h){h=h||0;var n=Prototype.Selector.match,j=c.length,k=0,o;for(o=0;o<j;o++)if(n(c[o],f)&&h==k++)return Element.extend(c[o])},extendElements:Element.extend===b?b:a,extendElement:Element.extend}}();
Prototype._original_property=window.Sizzle;
(function(){function a(u,C,H,E,N,M){N=u=="previousSibling"&&!M;for(var y=0,T=E.length;y<T;y++){var Q=E[y];if(Q){if(N&&Q.nodeType===1){Q.sizcache=H;Q.sizset=y}Q=Q[u];for(var ja=false;Q;){if(Q.sizcache===H){ja=E[Q.sizset];break}if(Q.nodeType===1&&!M){Q.sizcache=H;Q.sizset=y}if(Q.nodeName===C){ja=Q;break}Q=Q[u]}E[y]=ja}}}function b(u,C,H,E,N,M){N=u=="previousSibling"&&!M;for(var y=0,T=E.length;y<T;y++){var Q=E[y];if(Q){if(N&&Q.nodeType===1){Q.sizcache=H;Q.sizset=y}Q=Q[u];for(var ja=false;Q;){if(Q.sizcache===
H){ja=E[Q.sizset];break}if(Q.nodeType===1){if(!M){Q.sizcache=H;Q.sizset=y}if(typeof C!=="string"){if(Q===C){ja=true;break}}else if(k.filter(C,[Q]).length>0){ja=Q;break}}Q=Q[u]}E[y]=ja}}}var c=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,f=0,h=Object.prototype.toString,n=false,j=true;[0,0].sort(function(){j=false;return 0});var k=function(u,C,H,E){H=H||[];var N=C=C||document;if(C.nodeType!==1&&C.nodeType!==9)return[];
if(!u||typeof u!=="string")return H;for(var M=[],y,T,Q,ja,R=true,wa=ya(C),pa=u;(c.exec(""),y=c.exec(pa))!==null;){pa=y[3];M.push(y[1]);if(y[2]){ja=y[3];break}}if(M.length>1&&p.exec(u))if(M.length===2&&o.relative[M[0]])T=Ba(M[0]+M[1],C);else for(T=o.relative[M[0]]?[C]:k(M.shift(),C);M.length;){u=M.shift();if(o.relative[u])u+=M.shift();T=Ba(u,T)}else{if(!E&&M.length>1&&C.nodeType===9&&!wa&&o.match.ID.test(M[0])&&!o.match.ID.test(M[M.length-1])){y=k.find(M.shift(),C,wa);C=y.expr?k.filter(y.expr,y.set)[0]:
y.set[0]}if(C){y=E?{expr:M.pop(),set:F(E)}:k.find(M.pop(),M.length===1&&(M[0]==="~"||M[0]==="+")&&C.parentNode?C.parentNode:C,wa);T=y.expr?k.filter(y.expr,y.set):y.set;if(M.length>0)Q=F(T);else R=false;for(;M.length;){var g=M.pop();y=g;if(o.relative[g])y=M.pop();else g="";if(y==null)y=C;o.relative[g](Q,y,wa)}}else Q=[]}Q||(Q=T);if(!Q)throw"Syntax error, unrecognized expression: "+(g||u);if(h.call(Q)==="[object Array]")if(R)if(C&&C.nodeType===1)for(u=0;Q[u]!=null;u++){if(Q[u]&&(Q[u]===true||Q[u].nodeType===
1&&sa(C,Q[u])))H.push(T[u])}else for(u=0;Q[u]!=null;u++)Q[u]&&Q[u].nodeType===1&&H.push(T[u]);else H.push.apply(H,Q);else F(Q,H);if(ja){k(ja,N,H,E);k.uniqueSort(H)}return H};k.uniqueSort=function(u){if(da){n=j;u.sort(da);if(n)for(var C=1;C<u.length;C++)u[C]===u[C-1]&&u.splice(C--,1)}return u};k.matches=function(u,C){return k(u,null,null,C)};k.find=function(u,C,H){var E,N;if(!u)return[];for(var M=0,y=o.order.length;M<y;M++){var T=o.order[M];if(N=o.leftMatch[T].exec(u)){var Q=N[1];N.splice(1,1);if(Q.substr(Q.length-
1)!=="\\"){N[1]=(N[1]||"").replace(/\\/g,"");E=o.find[T](N,C,H);if(E!=null){u=u.replace(o.match[T],"");break}}}}E||(E=C.getElementsByTagName("*"));return{set:E,expr:u}};k.filter=function(u,C,H,E){for(var N=u,M=[],y=C,T,Q,ja=C&&C[0]&&ya(C[0]);u&&C.length;){for(var R in o.filter)if((T=o.match[R].exec(u))!=null){var wa=o.filter[R],pa,g;Q=false;if(y==M)M=[];if(o.preFilter[R])if(T=o.preFilter[R](T,y,H,M,E,ja)){if(T===true)continue}else Q=pa=true;if(T)for(var Da=0;(g=y[Da])!=null;Da++)if(g){pa=wa(g,T,Da,
y);var Ja=E^!!pa;if(H&&pa!=null)if(Ja)Q=true;else y[Da]=false;else if(Ja){M.push(g);Q=true}}if(pa!==undefined){H||(y=M);u=u.replace(o.match[R],"");if(!Q)return[];break}}if(u==N)if(Q==null)throw"Syntax error, unrecognized expression: "+u;else break;N=u}return y};var o=k.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(u){return u.getAttribute("href")}},relative:{"+":function(u,C,H){var E=typeof C==="string",N=E&&!/\W/.test(C);E=E&&!N;if(N&&!H)C=C.toUpperCase();H=0;N=u.length;
for(var M;H<N;H++)if(M=u[H]){for(;(M=M.previousSibling)&&M.nodeType!==1;);u[H]=E||M&&M.nodeName===C?M||false:M===C}E&&k.filter(C,u,true)},">":function(u,C,H){var E=typeof C==="string";if(E&&!/\W/.test(C)){C=H?C:C.toUpperCase();H=0;for(var N=u.length;H<N;H++){var M=u[H];if(M){E=M.parentNode;u[H]=E.nodeName===C?E:false}}}else{H=0;for(N=u.length;H<N;H++)if(M=u[H])u[H]=E?M.parentNode:M.parentNode===C;E&&k.filter(C,u,true)}},"":function(u,C,H){var E=f++,N=b;if(!/\W/.test(C)){var M=C=H?C:C.toUpperCase();
N=a}N("parentNode",C,E,u,M,H)},"~":function(u,C,H){var E=f++,N=b;if(typeof C==="string"&&!/\W/.test(C)){var M=C=H?C:C.toUpperCase();N=a}N("previousSibling",C,E,u,M,H)}},find:{ID:function(u,C,H){if(typeof C.getElementById!=="undefined"&&!H)return(u=C.getElementById(u[1]))?[u]:[]},NAME:function(u,C){if(typeof C.getElementsByName!=="undefined"){for(var H=[],E=C.getElementsByName(u[1]),N=0,M=E.length;N<M;N++)E[N].getAttribute("name")===u[1]&&H.push(E[N]);return H.length===0?null:H}},TAG:function(u,C){return C.getElementsByTagName(u[1])}},
preFilter:{CLASS:function(u,C,H,E,N,M){u=" "+u[1].replace(/\\/g,"")+" ";if(M)return u;M=0;for(var y;(y=C[M])!=null;M++)if(y)if(N^(y.className&&(" "+y.className+" ").indexOf(u)>=0))H||E.push(y);else if(H)C[M]=false;return false},ID:function(u){return u[1].replace(/\\/g,"")},TAG:function(u,C){for(var H=0;C[H]===false;H++);return C[H]&&ya(C[H])?u[1]:u[1].toUpperCase()},CHILD:function(u){if(u[1]=="nth"){var C=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(u[2]=="even"&&"2n"||u[2]=="odd"&&"2n+1"||!/\D/.test(u[2])&&"0n+"+
u[2]||u[2]);u[2]=C[1]+(C[2]||1)-0;u[3]=C[3]-0}u[0]=f++;return u},ATTR:function(u,C,H,E,N,M){C=u[1].replace(/\\/g,"");if(!M&&o.attrMap[C])u[1]=o.attrMap[C];if(u[2]==="~=")u[4]=" "+u[4]+" ";return u},PSEUDO:function(u,C,H,E,N){if(u[1]==="not")if((c.exec(u[3])||"").length>1||/^\w/.test(u[3]))u[3]=k(u[3],null,null,C);else{u=k.filter(u[3],C,H,true^N);H||E.push.apply(E,u);return false}else if(o.match.POS.test(u[0])||o.match.CHILD.test(u[0]))return true;return u},POS:function(u){u.unshift(true);return u}},
filters:{enabled:function(u){return u.disabled===false&&u.type!=="hidden"},disabled:function(u){return u.disabled===true},checked:function(u){return u.checked===true},selected:function(u){return u.selected===true},parent:function(u){return!!u.firstChild},empty:function(u){return!u.firstChild},has:function(u,C,H){return!!k(H[3],u).length},header:function(u){return/h\d/i.test(u.nodeName)},text:function(u){return"text"===u.type},radio:function(u){return"radio"===u.type},checkbox:function(u){return"checkbox"===
u.type},file:function(u){return"file"===u.type},password:function(u){return"password"===u.type},submit:function(u){return"submit"===u.type},image:function(u){return"image"===u.type},reset:function(u){return"reset"===u.type},button:function(u){return"button"===u.type||u.nodeName.toUpperCase()==="BUTTON"},input:function(u){return/input|select|textarea|button/i.test(u.nodeName)}},setFilters:{first:function(u,C){return C===0},last:function(u,C,H,E){return C===E.length-1},even:function(u,C){return C%2===
0},odd:function(u,C){return C%2===1},lt:function(u,C,H){return C<H[3]-0},gt:function(u,C,H){return C>H[3]-0},nth:function(u,C,H){return H[3]-0==C},eq:function(u,C,H){return H[3]-0==C}},filter:{PSEUDO:function(u,C,H,E){var N=C[1],M=o.filters[N];if(M)return M(u,H,C,E);else if(N==="contains")return(u.textContent||u.innerText||"").indexOf(C[3])>=0;else if(N==="not"){C=C[3];H=0;for(E=C.length;H<E;H++)if(C[H]===u)return false;return true}},CHILD:function(u,C){var H=C[1],E=u;switch(H){case "only":case "first":for(;E=
E.previousSibling;)if(E.nodeType===1)return false;if(H=="first")return true;E=u;case "last":for(;E=E.nextSibling;)if(E.nodeType===1)return false;return true;case "nth":H=C[2];var N=C[3];if(H==1&&N==0)return true;var M=C[0],y=u.parentNode;if(y&&(y.sizcache!==M||!u.nodeIndex)){var T=0;for(E=y.firstChild;E;E=E.nextSibling)if(E.nodeType===1)E.nodeIndex=++T;y.sizcache=M}E=u.nodeIndex-N;return H==0?E==0:E%H==0&&E/H>=0}},ID:function(u,C){return u.nodeType===1&&u.getAttribute("id")===C},TAG:function(u,C){return C===
"*"&&u.nodeType===1||u.nodeName===C},CLASS:function(u,C){return(" "+(u.className||u.getAttribute("class"))+" ").indexOf(C)>-1},ATTR:function(u,C){var H=C[1];H=o.attrHandle[H]?o.attrHandle[H](u):u[H]!=null?u[H]:u.getAttribute(H);var E=H+"",N=C[2],M=C[4];return H==null?N==="!=":N==="="?E===M:N==="*="?E.indexOf(M)>=0:N==="~="?(" "+E+" ").indexOf(M)>=0:!M?E&&H!==false:N==="!="?E!=M:N==="^="?E.indexOf(M)===0:N==="$="?E.substr(E.length-M.length)===M:N==="|="?E===M||E.substr(0,M.length+1)===M+"-":false},
POS:function(u,C,H,E){var N=o.setFilters[C[2]];if(N)return N(u,H,C,E)}}},p=o.match.POS,v;for(v in o.match){o.match[v]=RegExp(o.match[v].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[v]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[v].source)}var F=function(u,C){u=Array.prototype.slice.call(u,0);if(C){C.push.apply(C,u);return C}return u};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(V){F=function(u,C){var H=C||[];if(h.call(u)==="[object Array]")Array.prototype.push.apply(H,
u);else if(typeof u.length==="number")for(var E=0,N=u.length;E<N;E++)H.push(u[E]);else for(E=0;u[E];E++)H.push(u[E]);return H}}var da;if(document.documentElement.compareDocumentPosition)da=function(u,C){if(!u.compareDocumentPosition||!C.compareDocumentPosition){if(u==C)n=true;return 0}var H=u.compareDocumentPosition(C)&4?-1:u===C?0:1;if(H===0)n=true;return H};else if("sourceIndex"in document.documentElement)da=function(u,C){if(!u.sourceIndex||!C.sourceIndex){if(u==C)n=true;return 0}var H=u.sourceIndex-
C.sourceIndex;if(H===0)n=true;return H};else if(document.createRange)da=function(u,C){if(!u.ownerDocument||!C.ownerDocument){if(u==C)n=true;return 0}var H=u.ownerDocument.createRange(),E=C.ownerDocument.createRange();H.setStart(u,0);H.setEnd(u,0);E.setStart(C,0);E.setEnd(C,0);H=H.compareBoundaryPoints(Range.START_TO_END,E);if(H===0)n=true;return H};(function(){var u=document.createElement("div"),C="script"+(new Date).getTime();u.innerHTML="<a name='"+C+"'/>";var H=document.documentElement;H.insertBefore(u,
H.firstChild);if(document.getElementById(C)){o.find.ID=function(E,N,M){if(typeof N.getElementById!=="undefined"&&!M)return(N=N.getElementById(E[1]))?N.id===E[1]||typeof N.getAttributeNode!=="undefined"&&N.getAttributeNode("id").nodeValue===E[1]?[N]:undefined:[]};o.filter.ID=function(E,N){var M=typeof E.getAttributeNode!=="undefined"&&E.getAttributeNode("id");return E.nodeType===1&&M&&M.nodeValue===N}}H.removeChild(u);H=u=null})();(function(){var u=document.createElement("div");u.appendChild(document.createComment(""));
if(u.getElementsByTagName("*").length>0)o.find.TAG=function(C,H){var E=H.getElementsByTagName(C[1]);if(C[1]==="*"){for(var N=[],M=0;E[M];M++)E[M].nodeType===1&&N.push(E[M]);E=N}return E};u.innerHTML="<a href='#'></a>";if(u.firstChild&&typeof u.firstChild.getAttribute!=="undefined"&&u.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(C){return C.getAttribute("href",2)};u=null})();document.querySelectorAll&&function(){var u=k,C=document.createElement("div");C.innerHTML="<p class='TEST'></p>";
if(!(C.querySelectorAll&&C.querySelectorAll(".TEST").length===0)){k=function(E,N,M,y){N=N||document;if(!y&&N.nodeType===9&&!ya(N))try{return F(N.querySelectorAll(E),M)}catch(T){}return u(E,N,M,y)};for(var H in u)k[H]=u[H];C=null}}();document.getElementsByClassName&&document.documentElement.getElementsByClassName&&function(){var u=document.createElement("div");u.innerHTML="<div class='test e'></div><div class='test'></div>";if(u.getElementsByClassName("e").length!==0){u.lastChild.className="e";if(u.getElementsByClassName("e").length!==
1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(C,H,E){if(typeof H.getElementsByClassName!=="undefined"&&!E)return H.getElementsByClassName(C[1])};u=null}}}();var sa=document.compareDocumentPosition?function(u,C){return u.compareDocumentPosition(C)&16}:function(u,C){return u!==C&&(u.contains?u.contains(C):true)},ya=function(u){return u.nodeType===9&&u.documentElement.nodeName!=="HTML"||!!u.ownerDocument&&u.ownerDocument.documentElement.nodeName!=="HTML"},Ba=function(u,C){for(var H=[],E="",N,
M=C.nodeType?[C]:C;N=o.match.PSEUDO.exec(u);){E+=N[0];u=u.replace(o.match.PSEUDO,"")}u=o.relative[u]?u+"*":u;N=0;for(var y=M.length;N<y;N++)k(u,M[N],H);return k.filter(E,H)};window.Sizzle=k})();(function(a){var b=Prototype.Selector.extendElements;Prototype.Selector.engine=a;Prototype.Selector.select=function(c,f){return b(a(c,f||document))};Prototype.Selector.match=function(c,f){return a.matches(f,[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,f,h=false,n=b.submit,j,k;if(b.hash){k={};j=function(o,p,v){if(p in o){Object.isArray(o[p])||(o[p]=[o[p]]);o[p].push(v)}else o[p]=v;return o}}else{k="";j=function(o,p,v){return o+(o?"&":"")+encodeURIComponent(p)+"="+encodeURIComponent(v)}}return a.inject(k,function(o,p){if(!p.disabled&&p.name){c=p.name;f=$(p).getValue();if(f!=
null&&p.type!="file"&&(p.type!="submit"||!h&&n!==false&&(!n||c==n)&&(h=true)))o=j(o,c,f)}return o})}};
Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(a){a=$(a).getElementsByTagName("*");for(var b,c=[],f=Form.Element.Serializers,h=0;b=a[h];h++)c.push(b);return c.inject([],function(n,j){f[j.tagName.toLowerCase()]&&n.push(Element.extend(j));return n})},getInputs:function(a,b,c){a=$(a);a=a.getElementsByTagName("input");if(!b&&!c)return $A(a).map(Element.extend);for(var f=0,h=[],n=a.length;f<n;f++){var j=a[f];b&&j.type!=b||c&&j.name!=c||
h.push(Element.extend(j))}return h},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(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,f=a.readAttribute("action")||"";if(f.blank())f=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(f,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(n,j){if(Object.isUndefined(j))return n.checked?n.value:null;else n.checked=!!j}function b(n,j){if(Object.isUndefined(j))return n.value;else n.value=j}function c(n){var j=n.selectedIndex;return j>=0?h(n.options[j]):null}function f(n){var j,k=n.length;if(!k)return null;var o=0;for(j=[];o<k;o++){var p=n.options[o];p.selected&&j.push(h(p))}return j}function h(n){return Element.hasAttribute(n,"value")?n.value:n.text}return{input:function(n,j){switch(n.type.toLowerCase()){case "checkbox":case "radio":return a(n,
j);default:return b(n,j)}},inputSelector:a,textarea:b,select:function(n,j){if(Object.isUndefined(j))return(n.type==="select-one"?c:f)(n);for(var k,o,p=!Object.isArray(j),v=0,F=n.length;v<F;v++){k=n.options[v];o=this.optionValue(k);if(p){if(o==j){k.selected=true;break}}else k.selected=j.include(o)}},selectOne:c,selectMany:f,optionValue:h,button:b}}();
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,f){$super(f,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(y,T){return y.which?y.which===T+1:y.button===T}function b(y,T){return y.button===Ba[T]}function c(y,T){switch(T){case 0:return y.which==1&&!y.metaKey;case 1:return y.which==2||y.which==1&&y.metaKey;case 2:return y.which==3;default:return false}}function f(y){var T=document.documentElement,Q=document.body||{scrollLeft:0};return y.pageX||y.clientX+(T.scrollLeft||Q.scrollLeft)-(T.clientLeft||0)}function h(y){var T=document.documentElement,Q=document.body||{scrollTop:0};return y.pageY||
y.clientY+(T.scrollTop||Q.scrollTop)-(T.clientTop||0)}function n(y,T,Q){var ja=Element.retrieve(y,"prototype_event_registry");if(Object.isUndefined(ja)){E.push(y);ja=Element.retrieve(y,"prototype_event_registry",$H())}var R=ja.get(T);if(Object.isUndefined(R)){R=[];ja.set(T,R)}if(R.pluck("handler").include(Q))return false;var wa;if(T.include(":"))wa=function(pa){if(Object.isUndefined(pa.eventName))return false;if(pa.eventName!==T)return false;F.extend(pa,y);Q.call(y,pa)};else if(!da&&(T==="mouseenter"||
T==="mouseleave")){if(T==="mouseenter"||T==="mouseleave")wa=function(pa){F.extend(pa,y);for(var g=pa.relatedTarget;g&&g!==y;)try{g=g.parentNode}catch(Da){g=y}g!==y&&Q.call(y,pa)}}else wa=function(pa){F.extend(pa,y);Q.call(y,pa)};wa.handler=Q;R.push(wa);return wa}function j(){for(var y=0,T=E.length;y<T;y++){F.stopObserving(E[y]);E[y]=null}}function k(y,T,Q){y=$(y);Q=n(y,T,Q);if(!Q)return y;if(T.include(":"))if(y.addEventListener)y.addEventListener("dataavailable",Q,false);else{y.attachEvent("ondataavailable",
Q);y.attachEvent("onlosecapture",Q)}else{T=N(T);y.addEventListener?y.addEventListener(T,Q,false):y.attachEvent("on"+T,Q)}return y}function o(y,T,Q){y=$(y);var ja=Element.retrieve(y,"prototype_event_registry");if(!ja)return y;if(!T){ja.each(function(g){o(y,g.key)});return y}var R=ja.get(T);if(!R)return y;if(!Q){R.each(function(g){o(y,T,g.handler)});return y}for(var wa=R.length,pa;wa--;)if(R[wa].handler===Q){pa=R[wa];break}if(!pa)return y;if(T.include(":"))if(y.removeEventListener)y.removeEventListener("dataavailable",
pa,false);else{y.detachEvent("ondataavailable",pa);y.detachEvent("onlosecapture",pa)}else{Q=N(T);y.removeEventListener?y.removeEventListener(Q,pa,false):y.detachEvent("on"+Q,pa)}ja.set(T,R.without(pa));return y}function p(y,T,Q,ja){y=$(y);if(Object.isUndefined(ja))ja=true;if(y==document&&document.createEvent&&!y.dispatchEvent)y=document.documentElement;var R;if(document.createEvent){R=document.createEvent("HTMLEvents");R.initEvent("dataavailable",ja,true)}else{R=document.createEventObject();R.eventType=
ja?"ondataavailable":"onlosecapture"}R.eventName=T;R.memo=Q||{};document.createEvent?y.dispatchEvent(R):y.fireEvent(R.eventType,R);return F.extend(R)}function v(y,T,Q,ja){y=$(y);if(Object.isFunction(Q)&&Object.isUndefined(ja)){ja=Q;Q=null}return(new F.Handler(y,T,Q,ja)).start()}var F={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:{}},V=document.documentElement,
da="onmouseenter"in V&&"onmouseleave"in V,sa=function(){return false};if(window.attachEvent)sa=window.addEventListener?function(y){return!(y instanceof window.Event)}:function(){return true};var ya,Ba={0:1,1:4,2:2};ya=window.attachEvent?window.addEventListener?function(y,T){return sa(y)?b(y,T):a(y,T)}:b:Prototype.Browser.WebKit?c:a;F.Methods={isLeftClick:function(y){return ya(y,0)},isMiddleClick:function(y){return ya(y,1)},isRightClick:function(y){return ya(y,2)},element:function(y){y=F.extend(y);
var T=y.target,Q=y.type;if((y=y.currentTarget)&&y.tagName)if(Q==="load"||Q==="error"||Q==="click"&&y.tagName.toLowerCase()==="input"&&y.type==="radio")T=y;if(T.nodeType==Node.TEXT_NODE)T=T.parentNode;return Element.extend(T)},findElement:function(y,T){var Q=F.element(y);if(!T)return Q;for(;Q;){if(Object.isElement(Q)&&Prototype.Selector.match(Q,T))return Element.extend(Q);Q=Q.parentNode}},pointer:function(y){return{x:f(y),y:h(y)}},pointerX:f,pointerY:h,stop:function(y){F.extend(y);y.preventDefault();
y.stopPropagation();y.stopped=true}};var u=Object.keys(F.Methods).inject({},function(y,T){y[T]=F.Methods[T].methodize();return y});if(window.attachEvent){var C=function(y){switch(y.type){case "mouseover":case "mouseenter":y=y.fromElement;break;case "mouseout":case "mouseleave":y=y.toElement;break;default:return null}return Element.extend(y)},H={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};F.extend=
function(y,T){if(!y)return false;if(!sa(y))return y;if(y._extendedByPrototype)return y;y._extendedByPrototype=Prototype.emptyFunction;var Q=F.pointer(y);Object.extend(y,{target:y.srcElement||T,relatedTarget:C(y),pageX:Q.x,pageY:Q.y});Object.extend(y,u);Object.extend(y,H);return y}}else F.extend=Prototype.K;if(window.addEventListener){F.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(F.prototype,u)}var E=[];Prototype.Browser.IE&&window.attachEvent("onunload",
j);Prototype.Browser.WebKit&&window.addEventListener("unload",Prototype.emptyFunction,false);var N=Prototype.K,M={mouseenter:"mouseover",mouseleave:"mouseout"};da||(N=function(y){return M[y]||y});F.Handler=Class.create({initialize:function(y,T,Q,ja){this.element=$(y);this.eventName=T;this.selector=Q;this.callback=ja;this.handler=this.handleEvent.bind(this)},start:function(){F.observe(this.element,this.eventName,this.handler);return this},stop:function(){F.stopObserving(this.element,this.eventName,
this.handler);return this},handleEvent:function(y){var T=F.findElement(y,this.selector);T&&this.callback.call(this.element,y,T)}});Object.extend(F,F.Methods);Object.extend(F,{fire:p,observe:k,stopObserving:o,on:v});Element.addMethods({fire:p,observe:k,stopObserving:o,on:v});Object.extend(document,{fire:p.methodize(),observe:k.methodize(),stopObserving:o.methodize(),on:v.methodize(),loaded:false});if(window.Event)Object.extend(window.Event,F);else window.Event=F})();
(function(){function a(){if(!document.loaded){f&&window.clearTimeout(f);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(h){f=c.defer();return}a()}var f;if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);else{document.observe("readystatechange",b);if(window==top)f=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 f=Element.cumulativeScrollOffset(a);this.xcomp=b+f[0]-this.deltaX;this.ycomp=c+f[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,f){f=f.toString().strip();var h=/\s/.test(f)?$w(f).map(b).join(""):b(f);return h?document._getElementsByXPath(".//*"+h,c):[]}:function(c,f){f=f.toString().strip();var h=[],n=/\s/.test(f)?$w(f):null;if(!n&&!f)return h;var j=$(c).getElementsByTagName("*");f=" "+f+" ";for(var k=
0,o,p;o=j[k];k++)if(o.className&&(p=" "+o.className+" ")&&(p.include(f)||n&&n.all(function(v){return!v.toString().blank()&&p.include(" "+v+" ")})))h.push(Element.extend(o));return h};return function(c,f){return $(f||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,f=[],h=0,n=a.length;h<n;h++){var j=a[h];c(j,b)&&f.push(Element.extend(j))}return f},
findElement:function(a,b,c){c=c||0;for(var f=0,h,n=0,j=a.length;n<j;n++){h=a[n];if(Prototype.Selector.match(h,b)&&c===f++)return Element.extend(h)}},findChildElements:function(a,b){var c=b.toArray().join(", ");return Prototype.Selector.select(c,a||document)}})})();
String.prototype.parseColor=function(a){var b="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(","),f=0;do b+=parseInt(c[f]).toColorPart();while(++f<3)}else if(this.slice(0,1)=="#"){if(this.length==4)for(f=1;f<4;f++)b+=(this.charAt(f)+this.charAt(f)).toLowerCase();if(this.length==7)b=this.toLowerCase()}return b.length==7?b:a||this};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return b.nodeType==3?b.nodeValue:b.hasChildNodes()?Element.collectTextNodes(b):""}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return c.nodeType==3?c.nodeValue:c.hasChildNodes()&&!Element.hasClassName(c,b)?Element.collectTextNodesIgnoreClass(c,b):""}).flatten().join("")};
Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:b/100+"em"});Prototype.Browser.WebKit&&window.scrollBy(0,0);return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var b=document.createTextNode(" ");a.appendChild(b);a.removeChild(b)}catch(c){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return-Math.cos(a*Math.PI)/2+0.5},reverse:function(a){return 1-a},flicker:function(a){a=-Math.cos(a*Math.PI)/4+0.75+Math.random()/4;return a>1?1:a},wobble:function(a){return-Math.cos(a*Math.PI*9*a)/2+0.5},pulse:function(a,b){return-Math.cos(a*((b||5)-0.5)*2*Math.PI)/2+0.5},spring:function(a){return 1-
Math.cos(a*4.5*Math.PI)*Math.exp(-a*6)},none:function(){return 0},full:function(){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE)b+=";zoom:1";a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(f){a.insertBefore((new Element("span",{style:b})).update(f==" "?String.fromCharCode(160):f),c)});Element.remove(c)}})},multiple:function(a,b,c){a=
(typeof a=="object"||Object.isFunction(a))&&a.length?a:$(a).childNodes;var f=Object.extend({speed:0.1,delay:0},c||{}),h=f.delay;$A(a).each(function(n,j){new b(n,Object.extend(f,{delay:j*f.speed+h}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(a,b,c){a=$(a);b=(b||"appear").toLowerCase();return Effect[Effect.PAIRS[b][a.visible()?1:0]](a,Object.extend({queue:{position:"end",scope:a.id||"global",limit:1}},c||{}))}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=(new Date).getTime();switch(Object.isString(a.options.queue)?a.options.queue:a.options.queue.position){case "front":this.effects.findAll(function(c){return c.state=="idle"}).each(function(c){c.startOn+=a.finishOn;c.finishOn+=a.finishOn});break;case "with-last":b=this.effects.pluck("startOn").max()||b;break;case "end":b=this.effects.pluck("finishOn").max()||
b}a.startOn+=b;a.finishOn+=b;if(!a.options.queue.limit||this.effects.length<a.options.queue.limit)this.effects.push(a);if(!this.interval)this.interval=setInterval(this.loop.bind(this),15)},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){for(var a=(new Date).getTime(),b=0,c=this.effects.length;b<c;b++)this.effects[b]&&this.effects[b].loop(a)}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a))return a;return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue)}};Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){if(a&&a.transition===false)a.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1E3;this.finishOn=this.startOn+this.options.duration*1E3;this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=function(){function b(c,
f){c.options[f+"Internal"]&&c.options[f+"Internal"](c);c.options[f]&&c.options[f](c)}return function(c){if(this.state==="idle"){this.state="running";b(this,"beforeSetup");this.setup&&this.setup();b(this,"afterSetup")}if(this.state==="running"){this.position=c=this.options.transition(c)*this.fromToDelta+this.options.from;b(this,"beforeUpdate");this.update&&this.update(c);b(this,"afterUpdate")}}}();this.event("beforeStart");this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":
this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn)if(a>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");this.finish&&this.finish();this.event("afterFinish")}else{a=(a-this.startOn)/this.totalTime;var b=(a*this.totalFrames).round();if(b>this.currentFrame){this.render(a);this.currentFrame=b}}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);this.state="finished"},
event:function(a){this.options[a+"Internal"]&&this.options[a+"Internal"](this);this.options[a]&&this.options[a](this)},inspect:function(){var a=$H();for(property in this)Object.isFunction(this[property])||a.set(property,this[property]);return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a,b){this.effects=a||[];this.start(b)},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");b.finish&&b.finish(a);b.event("afterFinish")})}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(a,b,c){a=Object.isString(a)?$(a):a;var f=$A(arguments),h=f.last();f=f.length==5?f[3]:null;this.method=Object.isFunction(h)?h.bind(a):Object.isFunction(a[h])?a[h].bind(a):function(n){a[h]=n};this.start(Object.extend({from:b,to:c},f||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(a){this.start(Object.extend({duration:0},a||{}))},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});this.start(Object.extend({from:this.element.getOpacity()||0,to:1},b||{}))},update:function(a){this.element.setOpacity(a)}});
Effect.Move=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({x:0,y:0,mode:"relative"},b||{}))},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x-=this.originalLeft;this.options.y-=this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*
a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(a,b,c,f){return new Effect.Move(a,Object.extend({x:c,y:b},f||{}))};
Effect.Scale=Class.create(Effect.Base,{initialize:function(a,b,c){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:b},c||{}))},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=
this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box")this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=
[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){a=this.options.scaleFrom/100+this.factor*a;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*a+this.fontSizeType});this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var c={};
if(this.options.scaleX)c.width=b.round()+"px";if(this.options.scaleY)c.height=a.round()+"px";if(this.options.scaleFromCenter){var f=(a-this.dims[0])/2,h=(b-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY)c.top=this.originalTop-f+"px";if(this.options.scaleX)c.left=this.originalLeft-h+"px"}else{if(this.options.scaleY)c.top=-f+"px";if(this.options.scaleX)c.left=-h+"px"}}this.element.setStyle(c)}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({startcolor:"#ffff99"},b||{}))},setup:function(){if(this.element.getStyle("display")=="none")this.cancel();else{this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor)this.options.endcolor=
this.element.getStyle("background-color").parseColor("#ffffff");if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle("background-color");this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))}},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,f){return b+
(this._base[f]+this._delta[f]*a).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(a,b){var c=b||{},f=document.viewport.getScrollOffsets(),h=$(a).cumulativeOffset();if(c.offset)h[1]+=c.offset;return new Effect.Tween(null,f.top,h[1],c,function(n){scrollTo(f.left,n.round())})};
Effect.Fade=function(a,b){a=$(a);var c=a.getInlineOpacity(),f=Object.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(h){h.options.to==0&&h.element.hide().setStyle({opacity:c})}},b||{});return new Effect.Opacity(a,f)};
Effect.Appear=function(a,b){a=$(a);var c=Object.extend({from:a.getStyle("display")=="none"?0:a.getOpacity()||0,to:1,afterFinishInternal:function(f){f.element.forceRerendering()},beforeSetup:function(f){f.element.setOpacity(f.options.from).show()}},b||{});return new Effect.Opacity(a,c)};
Effect.Puff=function(a,b){a=$(a);var c={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return new Effect.Parallel([new Effect.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(f){Position.absolutize(f.effects[0].element)},afterFinishInternal:function(f){f.effects[0].element.hide().setStyle(c)}},
b||{}))};Effect.BlindUp=function(a,b){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(c){c.element.hide().undoClipping()}},b||{}))};
Effect.BlindDown=function(a,b){a=$(a);var c=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(f){f.element.undoClipping()}},b||{}))};
Effect.SwitchOff=function(a,b){a=$(a);var c=a.getInlineOpacity();return new Effect.Appear(a,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(f){new Effect.Scale(f.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(h){h.element.makePositioned().makeClipping()},afterFinishInternal:function(h){h.element.hide().undoClipping().undoPositioned().setStyle({opacity:c})}})}},b||{}))};
Effect.DropOut=function(a,b){a=$(a);var c={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(f){f.effects[0].element.makePositioned()},afterFinishInternal:function(f){f.effects[0].element.hide().undoPositioned().setStyle(c)}},b||{}))};
Effect.Shake=function(a,b){a=$(a);var c=Object.extend({distance:20,duration:0.5},b||{}),f=parseFloat(c.distance),h=parseFloat(c.duration)/10,n={top:a.getStyle("top"),left:a.getStyle("left")};return new Effect.Move(a,{x:f,y:0,duration:h,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-f*2,y:0,duration:h*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:f*2,y:0,duration:h*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:-f*2,y:0,duration:h*2,afterFinishInternal:function(p){new Effect.Move(p.element,
{x:f*2,y:0,duration:h*2,afterFinishInternal:function(v){new Effect.Move(v.element,{x:-f,y:0,duration:h,afterFinishInternal:function(F){F.element.undoPositioned().setStyle(n)}})}})}})}})}})}})};
Effect.SlideDown=function(a,b){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom"),f=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:f.height,originalWidth:f.width},restoreAfterFinish:true,afterSetup:function(h){h.element.makePositioned();h.element.down().makePositioned();window.opera&&h.element.setStyle({top:""});h.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(h){h.element.down().setStyle({bottom:h.dims[0]-
h.element.clientHeight+"px"})},afterFinishInternal:function(h){h.element.undoClipping().undoPositioned();h.element.down().undoPositioned().setStyle({bottom:c})}},b||{}))};
Effect.SlideUp=function(a,b){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom"),f=a.getDimensions();return new Effect.Scale(a,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:f.height,originalWidth:f.width},restoreAfterFinish:true,afterSetup:function(h){h.element.makePositioned();h.element.down().makePositioned();window.opera&&h.element.setStyle({top:""});h.element.makeClipping().show()},afterUpdateInternal:function(h){h.element.down().setStyle({bottom:h.dims[0]-
h.element.clientHeight+"px"})},afterFinishInternal:function(h){h.element.hide().undoClipping().undoPositioned();h.element.down().undoPositioned().setStyle({bottom:c})}},b||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};
Effect.Grow=function(a,b){a=$(a);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},b||{}),f={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},h=a.getDimensions(),n,j,k,o;switch(c.direction){case "top-left":n=j=k=o=0;break;case "top-right":n=h.width;j=o=0;k=-h.width;break;case "bottom-left":n=k=0;j=h.height;o=-h.height;break;
case "bottom-right":n=h.width;j=h.height;k=-h.width;o=-h.height;break;case "center":n=h.width/2;j=h.height/2;k=-h.width/2;o=-h.height/2}return new Effect.Move(a,{x:n,y:j,duration:0.01,beforeSetup:function(p){p.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(p){new Effect.Parallel([new Effect.Opacity(p.element,{sync:true,to:1,from:0,transition:c.opacityTransition}),new Effect.Move(p.element,{x:k,y:o,sync:true,transition:c.moveTransition}),new Effect.Scale(p.element,100,
{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:c.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(v){v.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(v){v.effects[0].element.undoClipping().undoPositioned().setStyle(f)}},c))}})};
Effect.Shrink=function(a,b){a=$(a);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},b||{}),f={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},h=a.getDimensions(),n,j;switch(c.direction){case "top-left":n=j=0;break;case "top-right":n=h.width;j=0;break;case "bottom-left":n=0;j=h.height;break;case "bottom-right":n=h.width;j=
h.height;break;case "center":n=h.width/2;j=h.height/2}return new Effect.Parallel([new Effect.Opacity(a,{sync:true,to:0,from:1,transition:c.opacityTransition}),new Effect.Scale(a,window.opera?1:0,{sync:true,transition:c.scaleTransition,restoreAfterFinish:true}),new Effect.Move(a,{x:n,y:j,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(k){k.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(k){k.effects[0].element.hide().undoClipping().undoPositioned().setStyle(f)}},
c))};Effect.Pulsate=function(a,b){a=$(a);var c=b||{},f=a.getInlineOpacity(),h=c.transition||Effect.Transitions.linear;return new Effect.Opacity(a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(n){n.element.setStyle({opacity:f})}},c),{transition:function(n){return 1-h(-Math.cos(n*(c.pulses||5)*2*Math.PI)/2+0.5)}}))};
Effect.Fold=function(a,b){a=$(a);var c={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};a.makeClipping();return new Effect.Scale(a,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(){new Effect.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(f){f.element.hide().undoClipping().setStyle(c)}})}},b||{}))};
Effect.Morph=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;var c=Object.extend({style:{}},b||{});if(Object.isString(c.style))if(c.style.include(":"))this.style=c.style.parseStyle();else{this.element.addClassName(c.style);this.style=$H(this.element.getStyles());this.element.removeClassName(c.style);var f=this.element.getStyles();this.style=this.style.reject(function(h){return h.value==f[h.key]});c.afterFinishInternal=function(h){h.element.addClassName(h.options.style);
h.transforms.each(function(n){h.element.style[n.style]=""})}}else this.style=$H(c.style);this.start(c)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b))b="#ffffff";b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(b){var c=b[0];b=b[1];var f=null;if(b.parseColor("#zzzzzz")!="#zzzzzz"){b=b.parseColor();f="color"}else if(c=="opacity"){b=parseFloat(b);Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&
this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(b)){f=b.match(/^([\+\-]?[0-9\.]+)(.*)$/);b=parseFloat(f[1]);f=f.length==3?f[2]:null}var h=this.element.getStyle(c);return{style:c.camelize(),originalValue:f=="color"?a(h):parseFloat(h||0),targetValue:f=="color"?a(b):b,unit:f}}.bind(this)).reject(function(b){return b.originalValue==b.targetValue||b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))})},update:function(a){for(var b={},c,f=this.transforms.length;f--;)b[(c=this.transforms[f]).style]=
c.unit=="color"?"#"+Math.round(c.originalValue[0]+(c.targetValue[0]-c.originalValue[0])*a).toColorPart()+Math.round(c.originalValue[1]+(c.targetValue[1]-c.originalValue[1])*a).toColorPart()+Math.round(c.originalValue[2]+(c.targetValue[2]-c.originalValue[2])*a).toColorPart():(c.originalValue+(c.targetValue-c.originalValue)*a).toFixed(3)+(c.unit===null?"":c.unit);this.element.setStyle(b,true)}});
Effect.Transform=Class.create({initialize:function(a,b){this.tracks=[];this.options=b||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=a.get("ids"),c=a.get("effect"),f=a.get("options");return[$(b)||$$(b)].flatten().map(function(h){return new c(h,Object.extend({sync:true},
f))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var a,b=$H();if(Prototype.Browser.WebKit)a=(new Element("div",{style:this})).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';a=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){a[c]&&b.set(c,a[c])});Prototype.Browser.IE&&this.include("opacity")&&b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return b};
Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=document.defaultView.getComputedStyle($(a),null);return Element.CSS_PROPERTIES.inject({},function(c,f){c[f]=b[f];return c})}:function(a){a=$(a);var b=a.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(f,h){f[h]=b[h];return f});if(!c.opacity)c.opacity=a.getOpacity();return c};
Effect.Methods={morph:function(a,b,c){a=$(a);new Effect.Morph(a,Object.extend({style:b},c||{}));return a},visualEffect:function(a,b,c){a=$(a);b=b.dasherize().camelize();b=b.charAt(0).toUpperCase()+b.substring(1);new Effect[b](a,c);return a},highlight:function(a,b){a=$(a);new Effect.Highlight(a,b);return a}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(b,c){b=$(b);Effect[a.charAt(0).toUpperCase()+a.substring(1)](b,c);return b}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);
if(Object.isUndefined(Effect))throw"dragdrop.js requires including script.aculo.us' effects.js library";
var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(a,b){a=$(a);var c=Object.extend({greedy:true,hoverclass:null,tree:false},b||{});if(c.containment){c._containers=[];var f=c.containment;Object.isArray(f)?f.each(function(h){c._containers.push($(h))}):c._containers.push($(f))}if(c.accept)c.accept=[c.accept].flatten();Element.makePositioned(a);c.element=a;this.drops.push(c)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i)if(Element.isParent(a[i].element,
deepest.element))deepest=a[i];return deepest},isContained:function(a,b){var c;c=b.tree?a.treeNode:a.parentNode;return b._containers.detect(function(f){return c==f})},isAffected:function(a,b,c){return c.element!=b&&(!c._containers||this.isContained(b,c))&&(!c.accept||Element.classNames(b).detect(function(f){return c.accept.include(f)}))&&Position.within(c.element,a[0],a[1])},deactivate:function(a){a.hoverclass&&Element.removeClassName(a.element,a.hoverclass);this.last_active=null},activate:function(a){a.hoverclass&&
Element.addClassName(a.element,a.hoverclass);this.last_active=a},show:function(a,b){if(this.drops.length){var c,f=[];this.drops.each(function(h){Droppables.isAffected(a,b,h)&&f.push(h)});if(f.length>0)c=Droppables.findDeepestChild(f);this.last_active&&this.last_active!=c&&this.deactivate(this.last_active);if(c){Position.within(c.element,a[0],a[1]);c.onHover&&c.onHover(b,c.element,Position.overlap(c.overlap,c.element));c!=this.last_active&&Droppables.activate(c)}}},fire:function(a,b){if(this.last_active){Position.prepare();
if(this.isAffected([Event.pointerX(a),Event.pointerY(a)],b,this.last_active))if(this.last_active.onDrop){this.last_active.onDrop(b,this.last_active.element,a);return true}}},reset:function(){this.last_active&&this.deactivate(this.last_active)}},Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);
Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay)this._timeout=
setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay);else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(this.activeDraggable){var b=[Event.pointerX(a),Event.pointerY(a)];if(!(this._lastPointer&&this._lastPointer.inspect()==b.inspect())){this._lastPointer=b;this.activeDraggable.updateDrag(a,b)}}},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=
null}if(this.activeDraggable){this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null}},keyPress:function(a){this.activeDraggable&&this.activeDraggable.keyPress(a)},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(a,b,c){this[a+"Count"]>0&&this.observers.each(function(f){f[a]&&f[a](a,b,c)});b.options[a]&&
b.options[a](b,c)},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}},Draggable=Class.create({initialize:function(a,b){var c={handle:false,reverteffect:function(f,h,n){new Effect.Move(f,{x:-n,y:-h,duration:Math.sqrt(Math.abs(h^2)+Math.abs(n^2))*0.02,queue:{scope:"_draggable",position:"end"}})},endeffect:function(f){var h=Object.isNumber(f._opacity)?f._opacity:1;new Effect.Opacity(f,
{duration:0.2,from:0.7,to:h,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[f]=false}})},zindex:1E3,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!b||Object.isUndefined(b.endeffect))Object.extend(c,{starteffect:function(f){f._opacity=Element.getOpacity(f);Draggable._dragging[f]=true;new Effect.Opacity(f,{duration:0.2,from:f._opacity,to:0.7})}});c=Object.extend(c,b||{});this.element=$(a);if(c.handle&&Object.isString(c.handle))this.handle=
this.element.down("."+c.handle,0);if(!this.handle)this.handle=$(c.handle);if(!this.handle)this.handle=this.element;if(c.scroll&&!c.scroll.scrollTo&&!c.scroll.outerHTML){c.scroll=$(c.scroll);this._isScrollChild=Element.childOf(this.element,c.scroll)}Element.makePositioned(this.element);this.options=c;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,
"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return[parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]},initDrag:function(a){if(!(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]))if(Event.isLeftClick(a))if(!((tag_name=Event.element(a).tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA"))){var b=
[Event.pointerX(a),Event.pointerY(a)],c=this.element.cumulativeOffset();this.offset=[0,1].map(function(f){return b[f]-c[f]});Draggables.activate(this);Event.stop(a)}},startDrag:function(a){this.dragging=true;if(!this.delta)this.delta=this.currentDelta();if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);(this._originallyAbsolute=this.element.getStyle("position")==
"absolute")||Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll)if(this.options.scroll==window){var b=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=b.left;this.originalScrollTop=b.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}Draggables.notify("onStart",this,a);this.options.starteffect&&this.options.starteffect(this.element)},updateDrag:function(a,
b){this.dragging||this.startDrag(a);if(!this.options.quiet){Position.prepare();Droppables.show(b,this.element)}Draggables.notify("onDrag",this,a);this.draw(b);this.options.change&&this.options.change(this);if(this.options.scroll){this.stopScrolling();var c;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll))c=[left,top,left+width,top+height];else{c=Position.page(this.options.scroll);c[0]+=this.options.scroll.scrollLeft+Position.deltaX;c[1]+=this.options.scroll.scrollTop+
Position.deltaY;c.push(c[0]+this.options.scroll.offsetWidth);c.push(c[1]+this.options.scroll.offsetHeight)}var f=[0,0];if(b[0]<c[0]+this.options.scrollSensitivity)f[0]=b[0]-(c[0]+this.options.scrollSensitivity);if(b[1]<c[1]+this.options.scrollSensitivity)f[1]=b[1]-(c[1]+this.options.scrollSensitivity);if(b[0]>c[2]-this.options.scrollSensitivity)f[0]=b[0]-(c[2]-this.options.scrollSensitivity);if(b[1]>c[3]-this.options.scrollSensitivity)f[1]=b[1]-(c[3]-this.options.scrollSensitivity);this.startScrolling(f)}Prototype.Browser.WebKit&&
window.scrollBy(0,0);Event.stop(a)},finishDrag:function(a,b){this.dragging=false;if(this.options.quiet){Position.prepare();var c=[Event.pointerX(a),Event.pointerY(a)];Droppables.show(c,this.element)}if(this.options.ghosting){this._originallyAbsolute||Position.relativize(this.element);delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}c=false;if(b)(c=Droppables.fire(a,this.element))||(c=false);c&&this.options.onDropped&&this.options.onDropped(this.element);Draggables.notify("onEnd",
this,a);var f=this.options.revert;if(f&&Object.isFunction(f))f=f(this.element);var h=this.currentDelta();if(f&&this.options.reverteffect){if(c==0||f!="failure")this.options.reverteffect(this.element,h[1]-this.delta[1],h[0]-this.delta[0])}else this.delta=h;if(this.options.zindex)this.element.style.zIndex=this.originalZ;this.options.endeffect&&this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode==Event.KEY_ESC){this.finishDrag(a,false);
Event.stop(a)}},endDrag:function(a){if(this.dragging){this.stopScrolling();this.finishDrag(a,true);Event.stop(a)}},draw:function(a){var b=this.element.cumulativeOffset();if(this.options.ghosting){var c=Position.realOffset(this.element);b[0]+=c[0]-Position.deltaX;b[1]+=c[1]-Position.deltaY}c=this.currentDelta();b[0]-=c[0];b[1]-=c[1];if(this.options.scroll&&this.options.scroll!=window&&this._isScrollChild){b[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;b[1]-=this.options.scroll.scrollTop-
this.originalScrollTop}c=[0,1].map(function(h){return a[h]-b[h]-this.offset[h]}.bind(this));if(this.options.snap)c=Object.isFunction(this.options.snap)?this.options.snap(c[0],c[1],this):Object.isArray(this.options.snap)?c.map(function(h,n){return(h/this.options.snap[n]).round()*this.options.snap[n]}.bind(this)):c.map(function(h){return(h/this.options.snap).round()*this.options.snap}.bind(this));var f=this.element.style;if(!this.options.constraint||this.options.constraint=="horizontal")f.left=c[0]+
"px";if(!this.options.constraint||this.options.constraint=="vertical")f.top=c[1]+"px";if(f.visibility=="hidden")f.visibility=""},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(a[0]||a[1]){this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date;this.scrollInterval=setInterval(this.scroll.bind(this),10)}},scroll:function(){var a=
new Date,b=a-this.lastScrolled;this.lastScrolled=a;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){a=b/1E3;this.options.scroll.scrollTo(left+a*this.scrollSpeed[0],top+a*this.scrollSpeed[1])}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*b/1E3;this.options.scroll.scrollTop+=this.scrollSpeed[1]*b/1E3}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=
Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*b/1E3;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*b/1E3;if(Draggables._lastScrollPointer[0]<0)Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer)}this.options.change&&this.options.change(this)},_getWindowScroll:function(a){var b,c,f;with(a.document){if(a.document.documentElement&&
documentElement.scrollTop){b=documentElement.scrollTop;c=documentElement.scrollLeft}else if(a.document.body){b=body.scrollTop;c=body.scrollLeft}if(a.innerWidth){f=a.innerWidth;a=a.innerHeight}else if(a.document.documentElement&&documentElement.clientWidth){f=documentElement.clientWidth;a=documentElement.clientHeight}else{f=body.offsetWidth;a=body.offsetHeight}}return{top:b,left:c,width:f,height:a}}});Draggable._dragging={};
var SortableObserver=Class.create({initialize:function(a,b){this.element=$(a);this.observer=b;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();this.lastValue!=Sortable.serialize(this.element)&&this.observer(this.element)}}),Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){for(;a.tagName.toUpperCase()!="BODY";){if(a.id&&Sortable.sortables[a.id])return a;
a=a.parentNode}},options:function(a){if(a=Sortable._findRootElement($(a)))return Sortable.sortables[a.id]},destroy:function(a){a=$(a);if(a=Sortable.sortables[a.id]){Draggables.removeObserver(a.element);a.droppables.each(function(b){Droppables.remove(b)});a.draggables.invoke("destroy");delete Sortable.sortables[a.element.id]}},create:function(a,b){a=$(a);var c=Object.extend({element:a,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:a,handle:false,
only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},b||{});this.destroy(a);var f={revert:true,quiet:c.quiet,scroll:c.scroll,scrollSpeed:c.scrollSpeed,scrollSensitivity:c.scrollSensitivity,delay:c.delay,ghosting:c.ghosting,constraint:c.constraint,handle:c.handle};if(c.starteffect)f.starteffect=c.starteffect;if(c.reverteffect)f.reverteffect=
c.reverteffect;else if(c.ghosting)f.reverteffect=function(j){j.style.top=0;j.style.left=0};if(c.endeffect)f.endeffect=c.endeffect;if(c.zindex)f.zindex=c.zindex;var h={overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass,onHover:Sortable.onHover},n={onHover:Sortable.onEmptyHover,overlap:c.overlap,containment:c.containment,hoverclass:c.hoverclass};Element.cleanWhitespace(a);c.draggables=[];c.droppables=[];if(c.dropOnEmpty||c.tree){Droppables.add(a,n);c.droppables.push(a)}(c.elements||
this.findElements(a,c)||[]).each(function(j,k){var o=c.handles?$(c.handles[k]):c.handle?$(j).select("."+c.handle)[0]:j;c.draggables.push(new Draggable(j,Object.extend(f,{handle:o})));Droppables.add(j,h);if(c.tree)j.treeNode=a;c.droppables.push(j)});if(c.tree)(Sortable.findTreeElements(a,c)||[]).each(function(j){Droppables.add(j,n);j.treeNode=a;c.droppables.push(j)});this.sortables[a.identify()]=c;Draggables.addObserver(new SortableObserver(a,c.onUpdate))},findElements:function(a,b){return Element.findChildren(a,
b.only,b.tree?true:false,b.tag)},findTreeElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.treeTag)},onHover:function(a,b,c){if(!Element.isParent(b,a))if(!(c>0.33&&c<0.66&&Sortable.options(b).tree))if(c>0.5){Sortable.mark(b,"before");if(b.previousSibling!=a){c=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,b);b.parentNode!=c&&Sortable.options(c).onChange(a);Sortable.options(b.parentNode).onChange(a)}}else{Sortable.mark(b,"after");var f=b.nextSibling||
null;if(f!=a){c=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,f);b.parentNode!=c&&Sortable.options(c).onChange(a);Sortable.options(b.parentNode).onChange(a)}}},onEmptyHover:function(a,b,c){var f=a.parentNode,h=Sortable.options(b);if(!Element.isParent(b,a)){var n=Sortable.findElements(b,{tag:h.tag,only:h.only}),j=null;if(n){var k=Element.offsetSize(b,h.overlap)*(1-c);for(c=0;c<n.length;c+=1)if(k-Element.offsetSize(n[c],h.overlap)>=0)k-=Element.offsetSize(n[c],h.overlap);else{j=
k-Element.offsetSize(n[c],h.overlap)/2>=0?c+1<n.length?n[c+1]:null:n[c];break}}b.insertBefore(a,j);Sortable.options(f).onChange(a);h.onChange(a)}},unmark:function(){Sortable._marker&&Sortable._marker.hide()},mark:function(a,b){var c=Sortable.options(a.parentNode);if(!(c&&!c.ghosting)){if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var f=
a.cumulativeOffset();Sortable._marker.setStyle({left:f[0]+"px",top:f[1]+"px"});if(b=="after")c.overlap=="horizontal"?Sortable._marker.setStyle({left:f[0]+a.clientWidth+"px"}):Sortable._marker.setStyle({top:f[1]+a.clientHeight+"px"});Sortable._marker.show()}},_tree:function(a,b,c){for(var f=Sortable.findElements(a,b)||[],h=0;h<f.length;++h){var n=f[h].id.match(b.format);if(n){n={id:encodeURIComponent(n?n[1]:null),element:a,parent:c,children:[],position:c.children.length,container:$(f[h]).down(b.treeTag)};
n.container&&this._tree(n.container,b,n);c.children.push(n)}}return c},tree:function(a,b){a=$(a);var c=this.options(a);c=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:a.id,format:c.format},b||{});return Sortable._tree(a,c,{id:null,parent:null,children:[],container:a,position:0})},_constructIndex:function(a){var b="";do if(a.id)b="["+a.position+"]"+b;while((a=a.parent)!=null);return b},sequence:function(a,b){a=$(a);var c=Object.extend(this.options(a),b||{});return $(this.findElements(a,
c)||[]).map(function(f){return f.id.match(c.format)?f.id.match(c.format)[1]:""})},setSequence:function(a,b,c){a=$(a);var f=Object.extend(this.options(a),c||{}),h={};this.findElements(a,f).each(function(n){if(n.id.match(f.format))h[n.id.match(f.format)[1]]=[n,n.parentNode];n.parentNode.removeChild(n)});b.each(function(n){var j=h[n];if(j){j[1].appendChild(j[0]);delete h[n]}})},serialize:function(a,b){a=$(a);var c=Object.extend(Sortable.options(a),b||{}),f=encodeURIComponent(b&&b.name?b.name:a.id);return c.tree?
Sortable.tree(a,b).children.map(function(h){return[f+Sortable._constructIndex(h)+"[id]="+encodeURIComponent(h.id)].concat(h.children.map(arguments.callee))}).flatten().join("&"):Sortable.sequence(a,b).map(function(h){return f+"[]="+encodeURIComponent(h)}).join("&")}};Element.isParent=function(a,b){if(!a.parentNode||a==b)return false;if(a.parentNode==b)return true;return Element.isParent(a.parentNode,b)};
Element.findChildren=function(a,b,c,f){if(!a.hasChildNodes())return null;f=f.toUpperCase();if(b)b=[b].flatten();var h=[];$A(a.childNodes).each(function(n){if(n.tagName&&n.tagName.toUpperCase()==f&&(!b||Element.classNames(n).detect(function(j){return b.include(j)})))h.push(n);if(c)(n=Element.findChildren(n,b,c,f))&&h.push(n)});return h.length>0?h.flatten():[]};Element.offsetSize=function(a,b){return a["offset"+(b=="vertical"||b=="height"?"Height":"Width")]};
(function(a,b){function c(d){var e=Da[d]={},l,m;d=d.split(/\s+/);l=0;for(m=d.length;l<m;l++)e[d[l]]=true;return e}function f(d,e,l){if(l===b&&d.nodeType===1){l="data-"+e.replace(La,"-$1").toLowerCase();l=d.getAttribute(l);if(typeof l==="string"){try{l=l==="true"?true:l==="false"?false:l==="null"?null:g.isNumeric(l)?parseFloat(l):eb.test(l)?g.parseJSON(l):l}catch(m){}g.data(d,e,l)}else l=b}return l}function h(d){for(var e in d)if(!(e==="data"&&g.isEmptyObject(d[e])))if(e!=="toJSON")return false;return true}
function n(d,e,l){var m=e+"defer",q=e+"queue",s=e+"mark",w=g._data(d,m);if(w&&(l==="queue"||!g._data(d,q))&&(l==="mark"||!g._data(d,s)))setTimeout(function(){if(!g._data(d,q)&&!g._data(d,s)){g.removeData(d,m,true);w.fire()}},0)}function j(){return false}function k(){return true}function o(d,e,l){e=e||0;if(g.isFunction(e))return g.grep(d,function(q,s){return!!e.call(q,s,q)===l});else if(e.nodeType)return g.grep(d,function(q){return q===e===l});else if(typeof e==="string"){var m=g.grep(d,function(q){return q.nodeType===
1});if(Kb.test(e))return g.filter(e,m,!l);else e=g.filter(e,m)}return g.grep(d,function(q){return g.inArray(q,e)>=0===l})}function p(d){var e=rb.split("|");d=d.createDocumentFragment();if(d.createElement)for(;e.length;)d.createElement(e.pop());return d}function v(d,e){if(!(e.nodeType!==1||!g.hasData(d))){var l,m,q;m=g._data(d);var s=g._data(e,m),w=m.events;if(w){delete s.handle;s.events={};for(l in w){m=0;for(q=w[l].length;m<q;m++)g.event.add(e,l+(w[l][m].namespace?".":"")+w[l][m].namespace,w[l][m],
w[l][m].data)}}if(s.data)s.data=g.extend({},s.data)}}function F(d,e){var l;if(e.nodeType===1){e.clearAttributes&&e.clearAttributes();e.mergeAttributes&&e.mergeAttributes(d);l=e.nodeName.toLowerCase();if(l==="object")e.outerHTML=d.outerHTML;else if(l==="input"&&(d.type==="checkbox"||d.type==="radio")){if(d.checked)e.defaultChecked=e.checked=d.checked;if(e.value!==d.value)e.value=d.value}else if(l==="option")e.selected=d.defaultSelected;else if(l==="input"||l==="textarea")e.defaultValue=d.defaultValue;
e.removeAttribute(g.expando)}}function V(d){return typeof d.getElementsByTagName!=="undefined"?d.getElementsByTagName("*"):typeof d.querySelectorAll!=="undefined"?d.querySelectorAll("*"):[]}function da(d){if(d.type==="checkbox"||d.type==="radio")d.defaultChecked=d.checked}function sa(d){var e=(d.nodeName||"").toLowerCase();if(e==="input")da(d);else e!=="script"&&typeof d.getElementsByTagName!=="undefined"&&g.grep(d.getElementsByTagName("input"),da)}function ya(d,e){e.src?g.ajax({url:e.src,async:false,
dataType:"script"}):g.globalEval((e.text||e.textContent||e.innerHTML||"").replace(Lb,"/*$0*/"));e.parentNode&&e.parentNode.removeChild(e)}function Ba(d,e,l){var m=e==="width"?d.offsetWidth:d.offsetHeight,q=e==="width"?Mb:Nb,s=0,w=q.length;if(m>0){if(l!=="border")for(;s<w;s++){l||(m-=parseFloat(g.css(d,"padding"+q[s]))||0);if(l==="margin")m+=parseFloat(g.css(d,l+q[s]))||0;else m-=parseFloat(g.css(d,"border"+q[s]+"Width"))||0}return m+"px"}m=Wa(d,e,e);if(m<0||m==null)m=d.style[e]||0;m=parseFloat(m)||
0;if(l)for(;s<w;s++){m+=parseFloat(g.css(d,"padding"+q[s]))||0;if(l!=="padding")m+=parseFloat(g.css(d,"border"+q[s]+"Width"))||0;if(l==="margin")m+=parseFloat(g.css(d,l+q[s]))||0}return m+"px"}function u(d){return function(e,l){if(typeof e!=="string"){l=e;e="*"}if(g.isFunction(l))for(var m=e.toLowerCase().split(sb),q=0,s=m.length,w,B;q<s;q++){w=m[q];if(B=/^\+/.test(w))w=w.substr(1)||"*";w=d[w]=d[w]||[];w[B?"unshift":"push"](l)}}}function C(d,e,l,m,q,s){q=q||e.dataTypes[0];s=s||{};s[q]=true;q=d[q];
for(var w=0,B=q?q.length:0,D=d===lb,L;w<B&&(D||!L);w++){L=q[w](e,l,m);if(typeof L==="string")if(!D||s[L])L=b;else{e.dataTypes.unshift(L);L=C(d,e,l,m,L,s)}}if((D||!L)&&!s["*"])L=C(d,e,l,m,"*",s);return L}function H(d,e){var l,m,q=g.ajaxSettings.flatOptions||{};for(l in e)if(e[l]!==b)(q[l]?d:m||(m={}))[l]=e[l];m&&g.extend(true,d,m)}function E(d,e,l,m){if(g.isArray(e))g.each(e,function(s,w){l||Ob.test(d)?m(d,w):E(d+"["+(typeof w==="object"||g.isArray(w)?s:"")+"]",w,l,m)});else if(!l&&e!=null&&typeof e===
"object")for(var q in e)E(d+"["+q+"]",e[q],l,m);else m(d,e)}function N(){try{return new a.XMLHttpRequest}catch(d){}}function M(){setTimeout(y,0);return fb=g.now()}function y(){fb=b}function T(d,e){var l={};g.each(tb.concat.apply([],tb.slice(0,e)),function(){l[this]=d});return l}function Q(d){if(!mb[d]){var e=R.body,l=g("<"+d+">").appendTo(e),m=l.css("display");l.remove();if(m==="none"||m===""){if(!Ka){Ka=R.createElement("iframe");Ka.frameBorder=Ka.width=Ka.height=0}e.appendChild(Ka);if(!Xa||!Ka.createElement){Xa=
(Ka.contentWindow||Ka.contentDocument).document;Xa.write((R.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>");Xa.close()}l=Xa.createElement(d);Xa.body.appendChild(l);m=g.css(l,"display");e.removeChild(Ka)}mb[d]=m}return mb[d]}function ja(d){return g.isWindow(d)?d:d.nodeType===9?d.defaultView||d.parentWindow:false}var R=a.document,wa=a.navigator,pa=a.location,g=function(){function d(){if(!e.isReady){try{R.documentElement.doScroll("left")}catch(A){setTimeout(d,1);return}e.ready()}}var e=
function(A,U){return new e.fn.init(A,U,q)},l=a.jQuery,m=a.$,q,s=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,w=/\S/,B=/^\s+/,D=/\s+$/,L=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,aa=/^[\],:{}\s]*$/,P=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,ca=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,X=/(?:^|:|,)(?:\s*\[)+/g,la=/(webkit)[ \/]([\w.]+)/,ra=/(opera)(?:.*version)?[ \/]([\w.]+)/,va=/(msie) ([\w.]+)/,ta=/(mozilla)(?:.*? rv:([\w.]+))?/,Ma=/-([a-z]|[0-9])/ig,Ea=/^-ms-/,ma=function(A,U){return(U+"").toUpperCase()},
Ga=wa.userAgent,t,z,G=Object.prototype.toString,I=Object.prototype.hasOwnProperty,K=Array.prototype.push,O=Array.prototype.slice,ea=String.prototype.trim,Y=Array.prototype.indexOf,na={};e.fn=e.prototype={constructor:e,init:function(A,U,Z){var W;if(!A)return this;if(A.nodeType){this.context=this[0]=A;this.length=1;return this}if(A==="body"&&!U&&R.body){this.context=R;this[0]=R.body;this.selector=A;this.length=1;return this}if(typeof A==="string")if((W=A.charAt(0)==="<"&&A.charAt(A.length-1)===">"&&
A.length>=3?[null,A,null]:s.exec(A))&&(W[1]||!U))if(W[1]){Z=(U=U instanceof e?U[0]:U)?U.ownerDocument||U:R;if(A=L.exec(A))if(e.isPlainObject(U)){A=[R.createElement(A[1])];e.fn.attr.call(A,U,true)}else A=[Z.createElement(A[1])];else{A=e.buildFragment([W[1]],[Z]);A=(A.cacheable?e.clone(A.fragment):A.fragment).childNodes}return e.merge(this,A)}else{if((U=R.getElementById(W[2]))&&U.parentNode){if(U.id!==W[2])return Z.find(A);this.length=1;this[0]=U}this.context=R;this.selector=A;return this}else return!U||
U.jquery?(U||Z).find(A):this.constructor(U).find(A);else if(e.isFunction(A))return Z.ready(A);if(A.selector!==b){this.selector=A.selector;this.context=A.context}return e.makeArray(A,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return O.call(this,0)},get:function(A){return A==null?this.toArray():A<0?this[this.length+A]:this[A]},pushStack:function(A,U,Z){var W=this.constructor();e.isArray(A)?K.apply(W,A):e.merge(W,A);W.prevObject=this;W.context=this.context;
if(U==="find")W.selector=this.selector+(this.selector?" ":"")+Z;else if(U)W.selector=this.selector+"."+U+"("+Z+")";return W},each:function(A,U){return e.each(this,A,U)},ready:function(A){e.bindReady();t.add(A);return this},eq:function(A){A=+A;return A===-1?this.slice(A):this.slice(A,A+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(O.apply(this,arguments),"slice",O.call(arguments).join(","))},map:function(A){return this.pushStack(e.map(this,
function(U,Z){return A.call(U,Z,U)}))},end:function(){return this.prevObject||this.constructor(null)},push:K,sort:[].sort,splice:[].splice};e.fn.init.prototype=e.fn;e.extend=e.fn.extend=function(){var A,U,Z,W,ka,ga=arguments[0]||{},ua=1,za=arguments.length,Pa=false;if(typeof ga==="boolean"){Pa=ga;ga=arguments[1]||{};ua=2}if(typeof ga!=="object"&&!e.isFunction(ga))ga={};if(za===ua){ga=this;--ua}for(;ua<za;ua++)if((A=arguments[ua])!=null)for(U in A){Z=ga[U];W=A[U];if(ga!==W)if(Pa&&W&&(e.isPlainObject(W)||
(ka=e.isArray(W)))){if(ka){ka=false;Z=Z&&e.isArray(Z)?Z:[]}else Z=Z&&e.isPlainObject(Z)?Z:{};ga[U]=e.extend(Pa,Z,W)}else if(W!==b)ga[U]=W}return ga};e.extend({noConflict:function(A){if(a.$===e)a.$=m;if(A&&a.jQuery===e)a.jQuery=l;return e},isReady:false,readyWait:1,holdReady:function(A){if(A)e.readyWait++;else e.ready(true)},ready:function(A){if(A===true&&!--e.readyWait||A!==true&&!e.isReady){if(!R.body)return setTimeout(e.ready,1);e.isReady=true;if(!(A!==true&&--e.readyWait>0)){t.fireWith(R,[e]);
e.fn.trigger&&e(R).trigger("ready").off("ready")}}},bindReady:function(){if(!t){t=e.Callbacks("once memory");if(R.readyState==="complete")return setTimeout(e.ready,1);if(R.addEventListener){R.addEventListener("DOMContentLoaded",z,false);a.addEventListener("load",e.ready,false)}else if(R.attachEvent){R.attachEvent("onreadystatechange",z);a.attachEvent("onload",e.ready);var A=false;try{A=a.frameElement==null}catch(U){}R.documentElement.doScroll&&A&&d()}}},isFunction:function(A){return e.type(A)==="function"},
isArray:Array.isArray||function(A){return e.type(A)==="array"},isWindow:function(A){return A&&typeof A==="object"&&"setInterval"in A},isNumeric:function(A){return!isNaN(parseFloat(A))&&isFinite(A)},type:function(A){return A==null?String(A):na[G.call(A)]||"object"},isPlainObject:function(A){if(!A||e.type(A)!=="object"||A.nodeType||e.isWindow(A))return false;try{if(A.constructor&&!I.call(A,"constructor")&&!I.call(A.constructor.prototype,"isPrototypeOf"))return false}catch(U){return false}for(var Z in A);
return Z===b||I.call(A,Z)},isEmptyObject:function(A){for(var U in A)return false;return true},error:function(A){throw Error(A);},parseJSON:function(A){if(typeof A!=="string"||!A)return null;A=e.trim(A);if(a.JSON&&a.JSON.parse)return a.JSON.parse(A);if(aa.test(A.replace(P,"@").replace(ca,"]").replace(X,"")))return(new Function("return "+A))();e.error("Invalid JSON: "+A)},parseXML:function(A){var U,Z;try{if(a.DOMParser){Z=new DOMParser;U=Z.parseFromString(A,"text/xml")}else{U=new ActiveXObject("Microsoft.XMLDOM");
U.async="false";U.loadXML(A)}}catch(W){U=b}if(!U||!U.documentElement||U.getElementsByTagName("parsererror").length)e.error("Invalid XML: "+A);return U},noop:function(){},globalEval:function(A){if(A&&w.test(A))(a.execScript||function(U){a.eval.call(a,U)})(A)},camelCase:function(A){return A.replace(Ea,"ms-").replace(Ma,ma)},nodeName:function(A,U){return A.nodeName&&A.nodeName.toUpperCase()===U.toUpperCase()},each:function(A,U,Z){var W,ka=0,ga=A.length,ua=ga===b||e.isFunction(A);if(Z)if(ua)for(W in A){if(U.apply(A[W],
Z)===false)break}else for(;ka<ga;){if(U.apply(A[ka++],Z)===false)break}else if(ua)for(W in A){if(U.call(A[W],W,A[W])===false)break}else for(;ka<ga;)if(U.call(A[ka],ka,A[ka++])===false)break;return A},trim:ea?function(A){return A==null?"":ea.call(A)}:function(A){return A==null?"":A.toString().replace(B,"").replace(D,"")},makeArray:function(A,U){var Z=U||[];if(A!=null){var W=e.type(A);A.length==null||W==="string"||W==="function"||W==="regexp"||e.isWindow(A)?K.call(Z,A):e.merge(Z,A)}return Z},inArray:function(A,
U,Z){var W;if(U){if(Y)return Y.call(U,A,Z);W=U.length;for(Z=Z?Z<0?Math.max(0,W+Z):Z:0;Z<W;Z++)if(Z in U&&U[Z]===A)return Z}return-1},merge:function(A,U){var Z=A.length,W=0;if(typeof U.length==="number")for(var ka=U.length;W<ka;W++)A[Z++]=U[W];else for(;U[W]!==b;)A[Z++]=U[W++];A.length=Z;return A},grep:function(A,U,Z){var W=[],ka;Z=!!Z;for(var ga=0,ua=A.length;ga<ua;ga++){ka=!!U(A[ga],ga);Z!==ka&&W.push(A[ga])}return W},map:function(A,U,Z){var W,ka,ga=[],ua=0,za=A.length;if(A instanceof e||za!==b&&
typeof za==="number"&&(za>0&&A[0]&&A[za-1]||za===0||e.isArray(A)))for(;ua<za;ua++){W=U(A[ua],ua,Z);if(W!=null)ga[ga.length]=W}else for(ka in A){W=U(A[ka],ka,Z);if(W!=null)ga[ga.length]=W}return ga.concat.apply([],ga)},guid:1,proxy:function(A,U){if(typeof U==="string"){var Z=A[U];U=A;A=Z}if(!e.isFunction(A))return b;var W=O.call(arguments,2);Z=function(){return A.apply(U,W.concat(O.call(arguments)))};Z.guid=A.guid=A.guid||Z.guid||e.guid++;return Z},access:function(A,U,Z,W,ka,ga){var ua=A.length;if(typeof U===
"object"){for(var za in U)e.access(A,za,U[za],W,ka,Z);return A}if(Z!==b){W=!ga&&W&&e.isFunction(Z);for(za=0;za<ua;za++)ka(A[za],U,W?Z.call(A[za],za,ka(A[za],U)):Z,ga);return A}return ua?ka(A[0],U):b},now:function(){return(new Date).getTime()},uaMatch:function(A){A=A.toLowerCase();A=la.exec(A)||ra.exec(A)||va.exec(A)||A.indexOf("compatible")<0&&ta.exec(A)||[];return{browser:A[1]||"",version:A[2]||"0"}},sub:function(){function A(Z,W){return new A.fn.init(Z,W)}e.extend(true,A,this);A.superclass=this;
A.fn=A.prototype=this();A.fn.constructor=A;A.sub=this.sub;A.fn.init=function(Z,W){if(W&&W instanceof e&&!(W instanceof A))W=A(W);return e.fn.init.call(this,Z,W,U)};A.fn.init.prototype=A.fn;var U=A(R);return A},browser:{}});e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(A,U){na["[object "+U+"]"]=U.toLowerCase()});Ga=e.uaMatch(Ga);if(Ga.browser){e.browser[Ga.browser]=true;e.browser.version=Ga.version}if(e.browser.webkit)e.browser.safari=true;if(w.test("\u00a0")){B=
/^[\s\xA0]+/;D=/[\s\xA0]+$/}q=e(R);if(R.addEventListener)z=function(){R.removeEventListener("DOMContentLoaded",z,false);e.ready()};else if(R.attachEvent)z=function(){if(R.readyState==="complete"){R.detachEvent("onreadystatechange",z);e.ready()}};return e}(),Da={};g.Callbacks=function(d){d=d?Da[d]||c(d):{};var e=[],l=[],m,q,s,w,B,D=function(P){var ca,X,la,ra;ca=0;for(X=P.length;ca<X;ca++){la=P[ca];ra=g.type(la);if(ra==="array")D(la);else if(ra==="function")if(!d.unique||!aa.has(la))e.push(la)}},L=
function(P,ca){ca=ca||[];m=!d.memory||[P,ca];q=true;B=s||0;s=0;for(w=e.length;e&&B<w;B++)if(e[B].apply(P,ca)===false&&d.stopOnFalse){m=true;break}q=false;if(e)if(d.once)if(m===true)aa.disable();else e=[];else if(l&&l.length){m=l.shift();aa.fireWith(m[0],m[1])}},aa={add:function(){if(e){var P=e.length;D(arguments);if(q)w=e.length;else if(m&&m!==true){s=P;L(m[0],m[1])}}return this},remove:function(){if(e)for(var P=arguments,ca=0,X=P.length;ca<X;ca++)for(var la=0;la<e.length;la++)if(P[ca]===e[la]){if(q)if(la<=
w){w--;la<=B&&B--}e.splice(la--,1);if(d.unique)break}return this},has:function(P){if(e)for(var ca=0,X=e.length;ca<X;ca++)if(P===e[ca])return true;return false},empty:function(){e=[];return this},disable:function(){e=l=m=b;return this},disabled:function(){return!e},lock:function(){l=b;if(!m||m===true)aa.disable();return this},locked:function(){return!l},fireWith:function(P,ca){if(l)if(q)d.once||l.push([P,ca]);else d.once&&m||L(P,ca);return this},fire:function(){aa.fireWith(this,arguments);return this},
fired:function(){return!!m}};return aa};var Ja=[].slice;g.extend({Deferred:function(d){var e=g.Callbacks("once memory"),l=g.Callbacks("once memory"),m=g.Callbacks("memory"),q="pending",s={resolve:e,reject:l,notify:m},w={done:e.add,fail:l.add,progress:m.add,state:function(){return q},isResolved:e.fired,isRejected:l.fired,then:function(L,aa,P){B.done(L).fail(aa).progress(P);return this},always:function(){B.done.apply(B,arguments).fail.apply(B,arguments);return this},pipe:function(L,aa,P){return g.Deferred(function(ca){g.each({done:[L,
"resolve"],fail:[aa,"reject"],progress:[P,"notify"]},function(X,la){var ra=la[0],va=la[1],ta;g.isFunction(ra)?B[X](function(){(ta=ra.apply(this,arguments))&&g.isFunction(ta.promise)?ta.promise().then(ca.resolve,ca.reject,ca.notify):ca[va+"With"](this===B?ca:this,[ta])}):B[X](ca[va])})}).promise()},promise:function(L){if(L==null)L=w;else for(var aa in w)L[aa]=w[aa];return L}},B=w.promise({}),D;for(D in s){B[D]=s[D].fire;B[D+"With"]=s[D].fireWith}B.done(function(){q="resolved"},l.disable,m.lock).fail(function(){q=
"rejected"},e.disable,m.lock);d&&d.call(B,B);return B},when:function(d){function e(aa){return function(P){m[aa]=arguments.length>1?Ja.call(arguments,0):P;--B||D.resolveWith(D,m)}}function l(aa){return function(P){w[aa]=arguments.length>1?Ja.call(arguments,0):P;D.notifyWith(L,w)}}var m=Ja.call(arguments,0),q=0,s=m.length,w=Array(s),B=s,D=s<=1&&d&&g.isFunction(d.promise)?d:g.Deferred(),L=D.promise();if(s>1){for(;q<s;q++)if(m[q]&&m[q].promise&&g.isFunction(m[q].promise))m[q].promise().then(e(q),D.reject,
l(q));else--B;B||D.resolveWith(D,m)}else if(D!==d)D.resolveWith(D,s?[d]:[]);return L}});g.support=function(){var d,e,l,m,q,s,w,B,D=R.createElement("div");D.setAttribute("className","t");D.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";e=D.getElementsByTagName("*");l=D.getElementsByTagName("a")[0];if(!e||!e.length||!l)return{};m=R.createElement("select");q=m.appendChild(R.createElement("option"));e=D.getElementsByTagName("input")[0];
d={leadingWhitespace:D.firstChild.nodeType===3,tbody:!D.getElementsByTagName("tbody").length,htmlSerialize:!!D.getElementsByTagName("link").length,style:/top/.test(l.getAttribute("style")),hrefNormalized:l.getAttribute("href")==="/a",opacity:/^0.55/.test(l.style.opacity),cssFloat:!!l.style.cssFloat,checkOn:e.value==="on",optSelected:q.selected,getSetAttribute:D.className!=="t",enctype:!!R.createElement("form").enctype,html5Clone:R.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",submitBubbles:true,
changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};e.checked=true;d.noCloneChecked=e.cloneNode(true).checked;m.disabled=true;d.optDisabled=!q.disabled;try{delete D.test}catch(L){d.deleteExpando=false}if(!D.addEventListener&&D.attachEvent&&D.fireEvent){D.attachEvent("onclick",function(){d.noCloneEvent=false});D.cloneNode(true).fireEvent("onclick")}e=R.createElement("input");e.value="t";e.setAttribute("type",
"radio");d.radioValue=e.value==="t";e.setAttribute("checked","checked");D.appendChild(e);l=R.createDocumentFragment();l.appendChild(D.lastChild);d.checkClone=l.cloneNode(true).cloneNode(true).lastChild.checked;d.appendChecked=e.checked;l.removeChild(e);l.appendChild(D);D.innerHTML="";if(a.getComputedStyle){e=R.createElement("div");e.style.width="0";e.style.marginRight="0";D.style.width="2px";D.appendChild(e);d.reliableMarginRight=(parseInt((a.getComputedStyle(e,null)||{marginRight:0}).marginRight,
10)||0)===0}if(D.attachEvent)for(w in{submit:1,change:1,focusin:1}){e="on"+w;B=e in D;if(!B){D.setAttribute(e,"return;");B=typeof D[e]==="function"}d[w+"Bubbles"]=B}l.removeChild(D);l=m=q=e=D=e=null;g(function(){var aa,P,ca,X,la=R.getElementsByTagName("body")[0];if(la){aa=R.createElement("div");aa.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";la.insertBefore(aa,la.firstChild);D=R.createElement("div");aa.appendChild(D);D.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
s=D.getElementsByTagName("td");B=s[0].offsetHeight===0;s[0].style.display="";s[1].style.display="none";d.reliableHiddenOffsets=B&&s[0].offsetHeight===0;D.innerHTML="";D.style.width=D.style.paddingLeft="1px";g.boxModel=d.boxModel=D.offsetWidth===2;if(typeof D.style.zoom!=="undefined"){D.style.display="inline";D.style.zoom=1;d.inlineBlockNeedsLayout=D.offsetWidth===2;D.style.display="";D.innerHTML="<div style='width:4px;'></div>";d.shrinkWrapBlocks=D.offsetWidth!==2}D.style.cssText="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;visibility:hidden;border:0;";
D.innerHTML="<div style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;'><div></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";P=D.firstChild;ca=P.firstChild;X={doesNotAddBorder:ca.offsetTop!==5,doesAddBorderForTableAndCells:P.nextSibling.firstChild.firstChild.offsetTop===5};ca.style.position="fixed";ca.style.top="20px";
X.fixedPosition=ca.offsetTop===20||ca.offsetTop===15;ca.style.position=ca.style.top="";P.style.overflow="hidden";P.style.position="relative";X.subtractsBorderForOverflowNotVisible=ca.offsetTop===-5;X.doesNotIncludeMarginInBodyOffset=la.offsetTop!==1;la.removeChild(aa);D=null;g.extend(d,X)}});return d}();var eb=/^(?:\{.*\}|\[.*\])$/,La=/([A-Z])/g;g.extend({cache:{},uuid:0,expando:"jQuery"+(g.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
applet:true},hasData:function(d){d=d.nodeType?g.cache[d[g.expando]]:d[g.expando];return!!d&&!h(d)},data:function(d,e,l,m){if(g.acceptData(d)){var q;q=g.expando;var s=typeof e==="string",w=d.nodeType,B=w?g.cache:d,D=w?d[q]:d[q]&&q,L=e==="events";if(!((!D||!B[D]||!L&&!m&&!B[D].data)&&s&&l===b)){if(!D)if(w)d[q]=D=++g.uuid;else D=q;if(!B[D]){B[D]={};if(!w)B[D].toJSON=g.noop}if(typeof e==="object"||typeof e==="function")if(m)B[D]=g.extend(B[D],e);else B[D].data=g.extend(B[D].data,e);q=d=B[D];if(!m){if(!d.data)d.data=
{};d=d.data}if(l!==b)d[g.camelCase(e)]=l;if(L&&!d[e])return q.events;if(s){l=d[e];if(l==null)l=d[g.camelCase(e)]}else l=d;return l}}},removeData:function(d,e,l){if(g.acceptData(d)){var m,q,s,w=g.expando,B=d.nodeType,D=B?g.cache:d,L=B?d[w]:w;if(D[L]){if(e)if(m=l?D[L]:D[L].data){if(!g.isArray(e))if(e in m)e=[e];else{e=g.camelCase(e);e=e in m?[e]:e.split(" ")}q=0;for(s=e.length;q<s;q++)delete m[e[q]];if(!(l?h:g.isEmptyObject)(m))return}if(!l){delete D[L].data;if(!h(D[L]))return}if(g.support.deleteExpando||
!D.setInterval)delete D[L];else D[L]=null;if(B)if(g.support.deleteExpando)delete d[w];else if(d.removeAttribute)d.removeAttribute(w);else d[w]=null}}},_data:function(d,e,l){return g.data(d,e,l,true)},acceptData:function(d){if(d.nodeName){var e=g.noData[d.nodeName.toLowerCase()];if(e)return!(e===true||d.getAttribute("classid")!==e)}return true}});g.fn.extend({data:function(d,e){var l,m,q,s=null;if(typeof d==="undefined"){if(this.length){s=g.data(this[0]);if(this[0].nodeType===1&&!g._data(this[0],"parsedAttrs")){m=
this[0].attributes;for(var w=0,B=m.length;w<B;w++){q=m[w].name;if(q.indexOf("data-")===0){q=g.camelCase(q.substring(5));f(this[0],q,s[q])}}g._data(this[0],"parsedAttrs",true)}}return s}else if(typeof d==="object")return this.each(function(){g.data(this,d)});l=d.split(".");l[1]=l[1]?"."+l[1]:"";if(e===b){s=this.triggerHandler("getData"+l[1]+"!",[l[0]]);if(s===b&&this.length){s=g.data(this[0],d);s=f(this[0],d,s)}return s===b&&l[1]?this.data(l[0]):s}else return this.each(function(){var D=g(this),L=[l[0],
e];D.triggerHandler("setData"+l[1]+"!",L);g.data(this,d,e);D.triggerHandler("changeData"+l[1]+"!",L)})},removeData:function(d){return this.each(function(){g.removeData(this,d)})}});g.extend({_mark:function(d,e){if(d){e=(e||"fx")+"mark";g._data(d,e,(g._data(d,e)||0)+1)}},_unmark:function(d,e,l){if(d!==true){l=e;e=d;d=false}if(e){l=l||"fx";var m=l+"mark";if(d=d?0:(g._data(e,m)||1)-1)g._data(e,m,d);else{g.removeData(e,m,true);n(e,l,"mark")}}},queue:function(d,e,l){var m;if(d){e=(e||"fx")+"queue";m=g._data(d,
e);if(l)if(!m||g.isArray(l))m=g._data(d,e,g.makeArray(l));else m.push(l);return m||[]}},dequeue:function(d,e){e=e||"fx";var l=g.queue(d,e),m=l.shift(),q={};if(m==="inprogress")m=l.shift();if(m){e==="fx"&&l.unshift("inprogress");g._data(d,e+".run",q);m.call(d,function(){g.dequeue(d,e)},q)}if(!l.length){g.removeData(d,e+"queue "+e+".run",true);n(d,e,"queue")}}});g.fn.extend({queue:function(d,e){if(typeof d!=="string"){e=d;d="fx"}if(e===b)return g.queue(this[0],d);return this.each(function(){var l=g.queue(this,
d,e);d==="fx"&&l[0]!=="inprogress"&&g.dequeue(this,d)})},dequeue:function(d){return this.each(function(){g.dequeue(this,d)})},delay:function(d,e){d=g.fx?g.fx.speeds[d]||d:d;e=e||"fx";return this.queue(e,function(l,m){var q=setTimeout(l,d);m.stop=function(){clearTimeout(q)}})},clearQueue:function(d){return this.queue(d||"fx",[])},promise:function(d){function e(){--s||l.resolveWith(m,[m])}if(typeof d!=="string")d=b;d=d||"fx";var l=g.Deferred(),m=this,q=m.length,s=1,w=d+"defer",B=d+"queue";d=d+"mark";
for(var D;q--;)if(D=g.data(m[q],w,b,true)||(g.data(m[q],B,b,true)||g.data(m[q],d,b,true))&&g.data(m[q],w,g.Callbacks("once memory"),true)){s++;D.add(e)}e();return l.promise()}});var Qa=/[\n\t\r]/g,Ca=/\s+/,cb=/\r/g,gb=/^(?:button|input)$/i,ia=/^(?:button|input|object|select|textarea)$/i,J=/^a(?:rea)?$/i,S=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,ba=g.support.getSetAttribute,fa,ha,qa;g.fn.extend({attr:function(d,e){return g.access(this,
d,e,true,g.attr)},removeAttr:function(d){return this.each(function(){g.removeAttr(this,d)})},prop:function(d,e){return g.access(this,d,e,true,g.prop)},removeProp:function(d){d=g.propFix[d]||d;return this.each(function(){try{this[d]=b;delete this[d]}catch(e){}})},addClass:function(d){var e,l,m,q,s,w,B;if(g.isFunction(d))return this.each(function(D){g(this).addClass(d.call(this,D,this.className))});if(d&&typeof d==="string"){e=d.split(Ca);l=0;for(m=this.length;l<m;l++){q=this[l];if(q.nodeType===1)if(!q.className&&
e.length===1)q.className=d;else{s=" "+q.className+" ";w=0;for(B=e.length;w<B;w++)~s.indexOf(" "+e[w]+" ")||(s+=e[w]+" ");q.className=g.trim(s)}}}return this},removeClass:function(d){var e,l,m,q,s,w,B;if(g.isFunction(d))return this.each(function(D){g(this).removeClass(d.call(this,D,this.className))});if(d&&typeof d==="string"||d===b){e=(d||"").split(Ca);l=0;for(m=this.length;l<m;l++){q=this[l];if(q.nodeType===1&&q.className)if(d){s=(" "+q.className+" ").replace(Qa," ");w=0;for(B=e.length;w<B;w++)s=
s.replace(" "+e[w]+" "," ");q.className=g.trim(s)}else q.className=""}}return this},toggleClass:function(d,e){var l=typeof d,m=typeof e==="boolean";if(g.isFunction(d))return this.each(function(q){g(this).toggleClass(d.call(this,q,this.className,e),e)});return this.each(function(){if(l==="string")for(var q,s=0,w=g(this),B=e,D=d.split(Ca);q=D[s++];){B=m?B:!w.hasClass(q);w[B?"addClass":"removeClass"](q)}else if(l==="undefined"||l==="boolean"){this.className&&g._data(this,"__className__",this.className);
this.className=this.className||d===false?"":g._data(this,"__className__")||""}})},hasClass:function(d){d=" "+d+" ";for(var e=0,l=this.length;e<l;e++)if(this[e].nodeType===1&&(" "+this[e].className+" ").replace(Qa," ").indexOf(d)>-1)return true;return false},val:function(d){var e,l,m,q=this[0];if(arguments.length){m=g.isFunction(d);return this.each(function(s){var w=g(this);if(this.nodeType===1){s=m?d.call(this,s,w.val()):d;if(s==null)s="";else if(typeof s==="number")s+="";else if(g.isArray(s))s=g.map(s,
function(B){return B==null?"":B+""});e=g.valHooks[this.nodeName.toLowerCase()]||g.valHooks[this.type];if(!e||!("set"in e)||e.set(this,s,"value")===b)this.value=s}})}else if(q){if((e=g.valHooks[q.nodeName.toLowerCase()]||g.valHooks[q.type])&&"get"in e&&(l=e.get(q,"value"))!==b)return l;l=q.value;return typeof l==="string"?l.replace(cb,""):l==null?"":l}}});g.extend({valHooks:{option:{get:function(d){var e=d.attributes.value;return!e||e.specified?d.value:d.text}},select:{get:function(d){var e,l,m=d.selectedIndex,
q=[],s=d.options,w=d.type==="select-one";if(m<0)return null;d=w?m:0;for(l=w?m+1:s.length;d<l;d++){e=s[d];if(e.selected&&(g.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!g.nodeName(e.parentNode,"optgroup"))){e=g(e).val();if(w)return e;q.push(e)}}if(w&&!q.length&&s.length)return g(s[m]).val();return q},set:function(d,e){var l=g.makeArray(e);g(d).find("option").each(function(){this.selected=g.inArray(g(this).val(),l)>=0});if(!l.length)d.selectedIndex=-1;
return l}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(d,e,l,m){var q,s,w=d.nodeType;if(!(!d||w===3||w===8||w===2)){if(m&&e in g.attrFn)return g(d)[e](l);if(typeof d.getAttribute==="undefined")return g.prop(d,e,l);if(m=w!==1||!g.isXMLDoc(d)){e=e.toLowerCase();s=g.attrHooks[e]||(S.test(e)?ha:fa)}if(l!==b)if(l===null)g.removeAttr(d,e);else if(s&&"set"in s&&m&&(q=s.set(d,l,e))!==b)return q;else{d.setAttribute(e,""+l);return l}else if(s&&
"get"in s&&m&&(q=s.get(d,e))!==null)return q;else{q=d.getAttribute(e);return q===null?b:q}}},removeAttr:function(d,e){var l,m,q,s,w=0;if(e&&d.nodeType===1){m=e.toLowerCase().split(Ca);for(s=m.length;w<s;w++)if(q=m[w]){l=g.propFix[q]||q;g.attr(d,q,"");d.removeAttribute(ba?q:l);if(S.test(q)&&l in d)d[l]=false}}},attrHooks:{type:{set:function(d,e){if(gb.test(d.nodeName)&&d.parentNode)g.error("type property can't be changed");else if(!g.support.radioValue&&e==="radio"&&g.nodeName(d,"input")){var l=d.value;
d.setAttribute("type",e);if(l)d.value=l;return e}}},value:{get:function(d,e){if(fa&&g.nodeName(d,"button"))return fa.get(d,e);return e in d?d.value:null},set:function(d,e,l){if(fa&&g.nodeName(d,"button"))return fa.set(d,e,l);d.value=e}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},
prop:function(d,e,l){var m,q,s=d.nodeType;if(!(!d||s===3||s===8||s===2)){if(s!==1||!g.isXMLDoc(d)){e=g.propFix[e]||e;q=g.propHooks[e]}return l!==b?q&&"set"in q&&(m=q.set(d,l,e))!==b?m:d[e]=l:q&&"get"in q&&(m=q.get(d,e))!==null?m:d[e]}},propHooks:{tabIndex:{get:function(d){var e=d.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):ia.test(d.nodeName)||J.test(d.nodeName)&&d.href?0:b}}}});g.attrHooks.tabindex=g.propHooks.tabIndex;ha={get:function(d,e){var l,m=g.prop(d,e);return m===
true||typeof m!=="boolean"&&(l=d.getAttributeNode(e))&&l.nodeValue!==false?e.toLowerCase():b},set:function(d,e,l){if(e===false)g.removeAttr(d,l);else{e=g.propFix[l]||l;if(e in d)d[e]=true;d.setAttribute(l,l.toLowerCase())}return l}};if(!ba){qa={name:true,id:true};fa=g.valHooks.button={get:function(d,e){var l;return(l=d.getAttributeNode(e))&&(qa[e]?l.nodeValue!=="":l.specified)?l.nodeValue:b},set:function(d,e,l){var m=d.getAttributeNode(l);if(!m){m=R.createAttribute(l);d.setAttributeNode(m)}return m.nodeValue=
e+""}};g.attrHooks.tabindex.set=fa.set;g.each(["width","height"],function(d,e){g.attrHooks[e]=g.extend(g.attrHooks[e],{set:function(l,m){if(m===""){l.setAttribute(e,"auto");return m}}})});g.attrHooks.contenteditable={get:fa.get,set:function(d,e,l){if(e==="")e="false";fa.set(d,e,l)}}}g.support.hrefNormalized||g.each(["href","src","width","height"],function(d,e){g.attrHooks[e]=g.extend(g.attrHooks[e],{get:function(l){l=l.getAttribute(e,2);return l===null?b:l}})});if(!g.support.style)g.attrHooks.style=
{get:function(d){return d.style.cssText.toLowerCase()||b},set:function(d,e){return d.style.cssText=""+e}};if(!g.support.optSelected)g.propHooks.selected=g.extend(g.propHooks.selected,{get:function(){return null}});if(!g.support.enctype)g.propFix.enctype="encoding";g.support.checkOn||g.each(["radio","checkbox"],function(){g.valHooks[this]={get:function(d){return d.getAttribute("value")===null?"on":d.value}}});g.each(["radio","checkbox"],function(){g.valHooks[this]=g.extend(g.valHooks[this],{set:function(d,
e){if(g.isArray(e))return d.checked=g.inArray(g(d).val(),e)>=0}})});var oa=/^(?:textarea|input|select)$/i,xa=/^([^\.]*)?(?:\.(.+))?$/,Aa=/\bhover(\.\S+)?\b/,Ra=/^key/,Ya=/^(?:mouse|contextmenu)|click/,Ha=/^(?:focusinfocus|focusoutblur)$/,Ia=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Za=function(d){if(d=Ia.exec(d)){d[1]=(d[1]||"").toLowerCase();d[3]=d[3]&&RegExp("(?:^|\\s)"+d[3]+"(?:\\s|$)")}return d},Sa=function(d){return g.event.special.hover?d:d.replace(Aa,"mouseenter$1 mouseleave$1")};g.event={add:function(d,
e,l,m,q){var s,w,B,D,L,aa,P,ca,X;if(!(d.nodeType===3||d.nodeType===8||!e||!l||!(s=g._data(d)))){if(l.handler){P=l;l=P.handler}if(!l.guid)l.guid=g.guid++;B=s.events;if(!B)s.events=B={};w=s.handle;if(!w){s.handle=w=function(la){return typeof g!=="undefined"&&(!la||g.event.triggered!==la.type)?g.event.dispatch.apply(w.elem,arguments):b};w.elem=d}e=g.trim(Sa(e)).split(" ");for(s=0;s<e.length;s++){D=xa.exec(e[s])||[];L=D[1];aa=(D[2]||"").split(".").sort();X=g.event.special[L]||{};L=(q?X.delegateType:X.bindType)||
L;X=g.event.special[L]||{};D=g.extend({type:L,origType:D[1],data:m,handler:l,guid:l.guid,selector:q,quick:Za(q),namespace:aa.join(".")},P);ca=B[L];if(!ca){ca=B[L]=[];ca.delegateCount=0;if(!X.setup||X.setup.call(d,m,aa,w)===false)if(d.addEventListener)d.addEventListener(L,w,false);else d.attachEvent&&d.attachEvent("on"+L,w)}if(X.add){X.add.call(d,D);if(!D.handler.guid)D.handler.guid=l.guid}q?ca.splice(ca.delegateCount++,0,D):ca.push(D);g.event.global[L]=true}d=null}},global:{},remove:function(d,e,
l,m,q){var s=g.hasData(d)&&g._data(d),w,B,D,L,aa,P,ca,X,la,ra;if(s&&(ca=s.events)){e=g.trim(Sa(e||"")).split(" ");for(w=0;w<e.length;w++){B=xa.exec(e[w])||[];D=L=B[1];B=B[2];if(D){X=g.event.special[D]||{};D=(m?X.delegateType:X.bindType)||D;la=ca[D]||[];aa=la.length;B=B?RegExp("(^|\\.)"+B.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(P=0;P<la.length;P++){ra=la[P];if((q||L===ra.origType)&&(!l||l.guid===ra.guid)&&(!B||B.test(ra.namespace))&&(!m||m===ra.selector||m==="**"&&ra.selector)){la.splice(P--,
1);ra.selector&&la.delegateCount--;X.remove&&X.remove.call(d,ra)}}if(la.length===0&&aa!==la.length){if(!X.teardown||X.teardown.call(d,B)===false)g.removeEvent(d,D,s.handle);delete ca[D]}}else for(D in ca)g.event.remove(d,D+e[w],l,m,true)}if(g.isEmptyObject(ca)){if(e=s.handle)e.elem=null;g.removeData(d,["events","handle"],true)}}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(d,e,l,m){if(!(l&&(l.nodeType===3||l.nodeType===8))){var q=d.type||d,s=[],w,B,D,L,aa;if(!Ha.test(q+
g.event.triggered)){if(q.indexOf("!")>=0){q=q.slice(0,-1);w=true}if(q.indexOf(".")>=0){s=q.split(".");q=s.shift();s.sort()}if(!((!l||g.event.customEvent[q])&&!g.event.global[q])){d=typeof d==="object"?d[g.expando]?d:new g.Event(q,d):new g.Event(q);d.type=q;d.isTrigger=true;d.exclusive=w;d.namespace=s.join(".");d.namespace_re=d.namespace?RegExp("(^|\\.)"+s.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;w=q.indexOf(":")<0?"on"+q:"";if(l){d.result=b;if(!d.target)d.target=l;e=e!=null?g.makeArray(e):[];e.unshift(d);
D=g.event.special[q]||{};if(!(D.trigger&&D.trigger.apply(l,e)===false)){aa=[[l,D.bindType||q]];if(!m&&!D.noBubble&&!g.isWindow(l)){L=D.delegateType||q;s=Ha.test(L+q)?l:l.parentNode;for(B=null;s;s=s.parentNode){aa.push([s,L]);B=s}if(B&&B===l.ownerDocument)aa.push([B.defaultView||B.parentWindow||a,L])}for(B=0;B<aa.length&&!d.isPropagationStopped();B++){s=aa[B][0];d.type=aa[B][1];(L=(g._data(s,"events")||{})[d.type]&&g._data(s,"handle"))&&L.apply(s,e);(L=w&&s[w])&&g.acceptData(s)&&L.apply(s,e)===false&&
d.preventDefault()}d.type=q;if(!m&&!d.isDefaultPrevented())if((!D._default||D._default.apply(l.ownerDocument,e)===false)&&!(q==="click"&&g.nodeName(l,"a"))&&g.acceptData(l))if(w&&l[q]&&(q!=="focus"&&q!=="blur"||d.target.offsetWidth!==0)&&!g.isWindow(l)){if(B=l[w])l[w]=null;g.event.triggered=q;l[q]();g.event.triggered=b;if(B)l[w]=B}return d.result}}else{l=g.cache;for(B in l)l[B].events&&l[B].events[q]&&g.event.trigger(d,e,l[B].handle.elem,true)}}}}},dispatch:function(d){d=g.event.fix(d||a.event);var e=
(g._data(this,"events")||{})[d.type]||[],l=e.delegateCount,m=[].slice.call(arguments,0),q=!d.exclusive&&!d.namespace,s=[],w,B,D,L,aa,P,ca;m[0]=d;d.delegateTarget=this;if(l&&!d.target.disabled&&!(d.button&&d.type==="click")){D=g(this);D.context=this.ownerDocument||this;for(B=d.target;B!=this;B=B.parentNode||this){aa={};P=[];D[0]=B;for(w=0;w<l;w++){L=e[w];ca=L.selector;if(aa[ca]===b){var X=aa,la=ca,ra;if(L.quick){ra=L.quick;var va=B.attributes||{};ra=(!ra[1]||B.nodeName.toLowerCase()===ra[1])&&(!ra[2]||
(va.id||{}).value===ra[2])&&(!ra[3]||ra[3].test((va["class"]||{}).value))}else ra=D.is(ca);X[la]=ra}aa[ca]&&P.push(L)}P.length&&s.push({elem:B,matches:P})}}e.length>l&&s.push({elem:this,matches:e.slice(l)});for(w=0;w<s.length&&!d.isPropagationStopped();w++){l=s[w];d.currentTarget=l.elem;for(e=0;e<l.matches.length&&!d.isImmediatePropagationStopped();e++){L=l.matches[e];if(q||!d.namespace&&!L.namespace||d.namespace_re&&d.namespace_re.test(L.namespace)){d.data=L.data;d.handleObj=L;L=((g.event.special[L.origType]||
{}).handle||L.handler).apply(l.elem,m);if(L!==b){d.result=L;if(L===false){d.preventDefault();d.stopPropagation()}}}}}return d.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(d,e){if(d.which==null)d.which=e.charCode!=null?e.charCode:e.keyCode;return d}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter:function(d,e){var l,m,q=e.button,s=e.fromElement;if(d.pageX==null&&e.clientX!=null){l=d.target.ownerDocument||R;m=l.documentElement;l=l.body;d.pageX=e.clientX+(m&&m.scrollLeft||l&&l.scrollLeft||0)-(m&&m.clientLeft||l&&l.clientLeft||0);d.pageY=e.clientY+(m&&m.scrollTop||l&&l.scrollTop||0)-(m&&m.clientTop||l&&l.clientTop||0)}if(!d.relatedTarget&&s)d.relatedTarget=s===d.target?e.toElement:s;if(!d.which&&q!==b)d.which=q&1?1:q&2?3:q&4?2:0;return d}},fix:function(d){if(d[g.expando])return d;var e,
l,m=d,q=g.event.fixHooks[d.type]||{},s=q.props?this.props.concat(q.props):this.props;d=g.Event(m);for(e=s.length;e;){l=s[--e];d[l]=m[l]}if(!d.target)d.target=m.srcElement||R;if(d.target.nodeType===3)d.target=d.target.parentNode;if(d.metaKey===b)d.metaKey=d.ctrlKey;return q.filter?q.filter(d,m):d},special:{ready:{setup:g.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(d,e,l){if(g.isWindow(this))this.onbeforeunload=l},teardown:function(d,
e){if(this.onbeforeunload===e)this.onbeforeunload=null}}},simulate:function(d,e,l,m){d=g.extend(new g.Event,l,{type:d,isSimulated:true,originalEvent:{}});m?g.event.trigger(d,null,e):g.event.dispatch.call(e,d);d.isDefaultPrevented()&&l.preventDefault()}};g.event.handle=g.event.dispatch;g.removeEvent=R.removeEventListener?function(d,e,l){d.removeEventListener&&d.removeEventListener(e,l,false)}:function(d,e,l){d.detachEvent&&d.detachEvent("on"+e,l)};g.Event=function(d,e){if(!(this instanceof g.Event))return new g.Event(d,
e);if(d&&d.type){this.originalEvent=d;this.type=d.type;this.isDefaultPrevented=d.defaultPrevented||d.returnValue===false||d.getPreventDefault&&d.getPreventDefault()?k:j}else this.type=d;e&&g.extend(this,e);this.timeStamp=d&&d.timeStamp||g.now();this[g.expando]=true};g.Event.prototype={preventDefault:function(){this.isDefaultPrevented=k;var d=this.originalEvent;if(d)if(d.preventDefault)d.preventDefault();else d.returnValue=false},stopPropagation:function(){this.isPropagationStopped=k;var d=this.originalEvent;
if(d){d.stopPropagation&&d.stopPropagation();d.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()},isDefaultPrevented:j,isPropagationStopped:j,isImmediatePropagationStopped:j};g.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(d,e){g.event.special[d]={delegateType:e,bindType:e,handle:function(l){var m=l.relatedTarget,q=l.handleObj,s;if(!m||m!==this&&!g.contains(this,m)){l.type=q.origType;s=q.handler.apply(this,arguments);
l.type=e}return s}}});if(!g.support.submitBubbles)g.event.special.submit={setup:function(){if(g.nodeName(this,"form"))return false;g.event.add(this,"click._submit keypress._submit",function(d){d=d.target;if((d=g.nodeName(d,"input")||g.nodeName(d,"button")?d.form:b)&&!d._submit_attached){g.event.add(d,"submit._submit",function(e){this.parentNode&&!e.isTrigger&&g.event.simulate("submit",this.parentNode,e,true)});d._submit_attached=true}})},teardown:function(){if(g.nodeName(this,"form"))return false;
g.event.remove(this,"._submit")}};if(!g.support.changeBubbles)g.event.special.change={setup:function(){if(oa.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){g.event.add(this,"propertychange._change",function(d){if(d.originalEvent.propertyName==="checked")this._just_changed=true});g.event.add(this,"click._change",function(d){if(this._just_changed&&!d.isTrigger){this._just_changed=false;g.event.simulate("change",this,d,true)}})}return false}g.event.add(this,"beforeactivate._change",
function(d){d=d.target;if(oa.test(d.nodeName)&&!d._change_attached){g.event.add(d,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&g.event.simulate("change",this.parentNode,e,true)});d._change_attached=true}})},handle:function(d){var e=d.target;if(this!==e||d.isSimulated||d.isTrigger||e.type!=="radio"&&e.type!=="checkbox")return d.handleObj.handler.apply(this,arguments)},teardown:function(){g.event.remove(this,"._change");return oa.test(this.nodeName)}};g.support.focusinBubbles||
g.each({focus:"focusin",blur:"focusout"},function(d,e){var l=0,m=function(q){g.event.simulate(e,q.target,g.event.fix(q),true)};g.event.special[e]={setup:function(){l++===0&&R.addEventListener(d,m,true)},teardown:function(){--l===0&&R.removeEventListener(d,m,true)}}});g.fn.extend({on:function(d,e,l,m,q){var s,w;if(typeof d==="object"){if(typeof e!=="string"){l=e;e=b}for(w in d)this.on(w,e,l,d[w],q);return this}if(l==null&&m==null){m=e;l=e=b}else if(m==null)if(typeof e==="string"){m=l;l=b}else{m=l;
l=e;e=b}if(m===false)m=j;else if(!m)return this;if(q===1){s=m;m=function(B){g().off(B);return s.apply(this,arguments)};m.guid=s.guid||(s.guid=g.guid++)}return this.each(function(){g.event.add(this,d,m,l,e)})},one:function(d,e,l,m){return this.on.call(this,d,e,l,m,1)},off:function(d,e,l){if(d&&d.preventDefault&&d.handleObj){var m=d.handleObj;g(d.delegateTarget).off(m.namespace?m.type+"."+m.namespace:m.type,m.selector,m.handler);return this}if(typeof d==="object"){for(m in d)this.off(m,e,d[m]);return this}if(e===
false||typeof e==="function"){l=e;e=b}if(l===false)l=j;return this.each(function(){g.event.remove(this,d,l,e)})},bind:function(d,e,l){return this.on(d,null,e,l)},unbind:function(d,e){return this.off(d,null,e)},live:function(d,e,l){g(this.context).on(d,this.selector,e,l);return this},die:function(d,e){g(this.context).off(d,this.selector||"**",e);return this},delegate:function(d,e,l,m){return this.on(e,d,l,m)},undelegate:function(d,e,l){return arguments.length==1?this.off(d,"**"):this.off(e,d,l)},trigger:function(d,
e){return this.each(function(){g.event.trigger(d,e,this)})},triggerHandler:function(d,e){if(this[0])return g.event.trigger(d,e,this[0],true)},toggle:function(d){var e=arguments,l=d.guid||g.guid++,m=0,q=function(s){var w=(g._data(this,"lastToggle"+d.guid)||0)%m;g._data(this,"lastToggle"+d.guid,w+1);s.preventDefault();return e[w].apply(this,arguments)||false};for(q.guid=l;m<e.length;)e[m++].guid=l;return this.click(q)},hover:function(d,e){return this.mouseenter(d).mouseleave(e||d)}});g.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),
function(d,e){g.fn[e]=function(l,m){if(m==null){m=l;l=null}return arguments.length>0?this.on(e,null,l,m):this.trigger(e)};if(g.attrFn)g.attrFn[e]=true;if(Ra.test(e))g.event.fixHooks[e]=g.event.keyHooks;if(Ya.test(e))g.event.fixHooks[e]=g.event.mouseHooks});(function(){function d(t,z,G,I,K,O){K=0;for(var ea=I.length;K<ea;K++){var Y=I[K];if(Y){var na=false;for(Y=Y[t];Y;){if(Y[m]===G){na=I[Y.sizset];break}if(Y.nodeType===1&&!O){Y[m]=G;Y.sizset=K}if(Y.nodeName.toLowerCase()===z){na=Y;break}Y=Y[t]}I[K]=
na}}}function e(t,z,G,I,K,O){K=0;for(var ea=I.length;K<ea;K++){var Y=I[K];if(Y){var na=false;for(Y=Y[t];Y;){if(Y[m]===G){na=I[Y.sizset];break}if(Y.nodeType===1){if(!O){Y[m]=G;Y.sizset=K}if(typeof z!=="string"){if(Y===z){na=true;break}}else if(P.filter(z,[Y]).length>0){na=Y;break}}Y=Y[t]}I[K]=na}}}var l=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,m="sizcache"+(Math.random()+"").replace(".",""),q=0,s=Object.prototype.toString,
w=false,B=true,D=/\\/g,L=/\r\n/g,aa=/\W/;[0,0].sort(function(){B=false;return 0});var P=function(t,z,G,I){G=G||[];var K=z=z||R;if(z.nodeType!==1&&z.nodeType!==9)return[];if(!t||typeof t!=="string")return G;var O,ea,Y,na,A,U=true,Z=P.isXML(z),W=[],ka=t;do{l.exec("");if(O=l.exec(ka)){ka=O[3];W.push(O[1]);if(O[2]){na=O[3];break}}}while(O);if(W.length>1&&la.exec(t))if(W.length===2&&X.relative[W[0]])ea=Ga(W[0]+W[1],z,I);else for(ea=X.relative[W[0]]?[z]:P(W.shift(),z);W.length;){t=W.shift();if(X.relative[t])t+=
W.shift();ea=Ga(t,ea,I)}else{if(!I&&W.length>1&&z.nodeType===9&&!Z&&X.match.ID.test(W[0])&&!X.match.ID.test(W[W.length-1])){O=P.find(W.shift(),z,Z);z=O.expr?P.filter(O.expr,O.set)[0]:O.set[0]}if(z){O=I?{expr:W.pop(),set:ta(I)}:P.find(W.pop(),W.length===1&&(W[0]==="~"||W[0]==="+")&&z.parentNode?z.parentNode:z,Z);ea=O.expr?P.filter(O.expr,O.set):O.set;if(W.length>0)Y=ta(ea);else U=false;for(;W.length;){O=A=W.pop();if(X.relative[A])O=W.pop();else A="";if(O==null)O=z;X.relative[A](Y,O,Z)}}else Y=[]}Y||
(Y=ea);Y||P.error(A||t);if(s.call(Y)==="[object Array]")if(U)if(z&&z.nodeType===1)for(t=0;Y[t]!=null;t++){if(Y[t]&&(Y[t]===true||Y[t].nodeType===1&&P.contains(z,Y[t])))G.push(ea[t])}else for(t=0;Y[t]!=null;t++)Y[t]&&Y[t].nodeType===1&&G.push(ea[t]);else G.push.apply(G,Y);else ta(Y,G);if(na){P(na,K,G,I);P.uniqueSort(G)}return G};P.uniqueSort=function(t){if(Ea){w=B;t.sort(Ea);if(w)for(var z=1;z<t.length;z++)t[z]===t[z-1]&&t.splice(z--,1)}return t};P.matches=function(t,z){return P(t,null,null,z)};P.matchesSelector=
function(t,z){return P(z,null,null,[t]).length>0};P.find=function(t,z,G){var I,K,O,ea,Y,na;if(!t)return[];K=0;for(O=X.order.length;K<O;K++){Y=X.order[K];if(ea=X.leftMatch[Y].exec(t)){na=ea[1];ea.splice(1,1);if(na.substr(na.length-1)!=="\\"){ea[1]=(ea[1]||"").replace(D,"");I=X.find[Y](ea,z,G);if(I!=null){t=t.replace(X.match[Y],"");break}}}}I||(I=typeof z.getElementsByTagName!=="undefined"?z.getElementsByTagName("*"):[]);return{set:I,expr:t}};P.filter=function(t,z,G,I){for(var K,O,ea,Y,na,A,U,Z,W=t,
ka=[],ga=z,ua=z&&z[0]&&P.isXML(z[0]);t&&z.length;){for(ea in X.filter)if((K=X.leftMatch[ea].exec(t))!=null&&K[2]){A=X.filter[ea];na=K[1];O=false;K.splice(1,1);if(na.substr(na.length-1)!=="\\"){if(ga===ka)ka=[];if(X.preFilter[ea])if(K=X.preFilter[ea](K,ga,G,ka,I,ua)){if(K===true)continue}else O=Y=true;if(K)for(U=0;(na=ga[U])!=null;U++)if(na){Y=A(na,K,U,ga);Z=I^Y;if(G&&Y!=null)if(Z)O=true;else ga[U]=false;else if(Z){ka.push(na);O=true}}if(Y!==b){G||(ga=ka);t=t.replace(X.match[ea],"");if(!O)return[];
break}}}if(t===W)if(O==null)P.error(t);else break;W=t}return ga};P.error=function(t){throw Error("Syntax error, unrecognized expression: "+t);};var ca=P.getText=function(t){var z,G;z=t.nodeType;var I="";if(z)if(z===1||z===9)if(typeof t.textContent==="string")return t.textContent;else if(typeof t.innerText==="string")return t.innerText.replace(L,"");else for(t=t.firstChild;t;t=t.nextSibling)I+=ca(t);else{if(z===3||z===4)return t.nodeValue}else for(z=0;G=t[z];z++)if(G.nodeType!==8)I+=ca(G);return I},
X=P.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(t){return t.getAttribute("href")},type:function(t){return t.getAttribute("type")}},relative:{"+":function(t,z){var G=typeof z==="string",I=G&&!aa.test(z);G=G&&!I;if(I)z=z.toLowerCase();I=0;for(var K=t.length,O;I<K;I++)if(O=t[I]){for(;(O=O.previousSibling)&&O.nodeType!==1;);t[I]=G||O&&O.nodeName.toLowerCase()===z?O||false:O===z}G&&
P.filter(z,t,true)},">":function(t,z){var G,I=typeof z==="string",K=0,O=t.length;if(I&&!aa.test(z))for(z=z.toLowerCase();K<O;K++){if(G=t[K]){G=G.parentNode;t[K]=G.nodeName.toLowerCase()===z?G:false}}else{for(;K<O;K++)if(G=t[K])t[K]=I?G.parentNode:G.parentNode===z;I&&P.filter(z,t,true)}},"":function(t,z,G){var I,K=q++,O=e;if(typeof z==="string"&&!aa.test(z)){I=z=z.toLowerCase();O=d}O("parentNode",z,K,t,I,G)},"~":function(t,z,G){var I,K=q++,O=e;if(typeof z==="string"&&!aa.test(z)){I=z=z.toLowerCase();
O=d}O("previousSibling",z,K,t,I,G)}},find:{ID:function(t,z,G){if(typeof z.getElementById!=="undefined"&&!G)return(t=z.getElementById(t[1]))&&t.parentNode?[t]:[]},NAME:function(t,z){if(typeof z.getElementsByName!=="undefined"){for(var G=[],I=z.getElementsByName(t[1]),K=0,O=I.length;K<O;K++)I[K].getAttribute("name")===t[1]&&G.push(I[K]);return G.length===0?null:G}},TAG:function(t,z){if(typeof z.getElementsByTagName!=="undefined")return z.getElementsByTagName(t[1])}},preFilter:{CLASS:function(t,z,G,
I,K,O){t=" "+t[1].replace(D,"")+" ";if(O)return t;O=0;for(var ea;(ea=z[O])!=null;O++)if(ea)if(K^(ea.className&&(" "+ea.className+" ").replace(/[\t\n\r]/g," ").indexOf(t)>=0))G||I.push(ea);else if(G)z[O]=false;return false},ID:function(t){return t[1].replace(D,"")},TAG:function(t){return t[1].replace(D,"").toLowerCase()},CHILD:function(t){if(t[1]==="nth"){t[2]||P.error(t[0]);t[2]=t[2].replace(/^\+|\s*/g,"");var z=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(t[2]==="even"&&"2n"||t[2]==="odd"&&"2n+1"||!/\D/.test(t[2])&&
"0n+"+t[2]||t[2]);t[2]=z[1]+(z[2]||1)-0;t[3]=z[3]-0}else t[2]&&P.error(t[0]);t[0]=q++;return t},ATTR:function(t,z,G,I,K,O){z=t[1]=t[1].replace(D,"");if(!O&&X.attrMap[z])t[1]=X.attrMap[z];t[4]=(t[4]||t[5]||"").replace(D,"");if(t[2]==="~=")t[4]=" "+t[4]+" ";return t},PSEUDO:function(t,z,G,I,K){if(t[1]==="not")if((l.exec(t[3])||"").length>1||/^\w/.test(t[3]))t[3]=P(t[3],null,null,z);else{t=P.filter(t[3],z,G,true^K);G||I.push.apply(I,t);return false}else if(X.match.POS.test(t[0])||X.match.CHILD.test(t[0]))return true;
return t},POS:function(t){t.unshift(true);return t}},filters:{enabled:function(t){return t.disabled===false&&t.type!=="hidden"},disabled:function(t){return t.disabled===true},checked:function(t){return t.checked===true},selected:function(t){return t.selected===true},parent:function(t){return!!t.firstChild},empty:function(t){return!t.firstChild},has:function(t,z,G){return!!P(G[3],t).length},header:function(t){return/h\d/i.test(t.nodeName)},text:function(t){var z=t.getAttribute("type"),G=t.type;return t.nodeName.toLowerCase()===
"input"&&"text"===G&&(z===G||z===null)},radio:function(t){return t.nodeName.toLowerCase()==="input"&&"radio"===t.type},checkbox:function(t){return t.nodeName.toLowerCase()==="input"&&"checkbox"===t.type},file:function(t){return t.nodeName.toLowerCase()==="input"&&"file"===t.type},password:function(t){return t.nodeName.toLowerCase()==="input"&&"password"===t.type},submit:function(t){var z=t.nodeName.toLowerCase();return(z==="input"||z==="button")&&"submit"===t.type},image:function(t){return t.nodeName.toLowerCase()===
"input"&&"image"===t.type},reset:function(t){var z=t.nodeName.toLowerCase();return(z==="input"||z==="button")&&"reset"===t.type},button:function(t){var z=t.nodeName.toLowerCase();return z==="input"&&"button"===t.type||z==="button"},input:function(t){return/input|select|textarea|button/i.test(t.nodeName)},focus:function(t){return t===t.ownerDocument.activeElement}},setFilters:{first:function(t,z){return z===0},last:function(t,z,G,I){return z===I.length-1},even:function(t,z){return z%2===0},odd:function(t,
z){return z%2===1},lt:function(t,z,G){return z<G[3]-0},gt:function(t,z,G){return z>G[3]-0},nth:function(t,z,G){return G[3]-0===z},eq:function(t,z,G){return G[3]-0===z}},filter:{PSEUDO:function(t,z,G,I){var K=z[1],O=X.filters[K];if(O)return O(t,G,z,I);else if(K==="contains")return(t.textContent||t.innerText||ca([t])||"").indexOf(z[3])>=0;else if(K==="not"){z=z[3];G=0;for(I=z.length;G<I;G++)if(z[G]===t)return false;return true}else P.error(K)},CHILD:function(t,z){var G,I,K,O,ea,Y;G=z[1];Y=t;switch(G){case "only":case "first":for(;Y=
Y.previousSibling;)if(Y.nodeType===1)return false;if(G==="first")return true;Y=t;case "last":for(;Y=Y.nextSibling;)if(Y.nodeType===1)return false;return true;case "nth":G=z[2];I=z[3];if(G===1&&I===0)return true;K=z[0];if((O=t.parentNode)&&(O[m]!==K||!t.nodeIndex)){ea=0;for(Y=O.firstChild;Y;Y=Y.nextSibling)if(Y.nodeType===1)Y.nodeIndex=++ea;O[m]=K}Y=t.nodeIndex-I;return G===0?Y===0:Y%G===0&&Y/G>=0}},ID:function(t,z){return t.nodeType===1&&t.getAttribute("id")===z},TAG:function(t,z){return z==="*"&&
t.nodeType===1||!!t.nodeName&&t.nodeName.toLowerCase()===z},CLASS:function(t,z){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(z)>-1},ATTR:function(t,z){var G=z[1];G=P.attr?P.attr(t,G):X.attrHandle[G]?X.attrHandle[G](t):t[G]!=null?t[G]:t.getAttribute(G);var I=G+"",K=z[2],O=z[4];return G==null?K==="!=":!K&&P.attr?G!=null:K==="="?I===O:K==="*="?I.indexOf(O)>=0:K==="~="?(" "+I+" ").indexOf(O)>=0:!O?I&&G!==false:K==="!="?I!==O:K==="^="?I.indexOf(O)===0:K==="$="?I.substr(I.length-O.length)===
O:K==="|="?I===O||I.substr(0,O.length+1)===O+"-":false},POS:function(t,z,G,I){var K=X.setFilters[z[2]];if(K)return K(t,G,z,I)}}},la=X.match.POS,ra=function(t,z){return"\\"+(z-0+1)},va;for(va in X.match){X.match[va]=RegExp(X.match[va].source+/(?![^\[]*\])(?![^\(]*\))/.source);X.leftMatch[va]=RegExp(/(^(?:.|\r|\n)*?)/.source+X.match[va].source.replace(/\\(\d+)/g,ra))}var ta=function(t,z){t=Array.prototype.slice.call(t,0);if(z){z.push.apply(z,t);return z}return t};try{Array.prototype.slice.call(R.documentElement.childNodes,
0)}catch(Ma){ta=function(t,z){var G=0,I=z||[];if(s.call(t)==="[object Array]")Array.prototype.push.apply(I,t);else if(typeof t.length==="number")for(var K=t.length;G<K;G++)I.push(t[G]);else for(;t[G];G++)I.push(t[G]);return I}}var Ea,ma;if(R.documentElement.compareDocumentPosition)Ea=function(t,z){if(t===z){w=true;return 0}if(!t.compareDocumentPosition||!z.compareDocumentPosition)return t.compareDocumentPosition?-1:1;return t.compareDocumentPosition(z)&4?-1:1};else{Ea=function(t,z){if(t===z){w=true;
return 0}else if(t.sourceIndex&&z.sourceIndex)return t.sourceIndex-z.sourceIndex;var G,I,K=[],O=[];G=t.parentNode;I=z.parentNode;var ea=G;if(G===I)return ma(t,z);else if(G){if(!I)return 1}else return-1;for(;ea;){K.unshift(ea);ea=ea.parentNode}for(ea=I;ea;){O.unshift(ea);ea=ea.parentNode}G=K.length;I=O.length;for(ea=0;ea<G&&ea<I;ea++)if(K[ea]!==O[ea])return ma(K[ea],O[ea]);return ea===G?ma(t,O[ea],-1):ma(K[ea],z,1)};ma=function(t,z,G){if(t===z)return G;for(t=t.nextSibling;t;){if(t===z)return-1;t=t.nextSibling}return 1}}(function(){var t=
R.createElement("div"),z="script"+(new Date).getTime(),G=R.documentElement;t.innerHTML="<a name='"+z+"'/>";G.insertBefore(t,G.firstChild);if(R.getElementById(z)){X.find.ID=function(I,K,O){if(typeof K.getElementById!=="undefined"&&!O)return(K=K.getElementById(I[1]))?K.id===I[1]||typeof K.getAttributeNode!=="undefined"&&K.getAttributeNode("id").nodeValue===I[1]?[K]:b:[]};X.filter.ID=function(I,K){var O=typeof I.getAttributeNode!=="undefined"&&I.getAttributeNode("id");return I.nodeType===1&&O&&O.nodeValue===
K}}G.removeChild(t);G=t=null})();(function(){var t=R.createElement("div");t.appendChild(R.createComment(""));if(t.getElementsByTagName("*").length>0)X.find.TAG=function(z,G){var I=G.getElementsByTagName(z[1]);if(z[1]==="*"){for(var K=[],O=0;I[O];O++)I[O].nodeType===1&&K.push(I[O]);I=K}return I};t.innerHTML="<a href='#'></a>";if(t.firstChild&&typeof t.firstChild.getAttribute!=="undefined"&&t.firstChild.getAttribute("href")!=="#")X.attrHandle.href=function(z){return z.getAttribute("href",2)};t=null})();
R.querySelectorAll&&function(){var t=P,z=R.createElement("div");z.innerHTML="<p class='TEST'></p>";if(!(z.querySelectorAll&&z.querySelectorAll(".TEST").length===0)){P=function(I,K,O,ea){K=K||R;if(!ea&&!P.isXML(K)){var Y=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(I);if(Y&&(K.nodeType===1||K.nodeType===9))if(Y[1])return ta(K.getElementsByTagName(I),O);else if(Y[2]&&X.find.CLASS&&K.getElementsByClassName)return ta(K.getElementsByClassName(Y[2]),O);if(K.nodeType===9){if(I==="body"&&K.body)return ta([K.body],
O);else if(Y&&Y[3]){var na=K.getElementById(Y[3]);if(na&&na.parentNode){if(na.id===Y[3])return ta([na],O)}else return ta([],O)}try{return ta(K.querySelectorAll(I),O)}catch(A){}}else if(K.nodeType===1&&K.nodeName.toLowerCase()!=="object"){Y=K;var U=(na=K.getAttribute("id"))||"__sizzle__",Z=K.parentNode,W=/^\s*[+~]/.test(I);if(na)U=U.replace(/'/g,"\\$&");else K.setAttribute("id",U);if(W&&Z)K=K.parentNode;try{if(!W||Z)return ta(K.querySelectorAll("[id='"+U+"'] "+I),O)}catch(ka){}finally{na||Y.removeAttribute("id")}}}return t(I,
K,O,ea)};for(var G in t)P[G]=t[G];z=null}}();(function(){var t=R.documentElement,z=t.matchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.msMatchesSelector;if(z){var G=!z.call(R.createElement("div"),"div"),I=false;try{z.call(R.documentElement,"[test!='']:sizzle")}catch(K){I=true}P.matchesSelector=function(O,ea){ea=ea.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!P.isXML(O))try{if(I||!X.match.PSEUDO.test(ea)&&!/!=/.test(ea)){var Y=z.call(O,ea);if(Y||!G||O.document&&O.document.nodeType!==
11)return Y}}catch(na){}return P(ea,null,null,[O]).length>0}}})();(function(){var t=R.createElement("div");t.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!t.getElementsByClassName||t.getElementsByClassName("e").length===0)){t.lastChild.className="e";if(t.getElementsByClassName("e").length!==1){X.order.splice(1,0,"CLASS");X.find.CLASS=function(z,G,I){if(typeof G.getElementsByClassName!=="undefined"&&!I)return G.getElementsByClassName(z[1])};t=null}}})();P.contains=R.documentElement.contains?
function(t,z){return t!==z&&(t.contains?t.contains(z):true)}:R.documentElement.compareDocumentPosition?function(t,z){return!!(t.compareDocumentPosition(z)&16)}:function(){return false};P.isXML=function(t){return(t=(t?t.ownerDocument||t:0).documentElement)?t.nodeName!=="HTML":false};var Ga=function(t,z,G){var I,K=[],O="";for(z=z.nodeType?[z]:z;I=X.match.PSEUDO.exec(t);){O+=I[0];t=t.replace(X.match.PSEUDO,"")}t=X.relative[t]?t+"*":t;I=0;for(var ea=z.length;I<ea;I++)P(t,z[I],K,G);return P.filter(O,K)};
P.attr=g.attr;P.selectors.attrMap={};g.find=P;g.expr=P.selectors;g.expr[":"]=g.expr.filters;g.unique=P.uniqueSort;g.text=P.getText;g.isXMLDoc=P.isXML;g.contains=P.contains})();var Pb=/Until$/,Qb=/^(?:parents|prevUntil|prevAll)/,Rb=/,/,Kb=/^.[^:#\[\.,]*$/,Sb=Array.prototype.slice,ub=g.expr.match.POS,Tb={children:true,contents:true,next:true,prev:true};g.fn.extend({find:function(d){var e=this,l,m;if(typeof d!=="string")return g(d).filter(function(){l=0;for(m=e.length;l<m;l++)if(g.contains(e[l],this))return true});
var q=this.pushStack("","find",d),s,w,B;l=0;for(m=this.length;l<m;l++){s=q.length;g.find(d,this[l],q);if(l>0)for(w=s;w<q.length;w++)for(B=0;B<s;B++)if(q[B]===q[w]){q.splice(w--,1);break}}return q},has:function(d){var e=g(d);return this.filter(function(){for(var l=0,m=e.length;l<m;l++)if(g.contains(this,e[l]))return true})},not:function(d){return this.pushStack(o(this,d,false),"not",d)},filter:function(d){return this.pushStack(o(this,d,true),"filter",d)},is:function(d){return!!d&&(typeof d==="string"?
ub.test(d)?g(d,this.context).index(this[0])>=0:g.filter(d,this).length>0:this.filter(d).length>0)},closest:function(d,e){var l=[],m,q,s=this[0];if(g.isArray(d)){for(q=1;s&&s.ownerDocument&&s!==e;){for(m=0;m<d.length;m++)g(s).is(d[m])&&l.push({selector:d[m],elem:s,level:q});s=s.parentNode;q++}return l}var w=ub.test(d)||typeof d!=="string"?g(d,e||this.context):0;m=0;for(q=this.length;m<q;m++)for(s=this[m];s;)if(w?w.index(s)>-1:g.find.matchesSelector(s,d)){l.push(s);break}else{s=s.parentNode;if(!s||
!s.ownerDocument||s===e||s.nodeType===11)break}l=l.length>1?g.unique(l):l;return this.pushStack(l,"closest",d)},index:function(d){if(!d)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof d==="string")return g.inArray(this[0],g(d));return g.inArray(d.jquery?d[0]:d,this)},add:function(d,e){var l=typeof d==="string"?g(d,e):g.makeArray(d&&d.nodeType?[d]:d),m=g.merge(this.get(),l);return this.pushStack(!l[0]||!l[0].parentNode||l[0].parentNode.nodeType===11||!m[0]||!m[0].parentNode||
m[0].parentNode.nodeType===11?m:g.unique(m))},andSelf:function(){return this.add(this.prevObject)}});g.each({parent:function(d){return(d=d.parentNode)&&d.nodeType!==11?d:null},parents:function(d){return g.dir(d,"parentNode")},parentsUntil:function(d,e,l){return g.dir(d,"parentNode",l)},next:function(d){return g.nth(d,2,"nextSibling")},prev:function(d){return g.nth(d,2,"previousSibling")},nextAll:function(d){return g.dir(d,"nextSibling")},prevAll:function(d){return g.dir(d,"previousSibling")},nextUntil:function(d,
e,l){return g.dir(d,"nextSibling",l)},prevUntil:function(d,e,l){return g.dir(d,"previousSibling",l)},siblings:function(d){return g.sibling(d.parentNode.firstChild,d)},children:function(d){return g.sibling(d.firstChild)},contents:function(d){return g.nodeName(d,"iframe")?d.contentDocument||d.contentWindow.document:g.makeArray(d.childNodes)}},function(d,e){g.fn[d]=function(l,m){var q=g.map(this,e,l);Pb.test(d)||(m=l);if(m&&typeof m==="string")q=g.filter(m,q);q=this.length>1&&!Tb[d]?g.unique(q):q;if((this.length>
1||Rb.test(m))&&Qb.test(d))q=q.reverse();return this.pushStack(q,d,Sb.call(arguments).join(","))}});g.extend({filter:function(d,e,l){if(l)d=":not("+d+")";return e.length===1?g.find.matchesSelector(e[0],d)?[e[0]]:[]:g.find.matches(d,e)},dir:function(d,e,l){var m=[];for(d=d[e];d&&d.nodeType!==9&&(l===b||d.nodeType!==1||!g(d).is(l));){d.nodeType===1&&m.push(d);d=d[e]}return m},nth:function(d,e,l){e=e||1;for(var m=0;d;d=d[l])if(d.nodeType===1&&++m===e)break;return d},sibling:function(d,e){for(var l=[];d;d=
d.nextSibling)d.nodeType===1&&d!==e&&l.push(d);return l}});var rb="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ub=/ jQuery\d+="(?:\d+|null)"/g,nb=/^\s+/,vb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,wb=/<([\w:]+)/,Vb=/<tbody/i,Wb=/<|&#?\w+;/,Xb=/<(?:script|style)/i,Yb=/<(?:script|object|embed|option|style)/i,xb=RegExp("<(?:"+rb+")","i"),yb=/checked\s*(?:[^=]|=\s*.checked.)/i,
Zb=/\/(java|ecma)script/i,Lb=/^\s*<!(?:\[CDATA\[|\-\-)/,Fa={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},zb=p(R);Fa.optgroup=Fa.option;Fa.tbody=Fa.tfoot=Fa.colgroup=Fa.caption=Fa.thead;Fa.th=Fa.td;if(!g.support.htmlSerialize)Fa._default=
[1,"div<div>","</div>"];g.fn.extend({text:function(d){if(g.isFunction(d))return this.each(function(e){var l=g(this);l.text(d.call(this,e,l.text()))});if(typeof d!=="object"&&d!==b)return this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(d));return g.text(this)},wrapAll:function(d){if(g.isFunction(d))return this.each(function(l){g(this).wrapAll(d.call(this,l))});if(this[0]){var e=g(d,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&e.insertBefore(this[0]);e.map(function(){for(var l=
this;l.firstChild&&l.firstChild.nodeType===1;)l=l.firstChild;return l}).append(this)}return this},wrapInner:function(d){if(g.isFunction(d))return this.each(function(e){g(this).wrapInner(d.call(this,e))});return this.each(function(){var e=g(this),l=e.contents();l.length?l.wrapAll(d):e.append(d)})},wrap:function(d){var e=g.isFunction(d);return this.each(function(l){g(this).wrapAll(e?d.call(this,l):d)})},unwrap:function(){return this.parent().each(function(){g.nodeName(this,"body")||g(this).replaceWith(this.childNodes)}).end()},
append:function(){return this.domManip(arguments,true,function(d){this.nodeType===1&&this.appendChild(d)})},prepend:function(){return this.domManip(arguments,true,function(d){this.nodeType===1&&this.insertBefore(d,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this)});else if(arguments.length){var d=g.clean(arguments);d.push.apply(d,this.toArray());return this.pushStack(d,"before",arguments)}},after:function(){if(this[0]&&
this[0].parentNode)return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this.nextSibling)});else if(arguments.length){var d=this.pushStack(this,"after",arguments);d.push.apply(d,g.clean(arguments));return d}},remove:function(d,e){for(var l=0,m;(m=this[l])!=null;l++)if(!d||g.filter(d,[m]).length){if(!e&&m.nodeType===1){g.cleanData(m.getElementsByTagName("*"));g.cleanData([m])}m.parentNode&&m.parentNode.removeChild(m)}return this},empty:function(){for(var d=0,e;(e=this[d])!=
null;d++)for(e.nodeType===1&&g.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(d,e){d=d==null?false:d;e=e==null?d:e;return this.map(function(){return g.clone(this,d,e)})},html:function(d){if(d===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ub,""):null;else if(typeof d==="string"&&!Xb.test(d)&&(g.support.leadingWhitespace||!nb.test(d))&&!Fa[(wb.exec(d)||["",""])[1].toLowerCase()]){d=d.replace(vb,"<$1></$2>");try{for(var e=
0,l=this.length;e<l;e++)if(this[e].nodeType===1){g.cleanData(this[e].getElementsByTagName("*"));this[e].innerHTML=d}}catch(m){this.empty().append(d)}}else g.isFunction(d)?this.each(function(q){var s=g(this);s.html(d.call(this,q,s.html()))}):this.empty().append(d);return this},replaceWith:function(d){if(this[0]&&this[0].parentNode){if(g.isFunction(d))return this.each(function(e){var l=g(this),m=l.html();l.replaceWith(d.call(this,e,m))});if(typeof d!=="string")d=g(d).detach();return this.each(function(){var e=
this.nextSibling,l=this.parentNode;g(this).remove();e?g(e).before(d):g(l).append(d)})}else return this.length?this.pushStack(g(g.isFunction(d)?d():d),"replaceWith",d):this},detach:function(d){return this.remove(d,true)},domManip:function(d,e,l){var m,q,s,w=d[0],B=[];if(!g.support.checkClone&&arguments.length===3&&typeof w==="string"&&yb.test(w))return this.each(function(){g(this).domManip(d,e,l,true)});if(g.isFunction(w))return this.each(function(aa){var P=g(this);d[0]=w.call(this,aa,e?P.html():b);
P.domManip(d,e,l)});if(this[0]){m=w&&w.parentNode;m=g.support.parentNode&&m&&m.nodeType===11&&m.childNodes.length===this.length?{fragment:m}:g.buildFragment(d,this,B);s=m.fragment;if(q=s.childNodes.length===1?s=s.firstChild:s.firstChild){e=e&&g.nodeName(q,"tr");q=0;for(var D=this.length,L=D-1;q<D;q++)l.call(e?g.nodeName(this[q],"table")?this[q].getElementsByTagName("tbody")[0]||this[q].appendChild(this[q].ownerDocument.createElement("tbody")):this[q]:this[q],m.cacheable||D>1&&q<L?g.clone(s,true,true):
s)}B.length&&g.each(B,ya)}return this}});g.buildFragment=function(d,e,l){var m,q,s,w,B=d[0];if(e&&e[0])w=e[0].ownerDocument||e[0];w.createDocumentFragment||(w=R);if(d.length===1&&typeof B==="string"&&B.length<512&&w===R&&B.charAt(0)==="<"&&!Yb.test(B)&&(g.support.checkClone||!yb.test(B))&&(g.support.html5Clone||!xb.test(B))){q=true;if((s=g.fragments[B])&&s!==1)m=s}if(!m){m=w.createDocumentFragment();g.clean(d,w,m,l)}if(q)g.fragments[B]=s?m:1;return{fragment:m,cacheable:q}};g.fragments={};g.each({appendTo:"append",
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(d,e){g.fn[d]=function(l){var m=[];l=g(l);var q=this.length===1&&this[0].parentNode;if(q&&q.nodeType===11&&q.childNodes.length===1&&l.length===1){l[e](this[0]);return this}else{q=0;for(var s=l.length;q<s;q++){var w=(q>0?this.clone(true):this).get();g(l[q])[e](w);m=m.concat(w)}return this.pushStack(m,d,l.selector)}}});g.extend({clone:function(d,e,l){var m,q,s;if(g.support.html5Clone||!xb.test("<"+d.nodeName))m=
d.cloneNode(true);else{m=R.createElement("div");zb.appendChild(m);m.innerHTML=d.outerHTML;m=m.firstChild}var w=m;if((!g.support.noCloneEvent||!g.support.noCloneChecked)&&(d.nodeType===1||d.nodeType===11)&&!g.isXMLDoc(d)){F(d,w);m=V(d);q=V(w);for(s=0;m[s];++s)q[s]&&F(m[s],q[s])}if(e){v(d,w);if(l){m=V(d);q=V(w);for(s=0;m[s];++s)v(m[s],q[s])}}return w},clean:function(d,e,l,m){e=e||R;if(typeof e.createElement==="undefined")e=e.ownerDocument||e[0]&&e[0].ownerDocument||R;for(var q=[],s,w=0,B;(B=d[w])!=
null;w++){if(typeof B==="number")B+="";if(B){if(typeof B==="string")if(Wb.test(B)){B=B.replace(vb,"<$1></$2>");s=(wb.exec(B)||["",""])[1].toLowerCase();var D=Fa[s]||Fa._default,L=D[0],aa=e.createElement("div");e===R?zb.appendChild(aa):p(e).appendChild(aa);for(aa.innerHTML=D[1]+B+D[2];L--;)aa=aa.lastChild;if(!g.support.tbody){L=Vb.test(B);D=s==="table"&&!L?aa.firstChild&&aa.firstChild.childNodes:D[1]==="<table>"&&!L?aa.childNodes:[];for(s=D.length-1;s>=0;--s)g.nodeName(D[s],"tbody")&&!D[s].childNodes.length&&
D[s].parentNode.removeChild(D[s])}!g.support.leadingWhitespace&&nb.test(B)&&aa.insertBefore(e.createTextNode(nb.exec(B)[0]),aa.firstChild);B=aa.childNodes}else B=e.createTextNode(B);var P;if(!g.support.appendChecked)if(B[0]&&typeof(P=B.length)==="number")for(s=0;s<P;s++)sa(B[s]);else sa(B);if(B.nodeType)q.push(B);else q=g.merge(q,B)}}if(l){d=function(ca){return!ca.type||Zb.test(ca.type)};for(w=0;q[w];w++)if(m&&g.nodeName(q[w],"script")&&(!q[w].type||q[w].type.toLowerCase()==="text/javascript"))m.push(q[w].parentNode?
q[w].parentNode.removeChild(q[w]):q[w]);else{if(q[w].nodeType===1){e=g.grep(q[w].getElementsByTagName("script"),d);q.splice.apply(q,[w+1,0].concat(e))}l.appendChild(q[w])}}return q},cleanData:function(d){for(var e,l,m=g.cache,q=g.event.special,s=g.support.deleteExpando,w=0,B;(B=d[w])!=null;w++)if(!(B.nodeName&&g.noData[B.nodeName.toLowerCase()]))if(l=B[g.expando]){if((e=m[l])&&e.events){for(var D in e.events)q[D]?g.event.remove(B,D):g.removeEvent(B,D,e.handle);if(e.handle)e.handle.elem=null}if(s)delete B[g.expando];
else B.removeAttribute&&B.removeAttribute(g.expando);delete m[l]}}});var ob=/alpha\([^)]*\)/i,$b=/opacity=([^)]*)/,ac=/([A-Z]|^ms)/g,Ab=/^-?\d+(?:px)?$/i,bc=/^-?\d/,cc=/^([\-+])=([\-+.\de]+)/,dc={position:"absolute",visibility:"hidden",display:"block"},Mb=["Left","Right"],Nb=["Top","Bottom"],Wa,Bb,Cb;g.fn.css=function(d,e){if(arguments.length===2&&e===b)return this;return g.access(this,d,e,true,function(l,m,q){return q!==b?g.style(l,m,q):g.css(l,m)})};g.extend({cssHooks:{opacity:{get:function(d,e){if(e){var l=
Wa(d,"opacity","opacity");return l===""?"1":l}else return d.style.opacity}}},cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":g.support.cssFloat?"cssFloat":"styleFloat"},style:function(d,e,l,m){if(!(!d||d.nodeType===3||d.nodeType===8||!d.style)){var q,s=g.camelCase(e),w=d.style,B=g.cssHooks[s];e=g.cssProps[s]||s;if(l!==b){m=typeof l;if(m==="string"&&(q=cc.exec(l))){l=+(q[1]+1)*+q[2]+parseFloat(g.css(d,e));m=
"number"}if(!(l==null||m==="number"&&isNaN(l))){if(m==="number"&&!g.cssNumber[s])l+="px";if(!B||!("set"in B)||(l=B.set(d,l))!==b)try{w[e]=l}catch(D){}}}else{if(B&&"get"in B&&(q=B.get(d,false,m))!==b)return q;return w[e]}}},css:function(d,e,l){var m,q;e=g.camelCase(e);q=g.cssHooks[e];e=g.cssProps[e]||e;if(e==="cssFloat")e="float";if(q&&"get"in q&&(m=q.get(d,true,l))!==b)return m;else if(Wa)return Wa(d,e)},swap:function(d,e,l){var m={},q;for(q in e){m[q]=d.style[q];d.style[q]=e[q]}l.call(d);for(q in e)d.style[q]=
m[q]}});g.curCSS=g.css;g.each(["height","width"],function(d,e){g.cssHooks[e]={get:function(l,m,q){var s;if(m){if(l.offsetWidth!==0)return Ba(l,e,q);else g.swap(l,dc,function(){s=Ba(l,e,q)});return s}},set:function(l,m){if(Ab.test(m)){m=parseFloat(m);if(m>=0)return m+"px"}else return m}}});if(!g.support.opacity)g.cssHooks.opacity={get:function(d,e){return $b.test((e&&d.currentStyle?d.currentStyle.filter:d.style.filter)||"")?parseFloat(RegExp.$1)/100+"":e?"1":""},set:function(d,e){var l=d.style,m=d.currentStyle,
q=g.isNumeric(e)?"alpha(opacity="+e*100+")":"",s=m&&m.filter||l.filter||"";l.zoom=1;if(e>=1&&g.trim(s.replace(ob,""))===""){l.removeAttribute("filter");if(m&&!m.filter)return}l.filter=ob.test(s)?s.replace(ob,q):s+" "+q}};g(function(){if(!g.support.reliableMarginRight)g.cssHooks.marginRight={get:function(d,e){var l;g.swap(d,{display:"inline-block"},function(){l=e?Wa(d,"margin-right","marginRight"):d.style.marginRight});return l}}});if(R.defaultView&&R.defaultView.getComputedStyle)Bb=function(d,e){var l,
m,q;e=e.replace(ac,"-$1").toLowerCase();if((m=d.ownerDocument.defaultView)&&(q=m.getComputedStyle(d,null))){l=q.getPropertyValue(e);if(l===""&&!g.contains(d.ownerDocument.documentElement,d))l=g.style(d,e)}return l};if(R.documentElement.currentStyle)Cb=function(d,e){var l,m,q=d.currentStyle&&d.currentStyle[e],s=d.style;if(q===null&&s&&(l=s[e]))q=l;if(!Ab.test(q)&&bc.test(q)){l=s.left;if(m=d.runtimeStyle&&d.runtimeStyle.left)d.runtimeStyle.left=d.currentStyle.left;s.left=e==="fontSize"?"1em":q||0;q=
s.pixelLeft+"px";s.left=l;if(m)d.runtimeStyle.left=m}return q===""?"auto":q};Wa=Bb||Cb;if(g.expr&&g.expr.filters){g.expr.filters.hidden=function(d){var e=d.offsetHeight;return d.offsetWidth===0&&e===0||!g.support.reliableHiddenOffsets&&(d.style&&d.style.display||g.css(d,"display"))==="none"};g.expr.filters.visible=function(d){return!g.expr.filters.hidden(d)}}var ec=/%20/g,Ob=/\[\]$/,Db=/\r?\n/g,fc=/#.*$/,gc=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,hc=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
ic=/^(?:GET|HEAD)$/,jc=/^\/\//,Eb=/\?/,kc=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,lc=/^(?:select|textarea)/i,sb=/\s+/,mc=/([?&])_=[^&]*/,Fb=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Gb=g.fn.load,lb={},Hb={},Ta,Ua,Ib=["*/"]+["*"];try{Ta=pa.href}catch(uc){Ta=R.createElement("a");Ta.href="";Ta=Ta.href}Ua=Fb.exec(Ta.toLowerCase())||[];g.fn.extend({load:function(d,e,l){if(typeof d!=="string"&&Gb)return Gb.apply(this,arguments);else if(!this.length)return this;var m=d.indexOf(" ");
if(m>=0){var q=d.slice(m,d.length);d=d.slice(0,m)}m="GET";if(e)if(g.isFunction(e)){l=e;e=b}else if(typeof e==="object"){e=g.param(e,g.ajaxSettings.traditional);m="POST"}var s=this;g.ajax({url:d,type:m,dataType:"html",data:e,complete:function(w,B,D){D=w.responseText;if(w.isResolved()){w.done(function(L){D=L});s.html(q?g("<div>").append(D.replace(kc,"")).find(q):D)}l&&s.each(l,[D,B,w])}});return this},serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?
g.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||lc.test(this.nodeName)||hc.test(this.type))}).map(function(d,e){var l=g(this).val();return l==null?null:g.isArray(l)?g.map(l,function(m){return{name:e.name,value:m.replace(Db,"\r\n")}}):{name:e.name,value:l.replace(Db,"\r\n")}}).get()}});g.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(d,e){g.fn[e]=function(l){return this.on(e,l)}});g.each(["get","post"],
function(d,e){g[e]=function(l,m,q,s){if(g.isFunction(m)){s=s||q;q=m;m=b}return g.ajax({type:e,url:l,data:m,success:q,dataType:s})}});g.extend({getScript:function(d,e){return g.get(d,b,e,"script")},getJSON:function(d,e,l){return g.get(d,e,l,"json")},ajaxSetup:function(d,e){if(e)H(d,g.ajaxSettings);else{e=d;d=g.ajaxSettings}H(d,e);return d},ajaxSettings:{url:Ta,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(Ua[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",
processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ib},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":true,"text json":g.parseJSON,"text xml":g.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:u(lb),ajaxTransport:u(Hb),ajax:function(d,e){function l(z,G,I,K){if(ta!==2){ta=2;ra&&clearTimeout(ra);la=
b;ca=K||"";ma.readyState=z>0?4:0;var O,ea,Y;K=G;if(I){var na=m,A=ma,U=na.contents,Z=na.dataTypes,W=na.responseFields,ka,ga,ua,za;for(ga in W)if(ga in I)A[W[ga]]=I[ga];for(;Z[0]==="*";){Z.shift();if(ka===b)ka=na.mimeType||A.getResponseHeader("content-type")}if(ka)for(ga in U)if(U[ga]&&U[ga].test(ka)){Z.unshift(ga);break}if(Z[0]in I)ua=Z[0];else{for(ga in I){if(!Z[0]||na.converters[ga+" "+Z[0]]){ua=ga;break}za||(za=ga)}ua=ua||za}if(ua){ua!==Z[0]&&Z.unshift(ua);I=I[ua]}else I=void 0}else I=b;I=I;if(z>=
200&&z<300||z===304){if(m.ifModified){if(ka=ma.getResponseHeader("Last-Modified"))g.lastModified[L]=ka;if(ka=ma.getResponseHeader("Etag"))g.etag[L]=ka}if(z===304){K="notmodified";O=true}else try{ka=m;I=I;if(ka.dataFilter)I=ka.dataFilter(I,ka.dataType);var Pa=ka.dataTypes;ga={};var db,hb,nc=Pa.length,ib,Na=Pa[0],$a,pb,Oa,Va,ab;for(db=1;db<nc;db++){if(db===1)for(hb in ka.converters)if(typeof hb==="string")ga[hb.toLowerCase()]=ka.converters[hb];$a=Na;Na=Pa[db];if(Na==="*")Na=$a;else if($a!=="*"&&$a!==
Na){pb=$a+" "+Na;Oa=ga[pb]||ga["* "+Na];if(!Oa){ab=b;for(Va in ga){ib=Va.split(" ");if(ib[0]===$a||ib[0]==="*")if(ab=ga[ib[1]+" "+Na]){Va=ga[Va];if(Va===true)Oa=ab;else if(ab===true)Oa=Va;break}}}Oa||ab||g.error("No conversion from "+pb.replace(" "," to "));if(Oa!==true)I=Oa?Oa(I):ab(Va(I))}}ea=I;K="success";O=true}catch(oc){K="parsererror";Y=oc}}else{Y=K;if(!K||z){K="error";if(z<0)z=0}}ma.status=z;ma.statusText=""+(G||K);O?w.resolveWith(q,[ea,K,ma]):w.rejectWith(q,[ma,K,Y]);ma.statusCode(D);D=b;
if(Ma)s.trigger("ajax"+(O?"Success":"Error"),[ma,m,O?ea:Y]);B.fireWith(q,[ma,K]);if(Ma){s.trigger("ajaxComplete",[ma,m]);--g.active||g.event.trigger("ajaxStop")}}}if(typeof d==="object"){e=d;d=b}e=e||{};var m=g.ajaxSetup({},e),q=m.context||m,s=q!==m&&(q.nodeType||q instanceof g)?g(q):g.event,w=g.Deferred(),B=g.Callbacks("once memory"),D=m.statusCode||{},L,aa={},P={},ca,X,la,ra,va,ta=0,Ma,Ea,ma={readyState:0,setRequestHeader:function(z,G){if(!ta){var I=z.toLowerCase();z=P[I]=P[I]||z;aa[z]=G}return this},
getAllResponseHeaders:function(){return ta===2?ca:null},getResponseHeader:function(z){var G;if(ta===2){if(!X)for(X={};G=gc.exec(ca);)X[G[1].toLowerCase()]=G[2];G=X[z.toLowerCase()]}return G===b?null:G},overrideMimeType:function(z){if(!ta)m.mimeType=z;return this},abort:function(z){z=z||"abort";la&&la.abort(z);l(0,z);return this}};w.promise(ma);ma.success=ma.done;ma.error=ma.fail;ma.complete=B.add;ma.statusCode=function(z){if(z){var G;if(ta<2)for(G in z)D[G]=[D[G],z[G]];else{G=z[ma.status];ma.then(G,
G)}}return this};m.url=((d||m.url)+"").replace(fc,"").replace(jc,Ua[1]+"//");m.dataTypes=g.trim(m.dataType||"*").toLowerCase().split(sb);if(m.crossDomain==null){va=Fb.exec(m.url.toLowerCase());m.crossDomain=!!(va&&(va[1]!=Ua[1]||va[2]!=Ua[2]||(va[3]||(va[1]==="http:"?80:443))!=(Ua[3]||(Ua[1]==="http:"?80:443))))}if(m.data&&m.processData&&typeof m.data!=="string")m.data=g.param(m.data,m.traditional);C(lb,m,e,ma);if(ta===2)return false;Ma=m.global;m.type=m.type.toUpperCase();m.hasContent=!ic.test(m.type);
Ma&&g.active++===0&&g.event.trigger("ajaxStart");if(!m.hasContent){if(m.data){m.url+=(Eb.test(m.url)?"&":"?")+m.data;delete m.data}L=m.url;if(m.cache===false){va=g.now();var Ga=m.url.replace(mc,"$1_="+va);m.url=Ga+(Ga===m.url?(Eb.test(m.url)?"&":"?")+"_="+va:"")}}if(m.data&&m.hasContent&&m.contentType!==false||e.contentType)ma.setRequestHeader("Content-Type",m.contentType);if(m.ifModified){L=L||m.url;g.lastModified[L]&&ma.setRequestHeader("If-Modified-Since",g.lastModified[L]);g.etag[L]&&ma.setRequestHeader("If-None-Match",
g.etag[L])}ma.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+(m.dataTypes[0]!=="*"?", "+Ib+"; q=0.01":""):m.accepts["*"]);for(Ea in m.headers)ma.setRequestHeader(Ea,m.headers[Ea]);if(m.beforeSend&&(m.beforeSend.call(q,ma,m)===false||ta===2)){ma.abort();return false}for(Ea in{success:1,error:1,complete:1})ma[Ea](m[Ea]);if(la=C(Hb,m,e,ma)){ma.readyState=1;Ma&&s.trigger("ajaxSend",[ma,m]);if(m.async&&m.timeout>0)ra=setTimeout(function(){ma.abort("timeout")},
m.timeout);try{ta=1;la.send(aa,l)}catch(t){if(ta<2)l(-1,t);else throw t;}}else l(-1,"No Transport");return ma},param:function(d,e){var l=[],m=function(s,w){w=g.isFunction(w)?w():w;l[l.length]=encodeURIComponent(s)+"="+encodeURIComponent(w)};if(e===b)e=g.ajaxSettings.traditional;if(g.isArray(d)||d.jquery&&!g.isPlainObject(d))g.each(d,function(){m(this.name,this.value)});else for(var q in d)E(q,d[q],e,m);return l.join("&").replace(ec,"+")}});g.extend({active:0,lastModified:{},etag:{}});var pc=g.now(),
jb=/(\=)\?(&|$)|\?\?/i;g.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return g.expando+"_"+pc++}});g.ajaxPrefilter("json jsonp",function(d,e,l){e=d.contentType==="application/x-www-form-urlencoded"&&typeof d.data==="string";if(d.dataTypes[0]==="jsonp"||d.jsonp!==false&&(jb.test(d.url)||e&&jb.test(d.data))){var m,q=d.jsonpCallback=g.isFunction(d.jsonpCallback)?d.jsonpCallback():d.jsonpCallback,s=a[q],w=d.url,B=d.data,D="$1"+q+"$2";if(d.jsonp!==false){w=w.replace(jb,D);if(d.url===w){if(e)B=
B.replace(jb,D);if(d.data===B)w+=(/\?/.test(w)?"&":"?")+d.jsonp+"="+q}}d.url=w;d.data=B;a[q]=function(L){m=[L]};l.always(function(){a[q]=s;m&&g.isFunction(s)&&a[q](m[0])});d.converters["script json"]=function(){m||g.error(q+" was not called");return m[0]};d.dataTypes[0]="json";return"script"}});g.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(d){g.globalEval(d);
return d}}});g.ajaxPrefilter("script",function(d){if(d.cache===b)d.cache=false;if(d.crossDomain){d.type="GET";d.global=false}});g.ajaxTransport("script",function(d){if(d.crossDomain){var e,l=R.head||R.getElementsByTagName("head")[0]||R.documentElement;return{send:function(m,q){e=R.createElement("script");e.async="async";if(d.scriptCharset)e.charset=d.scriptCharset;e.src=d.url;e.onload=e.onreadystatechange=function(s,w){if(w||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=
null;l&&e.parentNode&&l.removeChild(e);e=b;w||q(200,"success")}};l.insertBefore(e,l.firstChild)},abort:function(){e&&e.onload(0,1)}}}});var qb=a.ActiveXObject?function(){for(var d in bb)bb[d](0,1)}:false,qc=0,bb;g.ajaxSettings.xhr=a.ActiveXObject?function(){var d;if(!(d=!this.isLocal&&N()))a:{try{d=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(e){}d=void 0}return d}:N;(function(d){g.extend(g.support,{ajax:!!d,cors:!!d&&"withCredentials"in d})})(g.ajaxSettings.xhr());g.support.ajax&&g.ajaxTransport(function(d){if(!d.crossDomain||
g.support.cors){var e;return{send:function(l,m){var q=d.xhr(),s,w;d.username?q.open(d.type,d.url,d.async,d.username,d.password):q.open(d.type,d.url,d.async);if(d.xhrFields)for(w in d.xhrFields)q[w]=d.xhrFields[w];d.mimeType&&q.overrideMimeType&&q.overrideMimeType(d.mimeType);if(!d.crossDomain&&!l["X-Requested-With"])l["X-Requested-With"]="XMLHttpRequest";try{for(w in l)q.setRequestHeader(w,l[w])}catch(B){}q.send(d.hasContent&&d.data||null);e=function(D,L){var aa,P,ca,X,la;try{if(e&&(L||q.readyState===
4)){e=b;if(s){q.onreadystatechange=g.noop;qb&&delete bb[s]}if(L)q.readyState!==4&&q.abort();else{aa=q.status;ca=q.getAllResponseHeaders();X={};if((la=q.responseXML)&&la.documentElement)X.xml=la;X.text=q.responseText;try{P=q.statusText}catch(ra){P=""}if(!aa&&d.isLocal&&!d.crossDomain)aa=X.text?200:404;else if(aa===1223)aa=204}}}catch(va){L||m(-1,va)}X&&m(aa,P,X,ca)};if(!d.async||q.readyState===4)e();else{s=++qc;if(qb){if(!bb){bb={};g(a).unload(qb)}bb[s]=e}q.onreadystatechange=e}},abort:function(){e&&
e(0,1)}}}});var mb={},Ka,Xa,rc=/^(?:toggle|show|hide)$/,sc=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,kb,tb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],fb;g.fn.extend({show:function(d,e,l){if(d||d===0)return this.animate(T("show",3),d,e,l);else{l=0;for(var m=this.length;l<m;l++){d=this[l];if(d.style){e=d.style.display;if(!g._data(d,"olddisplay")&&e==="none")e=d.style.display="";e===""&&g.css(d,"display")===
"none"&&g._data(d,"olddisplay",Q(d.nodeName))}}for(l=0;l<m;l++){d=this[l];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=g._data(d,"olddisplay")||""}}return this}},hide:function(d,e,l){if(d||d===0)return this.animate(T("hide",3),d,e,l);else{l=0;for(var m=this.length;l<m;l++){d=this[l];if(d.style){e=g.css(d,"display");e!=="none"&&!g._data(d,"olddisplay")&&g._data(d,"olddisplay",e)}}for(l=0;l<m;l++)if(this[l].style)this[l].style.display="none";return this}},_toggle:g.fn.toggle,
toggle:function(d,e,l){var m=typeof d==="boolean";if(g.isFunction(d)&&g.isFunction(e))this._toggle.apply(this,arguments);else d==null||m?this.each(function(){var q=m?d:g(this).is(":hidden");g(this)[q?"show":"hide"]()}):this.animate(T("toggle",3),d,e,l);return this},fadeTo:function(d,e,l,m){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:e},d,l,m)},animate:function(d,e,l,m){function q(){s.queue===false&&g._mark(this);var w=g.extend({},s),B=this.nodeType===1,D=B&&g(this).is(":hidden"),
L,aa,P,ca,X;w.animatedProperties={};for(P in d){L=g.camelCase(P);if(P!==L){d[L]=d[P];delete d[P]}aa=d[L];if(g.isArray(aa)){w.animatedProperties[L]=aa[1];aa=d[L]=aa[0]}else w.animatedProperties[L]=w.specialEasing&&w.specialEasing[L]||w.easing||"swing";if(aa==="hide"&&D||aa==="show"&&!D)return w.complete.call(this);if(B&&(L==="height"||L==="width")){w.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(g.css(this,"display")==="inline"&&g.css(this,"float")==="none")if(!g.support.inlineBlockNeedsLayout||
Q(this.nodeName)==="inline")this.style.display="inline-block";else this.style.zoom=1}}if(w.overflow!=null)this.style.overflow="hidden";for(P in d){B=new g.fx(this,w,P);aa=d[P];if(rc.test(aa))if(L=g._data(this,"toggle"+P)||(aa==="toggle"?D?"show":"hide":0)){g._data(this,"toggle"+P,L==="show"?"hide":"show");B[L]()}else B[aa]();else{L=sc.exec(aa);ca=B.cur();if(L){aa=parseFloat(L[2]);X=L[3]||(g.cssNumber[P]?"":"px");if(X!=="px"){g.style(this,P,(aa||1)+X);ca=(aa||1)/B.cur()*ca;g.style(this,P,ca+X)}if(L[1])aa=
(L[1]==="-="?-1:1)*aa+ca;B.custom(ca,aa,X)}else B.custom(ca,aa,"")}}return true}var s=g.speed(e,l,m);if(g.isEmptyObject(d))return this.each(s.complete,[false]);d=g.extend({},d);return s.queue===false?this.each(q):this.queue(s.queue,q)},stop:function(d,e,l){if(typeof d!=="string"){l=e;e=d;d=b}if(e&&d!==false)this.queue(d||"fx",[]);return this.each(function(){function m(D,L,aa){L=L[aa];g.removeData(D,aa,true);L.stop(l)}var q,s=false,w=g.timers,B=g._data(this);l||g._unmark(true,this);if(d==null)for(q in B)B[q]&&
B[q].stop&&q.indexOf(".run")===q.length-4&&m(this,B,q);else if(B[q=d+".run"]&&B[q].stop)m(this,B,q);for(q=w.length;q--;)if(w[q].elem===this&&(d==null||w[q].queue===d)){l?w[q](true):w[q].saveState();s=true;w.splice(q,1)}l&&s||g.dequeue(this,d)})}});g.each({slideDown:T("show",1),slideUp:T("hide",1),slideToggle:T("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(d,e){g.fn[d]=function(l,m,q){return this.animate(e,l,m,q)}});g.extend({speed:function(d,
e,l){var m=d&&typeof d==="object"?g.extend({},d):{complete:l||!l&&e||g.isFunction(d)&&d,duration:d,easing:l&&e||e&&!g.isFunction(e)&&e};m.duration=g.fx.off?0:typeof m.duration==="number"?m.duration:m.duration in g.fx.speeds?g.fx.speeds[m.duration]:g.fx.speeds._default;if(m.queue==null||m.queue===true)m.queue="fx";m.old=m.complete;m.complete=function(q){g.isFunction(m.old)&&m.old.call(this);if(m.queue)g.dequeue(this,m.queue);else q!==false&&g._unmark(this)};return m},easing:{linear:function(d,e,l,
m){return l+m*d},swing:function(d,e,l,m){return(-Math.cos(d*Math.PI)/2+0.5)*m+l}},timers:[],fx:function(d,e,l){this.options=e;this.elem=d;this.prop=l;e.orig=e.orig||{}}});g.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(g.fx.step[this.prop]||g.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var d,e=g.css(this.elem,this.prop);return isNaN(d=parseFloat(e))?
!e||e==="auto"?0:e:d},custom:function(d,e,l){function m(w){return q.step(w)}var q=this,s=g.fx;this.startTime=fb||M();this.end=e;this.now=this.start=d;this.pos=this.state=0;this.unit=l||this.unit||(g.cssNumber[this.prop]?"":"px");m.queue=this.options.queue;m.elem=this.elem;m.saveState=function(){q.options.hide&&g._data(q.elem,"fxshow"+q.prop)===b&&g._data(q.elem,"fxshow"+q.prop,q.start)};if(m()&&g.timers.push(m)&&!kb)kb=setInterval(s.tick,s.interval)},show:function(){var d=g._data(this.elem,"fxshow"+
this.prop);this.options.orig[this.prop]=d||g.style(this.elem,this.prop);this.options.show=true;d!==b?this.custom(this.cur(),d):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());g(this.elem).show()},hide:function(){this.options.orig[this.prop]=g._data(this.elem,"fxshow"+this.prop)||g.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(d){var e,l=fb||M(),m=true,q=this.elem,s=this.options;if(d||l>=s.duration+this.startTime){this.now=this.end;
this.pos=this.state=1;this.update();s.animatedProperties[this.prop]=true;for(e in s.animatedProperties)if(s.animatedProperties[e]!==true)m=false;if(m){s.overflow!=null&&!g.support.shrinkWrapBlocks&&g.each(["","X","Y"],function(w,B){q.style["overflow"+B]=s.overflow[w]});s.hide&&g(q).hide();if(s.hide||s.show)for(e in s.animatedProperties){g.style(q,e,s.orig[e]);g.removeData(q,"fxshow"+e,true);g.removeData(q,"toggle"+e,true)}if(d=s.complete){s.complete=false;d.call(q)}}return false}else{if(s.duration==
Infinity)this.now=l;else{d=l-this.startTime;this.state=d/s.duration;this.pos=g.easing[s.animatedProperties[this.prop]](this.state,d,0,1,s.duration);this.now=this.start+(this.end-this.start)*this.pos}this.update()}return true}};g.extend(g.fx,{tick:function(){for(var d,e=g.timers,l=0;l<e.length;l++){d=e[l];!d()&&e[l]===d&&e.splice(l--,1)}e.length||g.fx.stop()},interval:13,stop:function(){clearInterval(kb);kb=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(d){g.style(d.elem,"opacity",
d.now)},_default:function(d){if(d.elem.style&&d.elem.style[d.prop]!=null)d.elem.style[d.prop]=d.now+d.unit;else d.elem[d.prop]=d.now}}});g.each(["width","height"],function(d,e){g.fx.step[e]=function(l){g.style(l.elem,e,Math.max(0,l.now)+l.unit)}});if(g.expr&&g.expr.filters)g.expr.filters.animated=function(d){return g.grep(g.timers,function(e){return d===e.elem}).length};var tc=/^t(?:able|d|h)$/i,Jb=/^(?:body|html)$/i;g.fn.offset="getBoundingClientRect"in R.documentElement?function(d){var e=this[0],
l;if(d)return this.each(function(w){g.offset.setOffset(this,d,w)});if(!e||!e.ownerDocument)return null;if(e===e.ownerDocument.body)return g.offset.bodyOffset(e);try{l=e.getBoundingClientRect()}catch(m){}var q=e.ownerDocument,s=q.documentElement;if(!l||!g.contains(s,e))return l?{top:l.top,left:l.left}:{top:0,left:0};e=q.body;q=ja(q);return{top:l.top+(q.pageYOffset||g.support.boxModel&&s.scrollTop||e.scrollTop)-(s.clientTop||e.clientTop||0),left:l.left+(q.pageXOffset||g.support.boxModel&&s.scrollLeft||
e.scrollLeft)-(s.clientLeft||e.clientLeft||0)}}:function(d){var e=this[0];if(d)return this.each(function(L){g.offset.setOffset(this,d,L)});if(!e||!e.ownerDocument)return null;if(e===e.ownerDocument.body)return g.offset.bodyOffset(e);var l,m=e.offsetParent,q=e.ownerDocument,s=q.documentElement,w=q.body;l=(q=q.defaultView)?q.getComputedStyle(e,null):e.currentStyle;for(var B=e.offsetTop,D=e.offsetLeft;(e=e.parentNode)&&e!==w&&e!==s;){if(g.support.fixedPosition&&l.position==="fixed")break;l=q?q.getComputedStyle(e,
null):e.currentStyle;B-=e.scrollTop;D-=e.scrollLeft;if(e===m){B+=e.offsetTop;D+=e.offsetLeft;if(g.support.doesNotAddBorder&&!(g.support.doesAddBorderForTableAndCells&&tc.test(e.nodeName))){B+=parseFloat(l.borderTopWidth)||0;D+=parseFloat(l.borderLeftWidth)||0}m=e.offsetParent}if(g.support.subtractsBorderForOverflowNotVisible&&l.overflow!=="visible"){B+=parseFloat(l.borderTopWidth)||0;D+=parseFloat(l.borderLeftWidth)||0}l=l}if(l.position==="relative"||l.position==="static"){B+=w.offsetTop;D+=w.offsetLeft}if(g.support.fixedPosition&&
l.position==="fixed"){B+=Math.max(s.scrollTop,w.scrollTop);D+=Math.max(s.scrollLeft,w.scrollLeft)}return{top:B,left:D}};g.offset={bodyOffset:function(d){var e=d.offsetTop,l=d.offsetLeft;if(g.support.doesNotIncludeMarginInBodyOffset){e+=parseFloat(g.css(d,"marginTop"))||0;l+=parseFloat(g.css(d,"marginLeft"))||0}return{top:e,left:l}},setOffset:function(d,e,l){var m=g.css(d,"position");if(m==="static")d.style.position="relative";var q=g(d),s=q.offset(),w=g.css(d,"top"),B=g.css(d,"left"),D={},L={};if((m===
"absolute"||m==="fixed")&&g.inArray("auto",[w,B])>-1){L=q.position();m=L.top;B=L.left}else{m=parseFloat(w)||0;B=parseFloat(B)||0}if(g.isFunction(e))e=e.call(d,l,s);if(e.top!=null)D.top=e.top-s.top+m;if(e.left!=null)D.left=e.left-s.left+B;"using"in e?e.using.call(d,D):q.css(D)}};g.fn.extend({position:function(){if(!this[0])return null;var d=this[0],e=this.offsetParent(),l=this.offset(),m=Jb.test(e[0].nodeName)?{top:0,left:0}:e.offset();l.top-=parseFloat(g.css(d,"marginTop"))||0;l.left-=parseFloat(g.css(d,
"marginLeft"))||0;m.top+=parseFloat(g.css(e[0],"borderTopWidth"))||0;m.left+=parseFloat(g.css(e[0],"borderLeftWidth"))||0;return{top:l.top-m.top,left:l.left-m.left}},offsetParent:function(){return this.map(function(){for(var d=this.offsetParent||R.body;d&&!Jb.test(d.nodeName)&&g.css(d,"position")==="static";)d=d.offsetParent;return d})}});g.each(["Left","Top"],function(d,e){var l="scroll"+e;g.fn[l]=function(m){var q,s;if(m===b){q=this[0];if(!q)return null;return(s=ja(q))?"pageXOffset"in s?s[d?"pageYOffset":
"pageXOffset"]:g.support.boxModel&&s.document.documentElement[l]||s.document.body[l]:q[l]}return this.each(function(){if(s=ja(this))s.scrollTo(!d?m:g(s).scrollLeft(),d?m:g(s).scrollTop());else this[l]=m})}});g.each(["Height","Width"],function(d,e){var l=e.toLowerCase();g.fn["inner"+e]=function(){var m=this[0];return m?m.style?parseFloat(g.css(m,l,"padding")):this[l]():null};g.fn["outer"+e]=function(m){var q=this[0];return q?q.style?parseFloat(g.css(q,l,m?"margin":"border")):this[l]():null};g.fn[l]=
function(m){var q=this[0];if(!q)return m==null?null:this;if(g.isFunction(m))return this.each(function(B){var D=g(this);D[l](m.call(this,B,D[l]()))});if(g.isWindow(q)){var s=q.document.documentElement["client"+e],w=q.document.body;return q.document.compatMode==="CSS1Compat"&&s||w&&w["client"+e]||s}else if(q.nodeType===9)return Math.max(q.documentElement["client"+e],q.body["scroll"+e],q.documentElement["scroll"+e],q.body["offset"+e],q.documentElement["offset"+e]);else if(m===b){q=g.css(q,l);s=parseFloat(q);
return g.isNumeric(s)?s:q}else return this.css(l,typeof m==="string"?m:m+"px")}});a.jQuery=a.$=g;typeof define==="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return g})})(window);window.$j=jQuery.noConflict();
(function(a){function b(c,f){this.$element=a(c);this.options=f;this.enabled=true;this.fixTitle()}b.prototype={show:function(){var c=this.getTitle();if(c&&this.enabled){var f=this.tip();f.find(".tipsy-inner")[this.options.html?"html":"text"](c);f[0].className="tipsy";f.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);c=a.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var h=f[0].offsetWidth,n=f[0].offsetHeight,
j=typeof this.options.gravity=="function"?this.options.gravity.call(this.$element[0]):this.options.gravity,k;switch(j.charAt(0)){case "n":k={top:c.top+c.height+this.options.offset,left:c.left+c.width/2-h/2};break;case "s":k={top:c.top-n-this.options.offset,left:c.left+c.width/2-h/2};break;case "e":k={top:c.top+c.height/2-n/2,left:c.left-h-this.options.offset};break;case "w":k={top:c.top+c.height/2-n/2,left:c.left+c.width+this.options.offset}}if(j.length==2)k.left=j.charAt(1)=="w"?c.left+c.width/2-
15:c.left+c.width/2-h+15;f.css(k).addClass("tipsy-"+j);f.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+j.charAt(0);this.options.className&&f.addClass(typeof this.options.className=="function"?this.options.className.call(this.$element[0]):this.options.className);this.options.fade?f.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):f.css({visibility:"visible",opacity:this.options.opacity});this.options.clickClose&&f.bind("click",{element:this.$element,
callback:this.options.closeCallback},function(o){o.data.element.tipsy("hide");o.data.callback&&o.data.callback()})}},showTimed:function(){var c=this;c.show();c.$element.delay(this.options.timerLength).queue(function(f){c.hide();f()})},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){a(this).remove()}):this.tip().remove()},fixTitle:function(){var c=this.$element;if(c.attr("title")||typeof c.attr("original-title")!="string")c.attr("original-title",c.attr("title")||"").removeAttr("title")},
getTitle:function(){var c,f=this.$element,h=this.options;this.fixTitle();h=this.options;if(typeof h.title=="string")c=f.attr(h.title=="title"?"original-title":h.title);else if(typeof h.title=="function")c=h.title.call(f[0]);return(""+c).replace(/(^\s*|\s*$)/,"")||h.fallback},tip:function(){if(!this.$tip)this.$tip=a('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.options=
this.$element=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};a.fn.tipsy=function(c){function f(o){var p=a.data(o,"tipsy");if(!p){p=new b(o,a.fn.tipsy.elementOptions(o,c));a.data(o,"tipsy",p)}return p}function h(){var o=f(this);o.hoverState="in";if(c.delayIn==0)o.show();else{o.fixTitle();setTimeout(function(){o.hoverState=="in"&&o.show()},c.delayIn)}}function n(){var o=f(this);o.hoverState="out";c.delayOut==0?
o.hide():setTimeout(function(){o.hoverState=="out"&&o.hide()},c.delayOut)}if(c===true)return this.data("tipsy");else if(typeof c=="string"){var j=this.data("tipsy");j&&j[c]();return this}c=a.extend({},a.fn.tipsy.defaults,c);c.live||this.each(function(){f(this)});if(c.trigger!="manual"){j=c.live?"live":"bind";var k=c.trigger=="hover"?"mouseleave":"blur";this[j](c.trigger=="hover"?"mouseenter":"focus",h)[j](k,n)}return this};a.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"",
gravity:"n",html:false,live:false,offset:0,opacity:0.8,title:"title",trigger:"hover",clickClose:false,closeCallback:null,timerLength:3E3};a.fn.tipsy.elementOptions=function(c,f){return a.metadata?a.extend({},f,a(c).metadata()):f};a.fn.tipsy.autoNS=function(){return a(this).offset().top>a(document).scrollTop()+a(window).height()/2?"s":"n"};a.fn.tipsy.autoWE=function(){return a(this).offset().left>a(document).scrollLeft()+a(window).width()/2?"e":"w"};a.fn.tipsy.autoBounds=function(c,f){return function(){var h=
{ns:f[0],ew:f.length>1?f[1]:false},n=a(document).scrollTop()+c,j=a(document).scrollLeft()+c,k=a(this);if(k.offset().top<n)h.ns="n";if(k.offset().left<j)h.ew="w";if(a(window).width()+a(document).scrollLeft()-k.offset().left<c)h.ew="e";if(a(window).height()+a(document).scrollTop()-k.offset().top<c)h.ns="s";return h.ns+(h.ew?h.ew:"")}}})(jQuery);
function get_doc_width(){var a=document;return Math.max(a.body.scrollWidth,a.documentElement.scrollWidth,a.body.offsetWidth,a.documentElement.offsetWidth,a.body.clientWidth,a.documentElement.clientWidth)}function get_doc_height(){var a=document;return Math.max(a.body.scrollHeight,a.documentElement.scrollHeight,a.body.offsetHeight,a.documentElement.offsetHeight,a.body.clientHeight,a.documentElement.clientHeight)}
function show_channel_lightbox(a){if($("lightboxdiv"))$("lightboxdiv").style.display="block";else{var b=$$(".left_col")[0].viewportOffset();if(a===undefined)a=true;a=['<div id="lightboxdiv" class="lightboxdivc" onClick="hide_channel_lightbox()"','style="'+(["position          : absolute","top               : -"+(b[1]+200)+"px","left              : -"+b[0]+"px","height            : "+(get_doc_height()+300)+"px","width             : "+get_doc_width()+"px","background-color  : "+(a?"#444":"#FFF"),"z-index           : 999000;-moz-opacity      : 0.9;opacity           : .9;filter            : alpha(opacity=90)"].join(";").gsub(" ",
"")+";")+'"',"> </div>"].join(" ");$$(".left_col")[0].insert({top:a})}a=$$(".live_site_player_container")[0];window.channel_lb_player_z=a.getStyle("z-index");a.setStyle({border:"1px solid #DDD",margin:"-1px",zIndex:"999999"})}
function hide_channel_lightbox(){if($("lightboxdiv")){$("lightboxdiv").style.display="none";$$(".live_site_player_container")[0].setStyle({border:"0",margin:"0"})}window.channel_lb_player_z?$$(".live_site_player_container")[0].setStyle({zIndex:window.channel_lb_player_z}):$$(".live_site_player_container")[0].setStyle({zIndex:1})}
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan",
"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"am",pmDesignator:"pm",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,
feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,
today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},
{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};
(function(){var a=Date,b=a.prototype,c=a.CultureInfo,f=function(k,o){o||(o=2);return("000"+k).slice(o*-1)};b.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};b.setTimeToNow=function(){var k=new Date;this.setHours(k.getHours());this.setMinutes(k.getMinutes());this.setSeconds(k.getSeconds());this.setMilliseconds(k.getMilliseconds());return this};a.today=function(){return(new Date).clearTime()};a.compare=function(k,o){if(isNaN(k)||isNaN(o))throw Error(k+
" - "+o);else if(k instanceof Date&&o instanceof Date)return k<o?-1:k>o?1:0;else throw new TypeError(k+" - "+o);};a.equals=function(k,o){return k.compareTo(o)===0};a.getDayNumberFromName=function(k){var o=c.dayNames,p=c.abbreviatedDayNames,v=c.shortestDayNames;k=k.toLowerCase();for(var F=0;F<o.length;F++)if(o[F].toLowerCase()==k||p[F].toLowerCase()==k||v[F].toLowerCase()==k)return F;return-1};a.getMonthNumberFromName=function(k){var o=c.monthNames,p=c.abbreviatedMonthNames;k=k.toLowerCase();for(var v=
0;v<o.length;v++)if(o[v].toLowerCase()==k||p[v].toLowerCase()==k)return v;return-1};a.isLeapYear=function(k){return k%4===0&&k%100!==0||k%400===0};a.getDaysInMonth=function(k,o){return[31,a.isLeapYear(k)?29:28,31,30,31,30,31,31,30,31,30,31][o]};a.getTimezoneAbbreviation=function(k){for(var o=c.timezones,p=0;p<o.length;p++)if(o[p].offset===k)return o[p].name;return null};a.getTimezoneOffset=function(k){for(var o=c.timezones,p=0;p<o.length;p++)if(o[p].name===k.toUpperCase())return o[p].offset;return null};
b.clone=function(){return new Date(this.getTime())};b.compareTo=function(k){return Date.compare(this,k)};b.equals=function(k){return Date.equals(this,k||new Date)};b.between=function(k,o){return this.getTime()>=k.getTime()&&this.getTime()<=o.getTime()};b.isAfter=function(k){return this.compareTo(k||new Date)===1};b.isBefore=function(k){return this.compareTo(k||new Date)===-1};b.isToday=function(){return this.isSameDay(new Date)};b.isSameDay=function(k){return this.clone().clearTime().equals(k.clone().clearTime())};
b.addMilliseconds=function(k){this.setMilliseconds(this.getMilliseconds()+k);return this};b.addSeconds=function(k){return this.addMilliseconds(k*1E3)};b.addMinutes=function(k){return this.addMilliseconds(k*6E4)};b.addHours=function(k){return this.addMilliseconds(k*36E5)};b.addDays=function(k){this.setDate(this.getDate()+k);return this};b.addWeeks=function(k){return this.addDays(k*7)};b.addMonths=function(k){var o=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+k);this.setDate(Math.min(o,
a.getDaysInMonth(this.getFullYear(),this.getMonth())));return this};b.addYears=function(k){return this.addMonths(k*12)};b.add=function(k){if(typeof k=="number"){this._orient=k;return this}k.milliseconds&&this.addMilliseconds(k.milliseconds);k.seconds&&this.addSeconds(k.seconds);k.minutes&&this.addMinutes(k.minutes);k.hours&&this.addHours(k.hours);k.weeks&&this.addWeeks(k.weeks);k.months&&this.addMonths(k.months);k.years&&this.addYears(k.years);k.days&&this.addDays(k.days);return this};var h,n,j;b.getWeek=
function(){var k,o,p,v,F;h=!h?this.getFullYear():h;n=!n?this.getMonth()+1:n;j=!j?this.getDate():j;if(n<=2){k=h-1;o=(k/4|0)-(k/100|0)+(k/400|0);p=((k-1)/4|0)-((k-1)/100|0)+((k-1)/400|0);p=o-p;v=0;F=j-1+31*(n-1)}else{k=h;o=(k/4|0)-(k/100|0)+(k/400|0);p=((k-1)/4|0)-((k-1)/100|0)+((k-1)/400|0);p=o-p;v=p+1;F=j+(153*(n-3)+2)/5+58+p}k=(k+o)%7;o=F+3-(F+k-v)%7|0;p=o<0?53-((k-p)/5|0):o>364+p?1:(o/7|0)+1;h=n=j=null;return p};b.getISOWeek=function(){h=this.getUTCFullYear();n=this.getUTCMonth()+1;j=this.getUTCDate();
return f(this.getWeek())};b.setWeek=function(k){return this.moveToDayOfWeek(1).addWeeks(k-this.getWeek())};a._validate=function(k,o,p,v){if(typeof k=="undefined")return false;else if(typeof k!="number")throw new TypeError(k+" is not a Number.");else if(k<o||k>p)throw new RangeError(k+" is not a valid value for "+v+".");return true};a.validateMillisecond=function(k){return a._validate(k,0,999,"millisecond")};a.validateSecond=function(k){return a._validate(k,0,59,"second")};a.validateMinute=function(k){return a._validate(k,
0,59,"minute")};a.validateHour=function(k){return a._validate(k,0,23,"hour")};a.validateDay=function(k,o,p){return a._validate(k,1,a.getDaysInMonth(o,p),"day")};a.validateMonth=function(k){return a._validate(k,0,11,"month")};a.validateYear=function(k){return a._validate(k,0,9999,"year")};b.set=function(k){a.validateMillisecond(k.millisecond)&&this.addMilliseconds(k.millisecond-this.getMilliseconds());a.validateSecond(k.second)&&this.addSeconds(k.second-this.getSeconds());a.validateMinute(k.minute)&&
this.addMinutes(k.minute-this.getMinutes());a.validateHour(k.hour)&&this.addHours(k.hour-this.getHours());a.validateMonth(k.month)&&this.addMonths(k.month-this.getMonth());a.validateYear(k.year)&&this.addYears(k.year-this.getFullYear());a.validateDay(k.day,this.getFullYear(),this.getMonth())&&this.addDays(k.day-this.getDate());k.timezone&&this.setTimezone(k.timezone);k.timezoneOffset&&this.setTimezoneOffset(k.timezoneOffset);k.week&&a._validate(k.week,0,53,"week")&&this.setWeek(k.week);return this};
b.moveToFirstDayOfMonth=function(){return this.set({day:1})};b.moveToLastDayOfMonth=function(){return this.set({day:a.getDaysInMonth(this.getFullYear(),this.getMonth())})};b.moveToNthOccurrence=function(k,o){var p=0;if(o>0)p=o-1;else if(o===-1){this.moveToLastDayOfMonth();this.getDay()!==k&&this.moveToDayOfWeek(k,-1);return this}return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(k,+1).addWeeks(p)};b.moveToDayOfWeek=function(k,o){var p=(k-this.getDay()+7*(o||+1))%7;return this.addDays(p===
0?p+=7*(o||+1):p)};b.moveToMonth=function(k,o){var p=(k-this.getMonth()+12*(o||+1))%12;return this.addMonths(p===0?p+=12*(o||+1):p)};b.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/864E5)+1};b.getTimezone=function(){return a.getTimezoneAbbreviation(this.getUTCOffset())};b.setTimezoneOffset=function(k){var o=this.getTimezoneOffset();return this.addMinutes(Number(k)*-6/10-o)};b.setTimezone=function(k){return this.setTimezoneOffset(a.getTimezoneOffset(k))};
b.hasDaylightSavingTime=function(){return Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset()};b.isDaylightSavingTime=function(){return this.hasDaylightSavingTime()&&(new Date).getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset()};b.getUTCOffset=function(){var k=this.getTimezoneOffset()*-10/6;if(k<0){k=(k-1E4).toString();return k.charAt(0)+k.substr(2)}else{k=(k+1E4).toString();return"+"+k.substr(1)}};b.getElapsed=function(k){return(k||
new Date)-this};if(!b.toISOString)b.toISOString=function(){function k(o){return o<10?"0"+o:o}return'"'+this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+'Z"'};b._toString=b.toString;b.toString=function(k){var o=this;if(k&&k.length==1){var p=c.formatPatterns;o.t=o.toString;switch(k){case "d":return o.t(p.shortDate);case "D":return o.t(p.longDate);case "F":return o.t(p.fullDateTime);case "m":return o.t(p.monthDay);
case "r":return o.t(p.rfc1123);case "s":return o.t(p.sortableDateTime);case "t":return o.t(p.shortTime);case "T":return o.t(p.longTime);case "u":return o.t(p.universalSortableDateTime);case "y":return o.t(p.yearMonth)}}var v=function(F){switch(F*1){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};return k?k.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(F){if(F.charAt(0)==="\\")return F.replace("\\","");o.h=o.getHours;
switch(F){case "hh":return f(o.h()<13?o.h()===0?12:o.h():o.h()-12);case "h":return o.h()<13?o.h()===0?12:o.h():o.h()-12;case "HH":return f(o.h());case "H":return o.h();case "mm":return f(o.getMinutes());case "m":return o.getMinutes();case "ss":return f(o.getSeconds());case "s":return o.getSeconds();case "yyyy":return f(o.getFullYear(),4);case "yy":return f(o.getFullYear());case "dddd":return c.dayNames[o.getDay()];case "ddd":return c.abbreviatedDayNames[o.getDay()];case "dd":return f(o.getDate());
case "d":return o.getDate();case "MMMM":return c.monthNames[o.getMonth()];case "MMM":return c.abbreviatedMonthNames[o.getMonth()];case "MM":return f(o.getMonth()+1);case "M":return o.getMonth()+1;case "t":return o.h()<12?c.amDesignator.substring(0,1):c.pmDesignator.substring(0,1);case "tt":return o.h()<12?c.amDesignator:c.pmDesignator;case "S":return v(o.getDate());default:return F}}):this._toString()}})();
(function(){var a=Date,b=a.prototype,c=a.CultureInfo,f=Number.prototype;b._orient=+1;b._nth=null;b._is=false;b._same=false;b._isSecond=false;f._dateElement="day";b.next=function(){this._orient=+1;return this};a.next=function(){return a.today().next()};b.last=b.prev=b.previous=function(){this._orient=-1;return this};a.last=a.prev=a.previous=function(){return a.today().last()};b.is=function(){this._is=true;return this};b.same=function(){this._same=true;this._isSecond=false;return this};b.today=function(){return this.same().day()};
b.weekday=function(){if(this._is){this._is=false;return!this.is().sat()&&!this.is().sun()}return false};b.at=function(V){return typeof V==="string"?a.parse(this.toString("d")+" "+V):this.set(V)};f.fromNow=f.after=function(V){var da={};da[this._dateElement]=this;return(!V?new Date:V.clone()).add(da)};f.ago=f.before=function(V){var da={};da[this._dateElement]=this*-1;return(!V?new Date:V.clone()).add(da)};var h="sunday monday tuesday wednesday thursday friday saturday".split(/\s/),n="january february march april may june july august september october november december".split(/\s/),
j="Millisecond Second Minute Hour Day Week Month Year".split(/\s/),k="Milliseconds Seconds Minutes Hours Date Week Month FullYear".split(/\s/),o="final first second third fourth fifth".split(/\s/);b.toObject=function(){for(var V={},da=0;da<j.length;da++)V[j[da].toLowerCase()]=this["get"+k[da]]();return V};a.fromObject=function(V){V.week=null;return Date.today().set(V)};for(var p=function(V){return function(){if(this._is){this._is=false;return this.getDay()==V}if(this._nth!==null){this._isSecond&&
this.addSeconds(this._orient*-1);this._isSecond=false;var da=this._nth;this._nth=null;var sa=this.clone().moveToLastDayOfMonth();this.moveToNthOccurrence(V,da);if(this>sa)throw new RangeError(a.getDayName(V)+" does not occur "+da+" times in the month of "+a.getMonthName(sa.getMonth())+" "+sa.getFullYear()+".");return this}return this.moveToDayOfWeek(V,this._orient)}},v=function(V){return function(){var da=a.today(),sa=V-da.getDay();if(V===0&&c.firstDayOfWeek===1&&da.getDay()!==0)sa+=7;return da.addDays(sa)}},
F=0;F<h.length;F++){a[h[F].toUpperCase()]=a[h[F].toUpperCase().substring(0,3)]=F;a[h[F]]=a[h[F].substring(0,3)]=v(F);b[h[F]]=b[h[F].substring(0,3)]=p(F)}h=function(V){return function(){if(this._is){this._is=false;return this.getMonth()===V}return this.moveToMonth(V,this._orient)}};p=function(V){return function(){return a.today().set({month:V,day:1})}};for(v=0;v<n.length;v++){a[n[v].toUpperCase()]=a[n[v].toUpperCase().substring(0,3)]=v;a[n[v]]=a[n[v].substring(0,3)]=p(v);b[n[v]]=b[n[v].substring(0,
3)]=h(v)}h=function(V){return function(da){if(this._isSecond){this._isSecond=false;return this}if(this._same){this._same=this._is=false;var sa=this.toObject();da=(da||new Date).toObject();for(var ya="",Ba=V.toLowerCase(),u=j.length-1;u>-1;u--){ya=j[u].toLowerCase();if(sa[ya]!=da[ya])return false;if(Ba==ya)break}return true}if(V.substring(V.length-1)!="s")V+="s";return this["add"+V](this._orient)}};p=function(V){return function(){this._dateElement=V;return this}};for(v=0;v<j.length;v++){n=j[v].toLowerCase();
b[n]=b[n+"s"]=h(j[v]);f[n]=f[n+"s"]=p(n)}b._ss=h("Second");f=function(V){return function(da){if(this._same)return this._ss(da);if(da||da===0)return this.moveToNthOccurrence(da,V);this._nth=V;if(V===2&&(da===undefined||da===null)){this._isSecond=true;return this.addSeconds(this._orient)}return this}};for(n=0;n<o.length;n++)b[o[n]]=n===0?f(-1):f(n)})();
(function(){Date.Parsing={Exception:function(n){this.message="Parse error at '"+n.substring(0,10)+" ...'"}};for(var a=Date.Parsing,b=a.Operators={rtoken:function(n){return function(j){var k=j.match(n);if(k)return[k[0],j.substring(k[0].length)];else throw new a.Exception(j);}},token:function(){return function(n){return b.rtoken(RegExp("^s*"+n+"s*"))(n)}},stoken:function(n){return b.rtoken(RegExp("^"+n))},until:function(n){return function(j){for(var k=[],o=null;j.length;){try{o=n.call(this,j)}catch(p){k.push(o[0]);
j=o[1];continue}break}return[k,j]}},many:function(n){return function(j){for(var k=[],o=null;j.length;){try{o=n.call(this,j)}catch(p){break}k.push(o[0]);j=o[1]}return[k,j]}},optional:function(n){return function(j){var k=null;try{k=n.call(this,j)}catch(o){return[null,j]}return[k[0],k[1]]}},not:function(n){return function(j){try{n.call(this,j)}catch(k){return[null,j]}throw new a.Exception(j);}},ignore:function(n){return n?function(j){var k=null;k=n.call(this,j);return[null,k[1]]}:null},product:function(){for(var n=
arguments[0],j=Array.prototype.slice.call(arguments,1),k=[],o=0;o<n.length;o++)k.push(b.each(n[o],j));return k},cache:function(n){var j={},k=null;return function(o){try{k=j[o]=j[o]||n.call(this,o)}catch(p){k=j[o]=p}if(k instanceof a.Exception)throw k;else return k}},any:function(){var n=arguments;return function(j){for(var k=null,o=0;o<n.length;o++)if(n[o]!=null){try{k=n[o].call(this,j)}catch(p){k=null}if(k)return k}throw new a.Exception(j);}},each:function(){var n=arguments;return function(j){for(var k=
[],o=null,p=0;p<n.length;p++)if(n[p]!=null){try{o=n[p].call(this,j)}catch(v){throw new a.Exception(j);}k.push(o[0]);j=o[1]}return[k,j]}},all:function(){var n=n;return n.each(n.optional(arguments))},sequence:function(n,j,k){j=j||b.rtoken(/^\s*/);k=k||null;if(n.length==1)return n[0];return function(o){for(var p=null,v=null,F=[],V=0;V<n.length;V++){try{p=n[V].call(this,o)}catch(da){break}F.push(p[0]);try{v=j.call(this,p[1])}catch(sa){v=null;break}o=v[1]}if(!p)throw new a.Exception(o);if(v)throw new a.Exception(v[1]);
if(k)try{p=k.call(this,p[1])}catch(ya){throw new a.Exception(p[1]);}return[F,p?p[1]:o]}},between:function(n,j,k){k=k||n;var o=b.each(b.ignore(n),j,b.ignore(k));return function(p){p=o.call(this,p);return[[p[0][0],r[0][2]],p[1]]}},list:function(n,j,k){j=j||b.rtoken(/^\s*/);k=k||null;return n instanceof Array?b.each(b.product(n.slice(0,-1),b.ignore(j)),n.slice(-1),b.ignore(k)):b.each(b.many(b.each(n,b.ignore(j))),px,b.ignore(k))},set:function(n,j,k){j=j||b.rtoken(/^\s*/);k=k||null;return function(o){for(var p=
null,v=null,F=null,V=[[],o],da=false,sa=0;sa<n.length;sa++){p=v=null;da=n.length==1;try{p=n[sa].call(this,o)}catch(ya){continue}F=[[p[0]],p[1]];if(p[1].length>0&&!da)try{v=j.call(this,p[1])}catch(Ba){da=true}else da=true;if(!da&&v[1].length===0)da=true;if(!da){p=[];for(da=0;da<n.length;da++)sa!=da&&p.push(n[da]);p=b.set(p,j).call(this,v[1]);if(p[0].length>0){F[0]=F[0].concat(p[0]);F[1]=p[1]}}if(F[1].length<V[1].length)V=F;if(V[1].length===0)break}if(V[0].length===0)return V;if(k){try{v=k.call(this,
V[1])}catch(u){throw new a.Exception(V[1]);}V[1]=v[1]}return V}},forward:function(n,j){return function(k){return n[j].call(this,k)}},replace:function(n,j){return function(k){k=n.call(this,k);return[j,k[1]]}},process:function(n,j){return function(k){k=n.call(this,k);return[j.call(this,k[0]),k[1]]}},min:function(n,j){return function(k){var o=j.call(this,k);if(o[0].length<n)throw new a.Exception(k);return o}}},c=function(n){return function(){var j=null,k=[];if(arguments.length>1)j=Array.prototype.slice.call(arguments);
else if(arguments[0]instanceof Array)j=arguments[0];if(j)for(var o=j.shift();0<o.length;){j.unshift(o[0]);k.push(n.apply(null,j));j.shift();return k}else return n.apply(null,arguments)}},f="optional not ignore cache".split(/\s/),h=0;h<f.length;h++)b[f[h]]=c(b[f[h]]);c=function(n){return function(){return arguments[0]instanceof Array?n.apply(null,arguments[0]):n.apply(null,arguments)}};f="each any all".split(/\s/);for(h=0;h<f.length;h++)b[f[h]]=c(b[f[h]])})();
(function(){var a=Date,b=a.CultureInfo,c=function(p){for(var v=[],F=0;F<p.length;F++)if(p[F]instanceof Array)v=v.concat(c(p[F]));else p[F]&&v.push(p[F]);return v};a.Grammar={};a.Translator={hour:function(p){return function(){this.hour=Number(p)}},minute:function(p){return function(){this.minute=Number(p)}},second:function(p){return function(){this.second=Number(p)}},meridian:function(p){return function(){this.meridian=p.slice(0,1).toLowerCase()}},timezone:function(p){return function(){var v=p.replace(/[^\d\+\-]/g,
"");if(v.length)this.timezoneOffset=Number(v);else this.timezone=p.toLowerCase()}},day:function(p){var v=p[0];return function(){this.day=Number(v.match(/\d+/)[0])}},month:function(p){return function(){this.month=p.length==3?"jan feb mar apr may jun jul aug sep oct nov dec".indexOf(p)/4:Number(p)-1}},year:function(p){return function(){var v=Number(p);this.year=p.length>2?v:v+(v+2E3<b.twoDigitYearMax?2E3:1900)}},rday:function(p){return function(){switch(p){case "yesterday":this.days=-1;break;case "tomorrow":this.days=
1;break;case "today":this.days=0;break;case "now":this.days=0;this.now=true}}},finishExact:function(p){p=p instanceof Array?p:[p];for(var v=0;v<p.length;v++)p[v]&&p[v].call(this);p=new Date;if((this.hour||this.minute)&&!this.month&&!this.year&&!this.day)this.day=p.getDate();if(!this.year)this.year=p.getFullYear();if(!this.month&&this.month!==0)this.month=p.getMonth();if(!this.day)this.day=1;if(!this.hour)this.hour=0;if(!this.minute)this.minute=0;if(!this.second)this.second=0;if(this.meridian&&this.hour)if(this.meridian==
"p"&&this.hour<12)this.hour+=12;else if(this.meridian=="a"&&this.hour==12)this.hour=0;if(this.day>a.getDaysInMonth(this.year,this.month))throw new RangeError(this.day+" is not a valid value for days.");p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone)p.set({timezone:this.timezone});else this.timezoneOffset&&p.set({timezoneOffset:this.timezoneOffset});return p},finish:function(p){p=p instanceof Array?c(p):[p];if(p.length===0)return null;for(var v=0;v<p.length;v++)typeof p[v]==
"function"&&p[v].call(this);p=a.today();if(this.now&&!this.unit&&!this.operator)return new Date;else if(this.now)p=new Date;v=!!(this.days&&this.days!==null||this.orient||this.operator);var F,V,da;da=this.orient=="past"||this.operator=="subtract"?-1:1;!this.now&&"hour minute second".indexOf(this.unit)!=-1&&p.setTimeToNow();if(this.month||this.month===0)if("year day hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;v=true}if(!v&&this.weekday&&!this.day&&!this.days){F=
Date[this.weekday]();this.day=F.getDate();if(!this.month)this.month=F.getMonth();this.year=F.getFullYear()}if(v&&this.weekday&&this.unit!="month"){this.unit="day";F=a.getDayNumberFromName(this.weekday)-p.getDay();V=7;this.days=F?(F+da*V)%V:da*V}if(this.month&&this.unit=="day"&&this.operator){this.value=this.month+1;this.month=null}if(this.value!=null&&this.month!=null&&this.year!=null)this.day=this.value*1;if(this.month&&!this.day&&this.value){p.set({day:this.value*1});if(!v)this.day=this.value*1}if(!this.month&&
this.value&&this.unit=="month"&&!this.now){this.month=this.value;v=true}if(v&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";F=this.month-p.getMonth();V=12;this.months=F?(F+da*V)%V:da*V;this.month=null}if(!this.unit)this.unit="day";if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null)this[this.unit+"s"]=this[this.unit+"s"]+(this.operator=="add"?1:-1)+(this.value||0)*da;else if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value)this.value=
1;this[this.unit+"s"]=this.value*da}if(this.meridian&&this.hour)if(this.meridian=="p"&&this.hour<12)this.hour+=12;else if(this.meridian=="a"&&this.hour==12)this.hour=0;if(this.weekday&&!this.day&&!this.days){F=Date[this.weekday]();this.day=F.getDate();if(F.getMonth()!==p.getMonth())this.month=F.getMonth()}if((this.month||this.month===0)&&!this.day)this.day=1;if(!this.orient&&!this.operator&&this.unit=="week"&&this.value&&!this.day&&!this.month)return Date.today().setWeek(this.value);if(v&&this.timezone&&
this.day&&this.days)this.day=this.days;return v?p.add(this):p.set(this)}};var f=a.Parsing.Operators,h=a.Grammar,n=a.Translator,j;h.datePartDelimiter=f.rtoken(/^([\s\-\.\,\/\x27]+)/);h.timePartDelimiter=f.stoken(":");h.whiteSpace=f.rtoken(/^\s*/);h.generalDelimiter=f.rtoken(/^(([\s\,]|at|@|on)+)/);var k={};h.ctoken=function(p){var v=k[p];if(!v){v=b.regexPatterns;for(var F=p.split(/\s+/),V=[],da=0;da<F.length;da++)V.push(f.replace(f.rtoken(v[F[da]]),F[da]));v=k[p]=f.any.apply(null,V)}return v};h.ctoken2=
function(p){return f.rtoken(b.regexPatterns[p])};h.h=f.cache(f.process(f.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),n.hour));h.hh=f.cache(f.process(f.rtoken(/^(0[0-9]|1[0-2])/),n.hour));h.H=f.cache(f.process(f.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),n.hour));h.HH=f.cache(f.process(f.rtoken(/^([0-1][0-9]|2[0-3])/),n.hour));h.m=f.cache(f.process(f.rtoken(/^([0-5][0-9]|[0-9])/),n.minute));h.mm=f.cache(f.process(f.rtoken(/^[0-5][0-9]/),n.minute));h.s=f.cache(f.process(f.rtoken(/^([0-5][0-9]|[0-9])/),n.second));h.ss=
f.cache(f.process(f.rtoken(/^[0-5][0-9]/),n.second));h.hms=f.cache(f.sequence([h.H,h.m,h.s],h.timePartDelimiter));h.t=f.cache(f.process(h.ctoken2("shortMeridian"),n.meridian));h.tt=f.cache(f.process(h.ctoken2("longMeridian"),n.meridian));h.z=f.cache(f.process(f.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),n.timezone));h.zz=f.cache(f.process(f.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),n.timezone));h.zzz=f.cache(f.process(h.ctoken2("timezone"),n.timezone));h.timeSuffix=f.each(f.ignore(h.whiteSpace),
f.set([h.tt,h.zzz]));h.time=f.each(f.optional(f.ignore(f.stoken("T"))),h.hms,h.timeSuffix);h.d=f.cache(f.process(f.each(f.rtoken(/^([0-2]\d|3[0-1]|\d)/),f.optional(h.ctoken2("ordinalSuffix"))),n.day));h.dd=f.cache(f.process(f.each(f.rtoken(/^([0-2]\d|3[0-1])/),f.optional(h.ctoken2("ordinalSuffix"))),n.day));h.ddd=h.dddd=f.cache(f.process(h.ctoken("sun mon tue wed thu fri sat"),function(p){return function(){this.weekday=p}}));h.M=f.cache(f.process(f.rtoken(/^(1[0-2]|0\d|\d)/),n.month));h.MM=f.cache(f.process(f.rtoken(/^(1[0-2]|0\d)/),
n.month));h.MMM=h.MMMM=f.cache(f.process(h.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),n.month));h.y=f.cache(f.process(f.rtoken(/^(\d\d?)/),n.year));h.yy=f.cache(f.process(f.rtoken(/^(\d\d)/),n.year));h.yyy=f.cache(f.process(f.rtoken(/^(\d\d?\d?\d?)/),n.year));h.yyyy=f.cache(f.process(f.rtoken(/^(\d\d\d\d)/),n.year));j=function(){return f.each(f.any.apply(null,arguments),f.not(h.ctoken2("timeContext")))};h.day=j(h.d,h.dd);h.month=j(h.M,h.MMM);h.year=j(h.yyyy,h.yy);h.orientation=f.process(h.ctoken("past future"),
function(p){return function(){this.orient=p}});h.operator=f.process(h.ctoken("add subtract"),function(p){return function(){this.operator=p}});h.rday=f.process(h.ctoken("yesterday tomorrow today now"),n.rday);h.unit=f.process(h.ctoken("second minute hour day week month year"),function(p){return function(){this.unit=p}});h.value=f.process(f.rtoken(/^\d\d?(st|nd|rd|th)?/),function(p){return function(){this.value=p.replace(/\D/g,"")}});h.expression=f.set([h.rday,h.operator,h.value,h.unit,h.orientation,
h.ddd,h.MMM]);j=function(){return f.set(arguments,h.datePartDelimiter)};h.mdy=j(h.ddd,h.month,h.day,h.year);h.ymd=j(h.ddd,h.year,h.month,h.day);h.dmy=j(h.ddd,h.day,h.month,h.year);h.date=function(p){return(h[b.dateElementOrder]||h.mdy).call(this,p)};h.format=f.process(f.many(f.any(f.process(f.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(p){if(h[p])return h[p];else throw a.Parsing.Exception(p);}),f.process(f.rtoken(/^[^dMyhHmstz]+/),function(p){return f.ignore(f.stoken(p))}))),
function(p){return f.process(f.each.apply(null,p),n.finishExact)});var o={};h.formats=function(p){if(p instanceof Array){for(var v=[],F=0;F<p.length;F++)v.push(o[p[F]]=o[p[F]]||h.format(p[F])[0]);return f.any.apply(null,v)}else return o[p]=o[p]||h.format(p)[0]};h._formats=h.formats(['"yyyy-MM-ddTHH:mm:ssZ"',"yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy",
"ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);h._start=f.process(f.set([h.date,h.time,h.expression],h.generalDelimiter,h.whiteSpace),n.finish);h.start=function(p){try{var v=h._formats.call({},p);if(v[1].length===0)return v}catch(F){}return h._start.call({},p)};a._parse=a.parse;a.parse=function(p){var v=null;if(!p)return null;if(p instanceof Date)return p;try{v=a.Grammar.start.call({},p.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"))}catch(F){return null}return v[1].length===
0?v[0]:null};a.getParseFunction=function(p){var v=a.Grammar.formats(p);return function(F){var V=null;try{V=v.call({},F)}catch(da){return null}return V[1].length===0?V[0]:null}};a.parseExact=function(p,v){return a.getParseFunction(v)(p)}})();
var swfobject=function(){function a(){if(!La){try{var J=y.getElementsByTagName("body")[0].appendChild(y.createElement("span"));J.parentNode.removeChild(J)}catch(S){return}La=true;J=ja.length;for(var ba=0;ba<J;ba++)ja[ba]()}}function b(J){if(La)J();else ja[ja.length]=J}function c(J){if(typeof M.addEventListener!=C)M.addEventListener("load",J,false);else if(typeof y.addEventListener!=C)y.addEventListener("load",J,false);else if(typeof M.attachEvent!=C)da(M,"onload",J);else if(typeof M.onload=="function"){var S=
M.onload;M.onload=function(){S();J()}}else M.onload=J}function f(){var J=y.getElementsByTagName("body")[0],S=y.createElement(H);S.setAttribute("type",E);var ba=J.appendChild(S);if(ba){var fa=0;(function(){if(typeof ba.GetVariable!=C){var ha=ba.GetVariable("$version");if(ha){ha=ha.split(" ")[1].split(",");ia.pv=[parseInt(ha[0],10),parseInt(ha[1],10),parseInt(ha[2],10)]}}else if(fa<10){fa++;setTimeout(arguments.callee,10);return}J.removeChild(S);ba=null;h()})()}else h()}function h(){var J=R.length;
if(J>0)for(var S=0;S<J;S++){var ba=R[S].id,fa=R[S].callbackFn,ha={success:false,id:ba};if(ia.pv[0]>0){var qa=V(ba);if(qa)if(sa(R[S].swfVersion)&&!(ia.wk&&ia.wk<312)){Ba(ba,true);if(fa){ha.success=true;ha.ref=n(ba);fa(ha)}}else if(R[S].expressInstall&&j()){ha={};ha.data=R[S].expressInstall;ha.width=qa.getAttribute("width")||"0";ha.height=qa.getAttribute("height")||"0";if(qa.getAttribute("class"))ha.styleclass=qa.getAttribute("class");if(qa.getAttribute("align"))ha.align=qa.getAttribute("align");var oa=
{};qa=qa.getElementsByTagName("param");for(var xa=qa.length,Aa=0;Aa<xa;Aa++)if(qa[Aa].getAttribute("name").toLowerCase()!="movie")oa[qa[Aa].getAttribute("name")]=qa[Aa].getAttribute("value");k(ha,oa,ba,fa)}else{o(qa);fa&&fa(ha)}}else{Ba(ba,true);if(fa){if((ba=n(ba))&&typeof ba.SetVariable!=C){ha.success=true;ha.ref=ba}fa(ha)}}}}function n(J){var S=null;if((J=V(J))&&J.nodeName=="OBJECT")if(typeof J.SetVariable!=C)S=J;else if(J=J.getElementsByTagName(H)[0])S=J;return S}function j(){return!Qa&&sa("6.0.65")&&
(ia.win||ia.mac)&&!(ia.wk&&ia.wk<312)}function k(J,S,ba,fa){Qa=true;Ja=fa||null;eb={success:false,id:ba};var ha=V(ba);if(ha){if(ha.nodeName=="OBJECT"){g=p(ha);Da=null}else{g=ha;Da=ba}J.id=N;if(typeof J.width==C||!/%$/.test(J.width)&&parseInt(J.width,10)<310)J.width="310";if(typeof J.height==C||!/%$/.test(J.height)&&parseInt(J.height,10)<137)J.height="137";y.title=y.title.slice(0,47)+" - Flash Player Installation";fa=ia.ie&&ia.win?"ActiveX":"PlugIn";fa="MMredirectURL="+M.location.toString().replace(/&/g,
"%26")+"&MMplayerType="+fa+"&MMdoctitle="+y.title;if(typeof S.flashvars!=C)S.flashvars+="&"+fa;else S.flashvars=fa;if(ia.ie&&ia.win&&ha.readyState!=4){fa=y.createElement("div");ba+="SWFObjectNew";fa.setAttribute("id",ba);ha.parentNode.insertBefore(fa,ha);ha.style.display="none";(function(){ha.readyState==4?ha.parentNode.removeChild(ha):setTimeout(arguments.callee,10)})()}v(J,S,ba)}}function o(J){if(ia.ie&&ia.win&&J.readyState!=4){var S=y.createElement("div");J.parentNode.insertBefore(S,J);S.parentNode.replaceChild(p(J),
S);J.style.display="none";(function(){J.readyState==4?J.parentNode.removeChild(J):setTimeout(arguments.callee,10)})()}else J.parentNode.replaceChild(p(J),J)}function p(J){var S=y.createElement("div");if(ia.win&&ia.ie)S.innerHTML=J.innerHTML;else if(J=J.getElementsByTagName(H)[0])if(J=J.childNodes)for(var ba=J.length,fa=0;fa<ba;fa++)!(J[fa].nodeType==1&&J[fa].nodeName=="PARAM")&&J[fa].nodeType!=8&&S.appendChild(J[fa].cloneNode(true));return S}function v(J,S,ba){var fa,ha=V(ba);if(ia.wk&&ia.wk<312)return fa;
if(ha){if(typeof J.id==C)J.id=ba;if(ia.ie&&ia.win){var qa="",oa;for(oa in J)if(J[oa]!=Object.prototype[oa])if(oa.toLowerCase()=="data")S.movie=J[oa];else if(oa.toLowerCase()=="styleclass")qa+=' class="'+J[oa]+'"';else if(oa.toLowerCase()!="classid")qa+=" "+oa+'="'+J[oa]+'"';oa="";for(var xa in S)if(S[xa]!=Object.prototype[xa])oa+='<param name="'+xa+'" value="'+S[xa]+'" />';ha.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+qa+">"+oa+"</object>";wa[wa.length]=J.id;fa=V(J.id)}else{xa=
y.createElement(H);xa.setAttribute("type",E);for(var Aa in J)if(J[Aa]!=Object.prototype[Aa])if(Aa.toLowerCase()=="styleclass")xa.setAttribute("class",J[Aa]);else Aa.toLowerCase()!="classid"&&xa.setAttribute(Aa,J[Aa]);for(qa in S)if(S[qa]!=Object.prototype[qa]&&qa.toLowerCase()!="movie"){J=xa;oa=qa;Aa=S[qa];ba=y.createElement("param");ba.setAttribute("name",oa);ba.setAttribute("value",Aa);J.appendChild(ba)}ha.parentNode.replaceChild(xa,ha);fa=xa}}return fa}function F(J){var S=V(J);if(S&&S.nodeName==
"OBJECT")if(ia.ie&&ia.win){S.style.display="none";(function(){if(S.readyState==4){var ba=V(J);if(ba){for(var fa in ba)if(typeof ba[fa]=="function")ba[fa]=null;ba.parentNode.removeChild(ba)}}else setTimeout(arguments.callee,10)})()}else S.parentNode.removeChild(S)}function V(J){var S=null;try{S=y.getElementById(J)}catch(ba){}return S}function da(J,S,ba){J.attachEvent(S,ba);pa[pa.length]=[J,S,ba]}function sa(J){var S=ia.pv;J=J.split(".");J[0]=parseInt(J[0],10);J[1]=parseInt(J[1],10)||0;J[2]=parseInt(J[2],
10)||0;return S[0]>J[0]||S[0]==J[0]&&S[1]>J[1]||S[0]==J[0]&&S[1]==J[1]&&S[2]>=J[2]?true:false}function ya(J,S,ba,fa){if(!(ia.ie&&ia.mac)){var ha=y.getElementsByTagName("head")[0];if(ha){ba=ba&&typeof ba=="string"?ba:"screen";if(fa)cb=Ca=null;if(!Ca||cb!=ba){fa=y.createElement("style");fa.setAttribute("type","text/css");fa.setAttribute("media",ba);Ca=ha.appendChild(fa);if(ia.ie&&ia.win&&typeof y.styleSheets!=C&&y.styleSheets.length>0)Ca=y.styleSheets[y.styleSheets.length-1];cb=ba}if(ia.ie&&ia.win)Ca&&
typeof Ca.addRule==H&&Ca.addRule(J,S);else Ca&&typeof y.createTextNode!=C&&Ca.appendChild(y.createTextNode(J+" {"+S+"}"))}}}function Ba(J,S){if(gb){var ba=S?"visible":"hidden";if(La&&V(J))V(J).style.visibility=ba;else ya("#"+J,"visibility:"+ba)}}function u(J){return/[\\\"<>\.;]/.exec(J)!=null&&typeof encodeURIComponent!=C?encodeURIComponent(J):J}var C="undefined",H="object",E="application/x-shockwave-flash",N="SWFObjectExprInst",M=window,y=document,T=navigator,Q=false,ja=[function(){Q?f():h()}],R=
[],wa=[],pa=[],g,Da,Ja,eb,La=false,Qa=false,Ca,cb,gb=true,ia=function(){var J=typeof y.getElementById!=C&&typeof y.getElementsByTagName!=C&&typeof y.createElement!=C,S=T.userAgent.toLowerCase(),ba=T.platform.toLowerCase(),fa=ba?/win/.test(ba):/win/.test(S);ba=ba?/mac/.test(ba):/mac/.test(S);S=/webkit/.test(S)?parseFloat(S.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var ha=!+"\u000b1",qa=[0,0,0],oa=null;if(typeof T.plugins!=C&&typeof T.plugins["Shockwave Flash"]==H){if((oa=T.plugins["Shockwave Flash"].description)&&
!(typeof T.mimeTypes!=C&&T.mimeTypes[E]&&!T.mimeTypes[E].enabledPlugin)){Q=true;ha=false;oa=oa.replace(/^.*\s+(\S+\s+\S+$)/,"$1");qa[0]=parseInt(oa.replace(/^(.*)\..*$/,"$1"),10);qa[1]=parseInt(oa.replace(/^.*\.(.*)\s.*$/,"$1"),10);qa[2]=/[a-zA-Z]/.test(oa)?parseInt(oa.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof M.ActiveXObject!=C)try{var xa=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(xa)if(oa=xa.GetVariable("$version")){ha=true;oa=oa.split(" ")[1].split(",");qa=[parseInt(oa[0],
10),parseInt(oa[1],10),parseInt(oa[2],10)]}}catch(Aa){}return{w3:J,pv:qa,wk:S,ie:ha,win:fa,mac:ba}}();(function(){if(ia.w3){if(typeof y.readyState!=C&&y.readyState=="complete"||typeof y.readyState==C&&(y.getElementsByTagName("body")[0]||y.body))a();if(!La){typeof y.addEventListener!=C&&y.addEventListener("DOMContentLoaded",a,false);if(ia.ie&&ia.win){y.attachEvent("onreadystatechange",function(){if(y.readyState=="complete"){y.detachEvent("onreadystatechange",arguments.callee);a()}});M==top&&function(){if(!La){try{y.documentElement.doScroll("left")}catch(J){setTimeout(arguments.callee,
0);return}a()}}()}ia.wk&&function(){La||(/loaded|complete/.test(y.readyState)?a():setTimeout(arguments.callee,0))}();c(a)}}})();(function(){ia.ie&&ia.win&&window.attachEvent("onunload",function(){for(var J=pa.length,S=0;S<J;S++)pa[S][0].detachEvent(pa[S][1],pa[S][2]);J=wa.length;for(S=0;S<J;S++)F(wa[S]);for(var ba in ia)ia[ba]=null;ia=null;for(var fa in swfobject)swfobject[fa]=null;swfobject=null})})();return{registerObject:function(J,S,ba,fa){if(ia.w3&&J&&S){var ha={};ha.id=J;ha.swfVersion=S;ha.expressInstall=
ba;ha.callbackFn=fa;R[R.length]=ha;Ba(J,false)}else fa&&fa({success:false,id:J})},getObjectById:function(J){if(ia.w3)return n(J)},embedSWF:function(J,S,ba,fa,ha,qa,oa,xa,Aa,Ra){var Ya={success:false,id:S};if(ia.w3&&!(ia.wk&&ia.wk<312)&&J&&S&&ba&&fa&&ha){Ba(S,false);b(function(){ba+="";fa+="";var Ha={};if(Aa&&typeof Aa===H)for(var Ia in Aa)Ha[Ia]=Aa[Ia];Ha.data=J;Ha.width=ba;Ha.height=fa;Ia={};if(xa&&typeof xa===H)for(var Za in xa)Ia[Za]=xa[Za];if(oa&&typeof oa===H)for(var Sa in oa)if(typeof Ia.flashvars!=
C)Ia.flashvars+="&"+Sa+"="+oa[Sa];else Ia.flashvars=Sa+"="+oa[Sa];if(sa(ha)){Za=v(Ha,Ia,S);Ha.id==S&&Ba(S,true);Ya.success=true;Ya.ref=Za}else if(qa&&j()){Ha.data=qa;k(Ha,Ia,S,Ra);return}else Ba(S,true);Ra&&Ra(Ya)})}else Ra&&Ra(Ya)},switchOffAutoHideShow:function(){gb=false},ua:ia,getFlashPlayerVersion:function(){return{major:ia.pv[0],minor:ia.pv[1],release:ia.pv[2]}},hasFlashPlayerVersion:sa,createSWF:function(J,S,ba){if(ia.w3)return v(J,S,ba)},showExpressInstall:function(J,S,ba,fa){ia.w3&&j()&&
k(J,S,ba,fa)},removeSWF:function(J){ia.w3&&F(J)},createCSS:function(J,S,ba,fa){ia.w3&&ya(J,S,ba,fa)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(J){var S=y.location.search||y.location.hash;if(S){if(/\?/.test(S))S=S.split("?")[1];if(J==null)return u(S);S=S.split("&");for(var ba=0;ba<S.length;ba++)if(S[ba].substring(0,S[ba].indexOf("="))==J)return u(S[ba].substring(S[ba].indexOf("=")+1))}return""},expressInstallCallback:function(){if(Qa){var J=V(N);if(J&&g){J.parentNode.replaceChild(g,
J);if(Da){Ba(Da,true);if(ia.ie&&ia.win)g.style.display="block"}Ja&&Ja(eb)}Qa=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,f,h,n,j,k){f=f||{allowScriptAccess:"always"};h=h||"";n=n||"0";j=j||"0";k=k||"9";createEmptyDiv(b,c);swfobject.embedSWF(unescape(a),c,n,j,k,"/widgets/expressinstall.swf","",f,h)}
Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;Prototype.Browser.IE8=Prototype.Browser.IE&&!Prototype.Browser.IE6&&!Prototype.Browser.IE7;BaseDomain="justin.tv";typeof jQuery!=="undefined"&&jQuery&&jQuery.noConflict();try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}
function createCookie(a,b,c,f,h){f||(f="/");if(c){var n=new Date;n.setTime(n.getTime()+c*1E3);c="; expires="+n.toGMTString()}else c="";a=a+"="+b+c+"; path="+f;if(h==null)document.cookie=a+"; domain=."+BaseDomain;else if(h=="")document.cookie=a}function readCookie(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var f=b[c];f.charAt(0)==" ";)f=f.substring(1,f.length);if(f.indexOf(a)==0)return f.substring(a.length,f.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 f=0;f<c.childNodes.length;f++)a.appendChild($(c.childNodes[f]).remove());$(c).remove()}function set_volume(a){createCookie("volume",a,604800)}
function get_volume(){return readCookie("volume")||100}function limit_tags(a,b,c,f){for(a=$(a).getElementsByTagName(b);a.length>c;)if(f){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")],f=[_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday")],h=[_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec")],n=[_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")],j=a.getHours()<12?"am":"pm",k=mil_to_ampm(a.getHours()),
o=two_digit(a.getHours()),p=two_digit(a.getMinutes()),v=two_digit(a.getSeconds()),F=a.is_today(),V=a.is_tomorrow(),da=f[a.getDay()]+" "+n[a.getMonth()]+" "+ordinalize(a.getDate());c=[["%a",c[a.getDay()]],["%A",f[a.getDay()]],["%b",h[a.getMonth()]],["%B",n[a.getMonth()]],["%c",a.toString()],["%d",two_digit(a.getDate())],["$d",a.getDate()],["%H",o],["%I",two_digit(k)],["%m",two_digit(a.getMonth()+1)],["%M",p],["%p",j],["%P",j.toUpperCase()],["%S",v],["%w",a.getDay()],["%x",time_to_date_string(a)],["%X",
k+":"+p+":"+v+" "+j],["%y",two_digit(a.getYear()%100)],["%Y",a.getFullYear()],["$f",k+(a.getMinutes()?":"+p:"")],["$m",a.getMonth()+1],["$M",a.getMinutes()],["$S",a.getSeconds()],["$H",a.getHours()],["$I",k],["%i",k],["%o",ordinalize(a.getDate())],["%T",F?_("Today at"):V?_("Tomorrow at"):da]];for(f=0;f<c.length;f++)b=b.replace(c[f][0],c[f][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(f,h,n,j){f=/([0-9]+)/.exec(f)[1];var k=/([0-9]+)/.exec(h)[1];if(!j){if(!b){c();b=true}if(f>50&&k>50)MobileBrowser()?on_dom_load(function(){$(n).innerHTML='<div style="padding-top:'+(k/2-25)+'px;">'+s_("Your mobile device does not support Justin.tv.")+"</div>"}):on_dom_load(function(){$(n).innerHTML='<div style="padding-top:'+(k/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(f){var h=c;c=function(){h();f()}};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"),f=0;f<c.length;f++)if(c[f].type=="checkbox")c[f].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,f){return b[f]})}function l_(a,b){var c=$A(arguments).slice(2);return b.replace(/\$(.+?)\$/g,function(f,h){return a.apply(this,[h].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 f=new Image(1,1);if(c)f.onload=c;try{query_string=[encodeURIComponent(a),b.map(encodeURI),get_page_log_params().toQueryString()].flatten().join("&");f.src="http://stats.jtvnw.net/"+Math.round(Math.random()*1E4)+"?"+query_string;return f}catch(h){}}
function get_page_log_params(){var a=$H(),b=function(c,f){f&&f!==""&&a.set(c,f)};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 f=PP.user_id;if(new Date(2007,11,24,0,0,0)<new Date&&(f==7824||f==39980||f==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(n){return b[n].test(navigator.platform)})||"unknown";a.os=function(){return c};return c};a.is_os=function(n){if(Object.isArray(n))return $A(n).indexOf(a.os())!=-1;else if(Object.isString(n))return a.os()==n;return false};var f=["IE","Opera","WebKit","MobileSafari","Gecko"],h=null;a.browser=function(){h=$A(f).detect(function(n){return Prototype.Browser[n]})||"unknown";a.browser=
function(){return h};return h};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 f=c;if(a!==b){f=c.replace("://"+a+".","://"+b+".");if(f===c)f=c.match("www.")?c.replace("www",b):c.replace(LanguageBaseDomain,b+"."+LanguageBaseDomain)}redirect_respecting_analytics(f)})}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,f){growl('<a href="'+f+'" 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(h){return h.innerHTML.replace(/\s/,"")==a.replace(/\s/,"")})){var f="growl_"+growl.growl_id++;b=['<div class="notification_holder" id="',f,'"><div class="notification"><a href="#" class="close" onclick="$(\'',f,'\').hide(); return false;">X</a><div class="content ',b,'">',a,"</div></div></div>"].join("");appendHTML("growl_slider",b);$(f).onmouseover=function(){x=$(f).down("a.close");x.style.display="block"};$(f).onmouseout=
function(){x=$(f).down("a.close");x.style.display=""};$("growl_container").show();c||(c=7);new Effect.Fade(f,{duration:3,delay:c,queue:{scope:f},afterFinish:function(){var h=$(f).offsetHeight;new Effect.Move("growl_slider",{y:0-h,x:0,mode:"relative",afterFinish:function(){$(f).remove();if($("growl_slider").childElements().length==0)$("growl_slider").style.top="0px";else $("growl_slider").style.top=$("growl_slider").positionedOffset().top+h+"px"}})}})}}growl.growl_id=0;
function show_info_popup(a,b,c,f){$("info_popup_title").update(a);$("info_popup_body").update(b);try{b.evalScripts()}catch(h){}$("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(f?f:"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 f=b.match(/:uid=>"(\w+)"/);if(f)b=b.match(/:format=>"(\w+)"/);else{f=b.match(/:uid:\s*(\w+)/);b=b.match(/:format:\s*(\w+)/)}return"http://s.jtvnw.net/jtv_user_pictures/"+c+"-profile_image-"+f[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(f){f.apply(EventBank,b)});var c=EventBank.prefix_handlers[a.split(":")[0]]||[];$A(c).each(function(f){f.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,f=EventBank.backlog[a];c=f.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(f){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(f)},onFailure:function(f){delete sharing_login_callbacks[a];delete sharing_login_windows[a];log_stat("sharing/login_prompt",["status=failure","service="+
a]);return b.onFailure(f)}}};
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,f){a=["_trackEvent",a,b];c!=null&&a.push(c);f!=null&&a.push(f);_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(f){return f.split("=")}).findAll(function(f){return f[0]in{utm_source:1,utm_medium:1,utm_campaign:1,utm_term:1,utm_content:1}}).map(function(f){return f.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,f,h){if((f=="true"||f===true)&&h!="true"&&h!==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 f={allowScriptAccess:"always",allowNetworking:"all",flashvars:Mixpanel._build_flashvars(a,b)};addSWF("/widgets/mixpanel_beacon.swf","_mpq",c,f,{id:c,name:"left",bgcolor:"#000000"})},_build_flashvars:function(a,b){b=Object.clone(b);b.login=PP.login;var c,f,h,n=0,j=[];j[n++]="event="+a.toString();for(c in b)if(c)if(c!="event"){val=b[c];f=val==null?"":val.toString();
h=c;j[n++]=h+"="+f}return j.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(f){c(f)},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(j){var k=$(j.id);if(k&&k.src!==j.src){var o=k.cumulativeOffset().top-
(k.cumulativeScrollOffset().top-a);if(b>=o-20&&k.clientWidth>0){k.src=j.src;return false}}return true});if(LateLoader.channel_about_me){var c=$("about_me_container"),f=c.cumulativeOffset();if(b>=f.top-20){c.innerHTML=LateLoader.channel_about_me;LateLoader.channel_about_me=null}if($("related")){var h=0;$$("#related_list .list_item").each(function(j){h+=j.getHeight()});c=-50;if($("clips"))c+=$("clips").getHeight();if($("about"))c+=$("about").getHeight();c=Math.min(h,c,400);f=$("related_list");if(c>
f.getHeight())f.style.height=c+"px"}}LateLoader.reposition_ad("ChanLeaderBottomv2");LateLoader.reposition_ad("Staging_ChanLeaderBottomv2");LateLoader.images=images;LateLoader.updating=false;if($$(".below_header")){var n=50-a;if(n<0)n=0;$$(".below_header").each(function(j){$(j).style.top=n+"px"})}if($$(".above_footer")&&$("footer")){n=b-$("footer").positionedOffset().top;if(n<0)n=0;$$(".above_footer").each(function(j){$(j).style.bottom=n+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 f=0,h=0;if(a.indexOf("Leaderv")>-1){LateLoader.leader_ad=true;f=b.getHeight();h=b.getWidth();f>0&&h>0&&show_header_banner()}var n={};if(typeof $j!="undefined"&&LateLoader.xarth){n=$j("#"+
a+"_holder").offset();var j=$j(".wrapper").offset();n.left-=j.left;n.top-=j.top}else n=c.positionedOffset();if(a.indexOf("Leaderv")>-1){if(f>0)b.style.top=n.top+(c.getHeight()-f)/2+"px";if(h>0)b.style.left=n.left+(c.getWidth()-h)/2+"px"}else{b.style.top=n.top+"px";b.style.left=n.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(f){if(f.tagName.toUpperCase()=="DIV"){var h=f.getStyle("clip");if(h)try{ss=h.split(",");if(ss.length<2)ss=h.split(" ");parseInt(ss[2])>0?f.setStyle({height:parseInt(ss[2])+"px"}):f.setStyle({height:null})}catch(n){}f=
f.getHeight();if(f>max_height)max_height=f}});$(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 f=$(b+c);if(f)new Effect.Move(f,{x:0,y:a,mode:"relative"});else(f=$("Staging_"+b+c))&&new Effect.Move(f,{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,f,h,n){c||(c=310);f||(f=320);h||(h="");if(b=="DirectoryMedRectBottomv2"&&document.getElementById("spotlight404"))h=true;if(!b&&LateLoader.companion_slot)b=LateLoader.companion_slot;var j=function(k){k='<iframe src="'+k+'" height="'+f+'" width="'+c+'" id="ad_iframe" scrolling="no"></iframe>';$(a).innerHTML=k;$(a).show();if(n){$(a).setStyle({width:c+"px",height:f+"px"});$(a).ancestors()[0].setStyle({width:c+35+"px",height:f+"px"})}LateLoader.reposition_all_ads()};url="/ad/iframe_ad?";
url+="ad_slot="+b+"&just_ad="+h+"&height="+f+"&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(h=0;h<Math.min(b.genres.length,3);h++)url+="&genre"+h+"="+encodeURIComponent(b.genres[h]);if(b.name)url+="&game_name="+encodeURIComponent(b.name)}else j(url)}function setExtraGoogleParams(a){PP.game_info&&setGoogleGameAttr(PP.game_info);a()}function fetchGoogleAds(){setExtraGoogleParams(GA_googleFetchAds)}
(function(a){a.fn.ajaxDom=function(b){var c=this;this.is(":visible")&&a.get(b).success(function(f){c.append(f)});return this}})(jQuery.noConflict());flash.onFail(function(){on_dom_load(function(){$("chat_loading_spinner").hide();$("chat_lines").insert('<div style="text-align: center; padding-top: 160px; font-weight: bold;">'+(MobileBrowser()?s_("Phone not supported."):s_("Plugin missing."))+"</div>")})});
function detect_and_load_chat(){var a=decodeURIComponent(readCookie("chat_saved_on_"+PP.channel)||"");if(a){$("chat_text_input").value=a;eraseCookie("chat_saved_on_"+PP.channel)}create_chat();$("chat_text_input").onkeypress=function(b){return CurrentChat.onkeypress(b)}.bindAsEventListener(CurrentChat);$("chat_text_input").onkeyup=function(b){return CurrentChat.onkeyupordown(b)}.bindAsEventListener(CurrentChat);$("chat_text_input").onkeydown=function(b){return CurrentChat.onkeyupordown(b)}.bindAsEventListener(CurrentChat);
$("chat_settings_switch_type").hide()}function chat_login_with_refresh(a){var b=open(a,"Chat Login Window");if(b)x=new PeriodicalExecuter(function(){if(b.closed){x.stop();location.reload()}});else CurrentChat.admin_message(_("Please enable popups"))}function login_to_chat(){CurrentChat.save_attempted_message();$("chat_login").hide();$("chat_returning").hide();$("temp_cover").hide();$("chat_line_list").update();create_chat();CurrentChat.show_login()}
function create_chat(){if(CurrentChat&&CurrentChat.ircSystem&&CurrentChat.ircSystem.disconnect){CurrentChat.ircSystem.disconnect();CurrentChat.joined_once=false}CurrentChat=new Chat;CurrentChat.connect(PP.channel);CurrentChat.admin_message(_("Loading chat..."));hide_chat_viewers_menu();hide_chat_settings_menu();CurrentChat.clear_user_list();$$("#chat_credentials .chat_settings").invoke("hide");$$("#jtv_settings").invoke("show");$("char_count")&&$("char_count").hide();$("post_to_twitter")&&$("post_to_twitter").hide()}
function toggle_chat(){if($("jtv_chat").style.display==""){log_stat("toggle_chat_click",["action=hide"]);$("chat_redisplay_holder").show();Effect.Fade("jtv_chat",{duration:0.25,from:1,to:0,afterFinish:LateLoader.reposition_all_ads});hide_chat_viewers_menu();hide_chat_settings_menu()}else{log_stat("toggle_chat_click",["action=show"]);$("chat_redisplay_holder").hide();Effect.Appear("jtv_chat",{duration:0.25,from:0,to:1,afterFinish:LateLoader.reposition_all_ads})}}
function start_time_since_commercial(){window.time_since_c_min=-1;window.time_since_c_hour=0;window.commercial_timer!=null&&clearInterval(window.commercial_timer);window.commercial_timer=setInterval("update_commercial_timer()",6E4);update_commercial_timer();$("time_since_commercial").show()}
function update_commercial_timer(){window.time_since_c_min+=1;if(window.time_since_c_min>59){window.time_since_c_min=0;window.time_since_c_hour+=1}$("time_since_commercial").innerHTML=""+window.time_since_c_hour+"h:"+window.time_since_c_min+"m since last /commercial"}
function show_share(){$("share_forms").style.display==""?Element.hide("share_forms"):Element.show("share_forms");if(PP.user_id){if($("share_friends").innerHTML.strip()==""){$("share_friends").innerHTML='<img src="/images/share_spinner.gif" />';new Ajax.Updater("share_friends","/community/share_friends",{onComplete:LateLoader.reposition_all_ads})}if($("share_contacts").innerHTML.strip()==""){$("share_friends").innerHTML='<img src="/images/share_spinner.gif" />';new Ajax.Updater("share_contacts","/community/share_contacts",
{onComplete:LateLoader.reposition_all_ads})}}else $("email-share-form").hide();LateLoader.reposition_all_ads()}function toggle_chat_settings_menu(){CurrentChat.setup_chat_settings_menu();$("chat_settings_dropmenu_button").toggleClassName("toggled");$("chat_settings_dropmenu").toggle();hide_chat_viewers_menu()}function hide_chat_viewers_menu(){$("chat_viewers_dropmenu_button").removeClassName("toggled");$("chat_viewers_dropmenu").hide()}
function toggle_chat_viewers_menu(){$("chat_viewers_dropmenu_button").toggleClassName("toggled");$("chat_viewers_dropmenu").toggle();hide_chat_settings_menu()}function hide_chat_settings_menu(){$("chat_settings_dropmenu_button").removeClassName("toggled");$("chat_settings_dropmenu").hide();$("chat_colors").hide()}
function popout_chat(){toggle_chat();if(!window.popout_chat_window||window.popout_chat_window.closed)window.popout_chat_window=window.open("/chat/embed?channel="+PP.channel+"&popout_chat=true","_blank","right=50,top=50,width=400,height=600,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");LateLoader.refresh();popout_chat_window.focus();wait_for_chat_popout_close()}
function return_chat(){window.popout_chat_window&&window.popout_chat_window.close()}function wait_for_chat_popout_close(){if(window.popout_chat_window&&window.popout_chat_window.closed)window.location.href=window.location.href;else setTimeout(wait_for_chat_popout_close,100)}function show_category_chooser(a){$("category_chooser").show();$("channel_cover").show();refresh_category_options(a);hide_flash_player();window.scrollTo(0,0)}
function hide_category_chooser(){$("category_chooser").hide();$("channel_cover").hide();show_flash_player()}var ad_timer=15;Event.observe(window,"load",function(){$("ad_container")&&window.setInterval(function(){ad_timer-=1;if(ad_timer>=0)$("ad_counter").innerHTML=ad_timer;ad_timer==0&&toggleAdElements()},1E3)});function toggleAdElements(){$("ad_timer_txt").hide();ad_timer=0;$$(".ad_toggle").each(function(a){Element.toggle(a)})}
function toggle_edit_status(){if(PP.login!=PP.channel)return false;$("channel_status_message").toggle();$("toggle_edit_status").toggle();$("channel_status_form").toggle()}function switch_data_tab(a){$$("#info .content").each(function(b){b.id==a?b.addClassName("selected"):b.removeClassName("selected")});$$("#info .tab").each(function(b){b.className=b.id==a+"_tab"?"tab selected col_bg":"tab"});LateLoader.refresh()}
function selected_data_tab(){return($$("#data_tabs li.selected")||[{id:""}])[0].id.replace(/_tab/g,"")}var channel_action_tab_loaded={};
function switch_action_tab(a){if(a=="report"&&!channel_action_tab_loaded[a]){new Ajax.Updater("report_form","/channel/report_form?channel="+PP.channel,{method:"GET"});channel_action_tab_loaded[a]=true}$$("#actions .tabs .action").each(function(b){b.id==a+"_tab"?b.addClassName("selected"):b.removeClassName("selected")});$$("#action_contents .top").each(function(b){b.id==a+"_contents"?b.addClassName("selected"):b.removeClassName("selected")});a=="clip"&&show_dvr_url()}
function switch_link_embed(a){$$(".share_input_label").each(function(b){b.removeClassName("selected")});$("share_"+a+"_label").addClassName("selected");$$(".share_input").each(function(b){b.hide()});$("share_"+a+"_input").show()}Event.observe(window,"load",make_floaty_buttons);function make_floaty_buttons(){$$("q.floaty_button")&&$$("a.floaty_button button").each(function(a){$(a).onmouseover=function(){show_floaty_text(a)};$(a).onmouseout=function(){hide_floaty_text(a)}})}
function show_floaty_text(a){a=$(a).previous("span",0);new Effect.Appear(a,{duration:0.2});new Effect.Scale(a,100,{scaleFrom:0,scaleY:false,scaleContent:false,scaleMode:"contents",duration:0.2})}function hide_floaty_text(a){a=$(a).previous("span",0);new Effect.Fade(a,{duration:0.2});new Effect.Scale(a,0,{scaleY:false,scaleContent:false,scaleMode:"contents",duration:0.2})}
function show_infotip(a,b){var c=$("info_tip");c.down("p").innerHTML=b;$(c).show();var f={setWidth:false,setHeight:false,offsetLeft:-(c.offsetWidth/2-$(a).offsetWidth/2),offsetTop:-40};c.clonePosition($(a),f)}function resize_status(){var a=$("channel_status_message"),b=a.innerHTML.length;a.setStyle({fontSize:(b<31?2:b<115?1.2:1)+"em"})}function resize_title(){var a=$("channel_title");if(a)a.setStyle({fontSize:(a.innerHTML.length<25?1:0.75)+"em"})}
function setup_one_click_favorites(){switch_action_tab=function(){var a=switch_action_tab,b=!PP.is_favorite?"remove":"add",c=function(f){growl(f);$("favorite_contents").update(f);$$("#actions .tabs .action").each(function(h){h.id=="favorite_tab"?h.addClassName("selected"):h.removeClassName("selected")});$$("#action_contents .top").each(function(h){h.id=="favorite_contents"?h.addClassName("selected"):h.removeClassName("selected")})};return function(f){if(f==="favorite"){if(!PP.user_id){show_login_box("Please log in to follow "+
PP.channel);return false}if(PP.login===PP.channel){c("This is you.");return false}f=Ajax.Request;b=b=="add"?"remove":"add";var h=["/community/",b,"_favorite/",PP.channel_id,"?oneclick="];new f(h.join.call(h,""),{onSuccess:function(n){c(n.responseText)}})}else a(f)}}()}function parse_broadcast_url_hash(){return/^#\/w\/(\w+)\/?(\w+)?/.exec(window.location.hash)}function broadcast_id_from_url(){var a=parse_broadcast_url_hash();if(a)return a[1]}
function broadcast_part_from_url(){var a=parse_broadcast_url_hash();if(a)return a[2]||"1"}EventBank.register_handler("channel:on_broadcast_part_change",function(a,b){var c="/w/"+a;if(b&&parseInt(b,10)>1)c+="/"+b;window.location.hash=c;fill_share_links(c)});
(function(a){a(function(){var b=a("#related_channels");"ajaxDom"in b&&b.ajaxDom("/"+PP.channel+"/related");a("#gameselector_edit_button").click(function(c){if(PP&&PP.category==="gaming"){c.preventDefault();c=_('To manage your game you should use your <a href="http://twitch.tv/broadcast/dashboard">Dashboard</a> on <a href="http://twitch.tv">TwitchTV</a>');a("#gameselector_edit_button").attr("title",c).tipsy({trigger:"manual",clickClose:true,gravity:"nw",fade:true,html:true}).tipsy("show")}})})})($j);
var Chat=Class.create({initialize:function(){this.initialized=false;if(PP.channel=="ignproleague"){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://esports.ign.com/users/current.json?callback=ign_chat_login";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}this.debug=/chat_debug=true/.test(window.location.toString());this.flash_loaded=false;this.show_timestamps=readCookie("chat_show_timestamps")==="true";this.me={};this.ignored=
{};this.banned={};this.moderators={};this.staff={};this.admins={};this.bots={};this.pros={};this.subscribers={};this.room_to_name={};this.retries=10;this.user_to_color={};this.notify_timer=false;this.viewer_tooltips=[];this.joined_once=false;this.id_to_nickname={};this.appending=false;this.queue=[];this.line_count=0;this.line_buffer=150;this.last_sender=false;this.handlers=DefaultChatHandlers;this.emoticons=DefaultChatEmoticons;this.linkify_re=/\x02?((?:https?:\/\/|[\w\-\.\+]+@)?\x02?(?:[\w\-]+\x02?\.)+\x02?(?:com|au|org|tv|net|info|jp|uk|us|cn|fr|mobi|gov|co|ly|me|vg|eu|ca|fm|am)\x02?(?:\:\d+)?\x02?(?:\/[\w\.\/@\?\&\%\#\(\)\,\-\+\=\;\:\x02?]+\x02?[\w\/@\?\&\%\#\(\)\=\;\x02?]|\x02?\w\x02?|\x02?)?\x02?)\x02?/ig;
this.chat_line_div_obj=false;safe_on_load(function(){$("user_info").hasClassName("nohide")||Event.observe(document.body,"click",function(){try{CurrentChat.close_chat_popup()}catch(c){}});if(readCookie("chat_icons")=="off"){$("chat_lines")&&$("chat_lines").addClassName("nobuttons");if($("mod_icons"))$("mod_icons").checked=false}else if($("mod_icons"))$("mod_icons").checked=true})},get_servers:function(){return ChatServers},get_ports:function(){return[80,443]},get_darklaunch:function(){return PP.tmi_darklauch()},
update_user_image:function(a,b){var c=$$("#speak_box img")[0];if(c){if(a)c.src=a;if(b)c.alt=b}},disable_chat_input:function(a){$("chat_text_input").disabled=!a;["chat_lines","chat_menu_buttons","speak","speak_stem","speak_options"].each(function(b){if($(b))a?$(b).removeClassName("fademe"):$(b).addClassName("fademe")})},enable_chat_input:function(){this.disable_chat_input(true)},onkeypress:function(a){var b=a||window.event;if((b.charCode||b.keyCode)==13){if(!b.shiftKey&&!b.shiftLeft){a.stopPropagation&&
a.stopPropagation();this.chat_say();return false}}else return true},onkeyupordown:function(){},logger:function(){},save_attempted_message:function(){this.last_attempted_message&&createCookie("chat_saved_on_"+PP.channel,encodeURIComponent(CurrentChat.last_attempted_message))},set_loaded:function(){this.flash_loaded=true},onChat:function(a,b){a!="debug"&&a!="special_user"&&this.logger("onChat",a,b);var c=this.handlers[a];c&&c.call(this,b)},set_currently_scrolling:function(a){a=this.chat_lines_div();
this.currently_scrolling=a.scrollTop+a.offsetHeight<a.scrollHeight-10?false:true},chat_lines_div:function(){if(this.chat_line_div_obj)return this.chat_line_div_obj;return this.chat_line_div_obj=$("chat_lines")},scroll_chat:function(){if(this.currently_scrolling)this.chat_lines_div().scrollTop=this.chat_lines_div().scrollHeight},chat_onkeypress:function(a){if(!a)a=window.event;if(a.keyCode=="13"){this.chat_say();return false}},admin_message:function(a){if(/^Loading\s+chat\.\.\./i.test(a)){CurrentChat.disable_chat_input();
$("chat_loading_spinner").show()}else{if(/commercial break/.test(a))try{start_time_since_commercial()}catch(b){}a='<li class="line fromjtv"><p class="content">'+a+"</p></li>";this.last_sender="jtv";this.insert_with_lock("#chat_line_list",a)}},notify:function(a){growl("<h4>"+a+"</h4>","chat")},escape_json:function(a){return a.replace(/\{/gi,"&#123;").replace(/\}/gi,"&#125;")},emoticonize:function(a,b){for(var c=this.emoticons.length-1;c>=0;c--){var f=this.emoticons[c];if(!f.sub||this.channel==f.channel&&
this.subscribers[b])a=a.replace(f.rx,['<span class="emo-',f.img,'"></span>'].join(""))}return a},linkify:function(a,b,c){c||(c={});var f=c.target_type=="none"?"":'target="_blank"';c="";if(PP.channel_hide_chat_links&&b!=PP.channel&&b!="jtv")c=a.replace(this.linkify_re,"&lt;deleted link&gt;");else{c=a.replace(this.linkify_re,function(h){return/\x02/.test(h)?h:h.indexOf("@")>-1&&(h.indexOf("/")==-1||h.indexOf("@")<h.indexOf("/"))?'<a href="mailto:'+h+'">'+h.breaking(23)+"</a>":'<a href="'+h+'" '+f+">"+
h.breaking(23)+"</a>"});c=c.replace(/.{0,3}(\S{23}\S+)/g,function(h){return/<|>/.test(h)?h:h.breaking(23)})}return c.replace(/<a href=\"(?!(?:https?:\/\/|mailto:))/g,'<a href="http://')},insert_chat_line:function(a){if(!(this.restarting&&!this.history_ended))if(a.sender!="chattester10"){var b=$("broadcast_tabs_holder");b&&TabbedView(b).notifyTab("chat",{inc:1});if(a.sender=="jtv"){this.last_sender=a.sender;this.admin_message(this.format_message(a))}else if(!a.is_action&&this.last_sender&&this.last_sender==
a.sender&&this.last_sender!="jtv")this.insert_with_lock("#chat_line_list li:last",'<p class="chat_line" style="display:block;">&raquo; '+this.format_message(a)+"</p>");else{this.last_sender=a.sender;var c="";if(a.image_url)c='<a href="#" id="profile-image-link-%linkid" onclick="return false;" class="chat_viewer_thumb left"><img src="/images/redesign/chat_type_jtv.png" class="type_overlay jtv" /><img src="'+a.image_url+'" class="thumb" /></a>';b="";if((PP.login===PP.channel||PP.is_admin==="true"||
PP.is_subadmin==="true"||this.staff[PP.login]||this.admins[PP.login]||this.moderators[PP.login])&&a.sender!="jtv"&&a.sender!=PP.login){b='<a name="timeout" class="mod_button timeout" onclick="CurrentChat.timeout(\'%nickname\'); return false;" title="%timeout_title"><img src="/images/buttons/chat_timeout.gif" alt="Timeout" /></a><a name="ban" class="mod_button ban" onclick="CurrentChat.ban(\'%nickname\'); return false;" title="%ban_title"><img src="/images/buttons/chat_ban.gif" alt="Ban" /></a><a name="unban" class="mod_button unban" onclick="CurrentChat.unban(\'%nickname\'); return false;" style="display:none;" title="%unban_title"><img src="/images/buttons/chat_unban.gif" alt="Unban" /></a>'.replace(/\%nickname/g,
a.sender);b=b.replace(/\%timeout_title/g,h_(_("Timeout %{username}"),{username:a.sender}).replace(/\"/g,""));b=b.replace(/\%ban_title/g,h_(_("Ban %{username}"),{username:a.sender}).replace(/\"/g,""));b=b.replace(/\%unban_title/g,h_(_("Unban %{username}"),{username:a.sender}).replace(/\"/g,""))}var f=a.is_action?'<li class="line jtv chat_from_%sender"><p style="color:%color">%timestamp%modbuttons<span class="nick">%displayname</span> <span class="chat_line" style="color:%color">%message</span></p></li>':
'<li class="line jtv chat_from_%sender'+(c?" pic clearfix":"")+'">'+c+'<p>%timestamp%tag%modbuttons<a href="#" style="color:%color" class="nick" id="%linkid">%displayname</a>:&nbsp;<span class="chat_line">%message</span></p></li>';a.timestamp=this.history_ended&&!this.show_timestamps?"":'<span class="small">'+a.timestamp+"&nbsp;</span>";var h=false;c=unescape(a.nickname);if(c.indexOf("ign-")==0){h=true;c=c.substr(4)}var n="";if(a.tagtype){var j='<span class="tag %tagtype" title="%tagname">%tagname</span>&nbsp;';
n=j.replace(/\%tagtype/g,a.tagtype).replace(/\%tagname/g,a.tagname)}if(a.pro){j='<span class="tag %tagtype" title="%tagname"><a href="http://justin.tv/payment/pro_account?utm_source=link&utm_medium=pro_link&utm_campaign=chat_badge">%tagname</a></span> ';n+=j.replace(/\%tagtype/g,"pro").replace(/\%tagname/g,"Pro")}if(a.subscriber){j='<span class="tag %tagtype %tagchannel" title="%tagname"><a href="http://justin.tv/'+this.channel+'/subscribe">%tagname</a></span> ';n+=j.replace(/\%tagtype/g,"subscriber").replace(/\%tagname/g,
"Subscriber").replace(/\%tagchannel/g,this.channel)}if(h){j='<span class="tag %tagtype" title="%tagname">%tagname</span>&nbsp;';n+=j.replace(/\%tagtype/g,"ign").replace(/\%tagname/g,"My IGN")}h="chat-line-"+Math.round(Math.random()*1E9);f=f.replace(/\%modbuttons/g,b);f=f.replace(/\%tag/g,n);f=f.replace(/\%sender/g,a.sender.replace(/\%/g,"_"));f=f.replace(/\%nickname/g,unescape(a.sender));f=f.replace(/\%displayname/g,c);f=f.replace(/\%timestamp/g,a.timestamp);f=f.replace(/\%message/g,this.format_message(a));
f=f.replace(/\%color/g,a.color);f=f.replace(/\%linkid/g,h);!a.is_action&&a.sender!="jtv"?this.insert_with_lock("#chat_line_list",f,a,h):this.insert_with_lock("#chat_line_list",f)}}},format_message:function(a){return a.sender=="jtv"?this.linkify(a.message,a.sender):this.emoticonize(this.linkify(escape_html(a.message),a.sender),a.sender)},insert_with_lock:function(a,b,c,f){this.queue.push({el:a,line:b,info:c,linkid:f});if(!this.appending){this.appending=true;var h=this;setTimeout(function(){h.insert_with_lock_in()},
50)}},insert_with_lock_in:function(){var a=this.set_currently_scrolling;this.set_currently_scrolling=function(){};for(var b,c=false,f="",h=[];this.queue.length>0;){b=this.queue.shift();b.linkid&&h.push({info:b.info,linkid:b.linkid});if(b.el=="#chat_line_list")this.line_count+=1;if(c&&c!=b.el){$j(c).append(f);f=""}c=b.el;f+=b.line}c&&$j(c).append(f);for(c=0;c<h.length;c++){b=h[c];this.setup_viewer_handlers(b.info,b.linkid)}if(this.line_count>this.line_buffer){$j("#chat_line_list li:lt("+(this.line_count-
this.line_buffer)+")").remove();this.line_count=this.line_buffer}this.history_ended&&this.scroll_chat();var n=this;setTimeout(function(){n.history_ended&&n.scroll_chat();n.set_currently_scrolling=a;n.appending=false},1)},format_chat_info:function(a,b){var c=this.nickname_info(a.sender);a.nickname=c.name;a.timestamp=(a.timestamp?new Date(a.timestamp):new Date).to_chat_timestamp();a.is_action=a.is_action||false;var f;if(!b&&/^externaluser\-(facebook|twitter)/i.test(a.sender)&&a.message.isJSON())f=a.message.evalJSON();
if(f&&f.message){a.message=f.message;a.image_url=f.image_url;a.is_action=f.is_action||a.is_action;a.login=f.login;a.facebook_id=f.facebook_id;a.name=f.name;a.profile_url=f.profile_url}a.color=this.get_color_for_user(a.nickname);a.profile_url="http://www.justin.tv/"+a.nickname+"/videos";if(this.staff[a.sender]){a.tagtype="staff";a.tagname=_("Staff");a.explanation="Staff at Justin.tv"}else if(this.bots[a.sender]){a.tagtype="bot";a.tagname=_("Bot");a.explanation="A Chat Bot"}else if(this.admins[a.sender]){a.tagtype=
"admin";a.tagname=_("Admin");a.explanation="Volunteer Admin"}else if(a.sender==this.channel){a.broadcaster=true;a.tagtype="broadcaster";a.tagname=_("Broadcaster");a.explanation="Justin.tv Broadcaster"}else if(this.moderators[a.sender]){a.tagtype="mod";a.tagname=_("Mod");a.explanation="Channel Moderator"}else{a.tagtype=null;a.tagname=null;a.explanation=null}a.pro=this.pros[a.sender];a.subscriber=this.subscribers[a.sender];return a},nickname_info:function(a){if(!a)return{chat_type:"jtv",name:"me"};
return{chat_type:"jtv",name:a.replace(/^(Externaluser|chat\_from\_externaluser)\-/i,"")||"me"}},update_user:function(a){if(this.user_item(a)){this.remove_user(a);this.add_user(a)}},add_user:function(a){var b=this.real_username(a);if(/^\@/.test(a))this.moderators[b]=true;b=this.real_username(b);var c=this.staff[b]?"staff":this.admins[b]?"admin":this.bots[b]?"bot":this.moderators[b]?"moderator":this.subscribers[b]?"subscriber":this.pros[b]?"pro":this.is_anonymous(b)?"spectator":"viewer";a=$(c+"_viewer_list");
(c=$(c+"_viewer_container"))&&c.show();if(!this.user_item(b)){c=this.user_item_id(b);var f=escape_html(unescape(this.nickname_info(this.real_username(b)).name));f='<li id="'+c+'" class="nick">'+(this.pros[b]?'<span class="tag pro"><a href="http://justin.tv/payment/pro_account?utm_source=link&utm_medium=pro_link&utm_campaign=chat_badge">Pro</a></span> ':"")+'<a id="'+c+'-link" href="#">'+f+"</a></li>";$("chat_viewers_staging").innerHTML=f;f=a.childNodes;var h=$(c);h.remove();for(var n=1;n<f.length;n++){var j=
f[n];if(c==j.id)return;else if(c<j.id){a.insertBefore(h,j);this.setup_viewer_handlers(this.format_chat_info({sender:b}),c);return}}a.appendChild(h);this.setup_viewer_handlers(this.format_chat_info({sender:b}),c+"-link",true)}},is_op:function(){return[PP.login,this.sender()].filter(function(a){return!!(a===PP.channel||CurrentChat.staff[a]||CurrentChat.admins[a])}).length>0},is_mod:function(){return PP.is_admin||PP.is_staff||[PP.login,this.sender()].filter(function(a){return!!(a===PP.channel||CurrentChat.staff[a]||
CurrentChat.admins[a]||CurrentChat.moderators[a])}).length>0},setup_viewer_handlers:function(a,b){$(b).onclick=function(c){c=c||window.event;Event.stop(c);CurrentChat.setup_chat_popup(a);$("user_info")&&!$("user_info").hasClassName("nohide")&&$("user_info").clonePosition(b,{offsetTop:20,setWidth:false,setHeight:false});$("chat_viewers_dropmenu").getStyle("display")=="none"||$("chat_viewers_dropmenu").getStyle("visibility")=="hidden"||$("chat_viewers_dropmenu").hide();return false}},setup_chat_popup:function(a){var b=
a.sender;["follow","unfollow","ignore","unignore","ban","unban","voice","unvoice","timeout","op","deop","pm"].each(function(f){$("chat_menu_"+f).onclick=function(){CurrentChat[f](b);$("chat_menu_"+f).style.display="none";var h={ignore:"unignore",unignore:"ignore",ban:"unban",unban:"ban",voice:"unvoice",unvoice:"voice",timeout:null,op:"deop",deop:"op",follow:"unfollow",unfollow:"follow"}[f];if(h)$("chat_menu_"+h).style.display="";CurrentChat.close_chat_popup();return false}});[["user_link_actions",
true],["chat_user_pic",true],["chat_user_channel_link",false],["chat_user_pic",true],["chat_menu_op_tools",this.is_mod()],["chat_menu_owner_tools",this.is_op()],["chat_menu_pm",this.admins[PP.login||null]||this.staff[PP.login||null]],["chat_menu_ignore",!this.ignored[b]],["chat_menu_unignore",!!this.ignored[b]],["chat_menu_timeout",!this.banned[b]],["chat_menu_ban",!this.banned[b]],["chat_menu_unban",!!this.banned[b]],["chat_menu_voice",!this.moderators[b]],["chat_menu_op",!this.moderators[b]],["chat_menu_deop",
!!this.moderators[b]],["chat_menu_follow",false],["chat_menu_unfollow",false]].each(function(f){document.getElementById(f[0]).style.display=f[1]?"":"none"});var c=b.replace(/[@\+]/,"");$("user_info").current_login=b;$("chat_menu_login").innerHTML=escape_html(unescape(this.real_username(a.nickname)));a=function(f,h){$(f).href=h;$(f).onclick=function(){open(h,"_blank");return false}};a("chat_user_channel_link","/"+c);a("chat_user_videos_link","/"+c+"/videos");a("chat_user_message_link","/message/compose?to="+
c);$("chat_user_message_link").onclick=function(){PP.login?open($("chat_user_message_link").href,"_blank"):$j.login();return false};a($("chat_user_pic").parentNode,"/"+c+"/videos");$("user_info").show();$("chat_user_pic").src="/images/redesign/spinner.gif";a=document.createElement("script");a.setAttribute("src","/live/chat_menu_update?login="+c);document.body.appendChild(a)},close_chat_popup:function(){$("user_info").style.display="none"},remove_user:function(a){if(this.user_item(a)){this.remove_viewer_handlers&&
this.remove_viewer_handlers(a);list=this.user_item(a).parentNode;list.removeChild(this.user_item(a));if(list.childNodes.length<1)list.parentNode.style.display="none"}},user_item_id:function(a){return"chat_user_"+a.replace(/[@+%]/,"")},user_item:function(a){return $(this.user_item_id(a))},is_anonymous:function(a){return!a||/^justinfan\d+/.test(a)},getIrcSystem:function(){return $("site_chat_flash")}});
Chat.addMethods({connect:function(a){if(PP.is_pro)try{$("extra_colors").show()}catch(b){}if((this.ircSystem=this.getIrcSystem())&&this.flash_loaded&&this.ircSystem.connect){this.save_room(a);this.join_on_connect=a;setTimeout(function(){CurrentChat.debug&&CurrentChat.admin_message("DEBUG: Connecting to "+a);CurrentChat.ircSystem.connect(a,PP.login,PP.password_hash)},250)}else setTimeout(function(){CurrentChat.connect(a)},250);this.update_user_image(user_profile_image("70x70"));$$(".chat_box")[0].show()},
disconnect:function(){CurrentChat.ircSystem.disconnect()},reconnect:function(){if(this.retries>1)this.admin_message(s_(_("Trying %s more times to reconnect..."),this.retries));else this.retries==1&&this.admin_message(_("Trying 1 more time to reconnect..."));var a=this.ircSystem.cloneNode(true);this.ircSystem.parentNode.replaceChild(a,this.ircSystem);this.ircSystem=a;this.me.is_loaded=false;if(this.retries>0){this.retries--;var b=this.room;setTimeout(function(){CurrentChat.connect(b)},1E3)}else{this.admin_message(_("It's not working")+
" :-(");Element.hide("speak_input");Element.hide("chat_menu");Element.hide("show_chat_options");Element.hide("chat_help_btn")}},setup_chat_settings_menu:function(){if($("chat_color_container")){$("chat_color_container").show();$("chat_colors").hide()}$("chat_clear").show();this.is_mod()?$("chat_section_moderation").show():$("chat_section_moderation").hide()},save_room:function(a){this.room=a=this.stripChannel(a);this.channel=a.split("-")[0]},do_nothing:function(a){Event.stop(a);return false},formatChannel:function(a){if(a.substr(0,
1)!="#")a="#"+a;return a},stripChannel:function(a){return a.replace("#","")},followersonly_is_on:function(){this.admin_message(_("This room is in followers-only mode.  If you are not a follower and you want to chat with other viewers, choose another room from the Rooms menu."));$("followers_only_mode").checked=true},followersonly_is_off:function(){this.admin_message(_("This room is no longer in followers-only mode."));$("followers_only_mode").checked=false},default_colors:[["YellowGreen","#9ACD32"],
["FireBrick","#B22222"],["OrangeRed","#FF4500"],["SeaGreen","#2E8B57"],["GoldenRod","#DAA520"],["Coral","#FF7F50"],["Chocolate","#D2691E"],["CadetBlue","#5F9EA0"],["DodgerBlue","#1E90FF"],["HotPink","#FF69B4"],["BlueViolet","#8A2BE2"],["SpringGreen","#00FF7F"]],get_color_for_user:function(a){a||(a="me");return this.user_to_color[a]?this.user_to_color[a]:this.default_colors[(a.charCodeAt(0)+a.charCodeAt(a.length-1))%this.default_colors.length][1]},set_color_for_user:function(a,b){this.user_to_color[a]=
b;if(a==PP.login){if($("chat_color_swatch"))$("chat_color_swatch").style.backgroundColor=b;$$(".chat_color_swatch").each(function(c){$(c).style.backgroundColor==b?$(c).addClassName("current"):$(c).removeClassName("current")})}},sender:function(){return(PP.login||"").toLowerCase()},fade_notification:function(){new Effect.Fade("channel_notifications",{duration:5,from:1,to:0.4})},chat_say:function(a){a=a||$("chat_text_input");var b=this.last_attempted_message=a.value;/^\/commercial(?=\s|$)/.test(b)&&
Mixpanel.track_with_swf("commercial",{channel:PP.channel,trigger:"chat"});if(b.replace(/\s/gi,"")!=""){this.say(b.replace("\n"," "));a.value=""}this.scroll_chat();PP.channel_category=="gaming"&&Mixpanel.track_with_swf("chat",{channel:PP.channel,game:PP.channel_meta_game})},show_chat_colors:function(){Element.toggle("chat_colors")},hide_chat_colors:function(){$("chat_colors").hide()},onClose:function(){this.logger("onClose");this.admin_message(_("Sorry, you were disconnected."));setTimeout("CurrentChat.reconnect();",
1E3)},joined_channel:function(){this.retries=10;if(!this.joined_once){this.admin_message(_("Welcome to the chat room!"));this.joined_once=true}$("chat_text_input").disabled=false;this.currently_scrolling=true;this.scroll_chat();this.rooms()},show_login:function(){CurrentChat.save_attempted_message();if(!PP.login){hide_flash_player();hide_embed_player();$("temp_cover").show();$("chat_login").show();window.scrollTo(0,0)}}});
Chat.addMethods({set_mod_icons_visible:function(a){if(a){$("chat_lines").removeClassName("nobuttons");createCookie("chat_icons","on",31536E3)}else{$("chat_lines").addClassName("nobuttons");createCookie("chat_icons","off",31536E3)}},display_icons_from_cookie:function(){if(readCookie("chat_icons")=="off"){$("chat_lines").addClassName("nobuttons");$("mod_icons").checked=false}else{$("chat_lines").removeClassName("nobuttons");$("mod_icons").checked=true}},clear_user_list:function(){$$("#viewer_list ul.viewer_list").each(function(a){a.innerHTML=
""})},toggle_show_timestamps:function(){this.show_timestamps=!this.show_timestamps;createCookie("chat_show_timestamps",this.show_timestamps,604800)},new_user_apology:function(){$$(".managed_ad").invoke("toggle");$("temp_cover").show();PP.login?$("chat_returning").show():$("chat_login").show();window.scrollTo(0,0)},close_new_user_apology:function(){$$(".managed_ad").invoke("toggle");if(PP.login)$("chat_returning").hide();else{$("chat_login").hide();$("user_login").value="";$("user_password").value=
""}$("temp_cover").hide()},send_command:function(a){this.logger("Sending command");this.ircSystem.send_command(a)},follow:function(a){new Ajax.Request("/chat/follow?login="+a)},unfollow:function(a){new Ajax.Request("/chat/unfollow?login="+a)},join_room:function(a){this.save_room(a);this.part_room();this.joined_once=false;this.clear_user_list();this.connect(a)},pm:function(a){if(Meebo)PP.login!==a&&Meebo.exec("im",a,a+"@justin.tv");else(growl||this.admin_message)(_("You must login to Meebo to use IM"))},
real_username:function(a){a||(a="me");if(a.charAt(0)=="@"||a.charAt(0)=="+")return a.substring(1);return a.split(" ")[0]},help:function(){show_info_popup(_("Chat Commands"),'<iframe src="/chat_commands.html" width="100%" height="600" frameBorder="0" ></iframe>',null,"double")}});
Chat.addMethods({say:function(a,b){this.logger("Sending public message");if(PP.page_type=="channel"&&/^\/help/.test(a))this.help();else if(a.substr(0,1)!="/"){this.insert_chat_line(this.format_chat_info($H({sender:this.sender(),message:this.escape_json(a),is_action:false}).update(b||{}).toObject(),true));this.ircSystem.send_channel_message(a)}else if(a.match(/^\/me\s+/)){var c=a.substr(4);this.insert_chat_line(this.format_chat_info($H({sender:this.sender(),message:this.escape_json(c),is_action:true}).update(b||
{}).toObject(),true));this.ircSystem.send_channel_action(c)}else this.ircSystem.send_channel_message(a);gaTrackEvent("Chat","Message",PP.channel_category,a.length)},timeout:function(a){this.say("/timeout "+a);$$(".chat_from_"+sender.replace(/%/g,"_")+" .mod_button.timeout img").each(function(b){b.src="/images/buttons/chat_timeout_disabled.gif"})},slow_mode_on:function(){this.say("/slow")},slow_mode_off:function(){this.say("/slowoff")},ignore:function(a){this.say("/ignore "+a);this.ignored[a]=true},
unignore:function(a){this.say("/unignore "+a);delete this.ignored[a]},clear:function(){this.say("/clear")},action:function(a){this.say("/me "+a)},followersonly_on:function(){this.say("/followerson")},followersonly_off:function(){this.say("/followersoff")},voice:function(a){this.send_command("MODE #"+this.channel+" +v "+a)},unvoice:function(a){this.send_command("MODE #"+this.channel+" -v "+a)},ban:function(a){this.say("/ban "+a);this.banned[a]=true;$$(".chat_from_"+a+" .mod_button.ban").each(function(b){b.style.display=
"none"});$$(".chat_from_"+a+" .mod_button.unban").each(function(b){b.style.display=""})},unban:function(a){this.say("/unban "+a);delete this.banned[a];$$(".chat_from_"+a+" .mod_button.ban").each(function(b){b.style.display=""});$$(".chat_from_"+a+" .mod_button.unban").each(function(b){b.style.display="none"})},op:function(a){this.say("/mod "+a)},deop:function(a){this.say("/unmod "+a)},rooms:function(){this.send_command("JTVROOMS "+this.channel)},part_room:function(){this.send_command("PART "+this.room)},
user_color:function(a){this.say("/color "+a);this.set_color_for_user(PP.login,a);$("chat_color_container")&&this.hide_chat_colors()}});lucky_emoticon=function(a,b,c){result=Math.random()*c;result=Math.round(result);return result==b?a+"-prize":a};roll_emoticon=function(a,b){result=Math.random()*b;result=Math.round(result);return a+"-"+result};
DefaultChatEmoticons=[{rx:/:-?\)/g,img:"happy"},{rx:/:-?\(/g,img:"sad"},{rx:/\s:-?(?:0|o)\s/ig,img:"excited"},{rx:/^:-?(?:0|o)/i,img:"excited"},{rx:/:-?z/ig,img:"bored"},{rx:/o_O/ig,img:"drunk"},{rx:/B-?\)/g,img:"cool"},{rx:/\&gt\;-?\(/g,img:"angry"},{rx:/\&lt\;3/g,img:"horny"},{rx:/:-?(?:\/|\\)(?!\/)/ig,img:"skeptical"},{rx:/;-?\)/ig,img:"wink"},{rx:/\s:-?P/ig,img:"raspberry"},{rx:/^:-?P/i,img:"raspberry"},{rx:/\s;-?P/ig,img:"winkberry"},{rx:/^;-?P/i,img:"winkberry"},{rx:/R-?\)/g,img:"pirate"},{rx:/JKanStyle/,
img:"justin",width:21,height:27},{rx:/OptimizePrime/,img:"emmett",width:22,height:27},{rx:/StoneLightning/,img:"mike",width:20,height:27},{rx:/TheRinger/,img:"kyle",width:20,height:27},{rx:/PazPazowitz/,img:"paz",width:18,height:27},{rx:/EagleEye/,img:"jacob",width:18,height:27},{rx:/CougarHunt/,img:"phil",width:21,height:27},{rx:/RedCoat/,img:"bill",width:19,height:27},{rx:/BrokeBack/,img:"dealer",width:22,height:27},{rx:/BionicBunion/,img:"bunion",width:30,height:30},{rx:/Kappa/,img:"josh",width:25,
height:28},{rx:/JonCarnage/,img:"dtoid-1",width:20,height:27},{rx:/PicoMause/,img:"dtoid-2",width:22,height:27},{rx:/MrDestructoid/,img:"dtoid-3",width:39,height:27},{rx:/MVGame/,img:"mvg",width:24,height:32},{rx:/BCWarrior/,img:"zeke",width:29,height:27},{rx:/SuperVinlin/,img:"kevin",width:23,height:27},{rx:/GingerPower/,img:"dylan",width:21,height:27},{rx:/DansGame/,img:"dansgaming",width:25,height:32},{rx:/SwiftRage/,img:"swiftor",width:21,height:28},{rx:/BrainSlug/,img:"bwana",width:18,height:27},
{rx:/PJSalt/,img:"peacefuljay",width:36,height:30},{rx:/StrawBeary/,img:"lordkat",width:20,height:27},{rx:/BlargNaut/,img:"ariablarg",width:21,height:27},{rx:/FreakinStinkin/,img:"thegreatgq",width:19,height:27},{rx:/KevinTurtle/,img:"klutch7",width:21,height:27},{rx:/Kreygasm/,img:"kreyg",width:19,height:27},{rx:/FPSMarksman/,img:"nick",width:20,height:27},{rx:/SoBayed/,img:"sonos",width:17,height:27},{rx:/NoNoSpot/,img:"towelliee",width:23,height:27},{rx:/NinjaTroll/,img:"ninja",width:19,height:27},
{rx:/SSSsss/,img:"mc_creeper",width:24,height:24},{rx:/PunchTrees/,img:"mc_steve",width:24,height:24},{rx:/TehFunrun/,img:"thegunrun",width:27,height:27},{rx:/UleetBackup/,img:"cream",width:17,height:27},{rx:/ArsonNoSexy/,img:"arson",width:18,height:27},{rx:/SMSkull/g,img:"sm-skull",width:24,height:24},{rx:/SMOrc/g,img:"sm-orc",width:32,height:32},{rx:/CaliPower/,img:"lu_calipower",width:22,height:29,sub:true,channel:"leveluplive"},{rx:/CHEESY/,img:"lu_cheesy",width:37,height:22,sub:true,channel:"leveluplive"},
{rx:/KO/,img:"lu_ko",width:41,height:18,sub:true,channel:"leveluplive"},{rx:/MURDERFACE/,img:"lu_murderface",width:37,height:20,sub:true,channel:"leveluplive"},{rx:/HYPE/,img:"lu_hype",width:70,height:30,sub:true,channel:"leveluplive"},{rx:/SCR/,img:"lu_scr",width:70,height:25,sub:true,channel:"leveluplive"},{rx:/TABLEFLIP/,img:"lu_tableflip",width:52,height:22,sub:true,channel:"leveluplive"},{rx:/WNF/,img:"lu_wnf",width:70,height:30,sub:true,channel:"leveluplive"},{rx:/PERFECT/,img:"lu_perfect",
width:70,height:21,sub:true,channel:"leveluplive"}];
DefaultChatHandlers={error_on_join:function(a){this.admin_message(a.message)},room_full:function(a){this.admin_message(s_(_("Sorry, that room is full - joining %s instead."),a.room));this.join_on_connect=a.room;this.ircSystem.join(a.room)},login_required:function(){CurrentChat.save_attempted_message();CurrentChat.new_user_apology(_("Please log in to chat"))},user_color:function(a){this.set_color_for_user(a.user,a.color)},notification:function(a){this.notify(a.message)},room_followers_only_on:function(){this.admin_message(_("This room is in followers-only mode.  If you are not a follower and you want to chat with other viewers, choose another room from the Rooms menu."));
this.followersonly_is_on()},room_followers_only_off:function(){this.admin_message(_("This room is not in followers-only mode."));this.followersonly_is_off()},error:function(){this.reconnect()},connected:function(){this.join_on_connect&&this.join(this.join_on_connect);this.join_on_connect=null;$("chat_line_list").innerHTML="";this.line_count=0;$("chat_text_input").disabled=false;this.debug&&this.ircSystem.debugOn()},viewers_count:function(a){$("num_viewers").innerHTML=a.count},user_names_end:function(){this.joined_channel()},
who_reply:function(){},no_such_nick:function(){$("chat_text_input").disabled=false},you_are_banned:function(){this.admin_message(_("Sorry, you are banned from this chat room."))},room_followers_only_on:function(){this.followersonly_is_on()},room_followers_only_off:function(){this.followersonly_is_off()},debug:function(a){this.debug&&this.admin_message("DEBUG: "+a.message)},clear_chat:function(a){this.last_sender=false;if(a.target=="all"){$("chat_line_list").innerHTML="";this.line_count=0;this.admin_message(_("Chat was cleared by a moderator"))}else if(a.target==
"user"){this.real_username(a.user);$$("#chat_line_list .chat_from_"+a.user.replace(/%/g,"_").replace(/[<>,]/g,"")+" .chat_line").each(function(b){b.innerHTML="&lt;"+_("message deleted")+"&gt;"})}},channel_message:function(a){this.insert_chat_line(this.format_chat_info(a))},private_message:function(a){this.insert_chat_line(this.format_chat_info(a))},dmcakill:function(){top.location.replace("http://www.justin.tv/"+PP.channel+"/dmca_violation")},toskill:function(){top.location.replace("http://www.justin.tv/"+
PP.channel+"/tos_violation")},shutdown:function(){this.admin_message(_("This chat server is restarting for maintainance. You should reconnect in a few seconds."));this.disable_chat_input();this.restarting=true},room_slow_mode_on:function(){this.admin_message(_("This room is now in slow mode. Viewers have a limit on their lines per minute."));$("slow_mode").checked=true},room_slow_mode_off:function(){this.admin_message(_("This room is no longer in slow mode. Everyone can chat freely."));$("slow_mode").checked=
false},user_names:function(a){for(var b=0;b<a.names.length;b++)this.add_user(a.names[b].strip())},user_names_end:function(){this.admin_message(_("Welcome to the chat room!"));CurrentChat.handlers.user_names_end=function(){}},join:function(a){this.add_user(a.nickname)},part:function(a){this.remove_user(a.nickname)},history_end:function(){this.enable_chat_input();$("chat_loading_spinner").hide();CurrentChat.history_ended=true;CurrentChat.restarting&&CurrentChat.admin_message(_("And we're back."));CurrentChat.restarting=
false;CurrentChat.currently_scrolling=true;CurrentChat.scroll_chat();CurrentChat.setup_chat_settings_menu()},emergency:function(a){this.notify(a.message.replace(/\/(\w+)/,function(b){return'<a href="'+b+'" target="blank">'+b+"</a>"}),"emergency")},user_oped:function(a){if(a.target==PP.login||a.target==this.sender()){this.ircSystem.who(this.formatChannel(this.channel));this.display_icons_from_cookie()}if(!this.moderators)this.moderators={};this.moderators[this.real_username(a.target)]=true;this.update_user("@"+
this.real_username(a.target))},user_deoped:function(a){if(a.target==PP.login||a.target==this.sender()){Element.hide("contextual_unmoderation_link");Element.hide("chat_mod")}this.moderators&&delete this.moderators[this.real_username(a.target)];this.update_user(this.real_username(a.target))},user_banned:function(a){if(a.banned==this.usershosts[PP.login]){this.admin_message(_("You were banned from this channel. If you think that you were banned unfairly, please send an email to info@justin.tv with the transcript leading up to this message."));
this.me.banned=true}a.from_me&&this.admin_message(s_(_("Successfully banned %s"),banned))},user_unbanned:function(a){a.from_me&&this.admin_message(s_(_("Successfully removed ban from %s"),a.unbanned))},user_voiced:function(a){a.from_user!="jtv"&&this.admin_message(s_(_("Voice granted to %s by %s"),a.target,a.from_user));this.update_user("+"+this.real_username(a.target))},user_unvoiced:function(a){a.from_user!="jtv"&&this.admin_message(s_(_("Voice removed from %s by %s"),a.target,a.from_user));this.update_user(this.real_username(a.target))},
special_user:function(a){var b={admin:"admins",bot:"bots",moderator:"moderators",pro:"pros",subscriber:"subscribers",staff:"staff"}[a.kind];if(b)this[b][a.user]=true;this.update_user(a.user)},welcome:function(){}};
function ign_chat_login(a){CurrentChat.debug&&CurrentChat.admin_message("DEBUG: From ign: "+a);if(!PP.login&&a.my_ign_username&&a.signature&&a.timestamp){$("chat_line_list").innerHTML="";CurrentChat.line_count=0;PP.login="ign-"+a.my_ign_username;PP.password_hash=escape(a.timestamp+"|"+a.signature);CurrentChat.admin_message(_("Logging in as your IGN user..."));CurrentChat.admin_message(_("You can log in as a Justin.tv user to override."));CurrentChat.disconnect();a=CurrentChat.ircSystem.cloneNode(true);
CurrentChat.ircSystem.parentNode.replaceChild(a,CurrentChat.ircSystem);CurrentChat.ircSystem=a;CurrentChat.me.is_loaded=false;CurrentChat.connect(PP.channel)}}(function(a){a(function(){var b=a("#twitch_chat .tag");b&&typeof b.tipsy==="function"&&b.tipsy({gravity:"sw",live:true})})})(jQuery.noConflict());function archive_play(a){video_player().play_video(a)}function live_play(){video_player().play_video()}
function toggle_live_player_popout(a){window.live_popout_window?window.live_popout_window.close():popout_live_player(a)}
function popout_live_player(a){if(!window.live_popout_window||window.live_popout_window.closed)window.live_popout_window=window.open("/"+a+"/popout","_blank","right=50,top=50,width=630,height=381,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");window.live_popout_window.focus();wait_for_live_player_popout_close();hide_flash_player();log_stat("channel_click_popout_video");$("popout_message").show();$("popout_message").style.zIndex=1;return false}
function wait_for_live_player_popout_close(){if(window.live_popout_window&&window.live_popout_window.closed){window.live_popout_window=null;$("popout_message").hide();$("popout_message").style.zIndex=-1;show_flash_player();video_player().play_video()}else setTimeout(wait_for_live_player_popout_close,100)}window.onbeforeunload="video_player().pause_video();";window.onunload="video_player().pause_video();";function set_player_html(){}function nabbr_impact(){video_player().onNabbrImpact()}
function nabbr_adbreak_finished(){video_player().onNabbrFinish()}function nabbr_ad_error(){video_player().onNabbrError()}function set_video_quality(a){video_player().set_quality(a)}CurrentDate=new Date;function show_tomorrow(){CurrentDate.setDate(CurrentDate.getDate()+1);show_current_date()}function show_yesterday(){CurrentDate.setDate(CurrentDate.getDate()-1);show_current_date()}
function show_current_date(){new Ajax.Updater("events_list","schedule/list",{parameters:{channel:PP.channel,on_date:CurrentDate.toString()}})}function fill_on_login(a,b,c){fill_on_login[c]=fill_on_login||[];fill_on_login[c].push([a,b])}function show_on_login(a){show_on_login.ids=show_on_login.ids||[];show_on_login.ids.push(a)}function hide_on_login(a){hide_on_login.ids=hide_on_login.ids||[];hide_on_login.ids.push(a)}
function refresh_category_options(a){for(var b=0;b<a.length;b++)a[b]!=="gaming"&&Element.hide("sc_select_"+a[b]);a=$("user[category]").value;if(a==""||a=="gaming"){$("user_subcategory").value="";$("subcategory_select").hide()}else{$("subcategory_select").show();a=$("sc_select_"+a);a.show();$("user_subcategory").value=a.value}}function track_link_click(a,b,c){a.observe("click",function(){log_stat(b,c)})}
function track_promoted_links(a,b,c){for(var f in c)for(var h=$$(a+" "+c[f]),n=0;n<h.length;n++)track_link_click(h[n],"promoted_click",["source="+b,"link_type="+f,"pos="+n])}function track_promoted_links_with_id(a,b,c,f){a=$$(a);$A(a).each(function(h,n){var j=$H(f).map(function(p){return h.hasClassName(p[0])?p[1]:""}).join(""),k;for(k in c){var o=$$("#"+h.id+" "+c[k]);$A(o).each(function(p){track_link_click(p,"promoted_click/"+b,["link_type="+k,"pos="+n,"type="+j])})}})}
safe_on_load(function(){track_promoted_links("#producer_info .list_item.channel","producer_spotlight",{status:".content a.status",title:".content .action a",thumb:"a.thumb"});track_promoted_links("#content_blog .front_page_channel","front_page_channel",{title:".title a",thumb:".photo a[href!='/apiredirect']",clip_thumb:".blog_clip a.thumb",clip_title:".blog_clip a.title"});track_promoted_links("#content_blog .front_page_channel","front_page_api",{thumb:".photo a[href='/apiredirect']"});track_promoted_links("#upcoming .list_item",
"upcoming_events",{title:"a.title",thumb:"a.thumb"});track_promoted_links("#search_results .sponsored_result","search_results",{title:".data .title a",thumb_live:".thumb .live_tag a",thumb:".thumb a.thumb_link"});track_promoted_links("#related_list .list_item.channel","channel_related",{thumb:"a.thumb",status:"a.title",title:"span.action a"});track_promoted_links_with_id("#broadcasts_list li.list_item","feed",{thumb:"a.broadcast-thumb",channel_thumb:"a.channel-thumb",title:"a.broadcast-title",source_title:"a.source-title",
source_thumb:"a.source-thumb"},{broadcast:"live",archive:"past_broadcast"})});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(f){}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),f=get_coordinates(b);c={top:Math.max(c.top,f.top),left:Math.max(c.left,f.left),right:Math.min(c.right,f.right),bottom:Math.min(c.bottom,f.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,f,h){c=$(c);var n={pageX:0,pageY:0,timestamp:0},j=function(o){n.pageX=Event.pointerX(o);n.pageY=Event.pointerY(o)},k=function(o){if(!c.loading){c.loading=true;n.timestamp=(new Date).valueOf();j(o);Event.observe(document.body,"mousemove",j);new Ajax.Request(a,{method:"get",onSuccess:function(p){Event.stopObserving(c,"mouseover",k);Event.stopObserving(document.body,"mousemove",j);$(f).insert(p.responseText);p.responseText.evalScripts();p=dropmenus.push((new Tooltip.Fixed(b,h)).attach(c))-
1;h.on_load&&h.on_load(c,dropmenus[p]);dropmenus[p]._logEvent(n);dropmenus[p]._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 p=1,v=$("DiropaBanner_holder");v||(v=$("Staging_DiropaBanner_holder"));if(v)p+=v.offsetHeight+13;p>
0&&b[0].setStyle({marginTop:p+"px"});b[1].setStyle({marginTop:p+"px"})}$("header_dropmenus")&&$("header_dropmenus").show()}})}};Event.observe(c,"mouseover",k.bindAsEventListener(window))}function position_to_container(a,b,c){var f=a[0];a=a[1];b=$(b).positionedOffset();var h=$(a).getStyle("padding-left");b=b[0]-parseFloat(h)-1;$(a).setStyle({left:b+"px"});c=c=="right"?b-$(f).getWidth()+$(a).getWidth():b;$(f).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)};function iab_rma_start(){$A(document.getElementsByTagName("embed")).each(function(a){a.pause_video&&a.pause_video()})}function iab_rma_stop(){$A(document.getElementsByTagName("embed")).each(function(a){a.resume_video&&a.resume_video()})}
(function(){function a(h){var n=document.createElement("div");h="on"+h;var j=h in n;if(!j){n.setAttribute(h,"return;");j=typeof n[h]=="function"}return j}function b(h){var n,j,k;if(h.fire("ajax:before").stopped)return false;if(h.tagName.toLowerCase()==="form"){n=h.readAttribute("method")||"post";j=h.readAttribute("action");k=h.serialize()}else{n=h.readAttribute("data-method")||"get";j=h.readAttribute("href");k={}}new Ajax.Request(j,{method:n,parameters:k,evalScripts:true,onComplete:function(o){h.fire("ajax:complete",
o)},onSuccess:function(o){h.fire("ajax:success",o)},onFailure:function(o){h.fire("ajax:failure",o)}});h.fire("ajax:after")}var c=a("submit"),f=a("change");if(!c||!f)Event.Handler.prototype.initialize=Event.Handler.prototype.initialize.wrap(function(h,n,j,k,o){h(n,j,k,o);if(!(h=!c&&this.eventName=="submit"&&!(Object.isElement(this.element)&&this.element.nodeName.toUpperCase()=="FORM")))if(h=!f)if(h=this.eventName=="change"){h=this.element;if(Object.isElement(h)){h=h.nodeName.toUpperCase();h=h=="INPUT"||
h=="SELECT"||h=="TEXTAREA"}else h=false;h=!h}if(h)this.eventName="emulated:"+this.eventName});c||document.on("focusin","form",function(h,n){if(!n.retrieve("emulated:submit")){n.on("submit",function(j){n.fire("emulated:submit",j,true).returnValue===false&&j.preventDefault()});n.store("emulated:submit",true)}});f||document.on("focusin","input, select, texarea",function(h,n){if(!n.retrieve("emulated:change")){n.on("change",function(j){n.fire("emulated:change",j,true)});n.store("emulated:change",true)}});
document.on("click","*[data-confirm]",function(h,n){var j=n.readAttribute("data-confirm");confirm(j)||h.stop()});document.on("click","a[data-remote]",function(h,n){if(!h.stopped){b(n);h.stop()}});document.on("click","a[data-method]",function(h,n){if(!h.stopped){var j=n.readAttribute("data-method"),k=n.readAttribute("href"),o=$$("meta[name=csrf-param]")[0],p=$$("meta[name=csrf-token]")[0];k=new Element("form",{method:"POST",action:k,style:"display: none;"});n.parentNode.insert(k);if(j!=="post"){j=
new Element("input",{type:"hidden",name:"_method",value:j});k.insert(j)}if(o){o=o.readAttribute("content");p=p.readAttribute("content");j=new Element("input",{type:"hidden",name:o,value:p});k.insert(j)}k.submit();h.stop()}});document.on("submit",function(h){var n=h.findElement(),j=n.readAttribute("data-confirm");if(j&&!confirm(j)){h.stop();return false}n.select("input[type=submit][data-disable-with]").each(function(k){k.disabled=true;k.writeAttribute("data-original-value",k.value);k.value=k.readAttribute("data-disable-with")});
if(n=h.findElement("form[data-remote]")){b(n);h.stop()}});document.on("ajax:after","form",function(h,n){n.select("input[type=submit][disabled=true][data-disable-with]").each(function(j){j.value=j.readAttribute("data-original-value");j.removeAttribute("data-original-value");j.disabled=false})});Ajax.Responders.register({onCreate:function(h){var n=$$("meta[name=csrf-token]")[0];if(n){n=n.readAttribute("content");if(!h.options.requestHeaders)h.options.requestHeaders={};h.options.requestHeaders["X-CSRF-Token"]=
n}}})})();

