var Prototype={Version:"1.6.1",Browser:(function(){var B=navigator.userAgent;var A=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!A,Opera:A,WebKit:B.indexOf("AppleWebKit/")>-1,Gecko:B.indexOf("Gecko")>-1&&B.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(B)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var A=window.Element||window.HTMLElement;return !!(A&&A.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var C=document.createElement("div");var B=document.createElement("form");var A=false;if(C.__proto__&&(C.__proto__!==B.__proto__)){A=true}C=B=null;return A})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var B;for(var C=0,A=arguments.length;C<A;C++){var D=arguments[C];try{B=D();break}catch(E){}}return B}};var Class=(function(){function C(){}function B(){var E=null,F=$A(arguments);if(Object.isFunction(F[0])){E=F.shift()}function D(){this.initialize.apply(this,arguments)}Object.extend(D,Class.Methods);D.superclass=E;D.subclasses=[];if(E){C.prototype=E.prototype;D.prototype=new C;E.subclasses.push(D)}for(var G=0;G<F.length;G++){D.addMethods(F[G])}if(!D.prototype.initialize){D.prototype.initialize=Prototype.emptyFunction}D.prototype.constructor=D;return D}function A(E){var H=this.superclass&&this.superclass.prototype;var G=Object.keys(E);if(!Object.keys({toString:true}).length){if(E.toString!=Object.prototype.toString){G.push("toString")}if(E.valueOf!=Object.prototype.valueOf){G.push("valueOf")}}for(var I=0,F=G.length;I<F;I++){var D=G[I],J=E[D];if(H&&Object.isFunction(J)&&J.argumentNames().first()=="$super"){var K=J;J=(function(L){return function(){return H[L].apply(this,arguments)}})(D).wrap(K);J.valueOf=K.valueOf.bind(K);J.toString=K.toString.bind(K)}this.prototype[D]=J}return this}return{create:B,Methods:{addMethods:A}}})();(function(){var E=Object.prototype.toString;function A(S,R){for(var Q in R){S[Q]=R[Q]}return S}function N(Q){try{if(C(Q)){return"undefined"}if(Q===null){return"null"}return Q.inspect?Q.inspect():String(Q)}catch(R){if(R instanceof RangeError){return"..."}throw R}}function P(S){var T=typeof S;switch(T){case"undefined":case"function":case"unknown":return ;case"boolean":return S.toString()}if(S===null){return"null"}if(S.toJSON){return S.toJSON()}if(I(S)){return }var R=[];for(var Q in S){var U=P(S[Q]);if(!C(U)){R.push(Q.toJSON()+": "+U)}}return"{"+R.join(", ")+"}"}function G(Q){return $H(Q).toQueryString()}function D(Q){return Q&&Q.toHTML?Q.toHTML():String.interpret(Q)}function O(S){var R=[];for(var Q in S){R.push(Q)}return R}function M(S){var R=[];for(var Q in S){R.push(S[Q])}return R}function J(Q){return A({},Q)}function I(Q){return !!(Q&&Q.nodeType==1)}function F(Q){return E.call(Q)=="[object Array]"}function K(Q){return Q instanceof Hash}function B(Q){return typeof Q==="function"}function H(Q){return E.call(Q)=="[object String]"}function L(Q){return E.call(Q)=="[object Number]"}function C(Q){return typeof Q==="undefined"}A(Object,{extend:A,inspect:N,toJSON:P,toQueryString:G,toHTML:D,keys:O,values:M,clone:J,isElement:I,isArray:F,isHash:K,isFunction:B,isString:H,isNumber:L,isUndefined:C})})();Object.extend(Function.prototype,(function(){var K=Array.prototype.slice;function D(O,M){var N=O.length,L=M.length;while(L--){O[N+L]=M[L]}return O}function J(M,L){M=K.call(M,0);return D(M,L)}function C(){var L=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return L.length==1&&!L[0]?[]:L}function H(M){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var N=this,L=K.call(arguments,1);return function(){var O=J(L,arguments);return N.apply(M,O)}}function F(M){var N=this,L=K.call(arguments,1);return function(P){var O=D([P||window.event],L);return N.apply(M,O)}}function I(){if(!arguments.length){return this}var M=this,L=K.call(arguments,0);return function(){var N=J(L,arguments);return M.apply(this,N)}}function E(L){var N=this,M=K.call(arguments,1);L=L*1000;return window.setTimeout(function(){return N.apply(N,M)},L)}function A(){var L=D([0.01],arguments);return this.delay.apply(this,L)}function B(M){var L=this;return function(){var N=D([L.bind(this)],arguments);return M.apply(this,N)}}function G(){if(this._methodized){return this._methodized}var L=this;return this._methodized=function(){var M=D([this],arguments);return L.apply(null,M)}}return{argumentNames:C,bind:H,bindAsEventListener:F,curry:I,delay:E,defer:A,wrap:B,methodize:G}})());Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(A,B){this.callback=A;this.frequency=B;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(A){this.currentlyExecuting=false;throw A}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(B,A){this.template=B.toString();this.pattern=A||Template.Pattern},evaluate:function(A){if(A&&Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(F){if(A==null){return(F[1]+"")}var C=F[1]||"";if(C=="\\"){return F[2]}var D=A,G=F[3];var B=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;F=B.exec(G);if(F==null){return C}while(F!=null){var E=F[1].startsWith("[")?F[2].replace(/\\\\]/g,"]"):F[1];D=D[E];if(null==D||""==F[3]){break}G=G.substring("["==F[3]?F[1].length:F[0].length);F=B.exec(G)}return C+String.interpret(D)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function D(Y,X){var W=0;try{this._each(function(a){Y.call(X,a,W++)})}catch(Z){if(Z!=$break){throw Z}}return this}function O(W,Z,Y){var X=-W,a=[],b=this.toArray();if(W<1){return b}while((X+=W)<b.length){a.push(b.slice(X,X+W))}return a.collect(Z,Y)}function C(X,W){X=X||Prototype.K;var Y=true;this.each(function(a,Z){Y=Y&&!!X.call(W,a,Z);if(!Y){throw $break}});return Y}function I(X,W){X=X||Prototype.K;var Y=false;this.each(function(a,Z){if(Y=!!X.call(W,a,Z)){throw $break}});return Y}function J(Y,X){Y=Y||Prototype.K;var W=[];this.each(function(a,Z){W.push(Y.call(X,a,Z))});return W}function M(X,W){var Y;this.each(function(a,Z){if(X.call(W,a,Z)){Y=a;throw $break}});return Y}function B(Y,X){var W=[];this.each(function(a,Z){if(Y.call(X,a,Z)){W.push(a)}});return W}function H(W,Z,Y){Z=Z||Prototype.K;var X=[];if(Object.isString(W)){W=new RegExp(RegExp.escape(W))}this.each(function(b,a){if(W.match(b)){X.push(Z.call(Y,b,a))}});return X}function A(W){if(Object.isFunction(this.indexOf)){if(this.indexOf(W)!=-1){return true}}var X=false;this.each(function(Y){if(Y==W){X=true;throw $break}});return X}function P(W,X){X=Object.isUndefined(X)?null:X;return this.eachSlice(W,function(Y){while(Y.length<W){Y.push(X)}return Y})}function U(W,Y,X){this.each(function(a,Z){W=Y.call(X,W,a,Z)});return W}function K(X){var W=$A(arguments).slice(1);return this.map(function(Y){return Y[X].apply(Y,W)})}function Q(X,W){X=X||Prototype.K;var Y;this.each(function(a,Z){a=X.call(W,a,Z);if(Y==null||a>=Y){Y=a}});return Y}function N(X,W){X=X||Prototype.K;var Y;this.each(function(a,Z){a=X.call(W,a,Z);if(Y==null||a<Y){Y=a}});return Y}function E(Z,X){Z=Z||Prototype.K;var Y=[],W=[];this.each(function(b,a){(Z.call(X,b,a)?Y:W).push(b)});return[Y,W]}function F(W){var X=[];this.each(function(Y){X.push(Y[W])});return X}function G(Y,X){var W=[];this.each(function(a,Z){if(!Y.call(X,a,Z)){W.push(a)}});return W}function T(X,W){return this.map(function(Z,Y){return{value:Z,criteria:X.call(W,Z,Y)}}).sort(function(d,c){var Z=d.criteria,Y=c.criteria;return Z<Y?-1:Z>Y?1:0}).pluck("value")}function R(){return this.map()}function S(){var X=Prototype.K,W=$A(arguments);if(Object.isFunction(W.last())){X=W.pop()}var Y=[this].concat(W).map($A);return this.map(function(a,Z){return X(Y.pluck(Z))})}function L(){return this.toArray().length}function V(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:D,eachSlice:O,all:C,every:C,any:I,some:I,collect:J,map:J,detect:M,findAll:B,select:B,filter:B,grep:H,include:A,member:A,inGroupsOf:P,inject:U,invoke:K,max:Q,min:N,partition:E,pluck:F,reject:G,sortBy:T,toArray:R,entries:R,zip:S,size:L,inspect:V,find:M}})();function $A(C){if(!C){return[]}if("toArray" in Object(C)){return C.toArray()}var A=C.length||0,B=new Array(A);while(A--){B[A]=C[A]}return B}function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}Array.from=$A;(function(){var M=Array.prototype,P=M.slice,R=M.forEach;function B(X){for(var W=0,V=this.length;W<V;W++){X(this[W])}}if(!R){R=B}function N(){this.length=0;return this}function D(){return this[0]}function G(){return this[this.length-1]}function J(){return this.select(function(V){return V!=null})}function I(){return this.inject([],function(W,V){if(Object.isArray(V)){return W.concat(V.flatten())}W.push(V);return W})}function H(){var V=P.call(arguments,0);return this.select(function(W){return !V.include(W)})}function F(V){return(V!==false?this:this.toArray())._reverse()}function L(V){return this.inject([],function(Y,X,W){if(0==W||(V?Y.last()!=X:!Y.include(X))){Y.push(X)}return Y})}function S(V){return this.uniq().findAll(function(W){return V.detect(function(X){return W===X})})}function T(){return P.call(this,0)}function K(){return this.length}function U(){return"["+this.map(Object.inspect).join(", ")+"]"}function O(){var V=[];this.each(function(W){var X=Object.toJSON(W);if(!Object.isUndefined(X)){V.push(X)}});return"["+V.join(", ")+"]"}function A(X,W){W||(W=0);var V=this.length;if(W<0){W=V+W}for(;W<V;W++){if(this[W]===X){return W}}return -1}function Q(W,V){V=isNaN(V)?this.length:(V<0?this.length+V:V)+1;var X=this.slice(0,V).reverse().indexOf(W);return(X<0)?X:V-X-1}function C(){var a=P.call(this,0),Y;for(var X=0,V=arguments.length;X<V;X++){Y=arguments[X];if(Object.isArray(Y)&&!("callee" in Y)){for(var W=0,Z=Y.length;W<Z;W++){a.push(Y[W])}}else{a.push(Y)}}return a}Object.extend(M,Enumerable);if(!M._reverse){M._reverse=M.reverse}Object.extend(M,{_each:R,clear:N,first:D,last:G,compact:J,flatten:I,without:H,reverse:F,uniq:L,intersect:S,clone:T,toArray:T,size:K,inspect:U,toJSON:O});var E=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(E){M.concat=C}if(!M.indexOf){M.indexOf=A}if(!M.lastIndexOf){M.lastIndexOf=Q}})();function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function D(Q){this._object=Object.isHash(Q)?Q.toObject():Object.clone(Q)}function E(R){for(var Q in this._object){var S=this._object[Q],T=[Q,S];T.key=Q;T.value=S;R(T)}}function K(Q,R){return this._object[Q]=R}function B(Q){if(this._object[Q]!==Object.prototype[Q]){return this._object[Q]}}function P(Q){var R=this._object[Q];delete this._object[Q];return R}function J(){return Object.clone(this._object)}function O(){return this.pluck("key")}function M(){return this.pluck("value")}function G(R){var Q=this.detect(function(S){return S.value===R});return Q&&Q.key}function I(Q){return this.clone().update(Q)}function C(Q){return new Hash(Q).inject(this,function(R,S){R.set(S.key,S.value);return R})}function A(Q,R){if(Object.isUndefined(R)){return Q}return Q+"="+encodeURIComponent(String.interpret(R))}function F(){return this.inject([],function(R,T){var Q=encodeURIComponent(T.key),S=T.value;if(S&&typeof S=="object"){if(Object.isArray(S)){return R.concat(S.map(A.curry(Q)))}}else{R.push(A(Q,S))}return R}).join("&")}function L(){return"#<Hash:{"+this.map(function(Q){return Q.map(Object.inspect).join(": ")}).join(", ")+"}>"}function N(){return Object.toJSON(this.toObject())}function H(){return new Hash(this)}return{initialize:D,_each:E,set:K,get:B,unset:P,toObject:J,toTemplateReplacements:J,keys:O,values:M,index:G,merge:I,update:C,toQueryString:F,inspect:L,toJSON:N,clone:H}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function D(){return this.toPaddedString(2,16)}function E(){return this+1}function A(K,J){$R(0,this,true).each(K,J);return this}function B(J,L){var K=this.toString(L||10);return"0".times(J-K.length)+K}function H(){return isFinite(this)?this.toString():"null"}function I(){return Math.abs(this)}function G(){return Math.round(this)}function F(){return Math.ceil(this)}function C(){return Math.floor(this)}return{toColorPart:D,succ:E,times:A,toPaddedString:B,toJSON:H,abs:I,round:G,ceil:F,floor:C}})());function $R(C,A,B){return new ObjectRange(C,A,B)}var ObjectRange=Class.create(Enumerable,(function(){function B(F,D,E){this.start=F;this.end=D;this.exclusive=E}function C(D){var E=this.start;while(this.include(E)){D(E);E=E.succ()}}function A(D){if(D<this.start){return false}if(this.exclusive){return D<this.end}return D<=this.end}return{initialize:B,_each:C,include:A}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(C,B,D,A){this.each(function(E){if(Object.isFunction(E[C])){try{E[C].apply(E,[B,D,A])}catch(F){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,A,B){$super(B);this.transport=Ajax.getTransport();this.request(A)},request:function(A){this.url=A;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D._method=this.method;this.method="post"}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="}}}try{var B=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(B)}Ajax.Responders.dispatch("onCreate",this,B);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var B=this.options.requestHeaders;if(Object.isFunction(B.push)){for(var D=0,A=B.length;D<A;D+=2){E[B[D]]=B[D+1]}}else{$H(B).each(function(F){E[F.key]=F.value})}}for(var C in E){this.transport.setRequestHeader(C,E[C])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(E){this.dispatchException(E)}var D=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&D&&D.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON)}catch(E){this.dispatchException(E)}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=D.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,C,A,B){this.container={success:(C.success||C),failure:(C.failure||(C.success?null:C))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(F,E){this.updateContent(F.responseText);if(Object.isFunction(D)){D(F,E)}}).bind(this);$super(A,B)},updateContent:function(D){var B=this.container[this.success()?"success":"failure"],C=this.options;if(!C.evalScripts){D=D.stripScripts()}if(B=$(B)){if(C.insertion){if(Object.isString(C.insertion)){var A={};A[C.insertion]=D;B.insert(A)}else{C.insertion(B,D)}}else{B.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,C,A,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=C;this.url=A;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(C){if(arguments.length>1){for(var D=0,A=[],B=arguments.length;D<B;D++){A.push($(arguments[D]))}return A}if(Object.isString(C)){C=document.getElementById(C)}return Element.extend(C)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,D){var C=[];var E=document.evaluate(F,$(D)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,A=E.snapshotLength;B<A;B++){C.push(Element.extend(E.snapshotItem(B)))}return C}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(A){var B=(function(){var E=document.createElement("form");var F=document.createElement("input");var D=document.documentElement;F.setAttribute("name","test");E.appendChild(F);D.appendChild(E);var G=E.elements?(typeof E.elements.test=="undefined"):null;D.removeChild(E);E=F=null;return G})();var C=A.Element;A.Element=function(F,E){E=E||{};F=F.toLowerCase();var D=Element.cache;if(B&&E.name){F="<"+F+' name="'+E.name+'">';delete E.name;return Element.writeAttribute(document.createElement(F),E)}if(!D[F]){D[F]=Element.extend(document.createElement(F))}return Element.writeAttribute(D[F].cloneNode(false),E)};Object.extend(A.Element,C||{});if(C){A.Element.prototype=C.prototype}})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){A=$(A);A.style.display="none";return A},show:function(A){A=$(A);A.style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:(function(){var B=(function(){var E=document.createElement("select"),F=true;E.innerHTML='<option value="test">test</option>';if(E.options&&E.options[0]){F=E.options[0].nodeName.toUpperCase()!=="OPTION"}E=null;return F})();var A=(function(){try{var E=document.createElement("table");if(E&&E.tBodies){E.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var G=typeof E.tBodies[0]=="undefined";E=null;return G}}catch(F){return true}})();var D=(function(){var E=document.createElement("script"),G=false;try{E.appendChild(document.createTextNode(""));G=!E.firstChild||E.firstChild&&E.firstChild.nodeType!==3}catch(F){G=true}E=null;return G})();function C(F,G){F=$(F);if(G&&G.toElement){G=G.toElement()}if(Object.isElement(G)){return F.update().insert(G)}G=Object.toHTML(G);var E=F.tagName.toUpperCase();if(E==="SCRIPT"&&D){F.text=G;return F}if(B||A){if(E in Element._insertionTranslations.tags){while(F.firstChild){F.removeChild(F.firstChild)}Element._getContentFromAnonymousElement(E,G.stripScripts()).each(function(H){F.appendChild(H)})}else{F.innerHTML=G.stripScripts()}}else{F.innerHTML=G.stripScripts()}G.evalScripts.bind(G).defer();return F}return C})(),replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(D,F){D=$(D);if(Object.isString(F)||Object.isNumber(F)||Object.isElement(F)||(F&&(F.toElement||F.toHTML))){F={bottom:F}}var E,B,C,G;for(var A in F){E=F[A];A=A.toLowerCase();B=Element._insertionTranslations[A];if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){B(D,E);continue}E=Object.toHTML(E);C=((A=="before"||A=="after")?D.parentNode:D).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(C,E.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(B.curry(D));E.evalScripts.bind(E).defer()}return D},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{})}else{if(Object.isString(C)){C=new Element(C,A)}else{C=new Element("div",C)}}if(B.parentNode){B.parentNode.replaceChild(C,B)}C.appendChild(B);return C},inspect:function(A){A=$(A);var B="<"+A.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(F){var C=F.first(),D=F.last();var E=(A[C]||"").toString();if(E){B+=" "+D+"="+E.inspect(true)}});return B+">"},recursivelyCollect:function(C,B){C=$(C);var A=[];while(C=C[B]){if(C.nodeType==1){A.push(Element.extend(C))}}return A},ancestors:function(A){return Element.recursivelyCollect(A,"parentNode")},descendants:function(A){return Element.select(A,"*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return Element.recursivelyCollect(A,"previousSibling")},nextSiblings:function(A){return Element.recursivelyCollect(A,"nextSibling")},siblings:function(A){A=$(A);return Element.previousSiblings(A).reverse().concat(Element.nextSiblings(A))},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(C,D,B){C=$(C);if(arguments.length==1){return $(C.parentNode)}var A=Element.ancestors(C);return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},down:function(B,C,A){B=$(B);if(arguments.length==1){return Element.firstDescendant(B)}return Object.isNumber(C)?Element.descendants(B)[C]:Element.select(B,C)[A||0]},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var C=Element.previousSiblings(B);return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},next:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(B))}var C=Element.nextSiblings(B);return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},select:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B,A)},adjacent:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(A){A=$(A);var B=Element.readAttribute(A,"id");if(B){return B}do{B="anonymous_element_"+Element.idCounter++}while($(B));Element.writeAttribute(A,"id",B);return B},readAttribute:function(B,A){B=$(B);if(Prototype.Browser.IE){var C=Element._attributeTranslations.read;if(C.values[A]){return C.values[A](B,A)}if(C.names[A]){A=C.names[A]}if(A.include(":")){return(!B.attributes||!B.attributes[A])?null:B.attributes[A].value}}return B.getAttribute(A)},writeAttribute:function(D,C,F){D=$(D);var B={},E=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=E.names[A]||A;F=B[A];if(E.values[A]){C=E.values[A](D,F)}if(F===false||F===null){D.removeAttribute(C)}else{if(F===true){D.setAttribute(C,C)}else{D.setAttribute(C,F)}}}return D},getHeight:function(A){return Element.getDimensions(A).height},getWidth:function(A){return Element.getDimensions(A).width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(B,A){if(!(B=$(B))){return }var C=B.className;return(C.length>0&&(C==A||new RegExp("(^|\\s)"+A+"(\\s|$)").test(C)))},addClassName:function(B,A){if(!(B=$(B))){return }if(!Element.hasClassName(B,A)){B.className+=(B.className?" ":"")+A}return B},removeClassName:function(B,A){if(!(B=$(B))){return }B.className=B.className.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ").strip();return B},toggleClassName:function(B,A){if(!(B=$(B))){return }return Element[Element.hasClassName(B,A)?"removeClassName":"addClassName"](B,A)},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C)}C=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(B,A){B=$(B),A=$(A);if(B.compareDocumentPosition){return(B.compareDocumentPosition(A)&8)===8}if(A.contains){return A.contains(B)&&A!==B}while(B=B.parentNode){if(B==A){return true}}return false},scrollTo:function(A){A=$(A);var B=Element.cumulativeOffset(A);window.scrollTo(B[0],B[1]);return A},getStyle:function(A,C){A=$(A);C=C=="float"?"cssFloat":C.camelize();var D=A.style[C];if(!D||D=="auto"){var B=document.defaultView.getComputedStyle(A,null);D=B?B[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(E,C){E=$(E);var B=E.style,D;if(Object.isString(C)){E.style.cssText+=";"+C;return C.include("opacity")?E.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):E}for(var A in C){if(A=="opacity"){E.setOpacity(C[A])}else{B[(A=="float"||A=="cssFloat")?(Object.isUndefined(B.styleFloat)?"cssFloat":"styleFloat"):A]=C[A]}}return E},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(C){C=$(C);var G=Element.getStyle(C,"display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var E=C.style;var A=E.visibility;var B=E.position;var D=E.display;E.visibility="hidden";if(B!="fixed"){E.position="absolute"}E.display="block";var H=C.clientWidth;var F=C.clientHeight;E.display=D;E.position=B;E.visibility=A;return{width:H,height:F}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(Prototype.Browser.Opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(A){var B=0,C=0;do{B+=A.offsetTop||0;C+=A.offsetLeft||0;A=A.offsetParent}while(A);return Element._returnOffset(C,B)},positionedOffset:function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;A=A.offsetParent;if(A){if(A.tagName.toUpperCase()=="BODY"){break}var C=Element.getStyle(A,"position");if(C!=="static"){break}}}while(A);return Element._returnOffset(D,B)},absolutize:function(B){B=$(B);if(Element.getStyle(B,"position")=="absolute"){return B}var A=Element.positionedOffset(B);var F=A[1];var E=A[0];var C=B.clientWidth;var D=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=D+"px";return B},relativize:function(A){A=$(A);if(Element.getStyle(A,"position")=="relative"){return A}A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A},cumulativeScrollOffset:function(A){var B=0,C=0;do{B+=A.scrollTop||0;C+=A.scrollLeft||0;A=A.parentNode}while(A);return Element._returnOffset(C,B)},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent)}if(A==document.body){return $(A)}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A)}}return $(document.body)},viewportOffset:function(C){var B=0,D=0;var A=C;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;if(A.offsetParent==document.body&&Element.getStyle(A,"position")=="absolute"){break}}while(A=A.offsetParent);A=C;do{if(!Prototype.Browser.Opera||(A.tagName&&(A.tagName.toUpperCase()=="BODY"))){B-=A.scrollTop||0;D-=A.scrollLeft||0}}while(A=A.parentNode);return Element._returnOffset(D,B)},clonePosition:function(C,A){var D=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var E=Element.viewportOffset(A);C=$(C);var F=[0,0];var B=null;if(Element.getStyle(C,"position")=="absolute"){B=Element.getOffsetParent(C);F=Element.viewportOffset(B)}if(B==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(D.setLeft){C.style.left=(E[0]-F[0]+D.offsetLeft)+"px"}if(D.setTop){C.style.top=(E[1]-F[1]+D.offsetTop)+"px"}if(D.setWidth){C.style.width=A.offsetWidth+"px"}if(D.setHeight){C.style.height=A.offsetHeight+"px"}return C}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(A,C,D){switch(D){case"left":case"top":case"right":case"bottom":if(A(C,"position")==="static"){return null}case"height":case"width":if(!Element.visible(C)){return null}var E=parseInt(A(C,D),10);if(E!==C["offset"+D.capitalize()]){return E+"px"}var B;if(D==="height"){B=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{B=["border-left-width","padding-left","padding-right","border-right-width"]}return B.inject(E,function(G,F){var H=A(C,F);return H===null?G:G-parseInt(H,10)})+"px";default:return A(C,D)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(A,B,C){if(C==="title"){return B.title}return A(B,C)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(B,C){C=$(C);try{C.offsetParent}catch(E){return $(document.body)}var A=C.getStyle("position");if(A!=="static"){return B(C)}C.setStyle({position:"relative"});var D=B(C);C.setStyle({position:A});return D});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(C,D){D=$(D);try{D.offsetParent}catch(G){return Element._returnOffset(0,0)}var B=D.getStyle("position");if(B!=="static"){return C(D)}var E=D.getOffsetParent();if(E&&E.getStyle("position")==="fixed"){E.setStyle({zoom:1})}D.setStyle({position:"relative"});var F=C(D);D.setStyle({position:B});return F})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(A,B){try{B.offsetParent}catch(C){return Element._returnOffset(0,0)}return A(B)});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B]}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100}}return 1}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return C};Element.Methods.setOpacity=function(C,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}C=$(C);var B=C.currentStyle;if((B&&!B.hasLayout)||(!B&&C.style.zoom=="normal")){C.style.zoom=1}var A=C.getStyle("filter"),D=C.style;if(E==1||E===""){(A=F(A))?D.filter=A:D.removeAttribute("filter");return C}else{if(E<0.00001){E=0}}D.filter=F(A)+"alpha(opacity="+(E*100)+")";return C};Element._attributeTranslations=(function(){var C="className";var B="for";var A=document.createElement("div");A.setAttribute(C,"x");if(A.className!=="x"){A.setAttribute("class","x");if(A.className==="x"){C="class"}}A=null;A=document.createElement("label");A.setAttribute(B,"x");if(A.htmlFor!=="x"){A.setAttribute("htmlFor","x");if(A.htmlFor==="x"){B="htmlFor"}}A=null;return{read:{names:{"class":C,className:C,"for":B,htmlFor:B},values:{_getAttr:function(D,E){return D.getAttribute(E)},_getAttr2:function(D,E){return D.getAttribute(E,2)},_getAttrNode:function(D,F){var E=D.getAttributeNode(F);return E?E.value:""},_getEv:(function(){var D=document.createElement("div");D.onclick=Prototype.emptyFunction;var F=D.getAttribute("onclick");var E;if(String(F).indexOf("{")>-1){E=function(G,H){H=G.getAttribute(H);if(!H){return null}H=H.toString();H=H.split("{")[1];H=H.split("}")[0];return H.strip()}}else{if(F===""){E=function(G,H){H=G.getAttribute(H);if(!H){return null}return H.strip()}}}D=null;return E})(),_flag:function(D,E){return $(D).hasAttribute(E)?E:null},style:function(D){return D.style.cssText.toLowerCase()},title:function(D){return D.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr2,src:A._getAttr2,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function A(C){var B=C.getElementsByTagName("*"),E=[];for(var D=0,F;F=B[D];D++){if(F.tagName!=="!"){E.push(F)}}return E}Element.Methods.down=function(C,D,B){C=$(C);if(arguments.length==1){return C.firstDescendant()}return Object.isNumber(D)?A(C)[D]:Element.select(C,D)[B||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName.toUpperCase()=="IMG"&&A.width){A.width++;A.width--}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(C){}}}return A};Element.Methods.cumulativeOffset=function(A){var B=0,C=0;do{B+=A.offsetTop||0;C+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break}}A=A.offsetParent}while(A);return Element._returnOffset(C,B)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(E,F){E=$(E);if(F&&F.toElement){F=F.toElement()}if(Object.isElement(F)){E.parentNode.replaceChild(F,E);return E}F=Object.toHTML(F);var C=E.parentNode,D=C.tagName.toUpperCase();if(Element._insertionTranslations.tags[D]){var B=E.next();var A=Element._getContentFromAnonymousElement(D,F.stripScripts());C.removeChild(E);if(B){A.each(function(G){C.insertBefore(G,B)})}else{A.each(function(G){C.appendChild(G)})}}else{E.outerHTML=F.stripScripts()}F.evalScripts.bind(F).defer();return E}}Element._returnOffset=function(A,B){var C=[A,B];C.left=A;C.top=B;return C};Element._getContentFromAnonymousElement=function(A,C){var D=new Element("div"),B=Element._insertionTranslations.tags[A];if(B){D.innerHTML=B[0]+C+B[1];B[2].times(function(){D=D.firstChild})}else{D.innerHTML=C}return $A(D.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var A=Element._insertionTranslations.tags;Object.extend(A,{THEAD:A.TBODY,TFOOT:A.TBODY,TH:A.TD})})();Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return !!(B&&B.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(A){if(!Prototype.BrowserFeatures.ElementExtensions&&A.__proto__){window.HTMLElement={};window.HTMLElement.prototype=A.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}A=null})(document.createElement("div"));Element.extend=(function(){function C(G){if(typeof window.Element!="undefined"){var I=window.Element.prototype;if(I){var K="_"+(Math.random()+"").slice(2);var H=document.createElement(G);I[K]="x";var J=(H[K]!=="x");delete I[K];H=null;return J}}return false}function B(I,H){for(var G in H){var J=H[G];if(Object.isFunction(J)&&!(G in I)){I[G]=J.methodize()}}}var A=C("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(A){return function(G){if(G&&typeof G._extendedByPrototype=="undefined"){var H=G.tagName;if(H&&(/^(?:object|applet|embed)$/i.test(H))){B(G,Element.Methods);B(G,Element.Methods.Simulated);B(G,Element.Methods.ByTag[H.toUpperCase()])}}return G}}return Prototype.K}var E={},D=Element.Methods.ByTag;var F=Object.extend(function(I){if(!I||typeof I._extendedByPrototype!="undefined"||I.nodeType!=1||I==window){return I}var G=Object.clone(E),H=I.tagName.toUpperCase();if(D[H]){Object.extend(G,D[H])}B(I,G);I._extendedByPrototype=Prototype.emptyFunction;return I},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(E,Element.Methods);Object.extend(E,Element.Methods.Simulated)}}});F.refresh();return F})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var J=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var G=C;C=arguments[1]}if(!G){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(G)){G.each(A)}else{A(G)}}function A(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function B(L,O,N){N=N||false;for(var F in L){var M=L[F];if(!Object.isFunction(M)){continue}if(!N||!(F in O)){O[F]=M.methodize()}}}function E(M){var F;var N={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(N[M]){F="HTML"+N[M]+"Element"}if(window[F]){return window[F]}F="HTML"+M+"Element";if(window[F]){return window[F]}F="HTML"+M.capitalize()+"Element";if(window[F]){return window[F]}var L=document.createElement(M);var O=L.__proto__||L.constructor.prototype;L=null;return O}var I=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(J.ElementExtensions){B(Element.Methods,I);B(Element.Methods.Simulated,I,true)}if(J.SpecificElementExtensions){for(var K in Element.Methods.ByTag){var H=E(K);if(Object.isUndefined(H)){continue}B(D[K],H.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(D){var H=Prototype.Browser,G=document,E,C={};function A(){if(H.WebKit&&!G.evaluate){return document}if(H.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function F(B){if(!E){E=A()}C[B]="client"+B;D["get"+B]=function(){return E[C[B]]};return D["get"+B]()}D.getWidth=F.curry("Width");D.getHeight=F.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(A){if(!(A=$(A))){return }var B;if(A===window){B=0}else{if(typeof A._prototypeUID==="undefined"){A._prototypeUID=[Element.Storage.UID++]}B=A._prototypeUID[0]}if(!Element.Storage[B]){Element.Storage[B]=$H()}return Element.Storage[B]},store:function(A,B,C){if(!(A=$(A))){return }if(arguments.length===2){Element.getStorage(A).update(B)}else{Element.getStorage(A).set(B,C)}return A},retrieve:function(A,B,C){if(!(A=$(A))){return }var E=Element.getStorage(A),D=E.get(B);if(Object.isUndefined(D)){E.set(B,C);D=C}return D},clone:function(B,A){if(!(B=$(B))){return }var E=B.cloneNode(A);E._prototypeUID=void 0;if(A){var D=Element.select(E,"*"),C=D.length;while(C--){D[C]._prototypeUID=void 0}}return Element.extend(E)}});var Selector=Class.create({initialize:function(A){this.expression=A.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:(function(){var A=(function(){var E=false;if(document.evaluate&&window.XPathResult){var C=document.createElement("div");C.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var B=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var D=document.evaluate(B,C,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);E=(D.snapshotLength!==2);C=null}return E})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var B=this.expression;if(Prototype.Browser.WebKit&&(B.include("-of-type")||B.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(B)){return false}if(A){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(A){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return }this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var G=this.expression,H=Selector.patterns,C=Selector.xpath,F,B,A=H.length,D;if(Selector._cache[G]){this.xpath=Selector._cache[G];return }this.matcher=[".//*"];while(G&&F!=G&&(/\S/).test(G)){F=G;for(var E=0;E<A;E++){D=H[E].name;if(B=G.match(H[E].re)){this.matcher.push(Object.isFunction(C[D])?C[D](B):new Template(C[D]).evaluate(B));G=G.replace(B[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;var C=this.expression,B;switch(this.mode){case"selectorsAPI":if(A!==document){var D=A.id,E=$(A).identify();E=E.replace(/([\.:])/g,"\\$1");C="#"+E+" "+C}B=$A(A.querySelectorAll(C)).map(Element.extend);A.id=D;return B;case"xpath":return document._getElementsByXPath(this.xpath,A);default:return this.matcher(A)}},match:function(H){this.tokens=[];var M=this.expression,B=Selector.patterns,F=Selector.assertions;var A,D,E,L=B.length,C;while(M&&A!==M&&(/\S/).test(M)){A=M;for(var I=0;I<L;I++){D=B[I].re;C=B[I].name;if(E=M.match(D)){if(F[C]){this.tokens.push([C,Object.clone(E)]);M=M.replace(E[0],"")}else{return this.findElements(document).include(H)}}}}var K=true,C,J;for(var I=0,G;G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var C=document.createElement("div"),A=document.createElement("span");C.id="prototype_test_id";A.className="Test";C.appendChild(A);var B=(C.querySelector("#prototype_test_id .test")!==null);C=A=null;return B})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(E){var H=E[6],C=Selector.patterns,I=Selector.xpath,A,J,G=C.length,B;var D=[];while(H&&A!=H&&(/\S/).test(H)){A=H;for(var F=0;F<G;F++){B=C[F].name;if(E=H.match(C[F].re)){J=Object.isFunction(I[B])?I[B](E):new Template(I[B]).evaluate(E);D.push("("+J.substring(1,J.length-1)+")");H=H.replace(E[0],"");break}}}return"[not("+D.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(D,B){var G,F=B[6],E;if(F=="even"){F="2n+0"}if(F=="odd"){F="2n+1"}if(G=F.match(/^(\d+)$/)){return"["+D+"= "+G[1]+"]"}if(G=F.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(G[1]=="-"){G[1]=-1}var C=G[1]?Number(G[1]):1;var A=G[2]?Number(G[2]):0;E="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(E).evaluate({fragment:D,a:C,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6])}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D)}return B},mark:function(A){var D=Prototype.emptyFunction;for(var B=0,C;C=A[B];B++){C._countedByPrototype=D}return A},unmark:(function(){var A=(function(){var C=document.createElement("div"),E=false,B="_countedByPrototype",D="x";C[B]=D;E=(C.getAttribute(B)===D);C=null;return E})();return A?function(B){for(var C=0,D;D=B[C];C++){D.removeAttribute("_countedByPrototype")}return B}:function(B){for(var C=0,D;D=B[C];C++){D._countedByPrototype=void 0}return B}})(),index:function(F,C,G){F._countedByPrototype=Prototype.emptyFunction;if(C){for(var A=F.childNodes,D=A.length-1,B=1;D>=0;D--){var E=A[D];if(E.nodeType==1&&(!G||E._countedByPrototype)){E.nodeIndex=B++}}}else{for(var D=0,B=1,A=F.childNodes;E=A[D];D++){if(E.nodeType==1&&(!G||E._countedByPrototype)){E.nodeIndex=B++}}}},unique:function(B){if(B.length==0){return B}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(typeof (E=B[C])._countedByPrototype=="undefined"){E._countedByPrototype=Prototype.emptyFunction;D.push(Element.extend(E))}}return Selector.handlers.unmark(D)},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"))}return B},child:function(A){var E=Selector.handlers;for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G)}}}return C},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D)}}return B},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,H,F,G){var I=F.toUpperCase();var D=[],E=Selector.handlers;if(A){if(G){if(G=="descendant"){for(var C=0,B;B=A[C];C++){E.concat(D,B.getElementsByTagName(F))}return D}else{A=this[G](A)}if(F=="*"){return A}}for(var C=0,B;B=A[C];C++){if(B.tagName.toUpperCase()===I){D.push(B)}}return D}else{return H.getElementsByTagName(F)}},id:function(A,I,B,G){var H=$(B),F=Selector.handlers;if(I==document){if(!H){return[]}if(!A){return[H]}}else{if(!I.sourceIndex||I.sourceIndex<1){var A=I.getElementsByTagName("*");for(var D=0,C;C=A[D];D++){if(C.id===B){return[C]}}}}if(A){if(G){if(G=="child"){for(var E=0,C;C=A[E];E++){if(H.parentNode==C){return[H]}}}else{if(G=="descendant"){for(var E=0,C;C=A[E];E++){if(Element.descendantOf(H,C)){return[H]}}}else{if(G=="adjacent"){for(var E=0,C;C=A[E];E++){if(Selector.handlers.previousElementSibling(H)==C){return[H]}}}else{A=F[G](A)}}}}for(var E=0,C;C=A[E];E++){if(C==H){return[H]}}return[]}return(H&&Element.descendantOf(H,I))?[H]:[]},className:function(D,B,C,A){if(D&&A){D=this[A](D)}return Selector.handlers.byClassName(D,B,C)},byClassName:function(C,A,B){if(!C){C=Selector.handlers.descendant([A])}var H=" "+B+" ";for(var E=0,D=[],G,F;G=C[E];E++){F=G.className;if(F.length==0){continue}if(F==B||(" "+F+" ").include(H)){D.push(G)}}return D},attrPresence:function(D,C,A,B){if(!D){D=C.getElementsByTagName("*")}if(D&&B){D=this[B](D)}var F=[];for(var E=0,G;G=D[E];E++){if(Element.hasAttribute(G,A)){F.push(G)}}return F},attr:function(A,I,H,J,G,F){if(!A){A=I.getElementsByTagName("*")}if(A&&F){A=this[F](A)}var K=Selector.operators[G],D=[];for(var C=0,B;B=A[C];C++){var E=Element.readAttribute(B,H);if(E===null){continue}if(K(E,J)){D.push(B)}}return D},pseudo:function(C,D,E,B,A){if(C&&A){C=this[A](C)}if(!C){C=B.getElementsByTagName("*")}return Selector.pseudos[D](C,E,B)}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue}C.push(E)}return C},"last-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue}C.push(E)}return C},"only-child":function(B,G,A){var E=Selector.handlers;for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F)}}return C},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A)},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true)},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true)},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true)},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A)},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[]}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E)}return D})},nth:function(A,B,N,L,K){if(A.length==0){return[]}if(B=="even"){B="2n+0"}if(B=="odd"){B="2n+1"}var J=Selector.handlers,I=[],C=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,L,K);C.push(D.parentNode)}}if(B.match(/^\d+$/)){B=Number(B);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==B){I.push(D)}}}else{if(E=B.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;G++){if(D.nodeIndex==P[G]){I.push(D)}}}}}J.unmark(A);J.unmark(C);return I},empty:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.tagName=="!"||E.firstChild){continue}C.push(E)}return C},not:function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;B=A[F];F++){if(!B._countedByPrototype){E.push(B)}}G.unmark(H);return E},enabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(!E.disabled&&(!E.type||E.type!=="hidden")){C.push(E)}}return C},disabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.disabled){C.push(E)}}return C},checked:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E)}}return C}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B==A||B&&B.startsWith(A)},"$=":function(B,A){return B==A||B&&B.endsWith(A)},"*=":function(B,A){return B==A||B&&B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+(B||"").toUpperCase()+"-").include("-"+(A||"").toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip())});return A},matchElements:function(A,G){var F=$$(G),E=Selector.handlers;E.mark(F);for(var D=0,C=[],B;B=A[D];D++){if(B._countedByPrototype){C.push(B)}}E.unmark(F);return C},findElement:function(A,C,B){if(Object.isNumber(C)){B=C;C=false}return Selector.matchElements(A,C||"*")[B||0]},findChildElements:function(C,G){G=Selector.split(G.join(","));var E=[],F=Selector.handlers;for(var D=0,B=G.length,A;D<B;D++){A=new Selector(G[D].strip());F.concat(E,A.findElements(C))}return(B>1)?F.unique(E):E}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var C=0,D;D=A[C];C++){if(D.tagName!=="!"){B.push(D)}}return B}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){A=$(A);A.reset();return A},serializeElements:function(C,E){if(typeof E!="object"){E={hash:!!E}}else{if(Object.isUndefined(E.hash)){E.hash=true}}var D,G,B=false,A=E.submit;var F=C.inject({},function(I,H){if(!H.disabled&&H.name){D=H.name;G=$(H).getValue();if(G!=null&&H.type!="file"&&(H.type!="submit"||(!B&&A!==false&&(!A||D==A)&&(B=true)))){if(D in I){if(!Object.isArray(I[D])){I[D]=[I[D]]}I[D].push(G)}else{I[D]=G}}}return I});return E.hash?F:Object.toQueryString(F)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(F){var B=$(F).getElementsByTagName("*"),D,A=[],C=Form.Element.Serializers;for(var E=0;D=B[E];E++){A.push(D)}return A.inject([],function(G,H){if(C[H.tagName.toLowerCase()]){G.push(Element.extend(H))}return G})},getInputs:function(G,E,C){G=$(G);var F=G.getElementsByTagName("input");if(!E&&!C){return $A(F).map(Element.extend)}for(var D=0,H=[],A=F.length;D<A;D++){var B=F[D];if((E&&B.type!=E)||(C&&B.name!=C)){continue}H.push(Element.extend(B))}return H},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(C){var A=$(C).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var B=A.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return B?B:A.find(function(D){return/^(?:input|select|textarea)$/i.test(D.tagName)})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(C,B){C=$(C),B=Object.clone(B||{});var D=B.parameters,A=C.readAttribute("action")||"";if(A.blank()){A=window.location.href}B.parameters=C.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(B.parameters,D)}if(C.hasAttribute("method")&&!B.method){B.method=C.method}return new Ajax.Request(A,B)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(A.type)))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(B,F){if(Object.isUndefined(F)){return this[B.type=="select-one"?"selectOne":"selectMany"](B)}else{var D,E,G=!Object.isArray(F);for(var C=0,A=B.length;C<A;C++){D=B.options[C];E=this.optionValue(D);if(G){if(E==F){D.selected=true;return }}else{D.selected=F.include(E)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(B){var E,A=B.length;if(!A){return null}for(var D=0,E=[];D<A;D++){var C=B.options[D];if(C.selected){E.push(this.optionValue(C))}}return E},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,C,B){$super(B,C);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var W={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var G=document.documentElement;var M="onmouseenter" in G&&"onmouseleave" in G;var R;if(Prototype.Browser.IE){var I={0:1,1:4,2:2};R=function(Y,X){return Y.button===I[X]}}else{if(Prototype.Browser.WebKit){R=function(Y,X){switch(X){case 0:return Y.which==1&&!Y.metaKey;case 1:return Y.which==1&&Y.metaKey;default:return false}}}else{R=function(Y,X){return Y.which?(Y.which===X+1):(Y.button===X)}}}function P(X){return R(X,0)}function Q(X){return R(X,1)}function L(X){return R(X,2)}function J(Z){Z=W.extend(Z);var Y=Z.target,X=Z.type,a=Z.currentTarget;if(a&&a.tagName){if(X==="load"||X==="error"||(X==="click"&&a.tagName.toLowerCase()==="input"&&a.type==="radio")){Y=a}}if(Y.nodeType==Node.TEXT_NODE){Y=Y.parentNode}return Element.extend(Y)}function U(Z,a){var Y=W.element(Z);if(!a){return Y}var X=[Y].concat(Y.ancestors());return Selector.findElement(X,a,0)}function S(X){return{x:D(X),y:C(X)}}function D(Z){var Y=document.documentElement,X=document.body||{scrollLeft:0};return Z.pageX||(Z.clientX+(Y.scrollLeft||X.scrollLeft)-(Y.clientLeft||0))}function C(Z){var Y=document.documentElement,X=document.body||{scrollTop:0};return Z.pageY||(Z.clientY+(Y.scrollTop||X.scrollTop)-(Y.clientTop||0))}function O(X){W.extend(X);X.preventDefault();X.stopPropagation();X.stopped=true}W.Methods={isLeftClick:P,isMiddleClick:Q,isRightClick:L,element:J,findElement:U,pointer:S,pointerX:D,pointerY:C,stop:O};var T=Object.keys(W.Methods).inject({},function(X,Y){X[Y]=W.Methods[Y].methodize();return X});if(Prototype.Browser.IE){function F(Y){var X;switch(Y.type){case"mouseover":X=Y.fromElement;break;case"mouseout":X=Y.toElement;break;default:return null}return Element.extend(X)}Object.extend(T,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});W.extend=function(Y,X){if(!Y){return false}if(Y._extendedByPrototype){return Y}Y._extendedByPrototype=Prototype.emptyFunction;var Z=W.pointer(Y);Object.extend(Y,{target:Y.srcElement||X,relatedTarget:F(Y),pageX:Z.x,pageY:Z.y});return Object.extend(Y,T)}}else{W.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(W.prototype,T);W.extend=Prototype.K}function B(Y,X,b){var a=Element.retrieve(Y,"prototype_event_registry");if(Object.isUndefined(a)){E.push(Y);a=Element.retrieve(Y,"prototype_event_registry",$H())}var c=a.get(X);if(Object.isUndefined(c)){c=[];a.set(X,c)}if(c.pluck("handler").include(b)){return false}var Z;if(X.include(":")){Z=function(d){if(Object.isUndefined(d.eventName)){return false}if(d.eventName!==X){return false}W.extend(d,Y);b.call(Y,d)}}else{if(!M&&(X==="mouseenter"||X==="mouseleave")){if(X==="mouseenter"||X==="mouseleave"){Z=function(f){W.extend(f,Y);var d=f.relatedTarget;while(d&&d!==Y){try{d=d.parentNode}catch(g){d=Y}}if(d===Y){return }b.call(Y,f)}}}else{Z=function(d){W.extend(d,Y);b.call(Y,d)}}}Z.handler=b;c.push(Z);return Z}function H(){for(var Y=0,X=E.length;Y<X;Y++){W.stopObserving(E[Y]);E[Y]=null}}var E=[];if(Prototype.Browser.IE){window.attachEvent("onunload",H)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var A=Prototype.K;if(!M){A=function(X){var Y={mouseenter:"mouseover",mouseleave:"mouseout"};return X in Y?Y[X]:X}}function N(Y,X,b){Y=$(Y);var a=B(Y,X,b);if(!a){return Y}if(X.include(":")){if(Y.addEventListener){Y.addEventListener("dataavailable",a,false)}else{Y.attachEvent("ondataavailable",a);Y.attachEvent("onfilterchange",a)}}else{var Z=A(X);if(Y.addEventListener){Y.addEventListener(Z,a,false)}else{Y.attachEvent("on"+Z,a)}}return Y}function K(Y,X,d){Y=$(Y);var c=Element.retrieve(Y,"prototype_event_registry");if(Object.isUndefined(c)){return Y}if(X&&!d){var Z=c.get(X);if(Object.isUndefined(Z)){return Y}Z.each(function(e){Element.stopObserving(Y,X,e.handler)});return Y}else{if(!X){c.each(function(g){var e=g.key,f=g.value;f.each(function(h){Element.stopObserving(Y,e,h.handler)})});return Y}}var Z=c.get(X);if(!Z){return }var b=Z.find(function(e){return e.handler===d});if(!b){return Y}var a=A(X);if(X.include(":")){if(Y.removeEventListener){Y.removeEventListener("dataavailable",b,false)}else{Y.detachEvent("ondataavailable",b);Y.detachEvent("onfilterchange",b)}}else{if(Y.removeEventListener){Y.removeEventListener(a,b,false)}else{Y.detachEvent("on"+a,b)}}c.set(X,Z.without(b));return Y}function V(Z,Y,X,b){Z=$(Z);if(Object.isUndefined(b)){b=true}if(Z==document&&document.createEvent&&!Z.dispatchEvent){Z=document.documentElement}var a;if(document.createEvent){a=document.createEvent("HTMLEvents");a.initEvent("dataavailable",true,true)}else{a=document.createEventObject();a.eventType=b?"ondataavailable":"onfilterchange"}a.eventName=Y;a.memo=X||{};if(document.createEvent){Z.dispatchEvent(a)}else{Z.fireEvent(a.eventType,a)}return W.extend(a)}Object.extend(W,W.Methods);Object.extend(W,{fire:V,observe:N,stopObserving:K});Element.addMethods({fire:V,observe:N,stopObserving:K});Object.extend(document,{fire:V.methodize(),observe:N.methodize(),stopObserving:K.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,W)}else{window.Event=W}})();(function(){var D;function A(){if(document.loaded){return }if(D){window.clearTimeout(D)}document.loaded=true;document.fire("dom:loaded")}function C(){if(document.readyState==="complete"){document.stopObserving("readystatechange",C);A()}}function B(){try{document.documentElement.doScroll("left")}catch(E){D=B.defer();return }A()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",A,false)}else{document.observe("readystatechange",C);if(window==top){D=B.defer()}}Event.observe(window,"load",A)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(A,C,B){B=B||{};return Element.clonePosition(C,A,B)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(D,C){C=C.toString().strip();var E=/\s/.test(C)?$w(C).map(A).join(""):A(C);return E?document._getElementsByXPath(".//*"+E,D):[]}:function(F,E){E=E.toString().strip();var C=[],H=(/\s/.test(E)?$w(E):null);if(!H&&!E){return C}var D=$(F).getElementsByTagName("*");E=" "+E+" ";for(var G=0,J,I;J=D[G];G++){if(J.className&&(I=" "+J.className+" ")&&(I.include(E)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){C.push(Element.extend(J))}}return C};return function(C,D){return $(D||document.body).getElementsByClassName(C)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A)},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0})._each(A)},set:function(A){this.element.className=A},add:function(A){if(this.include(A)){return }this.set($A(this).concat(A).join(" "))},remove:function(A){if(!this.include(A)){return }this.set($A(this).without(A).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);function debug(){for(var A=0;A<arguments.length;A++){ComCore.Debug.log(arguments[A])}}ComCore.Configuration={get:function(A,B){if(B&&(B.length>0)){if(ComCore.configValues[A]&&ComCore.configValues[A][B]){return ComCore.configValues[A][B]}return false}else{if(ComCore.configValues[A]){return ComCore.configValues[A]}}return false},_eoo:true};ComCore.ActionStates={show:function(F,C,E,B){debug("ComCore.ActionStates.show("+F+","+C+")");F=this.getMessageAndType(F,C);if(!F){debug("ComCore.ActionStates.show() - message not found");return false}debug(F);if(!B){B={}}if(E){var D=/(^|.|\r|\n)(%(.*?)%)/;var A=new Template(F.message,D);F.message=A.evaluate(E);B.callbackData=E}ComCore.ActionStateMessage.show(F.type,F.message,B);return true},getMessageAndType:function(D,B){var C=$("actionStates_"+B);if(C instanceof Element){var A=C.down(".actionState_"+D);if(A===undefined){ComCore.Debug.log("Could not find message for actionstate "+D+" (context: "+B+")","error");return false}return{type:A.getClassData("type"),message:A.innerHTML}}},_eoo:true};ComCore.Debug={debugData:[],startDate:new Date(),log:function(A,D){if(ComCore.Configuration.get("debug")){try{if(!D){D="log"}var B=new Date();ComCore.Debug.debugData[ComCore.Debug.debugData.length]={t:B.getTime(),m:A,type:D};if(window.console){if(typeof (A)==="string"){B=new Date();A="["+B.getHours()+":"+B.getMinutes()+":"+B.getSeconds()+"."+B.getMilliseconds()+"] "+A}if(D==="info"){window.console.info(A)}else{if(D==="warning"){window.console.warn(A)}else{if(D==="error"){window.console.error(A)}else{window.console.log(A)}}}}}catch(C){}}},group:function(B,C){if(ComCore.Configuration.get("debug")){try{if(window.console&&typeof window.console.group==="function"){if(C&&typeof window.console.groupCollapsed==="function"){window.console.groupCollapsed(B)}else{window.console.group(B)}}}catch(A){}}},groupEnd:function(){if(ComCore.Configuration.get("debug")){try{if(window.console&&typeof window.console.groupEnd==="function"){window.console.groupEnd()}}catch(A){}}},_eoo:true};ComCore.Page={defaults:[],get:function(A){return ComCore.Page.defaults[A]},getContextURL:function(){var A="";if(ComCore.Page.get("contextUrl")){A+=ComCore.Page.get("contextUrl")}else{A+=(ComCore.Login.getNickname()!==undefined)?"/"+ComCore.Login.getNickname():"/profile"}return A},_eoo:true};ComCore.Profile={};ComCore.Message={_hide:function(){var A=$A(arguments);if(A.length>0){A.each(function(B){$("content").select("div."+B).invoke("hide")})}},hideAll:function(){ComCore.Message._hide("success","warning","error")},hideSuccess:function(){ComCore.Message._hide("success")},hideWarning:function(){ComCore.Message._hide("warning")},hideError:function(){ComCore.Message._hide("error")},_eoo:true};ComCore.Events={extend:function(A){A._objectEventSetup=function(B){this._observers=this._observers||{};this._observers[B]=this._observers[B]||[]};A.observe=function(D,B){if(typeof (D)==="string"&&typeof (B)!=="undefined"){this._objectEventSetup(D);if(!this._observers[D].include(B)){this._observers[D].push(B)}}else{for(var C in D){if(D){this.observe(C,D[C])}}}};A.stopObserving=function(C,B){this._objectEventSetup(C);if(C&&B){this._observers[C]=this._observers[C].without(B)}else{if(C){this._observers[C]=[]}else{this._observers={}}}};A.observeOnce=function(D,C){var B=function(){C.apply(this,arguments);this.stopObserving(D,B)}.bind(this);this._objectEventSetup(D);this._observers[D].push(B)};A.notify=function(F){this._objectEventSetup(F);var D=[];var B=$A(arguments).slice(1);try{for(var C=0;C<this._observers[F].length;++C){D.push(this._observers[F][C].apply(this._observers[F][C],B)||null)}}catch(E){if(E===$break){return false}else{throw E}}return D};if(A.prototype){A.prototype._objectEventSetup=A._objectEventSetup;A.prototype.observe=A.observe;A.prototype.stopObserving=A.stopObserving;A.prototype.observeOnce=A.observeOnce;A.prototype.notify=function(F){var B=null;if(A.notify){B=$A(arguments).slice(1);B.unshift(this);B.unshift(F);A.notify.apply(A,B)}this._objectEventSetup(F);B=$A(arguments).slice(1);var D=[];try{if(this.options&&this.options[F]&&typeof (this.options[F])==="function"){D.push(this.options[F].apply(this,B)||null)}for(var C=0;C<this._observers[F].length;++C){D.push(this._observers[F][C].apply(this._observers[F][C],B)||null)}}catch(E){if(E===$break){return false}else{throw E}}return D}}},_eoo:true};ComCore.Queuer={functions:[],add:function(A,B){ComCore.Queuer._add(A,B)},disable:function(){ComCore.Queuer.add=function(A){ComCore.Debug.warning("I don't accept anything to queue anymore, will execute.");A()}},enable:function(){ComCore.Queuer.add=ComCore.Queuer._add},_add:function(A,B){ComCore.Queuer.functions[ComCore.Queuer.functions.length]={name:A,onwindowload:B}},_eoo:true};ComCore.CSRF={showStandardMessage:true,setToken:function(A,B){try{$$('input.csrftoken[name="csrftoken_'+A.toLowerCase()+'"]').first().value=B;return true}catch(C){debug(C);return false}},getToken:function(A){try{return $$('input.csrftoken[name="csrftoken_'+A.toLowerCase()+'"]').first().value}catch(B){debug(B);return""}},getParam:function(A,B){return"csrftoken_"+A.toLowerCase()+"="+this.getToken(A)+(B?"&getNewToken=1":"")},addParam:function(C,A,B){C.set("csrftoken_"+A.toLowerCase(),this.getToken(A));if(B){C.set("getNewToken","1")}},onInvalidToken:function(B,A){if(this.showStandardMessage){ComCore.ActionStateMessage.show("error",A.responseText+(A.getHeader("X-Debug-Csrf")?A.getHeader("X-Debug-Csrf"):""))}else{this.enableStandardMessage()}},disableStandardMessage:function(){this.showStandardMessage=false},enableStandardMessage:function(){this.showStandardMessage=true},_eoo:true};ComCore.OpenSocialList={};ComCore.pageLoaded=false;var isPageLoaded=function(){return ComCore.pageLoaded};ComCore.isWindowLoaded=false;jx={getHTTPObject:function(){var A=false;if(typeof ActiveXObject!=="undefined"){try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(D){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch(C){A=false}}}else{if(window.XMLHttpRequest){try{A=new XMLHttpRequest()}catch(B){A=false}}}return A},load:function(B,C,E,D){var A=this.init();if(!A||!B){return }if(A.overrideMimeType){A.overrideMimeType("text/xml")}C+="&t="+new Date().getTime();if(E==="post"){A.open("POST",B,true);A.setRequestHeader("Content-type","application/x-www-form-urlencoded");A.setRequestHeader("Content-length",C.length);A.setRequestHeader("Connection","close")}else{A.open("GET",B+C,true);C=null}A.onreadystatechange=function(){if(A.readyState===4){if(A.status===200){var F="";if(A.responseText){F=A.responseText}if(D){D(F)}}else{if(debug){debug(A.status)}}}};A.send(C)},init:function(){return this.getHTTPObject()}};function printStackTrace(){var I=[];var C=false;try{me.dont.exist+=0}catch(F){if(F.stack){return F.stack}else{if(window.opera&&F.message){var J=F.message.split("\n");for(var B=0,E=J.length;B<E;B++){if(J[B].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var H=J[B];if(J[B+1]){H+=" at "+J[B+1];B++}I.push(H)}}I.shift();C=true}}}if(!C){var D=arguments.callee.caller;while(D){var G=D.toString();var A=G.substring(G.indexOf("function")+8,G.indexOf("("))||"anonymous";I.push(A);D=D.caller}}return I.join(" ")}window.onerror=function(F,C,E){if(ComCore.configValues.jsPostErrors===true){var D="";if(ComCore.Debug.errorCount){D+="count="+ComCore.Debug.errorCount}else{D+="count=1"}if(F){F="BETA "+F;D+="&message="+encodeURIComponent(F)}if(C){D+="&script_url="+encodeURIComponent(C)}if(E){D+="&lno="+E}var B=printStackTrace();D+="&trace="+encodeURIComponent(B);if(ComCore.Page.pageSection){D+="&pageSection="+ComCore.Page.pageSection}if(ComCore.Server&&ComCore.Server.Number){D+="&server="+ComCore.Server.Number}D+="&url="+encodeURIComponent(window.location);var A=location.hostname;jx.load("/ajax/debug/action=postJavaScriptError",D,"post")}};function comcoreSetHomepageTakeover(E,B,F,A,D){document.body.className+=" adWallpaper";var G=$("adLeaderboard");G.width=E;G.className="ad adSuperLeaderboard";G.id="adSuperLeaderboard";G.style.backgroundColor=B;if(F=="<ADHESE_SWF_SRC_2ND>"){F=null}var C=$("contentWrapper");C.style.backgroundColor=B;if(F!==null){C.style.backgroundImage="url("+F+")";C.style.backgroundPosition="top center";C.style.backgroundRepeat=A;G.style.backgroundImage="url("+F+")";G.style.backgroundPosition="top center";G.style.backgroundRepeat=A;if(D!==null){C.observe("click",function(H){if(H.element().getAttribute("id")=="contentWrapper"){window.open(D)}})}}}comcoreSplashPage=function(A){var B=this;B.overlayNode=A.overlayNode||document.getElementById("splashOverlay");B.counterNode=A.counterNode||document.getElementById("splashCounter");B.contentNode=A.contentNode||document.getElementById("splashContent");B.closer=A.closer||[document.getElementById("splashLogo"),document.getElementById("splashCloser")];B.timer=A.runtime||15;B.size=A.size||{width:0,height:0};B.timeout=false;B.stylesheet=document.styleSheets[document.styleSheets.length-1];B.openSplash=function(){document.body.parentNode.style.overflow=document.body.style.overflow="hidden";document.body.parentNode.style.height=document.body.style.height="100%";window.doNotShowDialog=true;if(B.stylesheet.addRule){B.stylesheet.addRule("select","display:none !important")}B.overlayNode.style.display="block"};B.closeSplash=function(){B.stopTimeout();if(B.stylesheet.removeRule){B.stylesheet.removeRule(B.stylesheet.rules.length-1)}if(ComCore&&ComCore.Dialog){window.doNotShowDialog=false;ComCore.Dialog.show()}B.overlayNode.style.display="none";document.body.parentNode.style.height=document.body.style.height="auto";document.body.parentNode.style.overflow=document.body.style.overflow="auto"};B.runTimeout=function(){B.timeout=window.setInterval(B.updateTimer,1000)};B.stopTimeout=function(){window.clearInterval(B.timeout)};B.updateTimer=function(){B.counterNode.innerHTML=B.timer;B.timer-=1;if(B.timer<=0){B.closeSplash()}};B.init=function(){B.contentNode.style.width=B.size.width+"px";B.contentNode.style.height=B.size.height+"px";B.openSplash();B.contentNode.onmouseover=function(){B.stopTimeout()};B.contentNode.onmouseout=function(){B.runTimeout()};var C=function(){B.closeSplash();return false};for(var D=0;D<B.closer.length;D++){B.closer[D].onclick=C}B.updateTimer()}};var comcoreSetSkin=function(A,C){var B="";if(C){B=C+"/"}if(ComCore.pageLoaded&&ComCore.Login.isLoggedIn()){B+=ComCore.Configuration.get("rootURL")+"/"+ComCore.TopLogin.getNickname()}else{if(document.getElementById("userNickname")==null){return false}else{B+=ComCore.Configuration.get("rootURL")+"/"+document.getElementById("userNickname").innerHTML}}B+="/?preview=1&skin="+A;window.location=B};ComCore.Ads={bannerMinHeight:50,BannerFormats:{LEADERBOARD:"LEADERBOARD",RECTANGLE_TOP:"RECTANGLE_TOP",RECTANGLE_BOTTOM:"RECTANGLE_BOTTOM",SKYSCRAPER:"SKYSCRAPER",FOOTER:"FOOTER",STACK_FT_SKINS:"STACK_FT_SKINS",STACK_FT_VIDEOS:"STACK_FT_VIDEOS",STACK_FT_GAMES:"STACK_FT_GAMES",STACK_FT_BRANDS:"STACK_FT_BRANDS",STACK_FT_APPS:"STACK_FT_APPS",STACK_FT_CONTESTS:"STACK_FT_CONTESTS"},Saleshouses:{SkynetBE:"SKYNETBE",AdlinkAT:"ADLINKAT",AdlinkCH:"ADLINKCH",YahooDE:"YAHOODE",YahooIT:"YAHOOIT",AdlinkSE:"ADLINKSE",MediatotalNO:"MEDIATOTALNO",WebAdsNL:"WEBADSNL",AdlinkFR:"ADLINKFR",HimediaES:"HIMEDIAES",CimediaPT:"CIMEDIAPT",UnanimisGB:"UNANIMISGB"},sh:{},rm:{},adCounter:0,splashBanner:false,showStack:function(B){var A=false;switch(B){case ComCore.Ads.BannerFormats.STACK_FT_SKINS:A="stackFtSkinsWrapper";break;case ComCore.Ads.BannerFormats.STACK_FT_VIDEOS:A="stackFtVideosWrapper";break;case ComCore.Ads.BannerFormats.STACK_FT_GAMES:A="stackFtGamesWrapper";break;case ComCore.Ads.BannerFormats.STACK_FT_BRANDS:A="stackFtBrandsWrapper";break;case ComCore.Ads.BannerFormats.STACK_FT_APPS:A="stackFtAppsWrapper";break;case ComCore.Ads.BannerFormats.STACK_FT_CONTESTS:A="stackFtContestsWrapper";break}if(A!==false){if($(A)&&$(A).visible()==false){$(A).show()}}},injectHomepageRectangle:function(A){$("column3").appendChild(A)},autoExpandBanner:function(A,C){if($(A)){var B=$(A).getHeight();if(parseInt(B,10)>ComCore.Ads.bannerMinHeight){$(A).addClassName(C);$(A).setStyle({height:B+"px"})}else{$(A).setStyle({height:"0"})}}},showLeaderboard:function(A){},showHalfpager:function(){var A=$("hideForHalfpagerWrapper");if(A!==undefined&&A!==null&&A.visible()==true){A.hide()}},hideLeaderboard:function(){},getAd:function(F,C,E,A){A=$(A);var D=ComCore.configValues.staticURL.match(/.*\/(\d*)\//)[1];var B="";if(F=="SKYSCRAPER"&&A){if(Math.random()<=0.6){B='<iframe id="adiframe_'+ComCore.Ads.adCounter+'" src="http://pool.ads.netlog.com/iframe.html?'+D+"/adiframe_"+ComCore.Ads.adCounter+"/http://ads.ads.netlog.com/"+ComCore.Ads.adurl.replace(/AJAX_BANNER/,"SELFSERVICE_PREMIUM")+'" width="160" height="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>';ComCore.Ads.adCounter++;B+='<iframe id="adiframe_'+ComCore.Ads.adCounter+'" src="http://pool.ads.netlog.com/iframe.html?'+D+"/adiframe_"+ComCore.Ads.adCounter+"/http://ads.ads.netlog.com/"+ComCore.Ads.adurl.replace(/AJAX_BANNER/,"SELFSERVICE")+'" width="160" height="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>'}else{B='<iframe id="adiframe_'+ComCore.Ads.adCounter+'" src="http://pool.ads.netlog.com/iframe.html?'+D+"/adiframe_"+ComCore.Ads.adCounter+"/http://ads.ads.netlog.com/"+ComCore.Ads.adurl.replace(/AJAX_BANNER/,"SKYSCRAPER")+'" width="'+C+'" height="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>'}}else{if(A){B='<iframe id="adiframe_'+ComCore.Ads.adCounter+'" src="http://pool.ads.netlog.com/iframe.html?'+D+"/adiframe_"+ComCore.Ads.adCounter+"/http://ads.ads.netlog.com/"+ComCore.Ads.adurl.replace(/AJAX_BANNER/,F)+'" width="'+C+'" height="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>'}}if(B.length>0){ComCore.Ads.adCounter++;A.fade({afterFinish:function(){A.update(B);A.appear()}})}},getFallbackAd:function(C,B){var A=false;if(B!==null&&typeof B=="string"){A=ComCore.Ads.Google.getFallbackChannel(B,C);if(A!==false){A=[A]}}switch(C.toUpperCase()){case ComCore.Ads.BannerFormats.LEADERBOARD:break;case ComCore.Ads.BannerFormats.RECTANGLE_TOP:ComCore.Ads.Google.add("RECTANGLE","adRectangleTop",3,"VerticalTable",A);break;case ComCore.Ads.BannerFormats.FOOTER:ComCore.Ads.Google.add(ComCore.Ads.BannerFormats.FOOTER,"adFooter",3,"HorizontalTable",A);break;case ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM:ComCore.Ads.Google.add("RECTANGLE","adRectangleBottom",3,"VerticalTable",A);break;case ComCore.Ads.BannerFormats.SKYSCRAPER:ComCore.Ads.Google.add(ComCore.Ads.BannerFormats.SKYSCRAPER,"adSkyscraper",3,"VerticalTable",A);break;default:window.oneerror("Ads - illegal fallback format ["+C+"]","ComCore.Ads.getFallbackAd","174")}},_eoo:true};ComCore.Ads.GAFS={params:[],incoming:[],requested:[],additionalChannels:[],add:function(C,D,B,A){ComCore.Ads.GAFS.incoming[ComCore.Ads.GAFS.incoming.length]={divId:C,maxNumAds:D,layout:B};ComCore.Ads.GAFS.requested+=parseInt(D,10);if(A!==null){ComCore.Ads.GAFS.additionalChannels=ComCore.Ads.GAFS.additionalChannels.concat(A).uniq()}},getAds:function(){var B=ComCore.Ads.GAFS.incoming.length;var A=0;for(var C=0;C<B;C++){A+=ComCore.Ads.GAFS.incoming[C].maxNumAds}google_afs_client=ComCore.Ads.Google.params.google_ad_client;google_afs_query=$("qSearchBox").value;google_afs_adpage="1";google_afs_channel=ComCore.Ads.GAFS.params.google_afs_channel;google_afs_hl=ComCore.Ads.Google.params.google_language;google_afs_adsafe="high";google_afs_ie="utf8";google_afs_oe="utf8";google_afs_ad="w"+A+"n0";document.write('<script language="JavaScript" type="text/javascript" src="http://www.google.com/afsonline/show_afs_ads.js"><\/script>')},renderAds:function(B){var C=ComCore.Ads.GAFS.incoming.length;var E;var D;var A=0;if(C>0){for(A=0;A<C;A++){E=ComCore.Ads.GAFS.incoming[A].maxNumAds;if(B.length==0){break}else{if(E>B.length){ComCore.Ads.GAFS.renderAdUnit(B,ComCore.Ads.GAFS.incoming[A].divId,ComCore.Ads.GAFS.incoming[A].layout);B=[];break}else{D=B.splice(0,E);ComCore.Ads.GAFS.renderAdUnit(D,ComCore.Ads.GAFS.incoming[A].divId,ComCore.Ads.GAFS.incoming[A].layout)}}}}return true},renderAdUnit:function(I,G,B){if(I.length>0){var C=new Element("div");C.className="adGoogleAFS"+B+"Wrapper";for(j=0;j<I.length;j++){I[j].url.replace("<script","");I[j].url.replace("<\/script>","");I[j].line1.replace("<script","");I[j].line1.replace("<\/script>","");I[j].line2.replace("<script","");I[j].line2.replace("<\/script>","");I[j].line3.replace("<script","");I[j].line3.replace("<\/script>","");I[j].visible_url.replace("<script","");I[j].visible_url.replace("<\/script>","");var A=new Element("div");A.id="renderedGoogleAFSAd"+G+"_"+j;A.className="adGoogle adGoogle"+B+"Ad";C.appendChild(A);var H=new Element("div");H.className="adGoogle adGoogleAFS"+B+"AdTitle";H.update('<a href="'+I[j].url+'" target="_blank">'+I[j].line1+"</a>");A.appendChild(H);var D=new Element("div");D.className="adGoogle adGoogleAFS"+B+"AdText";D.update(I[j].line2);A.appendChild(D);var E=new Element("div");E.className="adGoogle adGoogleAFS"+B+"AdText";E.update(I[j].line3);A.appendChild(E);var F=new Element("div");F.className="adGoogle adGoogleAFS"+B+"AdUrl";F.update('<a href="'+I[j].url+'" target="_blank">'+I[j].visible_url+"</a>");A.appendChild(F)}$(G).appendChild(C)}},_eoo:true};ComCore.Ads.Google={incoming:[],additionalChannels:[],requested:0,skip:0,params:[],zones:[],directQuery:true,getFallbackChannel:function(A,E){var C=false;for(var B in ComCore.Ads.Google.fallbackChannels){if(B==A){for(var D in ComCore.Ads.Google.fallbackChannels[A]){if(D==E){C=ComCore.Ads.Google.fallbackChannels[A][E]}}}}return C},getAd:function(G,F,B,C,E){if(C==null||typeof C=="undefined"){C=window}var A=ComCore.Ads.Google.params.google_ad_type;if(typeof E!=="undefined"&&E!==null){A=E}C.google_ad_client=ComCore.Ads.Google.params.google_ad_client;C.google_ad_output=ComCore.Ads.Google.params.google_ad_output;C.google_safe=ComCore.Ads.Google.params.google_safe;C.google_feedback=ComCore.Ads.Google.params.google_feedback;C.google_encoding=ComCore.Ads.Google.params.google_encoding;C.google_ad_section=ComCore.Ads.Google.params.google_ad_section;C.google_ad_type=A;C.google_language=ComCore.Ads.Google.params.google_language;C.google_ad_channel=ComCore.Ads.Google.params.google_ad_channel;C.google_cust_age=ComCore.Ads.Google.params.google_cust_age;C.google_cust_gender=ComCore.Ads.Google.params.google_cust_gender;C.google_max_num_ads=F;C.google_skip=ComCore.Ads.Google.requested;if(ComCore.Ads.Google.params.google_adtest){C.google_adtest=ComCore.Ads.Google.params.google_adtest}if(ComCore.Ads.Google.zones[G]){C.google_ad_channel+="+"+ComCore.Ads.Google.zones[G]}if(B!==null&&typeof B=="object"){for(var D=0;D<ComCore.Ads.Google.additionalChannels.length;++D){C.google_ad_channel+="+"+B[D]}}debug("GAFC channels ["+G+"]: "+C.google_ad_channel);C.document.write('<script language="javascript" type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"><\/script>')},add:function(H,C,G,B,A,D,F,E){if(typeof D=="undefined"||D==null){D=window}if(typeof F=="undefined"||F==null){googleAdType=null}if(typeof E=="undefined"||E==null){E=false}ComCore.Ads.Google.incoming[ComCore.Ads.Google.incoming.length]={format:H,divId:C,maxNumAds:G,layout:B,adheseClickTracking:E};ComCore.Ads.Google.requested+=parseInt(G,10);if(ComCore.Ads.Google.directQuery){ComCore.Ads.Google.additionalChannels=[]}if(A!=null){ComCore.Ads.Google.additionalChannels=ComCore.Ads.Google.additionalChannels.concat(A).uniq()}if(ComCore.Ads.Google.directQuery){ComCore.Ads.Google.getAd(H,G,A,D,F)}},renderAds:function(B){var C=ComCore.Ads.Google.incoming.size();var E;var D;var A=0;if(C>0){for(A=0;A<C;A++){E=ComCore.Ads.Google.incoming[A].maxNumAds;if(B.length==0){if($(ComCore.Ads.Google.incoming[A].divId).visible()==true){debug("GAFC: Closed div ["+ComCore.Ads.Google.incoming[A].divId+"] because no ads returned");$(ComCore.Ads.Google.incoming[A].divId).hide()}break}if(B.length==1){if(B[0].type=="image"){ComCore.Ads.Google.renderImageUnit(B[0],ComCore.Ads.Google.incoming[A].divId,ComCore.Ads.Google.incoming[A].adheseClickTracking)}else{if(B[0].type=="flash"){ComCore.Ads.Google.renderFlashUnit(B[0],ComCore.Ads.Google.incoming[A].divId)}else{if(B[0].type=="text"){D=B.splice(0,E);ComCore.Ads.Google.renderAdUnit(D,ComCore.Ads.Google.incoming[A].divId,ComCore.Ads.Google.incoming[A].layout,ComCore.Ads.Google.incoming[A].format,ComCore.Ads.Google.incoming[A].adheseClickTracking)}}}break}else{if(E>B.length){ComCore.Ads.Google.renderAdUnit(B,ComCore.Ads.Google.incoming[A].divId,ComCore.Ads.Google.incoming[A].layout,ComCore.Ads.Google.incoming[A].format,ComCore.Ads.Google.incoming[A].adheseClickTracking);B=[];break}else{D=B.splice(0,E);ComCore.Ads.Google.renderAdUnit(D,ComCore.Ads.Google.incoming[A].divId,ComCore.Ads.Google.incoming[A].layout,ComCore.Ads.Google.incoming[A].format,ComCore.Ads.Google.incoming[A].adheseClickTracking)}}}}if(ComCore.Ads.Google.directQuery){ComCore.Ads.Google.incoming=[]}return true},renderImageUnit:function(F,A,E){var B=new Element("div");B.className="adGoogleImageWrapper";var D=new Element("a");if(E!=false){D.href="http://clicks.ads.netlog.com/"+E+"/"+F.url}else{D.href=F.url}D.target="_blank";var C=new Element("img");C.border=0;C.width=F.image_width;C.height=F.image_height;C.src=F.image_url;D.appendChild(C);B.appendChild(D);$(A).update(B)},renderFlashUnit:function(E,A){var B=new Element("div");B.className="adGoogleFlashWrapper";var D=new Element("div");var F="googleFlashAd"+Math.round(Math.random()*100000000);D.id=F;$(A).update(B);var C=new FlashObject(E.image_url,F,E.image_width,E.image_height,"7","#000","high");C.addParam("allowScriptAccess","never");C.addParam("wmode","transparent");C.write(F)},renderAdUnit:function(N,J,B,L,H){var E=new Element("div");E.className="adGoogle"+B+"Wrapper";if(N.length&&(L=="RECTANGLE_TOP"||L=="RECTANGLE_BOTTOM"||L=="RECTANGLE")){var M=new Element("hr");M.className="adHr";E.appendChild(M)}for(var D=0;D<N.length;D++){if(H!=false){N[D].url="http://clicks.ads.netlog.com/"+H+"/"+N[D].url}var A=new Element("div");A.id="renderedGoogleAd"+J+"_"+D;A.className="adGoogle adGoogle"+B+"Ad";E.appendChild(A);var K=new Element("div");K.className="adGoogle adGoogle"+B+"AdTitle";K.update('<a href="'+N[D].url+'" target="_blank">'+N[D].line1+"</a>");A.appendChild(K);var F=new Element("div");F.className="adGoogle adGoogle"+B+"AdText";F.update(N[D].line2);A.appendChild(F);var G=new Element("div");G.className="adGoogle adGoogle"+B+"AdText";G.update(N[D].line3);A.appendChild(G);var I=new Element("div");I.className="adGoogle adGoogle"+B+"AdUrl";I.update('<a href="'+N[D].url+'" target="_blank">'+N[D].visible_url+"</a>");A.appendChild(I)}if(N.length&&(L=="RECTANGLE_TOP"||L=="RECTANGLE_BOTTOM"||L=="RECTANGLE")){var C=new Element("hr");C.className="adHr";E.appendChild(C)}if($(J)){$(J).insert(E)}return true},_eoo:true};function google_ad_request_done(A){ComCore.Ads.Google.renderAds(A);return true}function google_afs_request_done(A){ComCore.Ads.GAFS.renderAds(A);return true}ComCore.Ads.Google.fallbackChannels={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.UnanimisGB]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.UnanimisGB][ComCore.Ads.BannerFormats.LEADERBOARD]="3744110529";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.UnanimisGB][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="7873407475";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.UnanimisGB][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="9107542794";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.UnanimisGB][ComCore.Ads.BannerFormats.SKYSCRAPER]="4700956340";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.UnanimisGB][ComCore.Ads.BannerFormats.FOOTER]="7839276389";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.SkynetBE]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.SkynetBE][ComCore.Ads.BannerFormats.LEADERBOARD]="9885520176";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.SkynetBE][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="4056763200";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.SkynetBE][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="6058407815";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.SkynetBE][ComCore.Ads.BannerFormats.SKYSCRAPER]="8274113170";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.SkynetBE][ComCore.Ads.BannerFormats.FOOTER]="3889100424";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkAT]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkAT][ComCore.Ads.BannerFormats.LEADERBOARD]="1125065293";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkAT][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="6686701618";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkAT][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="2489826922";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkAT][ComCore.Ads.BannerFormats.SKYSCRAPER]="3105265601";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkAT][ComCore.Ads.BannerFormats.FOOTER]="0925920705";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkCH]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkCH][ComCore.Ads.BannerFormats.LEADERBOARD]="9537709857";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkCH][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="1249548153";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkCH][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="1214557083";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkCH][ComCore.Ads.BannerFormats.SKYSCRAPER]="8973453211";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkCH][ComCore.Ads.BannerFormats.FOOTER]="7968471712";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkFR]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkFR][ComCore.Ads.BannerFormats.LEADERBOARD]="1596049432";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkFR][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="1991007930";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkFR][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="1431017650";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkFR][ComCore.Ads.BannerFormats.SKYSCRAPER]="4940795077";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.AdlinkFR][ComCore.Ads.BannerFormats.FOOTER]="3958623955";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooIT]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooIT][ComCore.Ads.BannerFormats.LEADERBOARD]="1604153520";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooIT][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="2146632932";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooIT][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="8873547104";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooIT][ComCore.Ads.BannerFormats.SKYSCRAPER]="1620442586";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooIT][ComCore.Ads.BannerFormats.FOOTER]="1604153520";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooDE]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooDE][ComCore.Ads.BannerFormats.LEADERBOARD]="6481302305";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooDE][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="4935821694";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooDE][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="4502450567";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooDE][ComCore.Ads.BannerFormats.SKYSCRAPER]="2650187430";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.YahooDE][ComCore.Ads.BannerFormats.FOOTER]="6053384152";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.MediaTotalNO]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.MediaTotalNO][ComCore.Ads.BannerFormats.LEADERBOARD]="4124773116";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.MediaTotalNO][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="9033480270";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.MediaTotalNO][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="6776633338";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.MediaTotalNO][ComCore.Ads.BannerFormats.SKYSCRAPER]="7492676214";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.MediaTotalNO][ComCore.Ads.BannerFormats.FOOTER]="3455952216";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.HimediaES]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.HimediaES][ComCore.Ads.BannerFormats.LEADERBOARD]="3332718712";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.HimediaES][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="9153495293";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.HimediaES][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="9073376688";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.HimediaES][ComCore.Ads.BannerFormats.SKYSCRAPER]="1324186802";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.HimediaES][ComCore.Ads.BannerFormats.FOOTER]="1627643505";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.CimediaPT]={};ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.CimediaPT][ComCore.Ads.BannerFormats.LEADERBOARD]="9464899566";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.CimediaPT][ComCore.Ads.BannerFormats.RECTANGLE_TOP]="3543831743";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.CimediaPT][ComCore.Ads.BannerFormats.RECTANGLE_BOTTOM]="6929871862";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.CimediaPT][ComCore.Ads.BannerFormats.SKYSCRAPER]="9405610177";ComCore.Ads.Google.fallbackChannels[ComCore.Ads.Saleshouses.CimediaPT][ComCore.Ads.BannerFormats.FOOTER]="5776932407";ComCore.Page.adsense={};ComCore.Page.adsense.rectangle={iframe:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.RECTANGLE_TOP);<\/script>',_eoo:true};ComCore.Page.adsense.footer={iframe:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.FOOTER);<\/script>',_eoo:true};ComCore.Page.adsense.skyscraper={iframe:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.SKYSCRAPER);<\/script>',_eoo:true};ComCore.Page.tags={};ComCore.Page.tags.rm={rectangle:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.RECTANGLE_TOP);<\/script>',footer:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.FOOTER);<\/script>',skyscraper:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.SKYSCRAPER);<\/script>',_eoo:true};Object.extend(ComCore,{Login:{getUserID:function(){return parseInt(ComCore.Login.userID,10)},getTopUserID:function(){return parseInt(ComCore.Login.topUserID,10)},getTopNickname:function(){return ComCore.Login.topNickname},getNickname:function(){return ComCore.Login.nickname},isAdmin:function(){return ComCore.Login._isAdmin},isBetaTester:function(){return ComCore.Login._isBetaTester},isPremium:function(){return ComCore.Login._isPremium},getCountry:function(){return ComCore.Login.country},getUserStatus:function(){return ComCore.Login.user_status},getUserType:function(){return ComCore.Login.userType},isLoggedIn:function(){return !(isNaN(ComCore.Login.getUserID())||(ComCore.Login.getUserID()<=0))},_eoo:true},TopLogin:{getUserID:function(){return parseInt(ComCore.Login.topUserID,10)},getNickname:function(){return ComCore.Login.topNickname},_eoo:true}});ComCore.BootLoader=Class.create();ComCore.BootLoader.prototype={showDebug:true,initialize:function(A){this.head=$(document.getElementsByTagName("head")[0]);this.config=Object.extend({injectClass:"injected",replaceInjections:true,forceTriggersReload:true},A)},load:function(C,B,D){this.clearTagsForLowerLevels("link",C.bootload.level);this.loadStylesheets(C.bootload.css,false);if(D){D.replace(C.payload)}else{$(B.contentWrapper).replace(C.payload)}this.applyBodyStyles(C.bootload.body,C.bootload.language);ComCore.Queuer.enable();try{this.loadJavascripts(C.bootload.js,false,ComCore.Queuer.execute)}catch(A){ComCore.Queuer.execute()}this.loadFeeds(C.bootload.feeds);this.applyMetaData(C.bootload.title,C.bootload.description,C.bootload.keywords);this.addCustomHead(C.bootload.head);return true},applyBodyStyles:function(A,C){var B=$(document.body);if(B){if(A.id){B.setAttribute("id",A.id)}B.className="yesJS";if(A.classes){B.addClassName(A.classes)}if(C.direction){B.addClassName(C.direction)}}},applyMetaData:function(E,A,D){document.title=E;var C=$$('meta[name="description"]').first();if(C){C.setAttribute("content",A)}else{if(this.head){this.head.insert('<meta name="description" content="'+A+'" />')}}var B=$$('meta[name="keywords"]').first();if(B){B.setAttribute("content",D)}else{if(this.head){this.head.insert('<meta name="keywords" content="'+D+'" />')}}},addCustomHead:function(E){this.removeCustomHead();var B;if(E!==""){var C=/Safari/.test(navigator.userAgent);var A=$(document.getElementsByTagName("head")[0]);if(C===true){B=new Element("div");B.innerHTML=E}else{B=Element.extend(document.createElement("head"));B.update(E)}var D=B.childElements();if(D.length>0){D.invoke("addClassName","extraHead")}A.insert(B.innerHTML)}},removeCustomHead:function(){var A=$$("head .extraHead");if(A){A.invoke("remove")}},loadStylesheets:function(A,B,C){debug("stylesheets to load:");debug(A);A.each(function(D){this.loadStylesheet(D,B)},this);if(C){C()}},loadStylesheet:function(C,D,G){var F=this.getStaticPath(C.name);var E=$$('link[href="'+F+'"]');var A=E&&E.length;if(!A||(A&&D)){var B=Element.extend(document.createElement("link"));B.setAttribute("rel","stylesheet");B.setAttribute("type","text/css");B.setAttribute("media","screen");B.setAttribute("href",F);B.addClassName("level_"+C.level);if(this.config.injectClass){B.addClassName(this.config.injectClass)}if(this.config.replaceInjections){debug("removing previous instances of stylesheet "+F);E.invoke("remove")}debug("adding stylesheet "+C.name);this.head.appendChild(B);if(G){G()}return true}if(G){G()}return false},loadJavascriptFiles:function(B,C,E,A){this.showDebug&&ComCore.Debug.group("ComCore.Bootloader.loadJavascriptFiles()",true);if((A!==undefined)&&(A!==false)&&(ComCore.Configuration.get("debug")===false)){B=[A]}var D=function(G){if((ComCore.Configuration.get("debug")===false)&&((/compiled_/).test(G)===false)){var F=G.split("/");F[F.length-1]="compiled_"+F[F.length-1];G=F.join("/")}this.showDebug&&ComCore.Debug.groupEnd();return G};this.loadJavascripts(B.collect(function(F){return{name:D(F)}}),C,E,false);this.showDebug&&ComCore.Debug.groupEnd()},loadJavascripts:function(A,D,E,F){if(F===undefined){F=true}this.showDebug&&ComCore.Debug.group("ComCore.Bootloader.loadJavascripts()",true);debug("javascripts to load:");debug(A);if(F===true){this.clearJavascriptInjections()}var C=0;var B=A.length;if(B>0){var G=function(){C++;if(C===B){debug("All javascript files have been loaded");if(Object.isFunction(E)){E()}}};A.each(function(H){this.loadJavascript(H,D,G)},this)}else{if(Object.isFunction(E)){E()}}this.showDebug&&ComCore.Debug.groupEnd()},loadJavascript:function(C,D,G){this.showDebug&&ComCore.Debug.group("ComCore.BootLoader.loadJavascript("+C.name+", "+D+")",true);var F=this.getStaticPath(C.name);var B=$$('script[src="'+F+'"]');var A=B&&B.length;if(this.config.forceTriggersReload&&C.name.toLowerCase().indexOf("/triggers/")>0){debug("force reloading "+C.name+" since it is a trigger js file");D=true}if(!A||(A&&D)){var E=Element.extend(document.createElement("script"));E.setAttribute("language","javascript");E.setAttribute("type","text/javascript");E.setAttribute("src",F);if(this.config.injectClass){E.addClassName(this.config.injectClass)}if(this.config.replaceInjections){debug("removing previous instances of script "+F);B.invoke("remove")}if(!Prototype.Browser.IE){E.observe("load",function(){if(Object.isFunction(G)){G()}})}else{E.onreadystatechange=function(){if((E.readyState==="complete"||E.readyState==="loaded")&&Object.isFunction(G)){G()}}}debug("adding javascript "+C.name);this.head.appendChild(E);this.showDebug&&ComCore.Debug.groupEnd();return true}else{if(Object.isFunction(G)){G()}}this.showDebug&&ComCore.Debug.groupEnd();return false},loadFeeds:function(A,B,C){this.clearFeedInjections();A.each(function(D){this.loadFeed(D.url,D.type,D.title,B)},this);if(C){C()}},loadFeed:function(D,A,B,C,F){var E=this.getPath(D);var H=$$('link[href="'+E+'"]');var I=H&&H.length;if(!I||(I&&C)){var G=Element.extend(document.createElement("link"));G.setAttribute("rel","alternate");G.setAttribute("href",E);G.setAttribute("type",A);G.setAttribute("title",B);if(this.config.injectClass){G.addClassName(this.config.injectClass)}debug("adding feed "+E);if(this.config.replaceInjections){debug("removing previous instances of feed "+E);H.invoke("remove")}this.head.appendChild(G);if(F){F()}return true}if(F){F()}return false},clearStylesheetInjections:function(){this.clearInjections('link[rel="stylesheet"]')},clearJavascriptInjections:function(){this.clearInjections("script")},clearFeedInjections:function(){this.clearInjections('link[rel="alternate"]')},clearInjections:function(A,C){if(this.config.injectClass){var B=$$(A+"."+this.config.injectClass);debug("removing injected "+A+" tags");B.invoke("remove")}},clearTagsForLowerLevels:function(A,C){var B=$$(A);debug("removing "+A+" tags");B.each(function(D){var E=D.getClassData("level");if(E&&E>C){debug("removing...",D);D.remove()}})},getStaticPath:function(A){return ComCore.Configuration.get("staticURL")+A},getPath:function(A){return ComCore.Configuration.get("rootURL")+"/"+A},_eoo:true};ComCore.BootLoader=new ComCore.BootLoader();