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);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,C.bootload.loggedin);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,D,F){var C=$(document.body);if(C){if(A.id){C.setAttribute("id",A.id)}var E="";if(C.hasClassName("adWallpaper")){E+=" adWallpaper"}var E="";if(C.hasClassName("rtl")){E+=" rtl"}var B="distro_"+ComCore.Page.get("distro");if(C.hasClassName(B)){E+=" "+B}C.className="yesJS";if(A.classes){C.addClassName(A.classes)}if(!F){C.addClassName("loggedOut")}C.addClassName(E)}},applyMetaData:function(E,A,D){if(E){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)&&(G.substr(0,4)!="http")){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()},loadOrderedJavascripts:function(A,C,E){this.loadedCounter=0;var D=this;var B=function(){if(D.loadedCounter<A.length){var F=A[D.loadedCounter];D.loadJavascript({name:F},C,B);D.loadedCounter+=1;return }E()};B(0)},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(E,F,I){this.showDebug&&ComCore.Debug.group("ComCore.BootLoader.loadJavascript("+E.name+", "+F+")",true);if(E.name.substr(0,4)!="http"){var K=this.getStaticPath(E.name)}else{var K=E.name}var A=$$('script[src="'+K+'"]');var C=A&&A.length;var H=function(L){L.addClassName("loaded");if(Object.isFunction(I)){I()}};var J=(this.config.forceTriggersReload&&(E.name.toLowerCase().indexOf("class.")===-1)&&(E.name.toLowerCase().indexOf("mediaviewer")===-1));if(C&&!F&&!J){var G=A.findAll(function(L){return !L.hasClassName("loaded")&&L.hasClassName("injected")});var D=A.findAll(function(L){return L.hasClassName("loaded")||!L.hasClassName("injected")});G.each(function(M){if(!M.hasClassName("loaded")){if(!Prototype.Browser.IE){M.observe("load",H.bind(this,M))}else{var L=M.onreadystatechange;M.onreadystatechange=function(){if((M.readyState==="complete"||M.readyState==="loaded")){H(M)}if(L&&Object.isFunction(L)){L()}}}}});D.each(function(){if(Object.isFunction(I)){I()}})}if(J){debug("force reloading "+E.name+" since it is a trigger js file");F=true}if(!C||(C&&F)){var B=Element.extend(document.createElement("script"));B.setAttribute("language","javascript");B.setAttribute("type","text/javascript");B.setAttribute("src",K);if(this.config.injectClass){B.addClassName(this.config.injectClass)}if(this.config.replaceInjections){debug("removing previous instances of script "+K);A.invoke("remove")}if(!Prototype.Browser.IE){B.observe("load",H.bind(this,B))}else{B.onreadystatechange=function(){if((B.readyState==="complete"||B.readyState==="loaded")){H(B)}}}debug("adding javascript "+E.name);this.head.appendChild(B);this.showDebug&&ComCore.Debug.groupEnd();return true}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();function debug(){for(var A=0;A<arguments.length;A++){ComCore.Debug.log(arguments[A])}}Array.prototype.shuffle=function(){for(var C,B,A=this.length;A;C=parseInt(Math.random()*A),B=this[--A],this[A]=this[C],this[C]=B){}};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}};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){}}},fixAvatar:function(B,D,A){var C=new Ajax.Request(ComCore.Page.getContextURL()+"/ajax/debug/action=fixAvatar","userID="+B+"&hash="+D+"&url="+encodeURIComponent(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+="/go"}return A},getOwnerContextURL:function(){return"/go"},_eoo:true};ComCore.Profile={};ComCore.trackEvent=function(E,A,B,F){try{if(!window._gaq){return }var D=window._gaq;if(!D){return }if(!F){F=1}if(!B){B="label"}debug("[track event] category:"+E+" action:"+A+" label:"+B+" value:"+F);window._googleTrackers.each(function(G){D.push([G+"._trackEvent",E,A,B,F])})}catch(C){debug("error in trackevent: ");debug(C)}};ComCore.Message={_hide:function(){var A=$A(arguments);if(A.size()>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}}}};ComCore.Queuer={functions:[],add:function(A,B){ComCore.Queuer._add(A,B)},disable:function(){ComCore.Queuer.add=function(A){A()}},addEnsureLoaded:function(A){if((document.loaded===true)&&A){A()}else{document.observe("dom:loaded",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)+(B?"&getNewToken=1":"")},onInvalidToken:function(B,A){if(this.showStandardMessage){ComCore.MessageBox.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}};ComCore.OpenSocialList={};ComCore.pageLoaded=false;var isPageLoaded=function(){return ComCore.pageLoaded};function printStackTrace(){var H=[];var B=false;try{A.dont.exist+=0}catch(E){if(E.stack){return E.stack}else{if(window.opera&&E.message){var I=E.message.split("\n");for(var A=0,D=I.length;A<D;A++){if(I[A].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var G=I[A];if(I[A+1]){G+=" at "+I[A+1];A++}H.push(G)}}H.shift();B=true}}}if(!B){var C=arguments.callee.caller;while(C){var F=C.toString();H.push(F);C=C.caller}}return H.join(" ")}window.onerror=function(G,C,F){if(ComCore.configValues.jsPostErrors===true){var D="";if(ComCore.Debug.errorCount){D+="count="+ComCore.Debug.errorCount}else{D+="count=1"}if(G){D+="&message="+encodeURIComponent(G)}if(C){D+="&script_url="+encodeURIComponent(C)}if(F){D+="&lno="+F}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;var E=new Ajax.Request(ComCore.Page.getContextURL()+"/ajax/debug/action=postJavaScriptError",{parameters:D})}};window.windowLoaded=false;Event.observe(window,"load",function(){window.windowLoaded=true});ComCore.CssRules={add:function(B,D){var A=document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css";A.appendChild(C);if(C.styleSheet){if(C.styleSheet.cssText===""){C.styleSheet.cssText=""}C.styleSheet.cssText+=B+" { "+D+" }"}else{C.appendChild(document.createTextNode(B+" { "+D+" }"))}},_eoo:true};function comcoreLoadScriptInline(A,B){var C=new Element("script",{src:A,type:"text/javascript"});document.getElementsByTagName("head")[0].appendChild(C);if(document.loaded){B()}else{document.observe("dom:loaded",B)}return C}ComCore.Ads={};if(Prototype.Browser.IE&&!Prototype.Browser.IE8){Element.Methods.insert=Element.Methods.insert.wrap(function(A,B,C){if((document.loaded!==true)&&(B===document.body)){if(window.onerror){window.onerror("Operation aborted",window.location.href,0,true)}return function(){}}return A(B,C)})}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)}}}};A.send(C)},init:function(){return this.getHTTPObject()}};ComCore.bubbleManager=null;ComCore.BubbleManager=Class.create();ComCore.BubbleManager.prototype={initialize:function(){this.showBubbleTime=30000;this.maxBubbles=4;this.effectIntervalMilliseconds=2000;this.effectIntervalSeconds=2;this.bubbleCounter=0;var A=$("chatList");this.bubble=$("bubble");if(A&&A.visible()){this.bubble.setStyle({width:"160px"})}try{this.showBubbleGuestbook=showBubbleGuestbook;this.showBubbleBlog=showBubbleBlog;this.showBubblePhoto=showBubblePhoto;this.showBubbleBirthday=showBubbleBirthday;this.showBubbleFriendship=showBubbleFriendship;this.showBubblePm=showBubblePm;this.showBubbleClan=showBubbleClan;this.showBubbleVideo=showBubbleVideo;this.showBubbleQuote=showBubbleQuote;this.showBubbleEvent=showBubbleEvent;this.showBubblePartner=showBubblePartner;this.showBubbleLink=showBubbleLink;this.showBubbleFriendsOnline=showBubbleFriendsOnline;this.showBubbleNewVisitor=showBubbleNewVisitor;this.showBubblePhotoFriend=showBubblePhotoFriend}catch(B){}},updateCounters:function(G,I,A,F){var D=this;var C=function(K){if(typeof (Effect)!=="undefined"){var J=new Effect.Highlight(K,{startcolor:"#ffffff",endcolor:"#cc0000",duration:D.effectIntervalSeconds})}};var E=$("messageCount");if(E&&(parseInt(E.innerHTML,10)!==parseInt(G,10))){if(parseInt(G,10)<=0){E.hide()}else{E.update(G).show();higlight(E)}}var B=$("notificationCount");if(B&&(parseInt(B.innerHTML,10)!==parseInt(I,10))){if(parseInt(I,10)<=0){B.hide()}else{B.update(I).show();higlight(B)}}var H=$("friendCount");if(H&&(parseInt(H.innerHTML,10)!==parseInt(A,10))){if(parseInt(A,10)<=0){H.hide()}else{H.update(A).show();higlight(H)}}},renderBubbles:function(D){var B={NEWFRIENDSTARTED:{f:this.showBubbleFriendship},FRIENDSTOPPED:{f:this.showBubbleFriendship},NEWFRIENDACCEPTED:{f:this.showBubbleFriendship},NEWFRIENDREGISTERED:{f:this.showBubbleFriendship},NEWEMAILCONTACTREGISTERED:{f:this.showBubbleFriendship},NEWFRIENDFROMINVITATION:{f:this.showBubbleFriendship},NEWFRIENDDENIED:{f:this.showBubbleFriendship},FRIENDRESTARTED:{f:this.showBubbleFriendship},LOVESTATERELATIONWITHYOU:{f:this.showBubbleFriendship},NEWGUESTBOOK:{f:this.showBubbleGuestbook},NEWQUEUEDGUESTBOOK:{f:this.showBubbleGuestbook},NEWCOMMENTONBLOG:{f:this.showBubbleBlog},NEWQUEUEDCOMMENTONBLOG:{f:this.showBubbleBlog},NEWCOMMENTONPHOTO:{f:this.showBubblePhoto},NEWQUEUEDCOMMENTONPHOTO:{f:this.showBubblePhoto},PHOTONOTEUSERMARKED:{f:this.showBubblePhoto},PHOTOCONFIRMED:{f:this.showBubblePhoto},NEWCOMMENTONVIDEO:{f:this.showBubbleVideo},NEWQUEUEDCOMMENTONVIDEO:{f:this.showBubbleVideo},VIDEOACTIVATED:{f:this.showBubbleVideo,picture:0},VIDEOERROR:{f:this.showBubbleVideo,picture:0},VIDEODUPLICATE:{f:this.showBubbleVideo,picture:0},VIDEODENIED:{f:this.showBubbleVideo,picture:0},NEWGUESTBOOKCOMMENTQUOTE:{f:this.showBubbleQuote},NEWBLOGCOMMENTQUOTE:{f:this.showBubbleQuote},NEWPHOTOCOMMENTQUOTE:{f:this.showBubbleQuote},NEWVIDEOCOMMENTQUOTE:{f:this.showBubbleQuote},EVENTACTIVATED:{f:this.showBubbleEvent,picture:0},EVENTDENIED:{f:this.showBubbleEvent,picture:0},EVENTATTENDINGTOMORROW:{f:this.showBubbleEvent,picture:0},BIRTHDAYTOMORROW:{f:this.showBubbleBirthday},BIRTHDAYTODAY:{f:this.showBubbleBirthday},PARTNERDELETED:{f:this.showBubblePartner,picture:0},APPLICATION:{f:this.showBubblePartner,picture:0},NEWPRIVATEMESSAGE:{f:this.showBubblePm},SHOUTMENTION:{f:this.showBubblePm},WHITELISTADD:{f:this.showBubblePm},NEWHELPDESKTICKET:{f:this.showBubblePm},ONLINEFRIEND:{f:this.showBubbleFriendsOnline},NEWVISITOR:{f:this.showBubbleNewVisitor},NEWCOMMENTONLINK:{f:this.showBubbleLink},NEWQUEUEDCOMMENTONLINK:{f:this.showBubbleLink},NEWLINKCOMMENTQUOTE:{f:this.showBubbleLink},CREDITSBOUGHT:{f:this.showBubblePm},PREMIUMEXPIRES7:{f:this.showBubblePm},PREMIUMEXPIRES3:{f:this.showBubblePm},PREMIUMEXPIRES1:{f:this.showBubblePm},PREMIUMSTOPPED:{f:this.showBubblePm},NOTIFICATION_BUBBLE_FRIEND_PHOTO_VIDEO_UPLOAD:{f:this.showBubbleLink}};for(var E=0,H=D.length;E<H;E++){var A=D[E];var I=A.type;var F=A.nickname;var C=A.pictureURL?'<img class="avatar" src="'+A.pictureURL+'" alt="'+F+'" />':"";var G=A.body;var K=A.id;var J="/logs/notifications/notificationID="+K;if((B[I]!==undefined)&&(B[I].f===true)){this.showBubble(J,(B[I].picture===undefined)?C:0,G,this.showBubbleTime)}else{ComCore.Debug.error("Unknown type or user doesn't want this (type: "+I+")")}}},showBubble:function(I,C,D,H,G){this.bubbleCounter++;var A=this.bubbleCounter;var F=$("bubble");if(F===null){return }if(ComCore.Configuration.get("bubblesPoller","enabled")===false){var E=($$("#chatConversationWindows .window").findAll(function(K){return K.visible()}).length>0);var B=E?150:180;html='<div class="clearfix" id="bubble'+A+'" style="display:none; width: '+B+'px">'}else{html='<div class="clearfix" id="bubble'+A+'" style="display:none;">'}html+='<div class="closeBubble" id="closeBubble'+A+'"><img class="icon iconCloseAlt" src="'+ComCore.Configuration.get("staticURL")+'//s/i/common/blank.gif" alt="" /></div>';if(C!=="0"){html+=C}html+='<p class="smiley">'+D+"</p></div>";$(F).insert({top:html});this.newBubble=$("bubble"+A);this.newBubble.observe("click",(function(K){if(G){debug("executing onClickFunction()");G(K);Element.remove("bubble"+A)}else{this.bubbleAction(I,A)}}).bind(this));this.closeBubble=$("closeBubble"+A);this.closeBubble.observe("click",function(K){Element.remove("bubble"+A);Event.stop(K)});this.newBubble.observe("mouseover",function(){$("closeBubble"+A).show()});this.newBubble.observe("mouseout",function(){$("closeBubble"+A).hide()});$(this.closeBubble).hide();if(this.bubbleCounter>this.maxBubbles){var J=(this.bubbleCounter-this.maxBubbles);Element.remove("bubble"+J)}if(typeof (Effect)!=="undefined"){Effect.Appear(this.newBubble,{duration:this.effectIntervalSeconds})}else{this.newBubble.show()}if(H!==0){window.setTimeout("ComCore.bubbleManager.hideBubble('bubble"+A+"')",H)}},bubbleAction:function(B,A){Element.remove("bubble"+A);var C="#utm_source=bubbles#utm_medium=bubbles#utm_campaign=bubbles";B=B+C;window.location=B},hideBubble:function(A){if($(A)){if(typeof (Effect)!=="undefined"){Effect.Fade(A,{duration:this.effectIntervalSeconds})}else{$(A).hide()}}},removeBubble:function(B){var A=$(B);if(A){A.remove()}}};document.observe("dom:loaded",function(){ComCore.bubbleManager=new ComCore.BubbleManager()});var V5Poll=Class.create({initialize:function(C,A){this.suffix=C||"";this.formView=$("pollForm"+this.suffix);this.resultsView=$("pollResults"+this.suffix);this.options=Object.extend({autoSubmit:false},A);if(!this.formView){return }this.form=this.formView.down("form");if(!this.form){return }if(!this.options.autoSubmit){this.form.observe("submit",this.onVote.bindAsEventListener(this))}else{var B=this;this.form.select('input[type="radio"]').each(function(D){D.observe("click",B.onVote.bindAsEventListener(B))})}this.showResultsLink=this.formView.select("a.showResults").first();this.showFormLink=this.resultsView.select("a.showForm").first();this.refreshPollButton=this.resultsView.select("input.refreshPoll").first();if(this.showResultsLink){this.showResultsLink.observe("click",this.onShowView.bindAsEventListener(this))}if(this.showFormLink){this.showFormLink.observe("click",this.onShowView.bindAsEventListener(this))}if(this.refreshPollButton){this.refreshPollButton.observe("click",this.onRefresh.bindAsEventListener(this))}if($("openAnswerText"+this.suffix)){this.enableOpenAnswerText(false);$("openAnswerText"+this.suffix).observe("click",this.onOpenAnswerTextClicked.bindAsEventListener(this,true));this.form.select('input[type="radio"]').invoke("observe","click",this.onOptionChanged.bindAsEventListener(this));this.moreOptionsLink=this.formView.select("li.moreOptions a").first();if(this.moreOptionsLink){this.moreOptionsLink.observe("click",this.onShowMoreOptionsClicked.bindAsEventListener(this))}}this.formView.select("li .photo a").invoke("observe","click",this.onShowOriginalPhoto.bindAsEventListener(this));this.resultsView.select("li .photo a").invoke("observe","click",this.onShowOriginalPhoto.bindAsEventListener(this))},showActionState:function(A){debug("Poll.showActionState()");ComCore.ActionStates.show(A,"pollActionStates"+this.suffix)},hideActionStates:function(){ComCore.ActionStateMessage.hide()},onShowMoreOptionsClicked:function(C){C.stop();C.element().up().hide();this.formView.select("li.more").invoke("removeClassName","more");var D={action:"getTopAnswers",pollID:Form.Element.getValue(this.form.pollid),pollOwnerID:Form.Element.getValue(this.form.pollownerid)};var A=this.onTopAnswersLoaded.bind(this);ComCore.LoadingIndicator.show();this.disable();var B=new Ajax.Request(ComCore.Page.buildAjaxURL("polls"),{method:"post",parameters:D,onSuccess:function(F,E){A(E)}})},onTopAnswersLoaded:function(C){ComCore.LoadingIndicator.hide();this.enable();if(C.success===true){var B=C.topAnswers;var A=new Autocompleter.Local("openAnswerText"+this.suffix,"openAnswerAutoComplete"+this.suffix,B,{fullSearch:true})}},onOpenAnswerTextClicked:function(A){A.stop();$("openAnswerRadio"+this.suffix).checked=true;this.enableOpenAnswerText(true);this.hideActionStates()},onOptionChanged:function(A){this.hideActionStates();this.enableOpenAnswerText(A.element().getAttribute("value")==="OPEN")},enableOpenAnswerText:function(A){$("openAnswerText"+this.suffix).setOpacity(A?1:0.65);if(A){$("openAnswerText"+this.suffix).focus()}},enable:function(){this.form.enable();if(this.refreshPollButton){this.refreshPollButton.enable()}},disable:function(){this.form.disable();if(this.refreshPollButton){this.refreshPollButton.disable()}},onRefresh:function(C){var D={action:"refresh",pollID:Form.Element.getValue(this.form.pollid),pollOwnerID:Form.Element.getValue(this.form.pollownerid)};var A=this.onRefreshed.bind(this);ComCore.LoadingIndicator.show();this.disable();var B=new Ajax.Request(ComCore.Page.buildAjaxURL("polls"),{method:"post",parameters:D,onSuccess:function(F,E){A(E)}})},onRefreshed:function(A){if(A.success===true){this.updateResults(A.pollUpdate);this.sortResults()}ComCore.LoadingIndicator.hide();this.enable()},onShowOriginalPhoto:function(D){D.stop();ComCore.Dialog.initialize();ComCore.Dialog.options.width=545;var A="";try{A=D.element().up("form").down('input[name="pollownerid"]');if(A instanceof Element){A="&pollOwnerID="+A.value}else{A=""}}catch(C){debug(C)}var B=ComCore.Page.buildAjaxURL("polls","getOriginalPhotoHTML")+"&photoID="+D.element().getAttribute("rel")+A;ComCore.Dialog.getContent(B)},onShowView:function(A){A.stop();this[A.element().hasClassName("showResults")?"showResultsView":"showFormView"]()},showResultsView:function(){this.formView.hide();this.resultsView.show()},showFormView:function(){this.resultsView.hide();this.formView.show()},onVote:function(D){D.stop();var A=this.formView.select('input:checked[type="radio"][name="optionid"]').pluck("value");if(A&&A.size()>0){if(A.first()==="OPEN"&&$("openAnswerText"+this.suffix).value.trim().length<1){$("openAnswerText"+this.suffix).setValue("");$("openAnswerText"+this.suffix).focus();this.hideActionStates();this.showActionState("emptyOpenAnswerWarning")}else{var E=this.form.serialize(true);var B=this.onVoted.bind(this);this.disable();ComCore.LoadingIndicator.show();var C=new Ajax.Request(ComCore.Page.buildAjaxURL("polls"),{method:"post",parameters:E,onSuccess:function(G,F){B(F)}})}}else{this.showActionState("noOptionSelectedWarning")}},onVoted:function(A){debug("Poll.onVoted()");this.enable();ComCore.LoadingIndicator.hide();if(A.success===true){this.showResultsView();this.updateResults(A.pollUpdate);this.sortResults();if(this.showFormLink){this.showFormLink.hide()}if(this.options.voteSuccessCallback&&typeof this.options.voteSuccessCallback==="function"){this.options.voteSuccessCallback()}this.hideActionStates();this.showActionState("voteSuccess")}else{if(A.reason==="DUPLICATE"){this.showActionState("voteDuplicate")}else{if(A.reason==="NOT_LOGGED_IN"){this.showActionState("voteNotLoggedIn")}else{if(A.reason==="EMPTY_OPEN_ANSWER"){this.showActionState("emptyOpenAnswerWarning")}else{this.showActionState("voteError")}}}}},updateResults:function(D){var C=$("pollVoteCount"+this.suffix);if(C){C.update(D.voteCount)}var B=this.resultsView.select("ul").first();var A=$H(D.options);A.each(function(H){var F=H.key;var G=H.value;var E=$("pollResult"+F);if(!E){E=this.resultsView.select("li").first().cloneNode(true);E.setAttribute("id","pollResult"+F);E.select("strong").first().update(G.value);B.insert(E)}E.select(".result").first().setStyle({width:G.width+"%"});E.select(".voteCount").first().update(G.voteCount);E.select(".percentage").first().update(G.percentage+"%")},this)},sortResults:function(){var A=this.resultsView.select("ul").first();if(A){var C=function(E,D){return parseInt(D.select(".percentage").first().innerHTML.replace(/%/,""),10)-parseInt(E.select(".percentage").first().innerHTML.replace(/%/,""),10)};this.resultsView.select("li").last().removeClassName("last").addClassName("dimmedBorder");this.resultsView.select("li").collect(function(D){return D.remove()}).sort(C).each(function(D){A.insert(D)});if($("pollResultOTHER")){var B=$("pollResultOTHER").remove();A.insert(B)}this.resultsView.select("li").last().addClassName("last").removeClassName("dimmedBorder")}},_eoo:true});if(typeof deconcept=="undefined"){var deconcept={}}if(typeof deconcept.util=="undefined"){deconcept.util={}}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={}}deconcept.SWFObject=function(D,C,K,F,H,J,L,E,A,G){if(!document.getElementById){return }this.DETECT_KEY=G?G:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(D){this.setAttribute("swf",D)}if(C){this.setAttribute("id",C)}if(K){this.setAttribute("width",K)}if(F){this.setAttribute("height",F)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(J){this.addParam("bgcolor",J)}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(E)?E:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]||""},addParam:function(A,B){this.params[A]=B},getParams:function(){return this.params},addVariable:function(A,B){this.variables[A]=B},getVariable:function(A){return this.variables[A]||""},getVariables:function(){return this.variables},getVariablePairs:function(){var A=[];var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B]}return A},getSWFHTML:function(){var C="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}C='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+(this.getAttribute("style")||"")+'"';C+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var D=this.getParams();for(var A in D){C+=[A]+'="'+D[A]+'" '}var B=this.getVariablePairs().join("&");if(B.length>0){C+='flashvars="'+B+'"'}C+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}C='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+(this.getAttribute("style")||"")+'">';C+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var D=this.getParams();for(var A in D){C+='<param name="'+A+'" value="'+D[A]+'" />'}var B=this.getVariablePairs().join("&");if(B.length>0){C+='<param name="flashvars" value="'+B+'" />'}C+="</object>"}return C},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){D=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var C=1;var B=3;while(C){try{B++;C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);D=new deconcept.PlayerVersion([B,0,0])}catch(E){C=null}}}else{try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");D=new deconcept.PlayerVersion([6,0,21]);C.AllowScriptAccess="always"}catch(E){if(D.major==6){return D}}try{C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(C!=null){D=new deconcept.PlayerVersion(C.GetVariable("$version").split(" ")[1].split(","))}}}return D};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D==null){return C}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;ComCore.MediaViewerJSLoader=Class.create({initialize:function(A){debug("MEDIAVIEWERJSLOADER; Initiliased");this.wrapper=$(A.videoWrapperId);this.videoId=A.videoId;this.videoWidth=A.videoWidth||500;this.videoHeight=A.videoHeight||375;this.autoplay=A.autoplay||false;this.callback=A.callback||false;this.controls=A.controls||["like","share","rate","comments","next","preview","title","fullscreen"];this.timedTrackers=A.timedTrackers||false;this.increment=0;this.createElement();this.startObserving()},createElement:function(){debug("MEDIAVIEWERJSLOADER: createElement");if(this.wrapper&&this.videoId){var A=ComCore.Configuration.get("staticURL")+"/s/f/mediaviewer.swf";this.flashObject=new FlashObject(A,"flash",this.videoWidth,this.videoHeight,"10.0.0","#FFFFFF");this.flashObject.addParam("allowScriptAccess","always");this.flashObject.addParam("allowNetworking","all");this.flashObject.addParam("allowFullScreen","true");this.flashObject.useExpressInstall(ComCore.Configuration.get("staticURL")+"/s/f/expressinstall.swf");this.flashObject.addParam("wmode","opaque");var B=Object.toQueryString({videoID:this.videoId,autoplay:(this.autoplay)?"true":"false",controls:this.controls});this.flashObject.addParam("FlashVars",B);this.flashObject.write(this.wrapper);debug("MEDIAVIEWERJSLOADER: written flashel");this.flashElement=$("flash");if(this.callback){this.callback()}}},startObserving:function(){if(this.wrapper&&this.videoId){window.comcoreMediaViewerLoaded=this.onLoad.bind(this)}},observe:function(B,C){var A=B+"_"+this.increment;window[A]=C;this.flashElement.mediaviewer_observe(B,A,true);this.increment+=1},onLoad:function(){if(this.timedTrackers){this.timedTrackers.each(function(A){this.observe("mediaviewer_video_percentage"+A[0],A[1])},this)}},_eoo:true});ComCore.Ads.NetspotTracker=Class.create({Events:{VideoPlayStarted:"",Rated:"-1",Voted:"-2",Shared:"-3",ClickOut:"-4",UnforcedView:"-5",IframeLoaded:"-6",CloseOrContinue:"-7",VideoPlay10pct:"-90",VideoPlay20pct:"-91",VideoPlay30pct:"-92",VideoPlay40pct:"-93",VideoPlay50pct:"-94",VideoPlay60pct:"-95",VideoPlay70pct:"-96",VideoPlay80pct:"-97",VideoPlay90pct:"-98",VideoPlay100pct:"-99"},initialize:function(A){var B=this;this.clickUrl=A.clickUrl;this.trackerId="netspotTracker_"+encodeURIComponent(this.clickUrl);this.preview=(typeof A.preview!="undefined")?A.preview:false;this.tracker=false;this.pendingTracks=[];document.observe("dom:loaded",function(){B.tracker=new Element("div",{id:B.trackerId});document.body.appendChild(B.tracker);B.pendingTracks.each(function(C){this.trackEvent(C)},B)})},trackEvent:function(A){if(this.clickUrl!==false&&this.tracker!==false&&this.preview===false){this.tracker.insert(new Element("img",{id:this.trackerId+"_EventTracked"+A,src:this.clickUrl+A+"/http://pool.ads.netlog.com/datamine.gif?rand="+Math.round(Math.random()*10000000000)}));return true}else{this.pendingTracks.push(A);return false}},_eoo:true});ComCore.Ads.NetspotLight=Class.create({initialize:function(A){debug("NETSPOTLIGHT: init");this.divid=A.divid;this.view=A.view||false;this.domain=A.domain||false;this.rate=A.rate||false;this.videoid=A.videoid||false;this.share=A.share||false;this.type=A.type||false;this.pollid=A.pollid||false;this.linktext=A.linktext||false;this.linkurl=A.linkurl||false;this.viral=A.viral||false;this.title=A.title||false;this.clickurl=A.clickurl||false;this.timeout=A.timeout||10000;this.timeoutFailsafe=A.timeoutFailsafe||15000;this.continueSet=false;this.iframe=parent.document.getElementById(A.iframeId)||$(A.iframeId);this.tracker=new ComCore.Ads.NetspotTracker({version:"light",clickUrl:this.clickurl,preview:A.preview})},addContinue:function(){if(this.continueSet===false){this.continueSet=true;var D=$(this.divid);var C=this;if(D){this.tracker.trackEvent(this.tracker.Events.UnforcedView);var B=$("netspotLightContinueLink");if(B){debug(B);Event.observe("netspotLightContinueLink","click",function(){D.update("");C.tracker.trackEvent(C.tracker.Events.CloseOrContinue);$$(".contentRectangleLeft").each(function(F){F.setStyle({marginTop:"0px"})});$$(".contentRectangleRight").each(function(F){F.setStyle({marginTop:"0px"})});$$(".netspotLightMoveUpClass").each(function(F){F.setStyle({position:"static"});F.setStyle({marginTop:"0px"})});var E=$("netspotLightMoveUpWrapper");if(E){E.setStyle({position:"static"});E.setStyle({marginLeft:"0px"})}D.removeClassName("adNetspotLight").removeClassName("adNetspotLightPlay")})}var A=$("netspotLightContinueDiv");if(A){A.show()}}}},progressProgressBar:function(B,C,E){var A=parseInt(B.getStyle("width").substring(0,2),10)+5;B.setStyle({width:A+"%"});if(A<=95){debug("NETSPOTLIGHT: progressing ["+A+"%]");var D=this;window.setTimeout(function(){D.progressProgressBar(B,C,E)},500)}else{debug("NETSPOTLIGHT: setting continue button");B.setStyle({visibility:"hidden"});E.show();C.hide();this.addContinue()}},writeAd:function(){debug("NETSPOTLIGHT: writing ad");var B=this;var A="http://"+this.domain+"/go/external/netspot/view=lightv2&divid="+this.divid+"&domain="+this.domain+"&rate="+this.rate+"&videoid="+this.videoid+"&share="+this.share+"&type="+this.type+"&pollid="+this.pollid+"&viral="+this.viral+"&title="+this.title+"&preview="+this.preview+"&linktext="+encodeURIComponent(this.linktext)+"&linkurl="+encodeURIComponent(this.linkurl)+"&clickurl="+this.clickurl;comcoreLoadScriptInline(A,function(){window.setTimeout(function(){B.addContinue()},B.timeoutFailsafe)});debug("NETSPOTLIGHT: written ad")},ratingSuccess:function(){if(this.tracker){this.tracker.trackEvent(this.tracker.Events.Rated)}var A=$("netspotLightRatingArrow");if(A){A.down("div.rateLabelNotRated").hide();A.down("div.rateLabelRated").show();A.removeClassName("notRated").addClassName("rated")}},pollVotedSuccess:function(){this.tracker.trackEvent(this.tracker.Events.Voted)},_eoo:true});Object.extend(ComCore.Ads,{highImpactTaken:false,bannerMinHeight:50,BannerFormats:{LEADERBOARD:"LEADERBOARD",SKYSCRAPER:"SKYSCRAPER",RECTANGLE:"RECTANGLE",FOOTER:"FOOTER",SPLASH:"SPLASH",SELFSERVICE:"SELFSERVICE",SELFSERVICE_TOP:"SELFSERVICE_TOP",BIGBUTTON:"BIGBUTTON",MAXI_BRANDBUTTON:"MAXI_BRANDBUTTON",NETSPOTLIGHT:"NETSPOTLIGHT",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",STACK_FT_ARTISTS:"STACK_FT_ARTISTS",INTEGRATED_MESSAGES:"INTEGRATED_MESSAGES",INTEGRATED_LOGS:"LOGS_INTEGRATED",INTEGRATED_PROFILE_TOP:"INTEGRATED_PROFILE_TOP"},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,renderAd:function(A){A()},renderStack:function(D,C,B){var G=B.max||5;var H=B.extraClass||"";var F=$(C);if(!F){alert("2");F=parent.document.getElementById(C)}if(F&&D.length>0){D.shuffle();var E=D.splice(0,G);var A=new Element("ul",{"class":B.extraClass});E.each(function(I){A.insert(new Element("li").update(I.code))});F.insert(A);F.show();return true}return false},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(G,F){var D=false;if(F!==null&&typeof F=="string"){D=ComCore.Ads.Google.getFallbackChannel(F,G);if(D!==false){D=[D]}}switch(G.toUpperCase()){case ComCore.Ads.BannerFormats.LEADERBOARD:break;case ComCore.Ads.BannerFormats.RECTANGLE:ComCore.Ads.gafc.get("adRectangle",ComCore.Ads.BannerFormats.RECTANGLE,undefined,undefined,undefined,undefined,undefined,300,250);break;case ComCore.Ads.BannerFormats.FOOTER:ComCore.Ads.gafc.get("adFooter",ComCore.Ads.BannerFormats.FOOTER,undefined,undefined,undefined,undefined,undefined,728,90);break;case ComCore.Ads.BannerFormats.SKYSCRAPER:ComCore.Ads.gafc.get("adSkyscraper",ComCore.Ads.BannerFormats.SKYSCRAPER,undefined,undefined,undefined,undefined,undefined,160,600);break;case ComCore.Ads.BannerFormats.INTEGRATED_PROFILE_TOP:var C=1;var B="ProfileOneLiner";var A=[];var E=undefined;switch(ComCore.Ads.gafc.testgroup){case"TEST_1":C=1;B="ProfileOneLiner";A=["2281954698"];break;case"TEST_2":C=2;B="ProfileOneLiner";A=["9042753118"];break;case"TEST_3":C=1;B="InProfileOneLiner";A=["2257325898"];E={before:function(){$("adIntegratedProfileTop").hide()},after:function(){ComCore.Queuer.add(function(){comcoreMoveElementIntoProfile($("adIntegratedProfileTop"),"left",2,true);$("adIntegratedProfileTop").show()})}};break;case"TEST_4":C=2;B="InProfileOneLiner";A=["2204097944"];E={before:function(){$("adIntegratedProfileTop").hide()},after:function(){ComCore.Queuer.add(function(){comcoreMoveElementIntoProfile($("adIntegratedProfileTop"),"left",2,true);$("adIntegratedProfileTop").show()})}};break;case"TEST_5":C=1;B="InProfileOneLiner";A=["8557579866"];E={before:function(){$("adIntegratedProfileTop").hide()},after:function(){ComCore.Queuer.add(function(){comcoreMoveElementIntoProfile($("adIntegratedProfileTop"),"right",2,true);$("adIntegratedProfileTop").show()})}};break;case"TEST_6":C=2;B="InProfileOneLiner";A=["6749495400"];E={before:function(){$("adIntegratedProfileTop").hide()},after:function(){ComCore.Queuer.add(function(){comcoreMoveElementIntoProfile($("adIntegratedProfileTop"),"right",2,true);$("adIntegratedProfileTop").show()})}};break;case"TEST_24":C=1;B="ProfileOneLiner";A=["2803661030"];break;case"TEST_25":C=2;B="ProfileOneLiner";A=["0563224389"];break}ComCore.Ads.gafc.get("adIntegratedProfileTop",ComCore.Ads.BannerFormats.INTEGRATED_PROFILE_TOP,"text",C,B,A,E,false,false);break;default:window.onerror("Ads - illegal fallback format ["+G+"]","ComCore.Ads.getFallbackAd","174")}},getSaleshouseAd:function(A){if(typeof ComCore.Ads.sh[A]!==undefined){return ComCore.Ads.sh[A]}},writeFlashAd:function(C){var H=C.swfUrl;var B=C.adDiv;var D=C.width;var F=C.height;var E=C.flashvars||false;var A=C.backgroundColor||"#FFF";if(H&&B&&$(B)&&D&&F){if(B.indexOf("Dummy")<0){B=B+"Dummy"}var G=new FlashObject(H,"flashMovie",D,F,"9.0.0",A);G.addParam("allowScriptAccess","always");G.addParam("allowNetworking","all");G.useExpressInstall(ComCore.configValues.staticURL+"/s/f/expressinstall.swf");G.addParam("wmode","transparent");if(E){G.addParam("FlashVars",E)}G.write(B);return true}else{ComCore.Debug.error("MANDATORY FIELDS NOT SET: swfUrl: "+H);return false}},swapOut:function(A,C){var D=$(A);var E=$(C);if(D&&E){for(index=D.childNodes.length-1;index>=0;index--){var B=D.childNodes[index];if((B.nodeName=="SCRIPT")||(B.nodeName=="NOSCRIPT")){D.removeChild(B)}}D.parentNode.removeChild(D);E.parentNode.replaceChild(D,E);D.style.display="block"}else{if(!D){ComCore.Debug.error("element with id "+A+" does not exist")}if(!E){ComCore.Debug.error("element with id "+C+" does not exist")}}},_eoo:true});function comcoreSetNetspot(A,G,B,C,D,E){if(typeof document.getElementById(A)!==null){var F='<div class="adNetspotWrapper"><iframe src="http://'+B+"/external/embed/view=embeddedComponent&embedid="+G+"&clickurl="+E+'" id="netspotId" frameborder="0" scrolling="no" style="width:'+C+"px;height:"+D+'px;backgroundColor:#000;"></iframe><div class="adNetspotCloseWrapper clearfix"><a href="#" onclick="IABcloseAD();" class="right adNetspotClose">X Close</a></div></div>';document.getElementById(A).innerHTML=F;ComCore.Ads.highImpactTaken=true}}var comcoreSetNetVideo=function(H,A,C){window.IABopenAD=function(){return D()};var D=function(){if(!L.visible()){L.show()}};var I=function(){if(L.visible()){L.remove();comcoreSetNetVideo(H,A,true)}};var F="";var K="";var J="";var E="";var B=ComCore.configValues.language+".netlog.com";if(ComCore.Login){F=ComCore.Login.topUserID;K=ComCore.Login.gender;J=ComCore.Login.age;E=ComCore.Login.distro}var L=new Element("div",{id:"netvideoExpanded",style:"display:none;position:absolute;z-index:99;margin-top:-130px;"});var G=new Element("iframe",{src:"http://netspot.netlog.com/netspot.php?uid="+F+"&g="+K+"&a="+J+"&lang="+E+"&sid="+B+"&m=netvideo&i=&r="+Math.floor(Math.random()*1000000000)+"&spotID="+A,style:"width:980px;height:440px;",scrolling:"no",frameborder:"0"});L.update(G);L.insert(new Element("div",{id:"netvideoCloser","class":"adNetvideoCloseWrapper clearfix"}).update(new Element("a",{href:"#","class":"right adNetvideoClose"}).update("X Close")));L.observe("click",I);$(H).insert(L);if(!(C!==undefined&&C===true)){$(H).onmouseover=D}ComCore.Ads.highImpactTaken=true};function comcoreSetNetspotLightV2(L,M,B,H,E,P,K,I,O,D,J,N,G,F,A){ComCore.CssRules.add(".contentRectangleLeft","margin-top:-100000px;");ComCore.CssRules.add(".contentRectangleRight","margin-top:-100000px;");ComCore.CssRules.add(".netspotLightMoveUpClass","position:absolute;margin-top:-100000px;");var C={divid:L,view:M,domain:B,rate:H,videoid:E,share:P,type:K,pollid:I,linktext:O,linkurl:D,viral:J,title:N,clickurl:G};ComCore.Ads.netspotLight=new ComCore.Ads.NetspotLight(C);ComCore.Ads.netspotLight.writeAd();ComCore.Ads.highImpactTaken=true}var comcoreGetProfileBackground=function(A){if(ComCore.Page.pageSection.indexOf("profile")===0){var B="";var C="content";switch(A){case"backgroundImage":B=document.getElementById(C).style.backgroundImage;break;case"backgroundColor":B=document.getElementById(C).style.backgroundColor;break;case"backgroundRepeat":B=document.getElementById(C).style.backgroundRepeat;break;case"backgroundPosition":B=document.getElementById(C).style.backgroundPosition;break}return B}return false};var comcoreSetSkin=function(A,C){var B="";if(C){B=C+"/"}if(ComCore.pageLoaded&&ComCore.Login.isLoggedIn()){B+=ComCore.Configuration.get("rootURL")+"/"+ComCore.Login.topNickname}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};var comcoreSetProfileBackground=function(A,B,D,C){if(ComCore.Page.pageSection.indexOf("profile")===0&&$("content")){if(A){$("content").style.backgroundImage="url('"+A+"')"}if(B){$("content").style.backgroundColor=B}if(D){$("content").style.backgroundImage=D}if(C){$("content").style.backgroundImage=C}}};function comcoreSetHomepageTakeover(width,backgroundColor,backgroundImage,repeat,url){document.body.className+=" adWallpaper";var adSuperleaderboard=$("adLeaderboard");adSuperleaderboard.width=width;adSuperleaderboard.className="ad adSuperLeaderboard";adSuperleaderboard.style.backgroundColor=backgroundColor;adSuperleaderboard.style.textAlign="center";if(backgroundImage=="<ADHESE_SWF_SRC_2ND>"){backgroundImage=null}var wallpaper=$("wallpaper");wallpaper.style.backgroundColor=backgroundColor;if(backgroundImage!==null){wallpaper.style.backgroundImage="url("+backgroundImage+")";wallpaper.style.backgroundPosition="top center";wallpaper.style.backgroundRepeat=repeat;wallpaper.style.backgroundPosition="center 34px";adSuperleaderboard.style.backgroundImage="url("+backgroundImage+")";adSuperleaderboard.style.backgroundPosition="top center";adSuperleaderboard.style.backgroundRepeat=repeat;if(typeof (url)!="undefined"&&url!==null&&url.indexOf("http")==0){contentWrapper.observe("click",function(evt){if(evt.element().getAttribute("id")=="contentWrapper"){if(url.indexOf("javascript:")==0){eval(url.substring(11,url.length))}else{window.open(url)}}})}}}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%";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)}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=setInterval(B.updateTimer,1000)};B.stopTimeout=function(){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()};for(var C=0;C<B.closer.length;C++){B.closer[C].onclick=function(){B.closeSplash();return false}}B.updateTimer();ComCore.Ads.highImpactTaken=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};function google_afs_request_done(A){ComCore.Ads.GAFS.renderAds(A);return true}ComCore.Page.adsense={rectangle:{iframe:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.RECTANGLE);<\/script>'},footer:{iframe:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.FOOTER);<\/script>'},skyscraper:{iframe:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.SKYSCRAPER);<\/script>'}};ComCore.Page.tags={rm:{rectangle:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.RECTANGLE);<\/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>',integrated_profile_top:'<script type="text/javascript">ComCore.Ads.getFallbackAd(ComCore.Ads.BannerFormats.INTEGRATED_PROFILE_TOP);<\/script>'},sh:{}};ComCore.Ads.GAFC=Class.create({blocked:{explore:{games:[ComCore.Ads.BannerFormats.FOOTER],profile:[ComCore.Ads.BannerFormats.FOOTER],deals:[ComCore.Ads.BannerFormats.RECTANGLE],explore:[ComCore.Ads.BannerFormats.FOOTER]},logs:{other:[ComCore.Ads.BannerFormats.FOOTER,ComCore.Ads.BannerFormats.INTEGRATED_LOGS]},messages:{other:[ComCore.Ads.BannerFormats.RECTANGLE]},profile:{other:[ComCore.Ads.BannerFormats.SKYSCRAPER,ComCore.Ads.BannerFormats.SELFSERVICE,ComCore.Ads.BannerFormats.SELFSERVICE_TOP]},home:{search:[ComCore.Ads.BannerFormats.FOOTER]}},textOnlyCountries:["SA","BE","AE","CH","AT","PT","EG"],textOnlyFormats:[ComCore.Ads.BannerFormats.SELFSERVICE,ComCore.Ads.BannerFormats.SELFSERVICE_TOP,ComCore.Ads.BannerFormats.INTEGRATED_MESSAGES,ComCore.Ads.BannerFormats.INTEGRATED_LOGS,ComCore.Ads.BannerFormats.INTEGRATED_PROFILE_TOP],initialize:function(A){this.skip=0;this.queue=[];this.channels=A.channels||{};this.age=parseInt(A.age,10)||undefined;this.gender=A.gender;this.country=A.country||false;this.module=A.module;this.submodule=A.submodule;this.testgroup=A.testgroup;this.google_ad_client=A.pubid||"pub-9756091228569145";this.google_ad_output="js";this.google_safe="high";this.google_feedback="on";this.google_encoding="utf8";this.google_ad_section="standard";this.google_adtest=A.adtest},isBlocked:function(C){if(this.module&&this.submodule){var A=this.module;var B=this.submodule;if(this.blocked[A]){if(!this.blocked[A][B]){B="other"}if(this.blocked[A][B].indexOf(C)>=0){return true}}}return false},getCustAge:function(){if(this.age!==undefined){ages=[[17,1000],[24,1001],[34,1002],[44,1003],[54,1004],[64,1005],[999,1006]];for(var A=ages.length-1;A>=0;A--){if(this.age<=ages[A][0]){return ages[A][1]}}}return age},getCustGender:function(){if(this.gender!==undefined){return(this.gender==="MALE")?1:2}return""},getChannels:function(A){if(typeof this.channels[A]!=="undefined"){return this.channels[A]}return[]},getLanguage:function(){var A="en";if(ComCore.configValues.language==="zh"){A="zh-CN"}else{if(["ar","bg","zh","hr","da","nl","en","de","el","he","hu","it","ja","ko","no","pl","pt","ro","ru","sr","sk","es","sv","th","tr"].indexOf(ComCore.configValues.language)){A=ComCore.configValues.language}}return A},getType:function(A){if(((this.textOnlyCountries.indexOf(this.country)>=0)&&!(this.module==="profile"&&A===ComCore.Ads.BannerFormats.FOOTER))||(this.textOnlyFormats.indexOf(A)>=0)||(this.module===this.submodule&&A===ComCore.Ads.BannerFormats.RECTANGLE)){return"text"}return"text_image_flash_html"},getLayout:function(A){if([ComCore.Ads.BannerFormats.SKYSCRAPER,ComCore.Ads.BannerFormats.RECTANGLE,ComCore.Ads.BannerFormats.SELFSERVICE,ComCore.Ads.BannerFormats.SELFSERVICE_TOP].indexOf(A)>=0){return"VerticalTable"}else{if([ComCore.Ads.BannerFormats.FOOTER,ComCore.Ads.BannerFormats.INTEGRATED_MESSAGES,ComCore.Ads.BannerFormats.INTEGRATED_LOGS].indexOf(A)>=0){return"HorizontalTable"}else{if([ComCore.Ads.BannerFormats.INTEGRATED_PROFILE_TOP].indexOf(A)>=0){return"ProfileOneLiner"}}}},getAmount:function(A){return 3},get:function(B,I,F,D,C,E,H,A,G){if(this.isBlocked(I)===true){debug("GOOGLEADS - Blocked banner on format ["+I+"] module ["+this.module+"] submodule ["+this.submodule+"]");return false}if(F==="undefined"){F=undefined}if(D==="undefined"){D=undefined}if(C==="undefined"){C=undefined}F=F||this.getType(I);C=C||this.getLayout(I);E=E||[];D=D||this.getAmount(I);window.google_ad_client=this.google_ad_client;window.google_ad_output=this.google_ad_output;window.google_safe=this.google_safe;window.google_feedback=this.google_feedback;window.google_encoding=this.google_encoding;window.google_ad_section=this.google_ad_section;window.google_adtest=this.adtest;window.google_ad_type=F;window.google_language=this.getLanguage();window.google_ad_channel=this.getChannels(I).concat(E).join("+");window.google_max_num_ads=D;window.google_skip=this.skip;window.google_cust_age=this.age?this.getCustAge():undefined;window.google_cust_gender=this.gender?this.getCustGender():undefined;if((F.indexOf("image")>=0||F.indexOf("flash")>=0)&&A&&G){window.google_image_size=A+"x"+G}debug("GOOGLEADS - id ["+B+"] format ["+I+"] amount ["+D+"] skip ["+window.google_skip+"] channels ["+window.google_ad_channel+"] cust_age ["+window.google_cust_age+"-"+this.age+"]");this.skip+=parseInt(D,10);this.queue.push({divid:B+"Dummy",format:I,layout:C,callback:H});document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"><\/script>')},render:function(E){var D=this.queue.pop();var A=E.length;var C=0;var B=false;if(!$(D.divid)&&D.divid.indexOf("Dummy")>=0){if($(D.divid.replace("Dummy",""))){D.divid=D.divid.replace("Dummy","")}}if(A===0){$(D.divid).hide()}else{if(A===1){if(E[0].type==="image"){B=this.renderImageAd(E[0])}else{if(E[0].type==="flash"){B=this.renderFlashAd(E[0],D.divid)}else{if(E[0].type==="text"){B=this.renderTextAd(E,D.format,D.layout,D.divid)}}}}else{B=this.renderTextAd(E,D.format,D.layout,D.divid)}}if(typeof D.callback==="object"){if(typeof D.callback.before==="function"){D.callback.before()}}if(B!==false){$(D.divid).insert(B)}if(typeof D.callback==="object"){if(typeof D.callback.after==="function"){D.callback.after()}}else{if(typeof D.callback==="function"){D.callback()}}return true},renderImageAd:function(A){return new Element("div",{"class":"ad adGoogleImageWrapper"}).update(new Element("a",{href:A.url.unescapeHTML(),target:"_blank"}).update(new Element("img",{src:A.image_url.unescapeHTML(),border:0,width:A.image_width,height:A.image_height})))},renderFlashAd:function(A,C){var B=function(E){var D=new FlashObject(A.image_url,E,A.image_width,A.image_height,"7","#000","high");D.addParam("allowScriptAccess","never");D.addParam("wmode","transparent");D.write(E)};if(document.loaded){B(C);return false}ComCore.Queuer.add(function(){B("adGoogleFlashWrapper"+C)});return'<div id="adGoogleFlashWrapper'+C+'" class="ad adGoogleFlashWrapper"></div>'},renderTextAd:function(N,M,C,B){var E="";if([ComCore.Ads.BannerFormats.INTEGRATED_PROFILE_TOP,"PROFILE_INTEGRATED_TOP"].indexOf(M)>=0&&["ProfileOneLiner","InProfileOneLiner","ProfileColumn","InProfileColumn"].indexOf(C)>=0){E+=" skinItem clearfix"}var A=new Element("div",{"class":"ad adGoogle"+C+"Wrapper"+E}).insert(new Element("div",{"class":"adGoogle"+C+"Slug dimmed"}).update(new Element("a",{href:window.google_info.feedback_url,target:"_blank"}).update("Ads by Google")));var D=N.length;for(var F=0;F<D;F++){var K="";if(M===ComCore.Ads.BannerFormats.RECTANGLE&&C==="VerticalTable"&&F===0){if(D===1){K=" adGoogleVerticalTableOneAdSpacer"}else{if(D===2){K=" adGoogleVerticalTableTwoAdSpacer"}}}var H=new Element("div",{"class":"adGoogle"+C+"Ad clearfix"+K});var L=new Element("div",{"class":"adGoogle"+C+"AdTitle"}).update(new Element("a",{href:N[F].url.unescapeHTML(),target:"_blank"}).update(N[F].line1));var G=new Element("div",{"class":"adGoogle"+C+"AdText"}).update(N[F].line2);var I=new Element("div",{"class":"adGoogle"+C+"AdText"}).update(N[F].line3);var J=new Element("div",{"class":"adGoogle"+C+"AdUrl"}).update(new Element("a",{href:N[F].url.unescapeHTML(),target:"_blank"}).update(N[F].visible_url));H.insert(L).insert(G).insert(I).insert(J);A.insert(H)}return A},_eoo:true});function google_ad_request_done(A){ComCore.Ads.gafc.render(A);return true};