/*
 * CG Prep JS Output
 * Version: 20090709a001
 * Date: 09/08/2009 10:02 CDT
 */

/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();jQuery.noConflict();var Prototype={Version:"1.6.0.3",Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:navigator.userAgent.indexOf("Opera")>-1,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div")["__proto__"]&&document.createElement("div")["__proto__"]!==document.createElement("form")["__proto__"]},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 Class={create:function(){var e=null,d=$A(arguments);if(Object.isFunction(d[0])){e=d.shift()}function a(){this.initialize.apply(this,arguments)}Object.extend(a,Class.Methods);a.superclass=e;a.subclasses=[];if(e){var b=function(){};b.prototype=e.prototype;a.prototype=new b;e.subclasses.push(a)}for(var c=0;c<d.length;c++){a.addMethods(d[c])}if(!a.prototype.initialize){a.prototype.initialize=Prototype.emptyFunction}a.prototype.constructor=a;return a}};Class.Methods={addMethods:function(g){var c=this.superclass&&this.superclass.prototype;var b=Object.keys(g);if(!Object.keys({toString:true}).length){b.push("toString","valueOf")}for(var a=0,d=b.length;a<d;a++){var f=b[a],e=g[f];if(c&&Object.isFunction(e)&&e.argumentNames().first()=="$super"){var h=e;e=(function(i){return function(){return c[i].apply(this,arguments)}})(f).wrap(h);e.valueOf=h.valueOf.bind(h);e.toString=h.toString.bind(h)}this.prototype[f]=e}return this}};var Abstract={};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a)){return"undefined"}if(a===null){return"null"}return a.inspect?a.inspect():String(a)}catch(b){if(b instanceof RangeError){return"..."}throw b}},toJSON:function(a){var c=typeof a;switch(c){case"undefined":case"function":case"unknown":return;case"boolean":return a.toString()}if(a===null){return"null"}if(a.toJSON){return a.toJSON()}if(Object.isElement(a)){return}var b=[];for(var e in a){var d=Object.toJSON(a[e]);if(!Object.isUndefined(d)){b.push(e.toJSON()+": "+d)}}return"{"+b.join(", ")+"}"},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)},isElement:function(a){return !!(a&&a.nodeType==1)},isArray:function(a){return a!=null&&typeof a=="object"&&"splice" in a&&"join" in a},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a=="function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,"").split(",");return a.length==1&&!a[0]?[]:a},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}},bindAsEventListener:function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[d||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=$A(arguments);return function(){return a.apply(this,b.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)},defer:function(){var a=[0.01].concat($A(arguments));return this.delay.apply(this,a)},wrap:function(b){var a=this;return function(){return b.apply(this,[a.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}});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"'};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;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()}finally{this.currentlyExecuting=false}}}});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,{gsub:function(e,c){var a="",d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length>0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=String.interpret(c(b));d=d.slice(b.index+b[0].length)}else{a+=d,d=""}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=Object.isUndefined(b)?1:b;return this.gsub(c,function(d){if(--b<0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return String(this)},truncate:function(b,a){b=b||30;a=Object.isUndefined(a)?"...":a;return this.length>b?this.slice(0,b-a.length)+a:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,"img");var a=new RegExp(Prototype.ScriptFragment,"im");return(this.match(b)||[]).map(function(c){return(c.match(a)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=new Element("div");a.innerHTML=this.stripTags();return a.childNodes[0]?(a.childNodes.length>1?$A(a.childNodes).inject("",function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue):""},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);if(!a){return{}}return a[1].split(b||"&").inject({},function(e,f){if((f=f.split("="))[0]){var c=decodeURIComponent(f.shift());var d=f.length>1?f.join("="):f[0];if(d!=undefined){d=decodeURIComponent(d)}if(c in e){if(!Object.isArray(e[c])){e[c]=[e[c]]}e[c].push(d)}else{e[c]=d}}return e})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a<1?"":new Array(a+1).join(this)},camelize:function(){var d=this.split("-"),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)=="-"?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b<a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:"\\u00"+c[0].charCodeAt().toPaddedString(2,16)});if(b){return'"'+a.replace(/"/g,'\\"')+'"'}return"'"+a.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,"#{1}")},isJSON:function(){var a=this;if(a.blank()){return false}a=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(a){return this.indexOf(a)>-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return new Template(this,b).evaluate(a)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.stripTags().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b)){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return""}var f=d[1]||"";if(f=="\\"){return d[2]}var b=a,g=d[3];var e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith("[")?d[2].gsub("\\\\]","]"):d[1];b=b[c];if(null==b||""==d[3]){break}g=g.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(c,b){var a=0;try{this._each(function(e){c.call(b,e,a++)})}catch(d){if(d!=$break){throw d}}return this},eachSlice:function(d,c,b){var a=-d,e=[],f=this.toArray();if(d<1){return f}while((a+=d)<f.length){e.push(f.slice(a,a+d))}return e.collect(c,b)},all:function(c,b){c=c||Prototype.K;var a=true;this.each(function(e,d){a=a&&!!c.call(b,e,d);if(!a){throw $break}});return a},any:function(c,b){c=c||Prototype.K;var a=false;this.each(function(e,d){if(a=!!c.call(b,e,d)){throw $break}});return a},collect:function(c,b){c=c||Prototype.K;var a=[];this.each(function(e,d){a.push(c.call(b,e,d))});return a},detect:function(c,b){var a;this.each(function(e,d){if(c.call(b,e,d)){a=e;throw $break}});return a},findAll:function(c,b){var a=[];this.each(function(e,d){if(c.call(b,e,d)){a.push(e)}});return a},grep:function(d,c,b){c=c||Prototype.K;var a=[];if(Object.isString(d)){d=new RegExp(d)}this.each(function(f,e){if(d.match(f)){a.push(c.call(b,f,e))}});return a},include:function(a){if(Object.isFunction(this.indexOf)){if(this.indexOf(a)!=-1){return true}}var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inGroupsOf:function(b,a){a=Object.isUndefined(a)?null:a;return this.eachSlice(b,function(c){while(c.length<b){c.push(a)}return c})},inject:function(a,c,b){this.each(function(e,d){a=c.call(b,a,e,d)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.map(function(c){return c[b].apply(c,a)})},max:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e>=a){a=e}});return a},min:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e<a){a=e}});return a},partition:function(d,b){d=d||Prototype.K;var c=[],a=[];this.each(function(f,e){(d.call(b,f,e)?c:a).push(f)});return[c,a]},pluck:function(b){var a=[];this.each(function(c){a.push(c[b])});return a},reject:function(c,b){var a=[];this.each(function(e,d){if(!c.call(b,e,d)){a.push(e)}});return a},sortBy:function(b,a){return this.map(function(d,c){return{value:d,criteria:b.call(a,d,c)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var b=Prototype.K,a=$A(arguments);if(Object.isFunction(a.last())){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}if(Prototype.Browser.WebKit){$A=function(c){if(!c){return[]}if(!(typeof c==="function"&&typeof c.length==="number"&&typeof c.item==="function")&&c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;a<c;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(Object.isArray(a)?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c)}return d})},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var a=[];this.each(function(b){var c=Object.toJSON(b);if(!Object.isUndefined(c)){a.push(c)}});return"["+a.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,a){a||(a=0);var b=this.length;if(a<0){a=b+a}for(;a<b;a++){if(this[a]===c){return a}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b,a){a=isNaN(a)?this.length:(a<0?this.length+a:a)+1;var c=this.slice(0,a).reverse().indexOf(b);return(c<0)?c:a-c-1}}Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b<c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b<c;b++){if(Object.isArray(arguments[b])){for(var a=0,d=arguments[b].length;a<d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(b,a){$R(0,this,true).each(b,a);return this},toPaddedString:function(c,b){var a=this.toString(b||10);return"0".times(c-a.length)+a},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function a(b,c){if(Object.isUndefined(c)){return b}return b+"="+encodeURIComponent(String.interpret(c))}return{initialize:function(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b)},_each:function(c){for(var b in this._object){var d=this._object[b],e=[b,d];e.key=b;e.value=d;c(e)}},set:function(b,c){return this._object[b]=c},get:function(b){if(this._object[b]!==Object.prototype[b]){return this._object[b]}},unset:function(b){var c=this._object[b];delete this._object[b];return c},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var b=this.detect(function(d){return d.value===c});return b&&b.key},merge:function(b){return this.clone().update(b)},update:function(b){return new Hash(b).inject(this,function(c,d){c.set(d.key,d.value);return c})},toQueryString:function(){return this.inject([],function(d,e){var c=encodeURIComponent(e.key),b=e.value;if(b&&typeof b=="object"){if(Object.isArray(b)){return d.concat(b.map(a.curry(c)))}}else{d.push(a(c,b))}return d}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start){return false}if(this.exclusive){return a<this.end}return a<=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};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(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};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,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;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 a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);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 c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){e[c[b]]=c[b+1]}}else{$H(c).each(function(f){e[f.key]=f.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},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(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}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,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,a){var c=[];var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b<d;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(){var a=this.Element;this.Element=function(d,c){c=c||{};d=d.toLowerCase();var b=Element.cache;if(Prototype.Browser.IE&&c.name){d="<"+d+' name="'+c.name+'">';delete c.name;return Element.writeAttribute(document.createElement(d),c)}if(!b[d]){b[d]=Element.extend(document.createElement(d))}return Element.writeAttribute(b[d].cloneNode(false),c)};Object.extend(this.Element,a||{});if(a){this.Element.prototype=a.prototype}}).call(window);Element.cache={};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(a,b){a=$(a);if(b&&b.toElement){b=b.toElement()}if(Object.isElement(b)){return a.update().insert(b)}b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a},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(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}}var d,f,b,g;for(var a in e){d=e[a];a=a.toLowerCase();f=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){f(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){g.reverse()}g.each(f.curry(c));d.evalScripts.bind(d).defer()}return c},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(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last();var d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return $(a).recursivelyCollect("parentNode")},descendants:function(a){return $(a).select("*")},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 $(a).recursivelyCollect("previousSibling")},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling")},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(b,a){if(Object.isString(a)){a=new Selector(a)}return a.match($(b))},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=b.ancestors();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return b.firstDescendant()}return Object.isNumber(c)?b.descendants()[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=b.previousSiblings();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=c.nextSiblings();return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},select:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},adjacent:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(b){b=$(b);var c=b.readAttribute("id"),a=arguments.callee;if(c){return c}do{c="anonymous_element_"+a.counter++}while($(c));b.writeAttribute("id",c);return c},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(e,c,f){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=d.names[a]||a;f=b[a];if(d.values[a]){c=d.values[a](e,f)}if(f===false||f===null){e.removeAttribute(c)}else{if(f===true){e.setAttribute(c,c)}else{e.setAttribute(c,f)}}}return e},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!a.hasClassName(b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return a[a.hasClassName(b)?"removeClassName":"addClassName"](b)},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=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var e=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{e[(d=="float"||d=="cssFloat")?(Object.isUndefined(e.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},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=c.getStyle("display");if(g!="none"&&g!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var f=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var h=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=f;return{width:h,height:e}},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(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(c,a)},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName.toUpperCase()=="BODY"){break}var c=Element.getStyle(b,"position");if(c!=="static"){break}}}while(b);return Element._returnOffset(d,a)},absolutize:function(b){b=$(b);if(b.getStyle("position")=="absolute"){return b}var d=b.positionedOffset();var f=d[1];var e=d[0];var c=b.clientWidth;var a=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=a+"px";return b},relativize:function(a){a=$(a);if(a.getStyle("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(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(c,a)},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(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body&&Element.getStyle(b,"position")=="absolute"){break}}while(b=b.offsetParent);b=d;do{if(!Prototype.Browser.Opera||(b.tagName&&(b.tagName.toUpperCase()=="BODY"))){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(c,a)},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var e=d.viewportOffset();b=$(b);var f=[0,0];var c=null;if(Element.getStyle(b,"position")=="absolute"){c=b.getOffsetParent();f=c.viewportOffset()}if(c==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Element.Methods.identify.counter=1;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(d,b,c){switch(c){case"left":case"top":case"right":case"bottom":if(d(b,"position")==="static"){return null}case"height":case"width":if(!Element.visible(b)){return null}var e=parseInt(d(b,c),10);if(e!==b["offset"+c.capitalize()]){return e+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(e,function(f,g){var h=d(b,g);return h===null?f:f-parseInt(h,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);try{b.offsetParent}catch(f){return $(document.body)}var a=b.getStyle("position");if(a!=="static"){return c(b)}b.setStyle({position:"relative"});var d=c(b);b.setStyle({position:a});return d});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,c){c=$(c);try{c.offsetParent}catch(h){return Element._returnOffset(0,0)}var b=c.getStyle("position");if(b!=="static"){return f(c)}var d=c.getOffsetParent();if(d&&d.getStyle("position")==="fixed"){d.setStyle({zoom:1})}c.setStyle({position:"relative"});var g=f(c);c.setStyle({position:b});return g})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent}catch(c){return Element._returnOffset(0,0)}return b(a)});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(b,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(e==1||e===""){(d=f(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(e<0.00001){e=0}}c.filter=f(d)+"alpha(opacity="+(e*100)+")";return b};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,c){var b=a.getAttributeNode(c);return b?b.value:""},_getEv:function(a,b){b=a.getAttribute(b);return b?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.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._getAttr,src:a._getAttr,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)}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(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}b=b.offsetParent}while(b);return Element._returnOffset(c,a)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}if(Object.isElement(c)){return b.update().insert(c)}c=Object.toHTML(c);var a=b.tagName.toUpperCase();if(a in Element._insertionTranslations.tags){$A(b.childNodes).each(function(d){b.removeChild(d)});Element._getContentFromAnonymousElement(a,c.stripScripts()).each(function(d){b.appendChild(d)})}else{b.innerHTML=c.stripScripts()}c.evalScripts.bind(c).defer();return b}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(c,e){c=$(c);if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var f=c.next();var a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(f){a.each(function(g){d.insertBefore(g,f)})}else{a.each(function(g){d.appendChild(g)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(c,b){var d=new Element("div"),a=Element._insertionTranslations.tags[c];if(a){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else{d.innerHTML=b}return $A(d.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);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);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div")["__proto__"]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div")["__proto__"];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var a={},b=Element.Methods.ByTag;var c=Object.extend(function(f){if(!f||f._extendedByPrototype||f.nodeType!=1||f==window){return f}var d=Object.clone(a),e=f.tagName.toUpperCase(),h,g;if(b[e]){Object.extend(d,b[e])}for(h in d){g=d[h];if(Object.isFunction(g)&&!(h in f)){f[h]=g.methodize()}}f._extendedByPrototype=Prototype.emptyFunction;return f},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});c.refresh();return c})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var h=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 b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(g)}else{g(b)}}function g(j){j=j.toUpperCase();if(!Element.Methods.ByTag[j]){Element.Methods.ByTag[j]={}}Object.extend(Element.Methods.ByTag[j],c)}function a(l,k,j){j=j||false;for(var n in l){var m=l[n];if(!Object.isFunction(m)){continue}if(!j||!(n in k)){k[n]=m.methodize()}}}function e(l){var j;var k={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(k[l]){j="HTML"+k[l]+"Element"}if(window[j]){return window[j]}j="HTML"+l+"Element";if(window[j]){return window[j]}j="HTML"+l.capitalize()+"Element";if(window[j]){return window[j]}window[j]={};window[j].prototype=document.createElement(l)["__proto__"];return window[j]}if(h.ElementExtensions){a(Element.Methods,HTMLElement.prototype);a(Element.Methods.Simulated,HTMLElement.prototype,true)}if(h.SpecificElementExtensions){for(var i in Element.Methods.ByTag){var f=e(i);if(Object.isUndefined(f)){continue}a(d[i],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var a={},b=Prototype.Browser;$w("width height").each(function(e){var c=e.capitalize();if(b.WebKit&&!document.evaluate){a[e]=self["inner"+c]}else{if(b.Opera&&parseFloat(window.opera.version())<9.5){a[e]=document.body["client"+c]}else{a[e]=document.documentElement["client"+c]}}});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};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(){if(!Prototype.BrowserFeatures.XPath){return false}var a=this.expression;if(Prototype.Browser.WebKit&&(a.include("-of-type")||a.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(a)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){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;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 in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).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 f=this.expression,g=Selector.patterns,b=Selector.xpath,d,a;if(Selector._cache[f]){this.xpath=Selector._cache[f];return}this.matcher=[".//*"];while(f&&d!=f&&(/\S/).test(f)){d=f;for(var c in g){if(a=f.match(g[c])){this.matcher.push(Object.isFunction(b[c])?b[c](a):new Template(b[c]).evaluate(a));f=f.replace(a[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,f=$(a).identify();c="#"+f+" "+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(j){this.tokens=[];var o=this.expression,a=Selector.patterns,f=Selector.assertions;var b,d,g;while(o&&b!==o&&(/\S/).test(o)){b=o;for(var k in a){d=a[k];if(g=o.match(d)){if(f[k]){this.tokens.push([k,Object.clone(g)]);o=o.replace(g[0],"")}else{return this.findElements(document).include(j)}}}}var n=true,c,l;for(var k=0,h;h=this.tokens[k];k++){c=h[0],l=h[1];if(!Selector.assertions[c](j,l)){n=false;break}}return n},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});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(b){var j=b[6],h=Selector.patterns,a=Selector.xpath,f,c;var g=[];while(j&&f!=j&&(/\S/).test(j)){f=j;for(var d in h){if(b=j.match(h[d])){c=Object.isFunction(a[d])?a[d](b):new Template(a[d]).evaluate(b);g.push("("+c.substring(1,c.length-1)+")");j=j.replace(b[0],"");break}}}return"[not("+g.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(g,e){var h,i=e[6],d;if(i=="even"){i="2n+0"}if(i=="odd"){i="2n+1"}if(h=i.match(/^(\d+)$/)){return"["+g+"= "+h[1]+"]"}if(h=i.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]=="-"){h[1]=-1}var f=h[1]?Number(h[1]):1;var c=h[2]?Number(h[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:g,a:f,b:c})}}}},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:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\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(d,c){for(var e=0,f;f=c[e];e++){d.push(f)}return d},mark:function(a){var d=Prototype.emptyFunction;for(var b=0,c;c=a[b];b++){c._countedByPrototype=d}return a},unmark:function(a){for(var b=0,c;c=a[b];b++){c._countedByPrototype=undefined}return a},index:function(a,d,g){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,e=b.length-1,c=1;e>=0;e--){var f=b[e];if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++}}}else{for(var e=0,c=1,b=a.childNodes;f=b[e];e++){if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],e;for(var c=0,a=b.length;c<a;c++){if(!(e=b[c])._countedByPrototype){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,j,c,b){var k=c.toUpperCase();var e=[],g=Selector.handlers;if(a){if(b){if(b=="descendant"){for(var f=0,d;d=a[f];f++){g.concat(e,d.getElementsByTagName(c))}return e}else{a=this[b](a)}if(c=="*"){return a}}for(var f=0,d;d=a[f];f++){if(d.tagName.toUpperCase()===k){e.push(d)}}return e}else{return j.getElementsByTagName(c)}},id:function(b,a,j,f){var g=$(j),d=Selector.handlers;if(!g){return[]}if(!b&&a==document){return[g]}if(b){if(f){if(f=="child"){for(var c=0,e;e=b[c];c++){if(g.parentNode==e){return[g]}}}else{if(f=="descendant"){for(var c=0,e;e=b[c];c++){if(Element.descendantOf(g,e)){return[g]}}}else{if(f=="adjacent"){for(var c=0,e;e=b[c];c++){if(Selector.handlers.previousElementSibling(g)==e){return[g]}}}else{b=d[f](b)}}}}for(var c=0,e;e=b[c];c++){if(e==g){return[g]}}return[]}return(g&&Element.descendantOf(g,a))?[g]:[]},className:function(b,a,c,d){if(b&&d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,f){if(!c){c=Selector.handlers.descendant([b])}var h=" "+f+" ";for(var e=0,d=[],g,a;g=c[e];e++){a=g.className;if(a.length==0){continue}if(a==f||(" "+a+" ").include(h)){d.push(g)}}return d},attrPresence:function(c,b,a,g){if(!c){c=b.getElementsByTagName("*")}if(c&&g){c=this[g](c)}var e=[];for(var d=0,f;f=c[d];d++){if(Element.hasAttribute(f,a)){e.push(f)}}return e},attr:function(a,j,h,k,c,b){if(!a){a=j.getElementsByTagName("*")}if(a&&b){a=this[b](a)}var l=Selector.operators[c],f=[];for(var e=0,d;d=a[e];e++){var g=Element.readAttribute(d,h);if(g===null){continue}if(l(g,k)){f.push(d)}}return f},pseudo:function(b,c,e,a,d){if(b&&d){b=this[d](b)}if(!b){b=a.getElementsByTagName("*")}return Selector.pseudos[c](b,e,a)}},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(d,c,e){if(d==0){return c>0?[c]:[]}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)}return a})},nth:function(c,s,u,r,e){if(c.length==0){return[]}if(s=="even"){s="2n+0"}if(s=="odd"){s="2n+1"}var q=Selector.handlers,p=[],d=[],g;q.mark(c);for(var o=0,f;f=c[o];o++){if(!f.parentNode._countedByPrototype){q.index(f.parentNode,r,e);d.push(f.parentNode)}}if(s.match(/^\d+$/)){s=Number(s);for(var o=0,f;f=c[o];o++){if(f.nodeIndex==s){p.push(f)}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1}var v=g[1]?Number(g[1]):1;var t=g[2]?Number(g[2]):0;var w=Selector.pseudos.getIndices(v,t,c.length);for(var o=0,f,k=w.length;f=c[o];o++){for(var n=0;n<k;n++){if(f.nodeIndex==w[n]){p.push(f)}}}}}q.unmark(c);q.unmark(d);return p},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,k){var g=Selector.handlers,l,c;var j=new Selector(d).findElements(k);g.mark(j);for(var f=0,e=[],b;b=a[f];f++){if(!b._countedByPrototype){e.push(b)}}g.unmark(j);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.endsWith(a)},"*=":function(b,a){return 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(f,g){var e=$$(g),d=Selector.handlers;d.mark(e);for(var c=0,b=[],a;a=f[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(e);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(e,g){g=Selector.split(g.join(","));var d=[],f=Selector.handlers;for(var c=0,b=g.length,a;c<b;c++){a=new Selector(g[c].strip());f.concat(d,a.findElements(e))}return(b>1)?f.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,f;f=c[e];e++){if(f.tagName!=="!"){d.push(f)}}return d},unmark:function(a){for(var b=0,c;c=a[b];b++){c.removeAttribute("_countedByPrototype")}return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(g,b){if(typeof b!="object"){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,f,a=false,e=b.submit;var d=g.inject({},function(h,i){if(!i.disabled&&i.name){c=i.name;f=$(i).getValue();if(f!=null&&i.type!="file"&&(i.type!="submit"||(!a&&e!==false&&(!e||c==e)&&(a=true)))){if(c in h){if(!Object.isArray(h[c])){h[c]=[h[c]]}h[c].push(f)}else{h[c]=f}}}return h});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(a){return $A($(a).getElementsByTagName("*")).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c))}return b})},getInputs:function(g,c,d){g=$(g);var a=g.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e<f;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){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(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return["input","select","textarea"].include(d.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};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"].include(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(c,f){if(Object.isUndefined(f)){return this[c.type=="select-one"?"selectOne":"selectMany"](c)}else{var b,d,g=!Object.isArray(f);for(var a=0,e=c.length;a<e;a++){b=c.options[a];d=this.optionValue(b);if(g){if(d==f){b.selected=true;return}}else{b.selected=f.include(d)}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,e=d.length;if(!e){return null}for(var c=0,a=[];c<e;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);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)}});if(!window.Event){var Event={}}Object.extend(Event,{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:{},relatedTarget:function(b){var a;switch(b.type){case"mouseover":a=b.fromElement;break;case"mouseout":a=b.toElement;break;default:return null}return Element.extend(a)}});Event.Methods=(function(){var a;if(Prototype.Browser.IE){var b={0:1,1:4,2:2};a=function(d,c){return d.button==b[c]}}else{if(Prototype.Browser.WebKit){a=function(d,c){switch(c){case 0:return d.which==1&&!d.metaKey;case 1:return d.which==1&&d.metaKey;default:return false}}}else{a=function(d,c){return d.which?(d.which===c+1):(d.button===c)}}}return{isLeftClick:function(c){return a(c,0)},isMiddleClick:function(c){return a(c,1)},isRightClick:function(c){return a(c,2)},element:function(e){e=Event.extend(e);var d=e.target,c=e.type,f=e.currentTarget;if(f&&f.tagName){if(c==="load"||c==="error"||(c==="click"&&f.tagName.toLowerCase()==="input"&&f.type==="radio")){d=f}}if(d.nodeType==Node.TEXT_NODE){d=d.parentNode}return Element.extend(d)},findElement:function(d,f){var c=Event.element(d);if(!f){return c}var e=[c].concat(c.ancestors());return Selector.findElement(e,f,0)},pointer:function(e){var d=document.documentElement,c=document.body||{scrollLeft:0,scrollTop:0};return{x:e.pageX||(e.clientX+(d.scrollLeft||c.scrollLeft)-(d.clientLeft||0)),y:e.pageY||(e.clientY+(d.scrollTop||c.scrollTop)-(d.clientTop||0))}},pointerX:function(c){return Event.pointer(c).x},pointerY:function(c){return Event.pointer(c).y},stop:function(c){Event.extend(c);c.preventDefault();c.stopPropagation();c.stopped=true}}})();Event.extend=(function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();return b});if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(b){if(!b){return false}if(b._extendedByPrototype){return b}b._extendedByPrototype=Prototype.emptyFunction;var c=Event.pointer(b);Object.extend(b,{target:b.srcElement,relatedTarget:Event.relatedTarget(b),pageX:c.x,pageY:c.y});return Object.extend(b,a)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents")["__proto__"];Object.extend(Event.prototype,a);return Prototype.K}})();Object.extend(Event,(function(){var b=Event.cache;function c(j){if(j._prototypeEventID){return j._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return j._prototypeEventID=[++arguments.callee.id]}function g(j){if(j&&j.include(":")){return"dataavailable"}return j}function a(j){return b[j]=b[j]||{}}function f(l,j){var k=a(l);return k[j]=k[j]||[]}function h(k,j,l){var o=c(k);var n=f(o,j);if(n.pluck("handler").include(l)){return false}var m=function(p){if(!Event||!Event.extend||(p.eventName&&p.eventName!=j)){return false}Event.extend(p);l.call(k,p)};m.handler=l;n.push(m);return m}function i(m,j,k){var l=f(m,j);return l.find(function(n){return n.handler==k})}function d(m,j,k){var l=a(m);if(!l[j]){return false}l[j]=l[j].without(i(m,j,k))}function e(){for(var k in b){for(var j in b[k]){b[k][j]=null}}}if(window.attachEvent){window.attachEvent("onunload",e)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}return{observe:function(l,j,m){l=$(l);var k=g(j);var n=h(l,j,m);if(!n){return l}if(l.addEventListener){l.addEventListener(k,n,false)}else{l.attachEvent("on"+k,n)}return l},stopObserving:function(l,j,m){l=$(l);var o=c(l),k=g(j);if(!m&&j){f(o,j).each(function(p){l.stopObserving(j,p.handler)});return l}else{if(!j){Object.keys(a(o)).each(function(p){l.stopObserving(p)});return l}}var n=i(o,j,m);if(!n){return l}if(l.removeEventListener){l.removeEventListener(k,n,false)}else{l.detachEvent("on"+k,n)}d(o,j,m);return l},fire:function(l,k,j){l=$(l);if(l==document&&document.createEvent&&!l.dispatchEvent){l=document.documentElement}var m;if(document.createEvent){m=document.createEvent("HTMLEvents");m.initEvent("dataavailable",true,true)}else{m=document.createEventObject();m.eventType="ondataavailable"}m.eventName=k;m.memo=j||{};if(document.createEvent){l.dispatchEvent(m)}else{l.fireEvent(m.eventType,m)}return Event.extend(m)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var b;function a(){if(document.loaded){return}if(b){window.clearInterval(b)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);Event.observe(window,"load",a)}else{document.addEventListener("DOMContentLoaded",a,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}})();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(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();var d=/\s/.test(e)?$w(e).map(a).join(""):a(e);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(e,f){f=f.toString().strip();var g=[],h=(/\s/.test(f)?$w(f):null);if(!h&&!f){return g}var c=$(e).getElementsByTagName("*");f=" "+f+" ";for(var d=0,k,j;k=c[d];d++){if(k.className&&(j=" "+k.className+" ")&&(j.include(f)||(h&&h.all(function(i){return !i.toString().blank()&&j.include(" "+i+" ")})))){g.push(Element.extend(k))}}return g};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(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);Element.addMethods();String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var e;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){e=b}else{e=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);c=(c||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(a){function b(d,c){return((d[c+"Internal"]?"this.options."+c+"Internal(this);":"")+(d[c]?"this.options."+c+"(this);":""))}if(a&&a.transition===false){a.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function c(e,d){if(e.options[d+"Internal"]){e.options[d+"Internal"](e)}if(e.options[d]){e.options[d](e)}}return function(d){if(this.state==="idle"){this.state="running";c(this,"beforeSetup");if(this.setup){this.setup()}c(this,"afterSetup")}if(this.state==="running"){d=(this.options.transition(d)*this.fromToDelta)+this.options.from;this.position=d;c(this,"beforeUpdate");if(this.update){this.update(d)}c(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,f,e){c=Object.isString(c)?$(c):c;var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(g){c[d]=g};this.start(Object.extend({from:f,to:e},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=e.round()+"px"}if(this.options.scaleY){f.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}this.element.setStyle(f)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();if(b.offset){d[1]+=b.offset}return new Effect.Tween(null,a.top,d[1],b,function(e){scrollTo(a.left,e.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(d){d=$(d);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});var e=parseFloat(b.distance);var c=parseFloat(b.duration)/10;var a={top:d.getStyle("top"),left:d.getStyle("left")};return new Effect.Move(d,{x:e,y:0,duration:c,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(i){new Effect.Move(i.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-e,y:0,duration:c,afterFinishInternal:function(k){k.element.undoPositioned().setStyle(a)}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var h,f;var e,d;switch(b.direction){case"top-left":h=f=e=d=0;break;case"top-right":h=g.width;f=d=0;e=-g.width;break;case"bottom-left":h=e=0;f=g.height;d=-g.height;break;case"bottom-right":h=g.width;f=g.height;e=-g.width;d=-g.height;break;case"center":h=g.width/2;f=g.height/2;e=-g.width/2;d=-g.height/2;break}return new Effect.Move(c,{x:h,y:f,duration:0.01,beforeSetup:function(i){i.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(i){new Effect.Parallel([new Effect.Opacity(i.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(i.element,{x:e,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(i.element,100,{scaleMode:{originalHeight:g.height,originalWidth:g.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(j){j.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(j){j.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var f=c.getDimensions();var e,d;switch(b.direction){case"top-left":e=d=0;break;case"top-right":e=f.width;d=0;break;case"bottom-left":e=0;d=f.height;break;case"bottom-right":e=f.width;d=f.height;break;case"center":e=f.width/2;d=f.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:e,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),e=b.transition||Effect.Transitions.linear,d=function(f){return 1-e((-Math.cos((f*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]});a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(e){d.element.style[e.style]=""})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(g){var f=g[0],e=g[1],d=null;if(e.parseColor("#zzzzzz")!="#zzzzzz"){e=e.parseColor();d="color"}else{if(f=="opacity"){e=parseFloat(e);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(e)){var c=e.match(/^([\+\-]?[0-9\.]+)(.*)$/);e=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(f);return{style:f.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(e):e,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)}this.element.setStyle(d,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");var e=[$(d)||$$(d)].flatten();return e.map(function(f){return new c(f,Object.extend({sync:true},b))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=a[e];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(c,e,b){c=$(c);var d=e.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);return c},highlight:function(b,a){b=$(b);new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);(function(d){d.fn.jqm=function(f){var e={overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:o,ajaxText:"",target:o,modal:o,toTop:o,onShow:o,onHide:o,onLoad:o};return this.each(function(){if(this._jqm){return n[this._jqm].c=d.extend({},n[this._jqm].c,f)}p++;this._jqm=p;n[p]={c:d.extend(e,d.jqm.params,f),a:o,w:d(this).addClass("jqmID"+p),s:p};if(e.trigger){d(this).jqmAddTrigger(e.trigger)}})};d.fn.jqmAddClose=function(f){return l(this,f,"jqmHide")};d.fn.jqmAddTrigger=function(f){return l(this,f,"jqmShow")};d.fn.jqmShow=function(e){return this.each(function(){e=e||window.event;d.jqm.open(this._jqm,e)})};d.fn.jqmHide=function(e){return this.each(function(){e=e||window.event;d.jqm.close(this._jqm,e)})};d.jqm={hash:{},open:function(B,A){var m=n[B],q=m.c,i="."+q.closeClass,v=(parseInt(m.w.css("z-index"),10)),v=(v>0)?v:3000,f=d("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":v-1,opacity:q.overlay/100});if(m.a){return o}m.t=A;m.a=true;m.w.css("z-index",v);if(q.modal){if(!a[0]){k("bind")}a.push(B)}else{if(q.overlay>0){m.w.jqmAddClose(f)}else{f=o}}m.o=(f)?f.addClass(q.overlayClass).prependTo("body"):o;if(c){d("html,body").css({height:"100%",width:"100%"});if(f){f=f.css({position:"absolute"})[0];for(var w in {Top:1,Left:1}){f.style.setExpression(w.toLowerCase(),"(_=(document.documentElement.scroll"+w+" || document.body.scroll"+w+"))+'px'")}}}if(q.ajax){var e=q.target||m.w,x=q.ajax,e=(typeof e=="string")?d(e,m.w):d(e),x=(x.substr(0,1)=="@")?d(A).attr(x.substring(1)):x;e.html(q.ajaxText).load(x,function(){if(q.onLoad){q.onLoad.call(this,m)}if(i){m.w.jqmAddClose(d(i,m.w))}j(m)})}else{if(i){m.w.jqmAddClose(d(i,m.w))}}if(q.toTop&&m.o){m.w.before('<span id="jqmP'+m.w[0]._jqm+'"></span>').insertAfter(m.o)}(q.onShow)?q.onShow(m):m.w.show();j(m);return o},close:function(f){var e=n[f];if(!e.a){return o}e.a=o;if(a[0]){a.pop();if(!a[0]){k("unbind")}}if(e.c.toTop&&e.o){d("#jqmP"+e.w[0]._jqm).after(e.w).remove()}if(e.c.onHide){e.c.onHide(e)}else{e.w.hide();if(e.o){e.o.remove()}}return o},params:{}};var p=0,n=d.jqm.hash,a=[],c=d.browser.msie&&(d.browser.version=="6.0"),o=false,g=d('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),j=function(e){if(c){if(e.o){e.o.html('<p style="width:100%;height:100%"/>').prepend(g)}else{if(!d("iframe.jqm",e.w)[0]){e.w.prepend(g)}}}h(e)},h=function(f){try{d(":input:visible",f.w)[0].focus()}catch(e){}},k=function(e){d()[e]("keypress",b)[e]("keydown",b)[e]("mousedown",b)},b=function(m){var f=n[a[a.length-1]],i=(!d(m.target).parents(".jqmID"+f.s)[0]);if(i){h(f)}return !i},l=function(e,f,i){return e.each(function(){var m=this._jqm;d(f).each(function(){if(!this[i]){this[i]=[];d(this).click(function(){for(var q in {jqmShow:1,jqmHide:1}){for(var r in this[q]){if(n[this[q][r]]){n[this[q][r]].w[q](this)}}}return o})}this[i].push(m)})})}})(jQuery);function require(obj,lib,handler){if(Object.prototype.toString.call(obj)!=="[object Array]"){obj=[obj]}if(typeof(lib)==="function"){handler=lib;lib=undefined}var badnews=[],len=obj.length,i;for(i=0;i<len;i++){try{if(eval("typeof("+obj[i]+") === 'undefined'")){throw"Bad voodoo"}}catch(e){badnews.push(obj[i])}}if(badnews.length){if(typeof(handler)==="function"){handler()}else{throw lib?lib+" requires "+badnews.join(" and ")+" to be loaded":badnews.join(" and ")+" "+(badnews.length>1?"are":"is")+" required to be loaded"}}}require("jQuery","CG");require("console",function(){window.console={log:function(){}}});(function(a){CG=a.extend(true,typeof(CG)==="undefined"?{}:CG,{options:typeof(CG)==="undefined"?{}:CG.options||{},GAMES:{1:{name:"Duels",link:"http://www.duels.com",hasBulletins:true,description:"Prove your combat skills in the arena"},2:{name:"Baseball Boss",link:"http://www.baseballboss.com",hasBulletins:true,description:"Collect cards & play baseball online!"},3:{name:"Warstorm",link:"http://www.warstorm.com",hasBulletins:true,description:"Can you lead your army to victory?"},6:{name:"MechDuels",link:"http://www.mechduels.com",hasBulletins:true,description:"You are the Commander. Build. Deploy. DESTROY."},7:{name:"Planetstorm",link:"http://www.planetstorm.com",hasBulletins:false,description:"Battle for the furture of man and machine."},dd:{name:"Duels Defense",link:"http://www.duelsdefense.com",hasBulletins:false,description:"Defend your kingdom against an onslaught of magical beasts."}},DEBUG:2,events:{startup:(function(){a(document).ready(function(){require("CG.Event","CG");CG.events.startup.fire()});return null})()}})})(jQuery);require("jQuery","CG.Util");(function($){$.fn.getData=function(key){var att=this.attr("data-"+key),data;if(att){try{data=eval("("+att+")")}catch(e){data=att}}return data};$.fn.truncate=function(length,elips){var length=length||20,elips=elips||"...";return this.each(function(){var obj=$(this),content=obj.text();if(content.length>length){obj.text(content.substr(0,length)+elips)}})}})(jQuery);require(["jQuery","CG"],"CG.Event");(function(a){CG.Event=function(b){this._scope=b||window;this._handlers=[];this._firing=false};CG.Event.prototype={subscribe:function(d,b,c){if(this.checkHandler(d)===-1){var c=c||this._scope,b=b||0,e=this._handlers.length;a.each(this._handlers,function(f,g){if(g.p>b){e=f;return false}});this._handlers.splice(e,0,{f:d,p:b,s:c})}return this},unsubscribe:function(c){var b=this.checkHandler(c);if(b!==-1){this._handlers.splice(b,1)}return this},fire:function(d){var e=this;if(!this._firing){this._firing=true;var b=this._handlers.slice(),c=[],d=d||{};(function f(){if(b.length){var i=b.shift(),g=i.f.call(i.s,e,d)||true;c.push(g);if(g===false){b=[]}setTimeout(f,10)}else{e._firing=false}})()}else{setTimeout(function(){e.fire(d)},10)}return this},checkHandler:function(b){var c;a.each(this._handlers,function(d,e){if(e.f&&e.f===b){c=d}});return c===undefined?-1:c}};if(CG.events){CG.events.startup=new CG.Event()}})(jQuery);require(["jQuery","CG","CG.Event"],"CG.Cache");(function(d){var b={},a={},c={};CG.Cache={STATUS_UNDEFINED:"cacheStatusUndefined",STATUS_LOADING:"cacheStatusLoading",STATUS_SET:"cacheStatusSet",events:{set:new CG.Event()},set:function(f,i,h){if(/string/i.test(f.constructor.toString())){var e={},g={};e[f]=i;g[f]=h;f=e;h=g}else{h=i}d.each(f,function(l,j){var m=typeof(h)==="function"?h:(h?h[l]:undefined);if(m!==undefined){a[l]=m}if(j!==undefined){b[l]=j;CG.Cache.events.set.fire({key:l,value:j});c[l]=CG.Cache.STATUS_SET}})},get:function(e){return b[e]||undefined},getStatus:function(e){return c[e]||CG.Cache.STATUS_UNDEFINED},reload:function(f){if(!d.isArray(f)){f=[f]}var e=[],g=[];d.each(f,function(){if(a[this]){var h=d.inArray(a[this],e);if(h===-1){e.push(a[this]);g.push([this])}else{g[h].push(this)}c[f]=CG.Cache.STATUS_LOADING}});d.each(e,function(k){var h=g[k].length>1,l=this(h?g[k]:g[k][0]),j=function(i,m){l.unsubscribe(j);if(m){CG.Cache.set(h?m:g[k][0],h?null:m[g[k][0]])}};if(l&&l instanceof CG.Event){l.subscribe(j)}else{CG.Cache.set(h?l:f,h?null:l)}})}}})(jQuery);require(["jQuery","CG","CG.Event"],"CG.Overlay");(function(a){CG.Overlay=(function(){var c,d=new CG.Event(),e=new CG.Event(),b=function(){if(!c){c=new f()}return c},f=function(){var j=this,g,i,l=function(){i=a('<iframe id="top_bar_shim" frameborder="0" src="javascript:void(0);"/>').css({position:"absolute",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0);",top:0,left:0,width:"100%",display:"none"}).insertBefore("#top_bar");g=a('<div id="top_bar_overlay"></div>').css({background:"#000",top:0,left:0,width:"100%",display:"none"}).insertBefore(i);i.css("zIndex",g.css("zIndex")-1);a.extend(j,{hide:h,show:m,visible:k})},k=function(){return g.is(":visible")},h=function(){g.animate({opacity:0},300,function(){e.fire()}).hide();i.hide();return j},m=function(){var n=a(document).height();if(g.height()<n){g.height(n);i.height(n)}d.fire();g.css("opacity",0).show().animate({opacity:0.75},300);i.show();return j};l()};return{getInstance:b,events:{beforeShow:d,afterHide:e}}})()})(jQuery);require(["jQuery","CG","CG.Event","CG.Overlay"],"CG.TopBarDropdown");(function(a){CG.TopBarDropdown=function(f){var n=this,r=a(f),g=++CG.TopBarDropdown.id_count,x=r.parents("#top_bar"),q=r.find("> a"),m=r.find("> .sub_content"),k,y=false,b=CG.TopBarDropdown.animating,u=false,o=function(){a(document.body).click(i);q.click(t);CG.TopBarDropdown.events.beforeShow.subscribe(l);CG.TopBarDropdown.events.afterShow.subscribe(h);CG.TopBarDropdown.events.beforeHide.subscribe(w);CG.TopBarDropdown.events.afterHide.subscribe(v);a.extend(n,{_topBar:x,_container:m,_title:q,getId:d,show:p,hide:e,toggle:c,_checkId:j})},d=function(){return g},j=function(z){return z===g},s=function(){m.css("backgroundPosition","-"+(m.offset().left-((x.width()-1194)/2))+"px 1px")},p=function(){if(!y&&!b){b=true;if(!k){k=CG.Overlay.getInstance()}CG.TopBarDropdown.events.beforeShow.fire({id:g});m.slideDown(500,function(){y=true;b=false;CG.TopBarDropdown.events.afterShow.fire({id:g})})}return n},e=function(){if(y&&!b){b=true;CG.TopBarDropdown.events.beforeHide.fire({id:g});m.slideUp(500,function(){y=false;b=false;CG.TopBarDropdown.events.afterHide.fire({id:g})})}return n},c=function(){y?e():p();return n},l=function(A,z){if(j(z.id)){CG.TopBarDropdown.animating=true;if(CG.TopBarDropdown.open_count==0){k.show()}CG.TopBarDropdown.open_count++}},h=function(A,z){if(j(z.id)){CG.TopBarDropdown.animating=false;if(!u){s()}u=true}},w=function(A,z){if(j(z.id)){CG.TopBarDropdown.animating=true}},v=function(A,z){if(j(z.id)){CG.TopBarDropdown.open_count--;if(CG.TopBarDropdown.open_count==0){k.hide()}CG.TopBarDropdown.animating=false}},t=function(z){c()},i=function(z){if(z==undefined||(z.type=="click"&&a(z.target).parents().index(m.get(0))==-1)){e()}if(a(z.target).get(0)==q.get(0)){return false}};o()};a.extend(CG.TopBarDropdown,{id_count:0,open_count:0,animating:false,events:{beforeShow:new CG.Event(),afterShow:new CG.Event(),beforeHide:new CG.Event(),afterHide:new CG.Event()}})})(jQuery);require(["jQuery","CG","CG.Event","CG.Overlay"],"CG.MessageWindow");(function(a){CG.MessageWindow=function(j,l,o){var e=this,f,m,g,d,h,b,n={id:"","class":"",hideClose:false,actions:[]},k=function(){a.extend(n,o||{});m=a("#top_bar");f=a('<div class="cg_message '+n["class"]+'" id="'+n.id+'"><div class="cg_message_bottom"></div></div>').css({position:"fixed",top:"-10000px",zIndex:m.css("zIndex")-1}).insertBefore(m);if(!n.hideClose){n.actions.push('<a href="#" onclick="return false;">X Close</a>')}d=a('<ul class="cg_message_actioncontainer"></ul>').appendTo(f);a.each(n.actions,function(p,q){d.append(a("<li></li>").append(a(q).click(c)))});if(l){h=a('<h1 class="cg_message_title">'+l+"</h1>").appendTo(f)}if(j){b=a('<div class="cg_message_content">'+j+"</div>").appendTo(f)}a.extend(e,{hide:c,show:i})},c=function(){CG.MessageWindow.events.beforeHide.fire({messageWindow:e});f.animate({top:"-="+f.outerHeight(true)+"px"},500,function(){CG.MessageWindow.events.afterHide.fire({messageWindow:e});g.hide()});return e},i=function(){if(!g){g=CG.Overlay.getInstance().show()}CG.MessageWindow.events.beforeShow.fire({messageWindow:e});f.css({top:"-"+(f.outerHeight()-m.outerHeight())+"px",left:Math.round((document.body.clientWidth-f.outerWidth())/2)+"px"}).animate({top:"+="+f.outerHeight()+"px"},500,function(){CG.MessageWindow.events.afterShow.fire({messageWindow:e})});return e};k()};CG.MessageWindow.events={beforeShow:new CG.Event(),afterShow:new CG.Event(),beforeHide:new CG.Event(),afterHide:new CG.Event()}})(jQuery);CG=typeof(CG)=="undefined"?{}:CG;CG.options={FriendManager:{defaultGame:2,FB:{inviteMessage:"You are invited to play Baseball Boss! Collect virtual baseball cards, use them to make a team and compete against other players online. Get 3 free starter packs of cards when you register. And oh yeah - it's free to register, so PLAY BALL!",inviteType:"Baseball Boss",inviteLanding:"http://www.baseballboss.com/promos/landing/baseball_boss_fb"}},Ticker:{url:"/notices/ticker",iconPath:"http://static0.baseballboss.com/img/"}};(function(d){Prototype.ScriptFragment='<script type=\\"text\\/javascript\\"[^>]*>([\\S\\s]*?)<\/script>';var a=false,e=function(){a=d(".cake-sql-log").length>0;Baseball.isLoggedIn=Boolean(d("#top_bar a[href='/users/accountsettings']").length);Baseball.staticServer=d("#top_bar img[src]:first").attr("src").replace(/(http|https)\:\/\//,"").split("/")[0];Baseball.events.startup.fire()},b=function(){return a},c=function(f){if(console&&console.log&&b()){console.log(f)}};Baseball={isDebug:b,startupfunctions:[],isLoggedIn:false,isIE6:false,isIE:false,staticServer:"static.baseballboss.com",cardServer:"cards.baseballboss.com",logoServer:"static.baseballboss.com",hasTextShadow:false,events:{startup:new CG.Event()}};window.log=c;d(document).ready(e)})(jQuery);(function(f){var k=0,a=[],l=[],d=[],m,b=function(){return a.length-l.length},i=function(){Baseball.events.startup.subscribe(g,-999);if(Ajax&&Ajax.Responders){Ajax.Responders.register({onCreate:h,onComplete:p})}f(document).ajaxSend(o).ajaxComplete(n);f(".bbb_ajax").live("click",e);f.ajaxSetup({cache:false})},g=function(){var q=f("#top_bar");if(q.length){m=f('<div id="ajax_indicator">Loading <img src="/img/c.gif" /></div>').appendTo(q).hide()}},j=function(r,q){a.push(r);d.push({url:q});if(m){m.show()}Baseball.Ajax.events.create.fire({url:q})},c=function(s){var q=f.inArray(s,a),r=d[q];l.push(a[q]);if(!b()&&m){m.hide()}Baseball.Ajax.events.complete.fire({url:r.url})},h=function(r,q){j(r.transport,r.url);r.log_id=(k++)+"_"+r.url},p=function(t,s){c(t.transport);if(f("#services-tab .panel-content-data").length){var q=f("#services-tab .panel-content-data"),r=s.responseText.match(/<!-- DEBUG DATA BEGIN([\s\S]*)DEBUG DATA END -->/)[0];if(r){r=r.substr(21,r.length-39).gsub("Page Statistics",t.log_id);q.insert({bottom:r})}}},o=function(s,r,q){j(r,q.url)},n=function(s,r,q){c(r)},e=function(r){var s={},q=this.href;f.each((q.split("?")[1]||"").split("&"),function(){var t=this.split("=");if(t.length){s[t[0]]=t[1]}});if(s.update){f("#"+s.update).load(q,null,function(){f("#"+s.update).data("url",q)})}else{f.get(q,null,function(u){if(s.alert&&u){alert(u)}else{if(s.reload){var t=f("#"+s.reload);if(t.length&&t.data("url")){t.load(t.data("url"))}}}})}return false};i();Baseball.Ajax={getCount:b,events:{create:new CG.Event(),complete:new CG.Event()}}})(jQuery);(function($){if(!Array.prototype.filter){Array.prototype.filter=function(fun){var len=this.length>>>0;if(typeof fun!="function"){throw new TypeError()}var res=new Array();var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){var val=this[i];if(fun.call(thisp,val,i,this)){res.push(val)}}}return res}}$.extend(Number.prototype,{mod:function(base){var num=this%base;return num<0?num+base:num},trunc:function(decimals,leadingZero){var num=this.toFixed(decimals);return num>0&&num<1&&leadingZero?String(num).substr(1):num},addCommas:function(){var num=String(this),x=num.split("."),x1=x[0],x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1,$2")}return x1+x2}});if(String.prototype.evalJSON){var __method=String.prototype.evalJSON;String.prototype.evalJSON=function(){return __method.apply(this.replace(/<!-- DEBUG DATA BEGIN([\s\S]*)DEBUG DATA END -->/,""))};delete __method}$.fn.pbGrow=function(newval,oldval,speed){var queue="pbq"+Math.random(),newval=Math.max(0,Math.min(100,newval===undefined?100:newval)),oldval=Math.max(0,Math.min(100,oldval===undefined?0:oldval)),speed=speed===undefined?1000:speed;return this.each(function(){var el=$(this),left=el.find(".front .left_corner"),right=el.find(".front .right_corner"),middle=el.find(".front .miniprogressbar"),width=middle.parent().width(),afterAnimate=function(){el.dequeue(queue)};el.find(".front").show();left.css("width",oldval==0?"0px":"5px").show();right.css("width",oldval<100?"0px":"5px").show();middle.css("width",width*oldval/100+"px").show();if(newval>oldval){if(oldval==0){el.queue(queue,function(){left.css({left:(middle.position().left-5)+"px",right:"auto"}).animate({width:"5px"},speed/5,afterAnimate)})}el.queue(queue,function(){middle.animate({width:width*newval/100+"px"},speed,afterAnimate)});if(newval==100){el.queue(queue,function(){right.css({left:middle.position().left+middle.width()+"px",right:"auto"}).animate({width:"5px"},speed/5,afterAnimate)})}}else{if(oldval>newval){if(oldval==100){el.queue(queue,function(){right.css({left:middle.position().left+middle.width()+"px",right:"auto"}).animate({width:"0px"},speed/5,afterAnimate)})}el.queue(queue,function(){middle.animate({width:width*newval/100+"px"},speed,afterAnimate)});if(newval==0){el.queue(queue,function(){left.css({left:(middle.position().left-5)+"px",right:"auto"}).animate({width:"0px"},speed/5,afterAnimate)})}}}el.dequeue(queue)})};$.fn.classData=function(attr){var el=this.eq(0),at=attr||"",pattern=new RegExp((at||"")+"\\:\\{.+\\}");return eval("("+((pattern.exec(el.attr("class"))||[""]).shift().substr(at.length+1)||"undefined")+")")};var _init=function(){Baseball.events.startup.subscribe(_onStartup);Baseball.Ajax.events.complete.subscribe(_onAjaxComplete)},_onStartup=function(){if(Baseball.isIE6){DD_belatedPNG.fix(".pngfix");setTimeout(_rboxIE6,2000)}},_onAjaxComplete=function(){if(Baseball.isIE6){DD_belatedPNG.fix(".pngfix");setTimeout(_rboxIE6,2000)}},_checkIESelect=function(){if(Baseball.isIE){$("select").each(function(){var el=$(this),key="selectWidthFixed";if(!el.data(key)){el.data(key,true).click(_onIESelectFocus).blur(_onIESelectBlur)}})}},_onIESelectFocus=function(){var el=$(this);el.data("origWidth",el.width()).css("width","auto").click()},_onIESelectBlur=function(){var el=$(this);if(el.data("origWidth")!==undefined){el.css("width",el.data("origWidth"))}},_rboxIE6=function(){$(".rbox").each(function(){var el=$(this),marked=el.data("markedAsRbox");if(!marked){el.data("markedAsRbox",true);el.find(".rbox_top_center").css({width:el.width()-el.find(".rbox_top_left").width()-el.find(".rbox_top_right").width()+" px"}).end().find(".rbox_bottom_center").css({width:el.width()-el.find(".rbox_bottom_left").width()-el.find(".rbox_bottom_right").width()+" px"}).end().find(".rbox_center_left").css({height:el.height()-el.find(".rbox_top_left").height()-el.find(".rbox_bottom_left").height()+" px"}).end().find(".rbox_center_right").css({height:el.height()-el.find(".rbox_top_right").height()-el.find(".rbox_bottom_right").height()+" px"}).end().find(".rbox_center_center").css({height:el.height()-el.find(".rbox_top_center").height()-el.find(".rbox_bottom_center").height()+" px",width:el.width()-el.find(".rbox_center_left").width()-el.find(".rbox_center_right").width()+" px"})}})};_init()})(jQuery);Baseball.Util={addMinMax:function(c,b){b=Object.extend({height:"30px"},b||{});var a=$(c),f="ballparkBanner",e=a.getStyle("height"),d=new Element("a",{href:"#",onclick:"return false;"}).update("Hide").setStyle({fontSize:".85em",position:"absolute",right:"5px",top:"5px"});Event.observe(d,"click",function(h){Baseball.Cookie.set(f,d.innerHTML);var g=d.innerHTML=="Hide"?b.height:e;new Effect.Morph(a,{style:{height:g},duration:2});d.update(d.innerHTML=="Hide"?"Show":"Hide");return false});if(Baseball.Cookie.load(f)==="Hide"){a.setStyle({height:b.height});d.update("Show")}a.insert(d)}};(function(g){var b,l=0,i=function(){Baseball.events.startup.subscribe(h)},h=function(){if(g("#flash_message").length){f(g("#flash_message"))}g(document).click(m)},m=function(q){var n=g(q.target);if(n.get(0).tagName.toLowerCase()!=="a"){n=n.parents("a").eq(0)}if(n.hasClass("bbb_modal")){var o=n.attr("href"),p=o.indexOf("?"),r={};if(p!==-1){g.each(o.substr(p+1).split("&"),function(s,u){var t=u.split("=");if(t.length==2&&t[0].substr(0,9)=="bbb_modal"){r[t[0].substr(10)]=parseInt(t[1],10)==t[1]?parseInt(t[1],10):t[1]}})}k(o,r);return false}},k=function(o,r){a();var r=g.extend(true,{closeOnClick:true,width:920,className:"modal_container",top:g(window).scrollTop()+100,left:(g(window).width()-(r&&r.width?r.width:920))/2,afterClose:function(){},afterOpen:function(){}},r||{}),q=typeof(o)=="string"?o:false,n=g(q?'<div id="bbb_modal_'+(l++)+'" class="'+r.className+'"></div>':o),t=function(u){u.w.show();Baseball.Window.events.createModal.fire({url:q,container:n});if(r.closeOnClick){u.w.jqmAddClose("#top_bar_overlay")}r.afterOpen.call(u.w)},p=function(u){u.w.remove();u.o.remove();Baseball.Window.events.closeModal.fire({url:q,container:n});r.afterClose.call(u.w)},s=function(u){Baseball.Window.events.loadModal.fire({url:q,container:n})};b=n.css({position:"absolute",width:r.width+"px",top:r.top+"px",left:r.left+"px"}).prependTo(document.body).jqm({ajax:q,ajaxText:'<img src="/img/help_load.gif" style="position: absolute; top: 100px; left: '+((r.width-16)/2)+'px"/>',overlay:75,modal:!r.closeOnClick,closeClass:"modal_close",onShow:t,onHide:p,onLoad:s}).jqmShow()},a=function(){if(b){b.jqmHide()}},j=function(){return String(window.location.hash)==""},e=function(q){var p=j()?[]:g.grep(window.location.hash.replace(/\#/g,"").split("/"),function(r){return r!=""});var n=q.split(":")[0];var o=false;g.each(p,function(r,t){if(t.split(":")[0]==n){o=true}if(o){p=p.without(t)}});p.push(q);window.location.hash="/"+p.join("/")},c=function(n){var o=g.grep(window.location.hash.split("/"),function(p){return p.split(":")[0]==n});if(typeof(o)=="undefined"){return false}return o.split(":")[1]},f=function(n){if(n.length){k(n,{width:940,top:-1000000,afterOpen:function(){n.css({top:-n.height()+"px"}).animate({top:"-15px"},500)}});n.find(".close_link").click(function(){d(n)})}},d=function(n){if(n.length){n.animate({top:-n.height()+"px"},500,function(){g(".jqmOverlay").click()})}};Baseball.Window={createModal:k,closeModals:a,addToHash:e,events:{createModal:new CG.Event(),closeModal:new CG.Event(),loadModal:new CG.Event()}};i()})(jQuery);(function(e){var a=function(h,i,f){var g=h+"="+escape(i)+";path=/";g+=f?";expires="+f:"";document.cookie=g},c=function(g){var f=e.grep(document.cookie.split(";"),function(h){return e.trim(h.split("=")[0])==e.trim(g)});if(f.length){return unescape(f[0].split("=")[1]||false)}return false},d=function(f){return e.grep(document.cookie.split(";"),function(g){return e.trim(g.split("=")[0])==e.trim(f)}).length>0},b=function(f){document.cookie=f+"=1;path=/;expires="+(new Date()).toGMTString()};Baseball.Cookie={set:a,load:c,check:d,"delete":b}})(jQuery);(function(g){var b=[],f=function(){Baseball.events.startup.subscribe(a);Baseball.Ajax.events.complete.subscribe(d)},e=function(){g(".bbb_filters").each(function(h,j){var j=g(j);if(!j.data("markedAsFilter")){j.data("markedAsFilter",true);new c(j)}})},a=function(h){e()},d=function(h){e()};var c=function(j){var s,u,r,k,i,q={},h,t={update:"",method:"get"},p=function(){s=j;k=s.attr("action");u=s.find("*:input");r=s.find(".bbb_filters_submit");i=s.find(".bbb_filters_jump");var v=k.split("?");if(v.length>1){g.each(v[1].split("&"),function(w,y){var x=y.split("=");if(x.length>1){t[x[0]]=x[1]}})}k=v[0];g.each(k.split("/"),function(x,y){var w=y.split(":");if(w.length>1){q[w[0]]=w[1];k=k.substr(0,k.indexOf(y)-1)+k.substr(k.indexOf(y)+y.length)}});i.click(l);s.submit(m);u.filter("select").change(o);r.click(n)},m=function(v){u.each(function(x,y){var y=g(y),z=(y.is(":checkbox")?y.attr("checked"):y.val()),w=y.attr("id");if(w){z=typeof(z)==="boolean"?Number(z):z;if(t.method=="post"){h=h||{};h[w]=z}else{q[w]=z}}});g.each(q,function(w,x){if(x){k+="/"+w+":"+encodeURIComponent(x)}});if(t.update){g("#"+t.update).load(k,h||null).data("url",k)}else{window.location=k}return false},o=function(v){s.submit()},n=function(v){s.submit();return false},l=function(w){var v=prompt("Jump to page");if(v>0){q.page=v;s.submit()}return false};p()};f()})(jQuery);(function(b){var a=function(c){var c=c||[],d=new CG.Event();if(!b.isArray(c)){c=[c]}b.post("/owners/assets",{asset_list:c.join("|")},function(e){d.fire(e)},"json");return d};CG.Cache.set({trades:undefined,auctions:undefined,challenges:undefined,currency:undefined,teams:undefined,packs:undefined,milestones:undefined},a)})(jQuery);(function(d){var b,g=function(){Baseball.events.startup.subscribe(f);CG.Cache.events.set.subscribe(h)},f=function(){if(Baseball.isLoggedIn&&d("#wrapper").length){b=d('<div class="dropdown"></div>').appendTo("#main_navigation");CG.Cache.reload(["trades","auctions","milestones","teams","challenges","currency","packs"])}},h=function(n,m){if(m&&m.key&&m.value!==undefined){switch(m.key){case"trades":k(m.value);break;case"auctions":e(m.value);break;case"packs":a(m.value);break;case"currency":l(m.value);break;case"challenges":c(m.value);break;case"milestones":i(m.value);break;case"teams":j(m.value);break;default:break}}},k=function(m){d("#owner_info .quick_info .label:first").text("Trades");d("#owner_info .quick_info .value:first").html('<a href="/owners/view/#/owner_tabs:pendingTrades">'+m+"</a>")},e=function(m){d("#owner_info .quick_info .label:last").text("Auctions");d("#owner_info .quick_info .value:last").html('<a href="/auctions/#/auction_tabs:myListings">'+m+"</a>")},i=function(m){d(".progress_container.milestones").find(".rollover_content").html("<strong>Unlocked: </strong>"+m.total+'<strong style="padding-left: 20px;">Completed: </strong>'+m.achieved+"<br />").append('<a href="/milestones/byowner" class="callout bbb_modal bbb_help">View All Milestones</a>').parents(".rbox:first").css("display","").end().end().find(".miniprogressbar_container").pbGrow(m.total>0?100*m.achieved/m.total:0)},l=function(m){d("#market .nav_extra").text(Number(m.coins).addCommas()+" CC :: "+Number(m.tickets).addCommas()+" Tickets")},a=function(m){d("#cards .nav_extra").text(m+" unopened packs")},c=function(m){d("#ballpark .nav_extra").text(m+" open challenges")},j=function(n){var m=[],o=d('<ul id="navteamdrop"></ul>').appendTo(b.empty());d.each(n,function(q,p){if(p.full_name){p.id==n.active_team?m.unshift(p):m.push(p)}});d.each(m,function(){var r=d('<a href="/avatars/setteam/'+this.id+'">Set As Active Team</a>').click(function(){o.hide();d.get(this.href,null,function(){document.fire("team_dropdown:teamchange",{team:this});CG.Cache.reload("teams")});return false}),q=d('<a href="/teams/edit/'+this.id+'?bbb_modal_width=960&bbb_modal_closeOnClick=0" class="bbb_modal">Edit Roster</a>'),s=d("<ul></ul>").append(r).append('<a href="/teams/view/'+this.id+'/">View Team Page</a>').append(q);if(this.division_id){s.append('<a href="/ladders/division/'+this.division_id+'/">Division: '+this.division_name+"</a>")}if(this.season_id){s.append('<a href="/leagues/view/'+this.league_id+'/">League: '+this.league_name+"</a>")}o.append(d('<li><a href="/teams/view/'+this.id+'" class="pngfix">'+this.full_name+"</a></li>").append(s.find("a").wrap("<li></li>").end()));if(this.id==n.active_team){if(this.division_id){var p="/ladders/division/"+this.division_id}else{if(this.season_id){var p="/leagues/view/"+this.league_id}else{var p="/ballpark"}}d("#play_ball a").attr("href",p)}});if(n.promotion_watch){d(".progress_container.promotion").find(".rollover_content").html("<strong>Wins: </strong>"+n.promotion_watch.wins+'<strong style="padding-left: 20px;">Wins Needed: </strong>'+n.promotion_watch.total+"<br />").append('<a href="/ladders/division/'+n[n.active_team].division_id+'" class="callout">View Division</a>').append('<a href="/ladders/autochallenge" class="callout">Find A Game</a>').parents(".rbox:first").css("display","").end().end().find(".miniprogressbar_container").pbGrow(n.promotion_watch.total>0?100*n.promotion_watch.wins/n.promotion_watch.total:0)}};g()})(jQuery);(function(c){var f={},g=[],n={},d=false,l=function(){return false},k=function(){Baseball.events.startup.subscribe(h);Baseball.Ajax.events.complete.subscribe(b);c("a").live("click",e);c(".bbb_tab").live("click",l)},h=function(o){i();m();d=true;c(".bbb_tab").die("click",l)},b=function(q){if(d){var p=c.extend([],g);m();var o=c.grep(c.extend([],g),function(s,r){return c.inArray(s,p)===-1});c.each(o,j)}},e=function(q){var o=c(this),p=(o.attr("href")||"").split("#").filter(function(s){return s!==""});if(p.length>1&&(p[0]==window.location.href.substr(0,p[0].length)||p[0]==window.location.pathname.substr(0,p[0].length))||p[0]=="#"){window.location.hash=p[1]||" ";i();var r=c.grep(p[1].split("/"),function(s){return s!=""});if(r.length){r=r[0].split(":");c("#"+r[0]+" .bbb_tab[rel="+r[1]+"]").dblclick()}return false}},m=function(){c(".bbb_tabs").each(j)},j=function(p,o){var q=o.id;if(q&&c.inArray(o,g)===-1){g.push(o);f[q]=new a(o)}},i=function(){c.each(window.location.hash.split("/"),function(o,p){var q=p.split(":");if(q.length>1){n[q[0]]=q[1]}})};var a=function(p){var t=this,z,B,u,y,w,s=[],r={},q=false,x=function(){B=c(p);z=B.attr("id");w=z&&n[z]&&B.find("[rel="+n[z]+"]").length?B.find("[rel="+n[z]+"]"):B.find(".bbb_tab.bbb_tab_default");u=c("#"+(B.attr("id")?B.attr("id")+"_update":"tab_update"));if(B.length){B.find(".bbb_tab").click(v).dblclick(o);w.click()}},v=function(F){if(!q){var G=c(this),D=G.attr("rel"),C=G.attr("href");if(!s.length||(s.length&&G.attr("rel")!==s[0].attr("rel"))){q=true;s.unshift(G);B.find(".bbb_tab").removeClass("selected");G.addClass("selected");if(C&&C!="#"&&C!=(window.location.protocol+"//"+window.location.host+window.location.pathname+"#")&&u.length){if(r[D]){if(s.length>1&&!r[s[1].attr("rel")]){r[s[1].attr("rel")]=y}r[s[1].attr("rel")].hide();Baseball.Tabs.events.hide.fire({tab:s[1],content:r[s[1].attr("rel")]});y=r[D].show();Baseball.Tabs.events.show.fire({tab:G,content:r[D]});A()}else{if(s.length>1&&!r[s[1].attr("rel")]){r[s[1].attr("rel")]=y}if(s.length>1){r[s[1].attr("rel")].hide();Baseball.Tabs.events.hide.fire({tab:s[1],content:r[s[1].attr("rel")]})}y=c('<div id="bbb_tabs_'+z+"_"+D+'" class="loading_placeholder"></div>').appendTo(u);y.show().load(C,null,A).data("url",C);Baseball.Tabs.events.show.fire({tab:G,content:y})}}else{var E="."+D.replace(/(\#|\;|\&|\,|\.|\+|\*|\~|\'|\:|\"|\!|\^|\$|\[|\]|\(|\)|\=|\>|\||\/)/g,"\\$1")+"_content";u.find(">*").hide().end().find(E).show();A()}}}return false},o=function(E){if(!q){var F=c(this),D=F.attr("rel"),C=F.attr("href");if(!E.clientX){F.click()}q=true;s.unshift(F);B.find(".bbb_tab").removeClass("selected");F.addClass("selected");if(C&&C!="#"&&u.length){if(s.length>1&&!r[s[1].attr("rel")]){r[s[1].attr("rel")]=y}if(r[D]){r[D].remove();r[D]=null}y=c('<div id="bbb_tabs_'+z+"_"+D+'" class="loading_placeholder"></div>').appendTo(u);Baseball.Tabs.events.hide.fire({tab:s[1],content:r[s[1].attr("rel")]});y.show().load(C,null,A).data("url",C);Baseball.Tabs.events.show.fire({tab:F,content:y})}}return false},A=function(C){if(y){y.removeClass("loading_placeholder")}Baseball.Window.addToHash(z+":"+s[0].attr("rel"));q=false;Baseball.Tabs.events.load.fire({tab:s[0],content:y})};x()};Baseball.Tabs={tabs:f,events:{show:new CG.Event(),hide:new CG.Event(),load:new CG.Event()}};k()})(jQuery);(function(g){var e,c,i,h=function(){Baseball.Window.events.loadModal.subscribe(f)},f=function(l,k){if(k&&k.url&&(k.url.match(/\/milestones\/byowner/)||[]).length){a();b()}},a=function(){e=g("#milestone_container");c=e.find(".info_box");e.find("tbody tr").click(j).eq(0).click()},j=function(n){var m=n.currentTarget?g(n.currentTarget):g(n.target),k=(/\<\!\-\- BEGIN MILESTONE TEXT[\s\S]*END MILESTONE TEXT \-\-\>/.exec(m.html())||[""]).shift(),l=g.trim(k.substr(25,k.length-47));c.html(l);e.find("tbody tr").removeClass("selected");m.addClass("selected")},b=function(){i=g("#milestone_controls .milestone_control");i.each(function(k,m){var m=g(m),l=m.attr("id").substr(11);m.text(m.text()+" ("+e.find("tr."+l).length+")").click(d)});i.eq(0).click()},d=function(m){var l=m.currentTarget?g(m.currentTarget):g(m.target),k=l.attr("id").substr(11);e.find("tr").hide().end().find("tr."+k).show();i.removeClass("selected");l.addClass("selected");return false};h()})(jQuery);(function(g){var c,a={visibleThreshold:2,modalTypes:["P2P","Auction","Trade"],modalOptions:{Trade:{width:960,height:500}}},f=function(){Baseball.events.startup.subscribe(b)},b=function(){c=g("#message_widget");if(Baseball.isLoggedIn&&c.length){h()}},d=function(){c.html('<div id="all_messages"></div>');h()},h=function(){g.getJSON("/messages/fetch",null,function(l){if(l){var j=l.total_messages,i=l.messages,k=c.find(".message").length;g.each(i,function(s,n){if(s<a.visibleThreshold-k){var o=g('<div class="message"></div>'),q=n.message_type=="P2P"?"/messages/p2p/"+n.from_avatar_id:(n.link?n.link:"/messages/view/"+n.id),t=g('<a href="'+q+'" class="message_link">'+n.subject+"</a>").truncate(35).click(e).data("message",n),p='<img src="'+n.icon_img+'" class="message_img"/>',r='<div class="message_date">'+n.created+"</div>";c.append(o.append(p).append(t).append(r))}else{return false}});g("#all_messages").html('<a href="/messages/index" class="bbb_modal">View all messages<br />'+(j?"("+j+" Unread)":"")+"</a>")}})},e=function(j){var i=g(this).data("message");g.get("/messages/markasread/"+i.id,null,function(){d()});if(g.inArray(i.message_type,a.modalTypes)!==-1||!i.link){Baseball.Window.createModal(this.href,a.modalOptions[i.message_type]?a.modalOptions[i.message_type]:{})}else{setTimeout(function(){window.location.href=i.link},400)}return false};f()})(jQuery);(function(d){var b=["/trades/create","/trades/review","/auctions/create"],e,c=function(){window.customFlashEvent=function(g,h){if(Baseball.Flash.events[g]){Baseball.Flash.events[g].fire(h)}};Baseball.Window.events.loadModal.subscribe(f)},f=function(h,g){if(g&&g.url){d.each(b,function(){if((new RegExp(this)).test(g.url)){e=this;Baseball.Flash.events.saveCompleted.subscribe(a);return false}})}},a=function(h,g){if(e){switch(String(e)){case"/auctions/create":d('#auction_tabs a[rel="allAuctions"]:first').dblclick();Baseball.Window.closeModals();break;case"/trades/create":case"/trades/review":d('#owner_tabs a[rel="pendingTrades"]:first').dblclick();Baseball.Window.closeModals();default:Baseball.Window.closeModals();break}}Baseball.Flash.events.saveCompleted.unsubscribe(a);e=null};Baseball.Flash={events:{saveCompleted:new CG.Event(),saveFailed:new CG.Event()}};c()})(jQuery);(function($){var _tabs,_init=function(){Baseball.events.startup.subscribe(_onStartup,-1);Baseball.Window.events.loadModal.subscribe(_onModalLoad);$("#challenge_tabs_update .game_choice").live("click",_onChoiceClick);$(".challenge_go").live("click",_onChallengeClick);$(".bbb_scrimmage").live("click",_onScrimmageClick);$(".game_choose .game_move a").live("click",_onMoveClick)},_onModalLoad=function(){$(".team_info_box select").change(_onChange).change();_tabs=$("#challenge_tabs .bbb_tab");if(_tabs.length>0){Baseball.Tabs.events.show.subscribe(_onTabShow);Baseball.Tabs.events.load.subscribe(_onTabLoad);_tabs.find(".tab_title").hide().end().find(".tab_preprocess").show();_simNext()}},_onStartup=function(){$(".team_info_box select").change(_onChange).change();_tabs=$("#challenge_tabs .bbb_tab");if(_tabs.length>0){Baseball.Tabs.events.show.subscribe(_onTabShow);Baseball.Tabs.events.load.subscribe(_onTabLoad);_tabs.find(".tab_title").hide().end().find(".tab_preprocess").show();_simNext()}},_simNext=function(){var prev=_tabs.filter(":has(.tab_process:visible):last"),next=_tabs.filter(":has(.tab_preprocess:visible):first");if(next.length){next.find(".tab_preprocess").hide().end().find(".tab_process").show();setTimeout(_simNext,2000)}prev.find(".tab_process").hide().end().find(".tab_title").show()},_onTabShow=function(e,data){var index;if(data&&data.tab&&(index=_tabs.index(data.tab))!=-1){data.tab.find("span").hide();_tabs.filter(":lt("+(index+1)+"):has(.tab_winner:hidden)").find(".tab_winner").show();_tabs.filter(":lt("+(index+1)+"):has(.tab_title:hidden)").find(".tab_title").show().end().find(".tab_preprocess").hide().end().find(".tab_process").hide();if(index==0){$(".pregame_help").show();$(".game_help").hide();$(".summary_help").hide()}else{if(index>=_tabs.length-1){$(".pregame_help").hide();$(".game_help").hide();$(".summary_help").show()}else{$(".pregame_help").hide();$(".game_help").show();$(".summary_help").hide()}}}},_onTabLoad=function(e,data){if(data&&data.tab&&data.tab.attr&&(data.tab.attr("href")||"").substr(0,19)=="/challenges/summary"){$(".performance_box .perf_box").each(function(i,box){var box=$(box),imgs=box.find("img").hide(),rows=box.find("tr"),img=imgs.eq(0).show();rows.hover(function(){imgs.hide();imgs.eq(rows.index(this)).show()},function(){imgs.hide();img.show()})})}},_onChange=function(e){var el=$(this),box=el.parents(".team_info_box:first"),options=el.find("option"),option=el.find("option:selected");box.find(".lineup_content table, .rotation_content table, .bullpen_content table").hide().end().find(".profile_"+option.attr("value")).show();options.each(function(){$(this).text($(this).text().replace(/^Selected\:\s/,""))});option.prepend("Selected: ")},_onChoiceClick=function(e){var $el=$(this),$parent=$el.parents("ul:first"),choice=(this.href.match(/\/boxscore/)||[]).length?"boxscore":"animate",opposite=choice=="boxscore"?"animate":"boxscore";$.get(this.href,function(){$parent.find(".game_"+opposite).append($el.attr("href",$el.attr("href").replace(new RegExp(choice),opposite)))});return false},_onChallengeClick=function(e){var $el=$("form .challenge_go"),$parent=$el.parents("form:first"),$container=$parent.parents(".modal_container:first"),options=$el.getData("modal-options");$.ajax({url:$parent.attr("action"),dataFilter:_dataFilter,data:$parent.serialize(),success:_ajaxSuccess(options||{}),type:"post"});return false},_onScrimmageClick=function(e){var $el=$(this);$.ajax({type:"get",url:$el.attr("href"),dataFilter:_dataFilter,success:_ajaxSuccess({})});return false},_ajaxSuccess=function(options){return function(data){if(data){if(data.redirect){if(/\/challenges\/view/.test(data.redirect)){Baseball.Window.createModal(data.redirect,$.extend({width:980},options||{}))}else{if(location.href==data.redirect){location.reload()}else{location.href=data.redirect}}}else{if(data.message){}else{Baseball.Window.createModal($("<div>"+data+"</div>"),options)}}}}},_dataFilter=function(data,t){try{return eval("("+data+")")}catch(_){}return data},_onMoveClick=function(e){var $el=$(this),dir=$el.parents("li:first").hasClass("game_move_prev")?-1:1,$tabs=$("#challenge_tabs .bbb_tab"),$selected=$tabs.filter(".selected"),index=$tabs.index($selected.get(0));console.log(dir,index,$selected.get(0));$tabs.eq(index+dir).click();return false};_init()})(jQuery);(function(d){var m,j,l=new CG.Event,r={Poor:"Fair",Fair:"Good",Good:"Very Good","Very Good":"Excellent",Excellent:"Near Mint","Near Mint":"Mint"},p={all_cards:"All Cards",my_cards:"My Cards",missing_cards:"Missing Cards",sold_cards:"Sold Cards"},g,h=function(){Baseball.events.startup.subscribe(s);Baseball.Ajax.events.complete.subscribe(q);Baseball.Window.events.loadModal.subscribe(f)},s=function(){c();o()},q=function(){if(d("img.player_card_img").length){c();o();n();e();if(m){l.fire({shoeboxes:m})}}},f=function(){k()},e=function(){var v=d("#col_filters_array");if(v.length){var u=v.find(".selected:first"),t=v.find("label:first").text("Viewing: "+p[u.attr("id")]);v.find("li.mode_filter").each(function(){var w=d(this);w.hover(function(){t.text("View: "+p[w.attr("id")])},function(){t.text("Viewing: "+p[u.attr("id")])})})}},k=function(){var t=d("#set_information table .info_link");if(t.length){t.click(function(){var u=d(this).parents("tr:first").attr("class").replace(/set\_/,"");d("#set_information").hide();d(".sets_container").hide();d("#set_container_"+u).show();return false});d(".sets_container h1 a").click(function(){d(".sets_container").hide();d("#set_information").show();return false})}},n=function(){g=g||0;var t=d("#bbb_tabs_collection_tabs_cards .miniprogressbar_container"),u=parseInt(d("#bbb_tabs_collection_tabs_cards #checklist_counts label").text(),10);if(t.length){t.pbGrow(u,g);g=u;d("#bbb_tabs_collection_tabs_cards #checklist_counts span").css("color",u>=100?"green":"red")}},o=function(){d(".card_container a.bbb_restore").each(function(){var t=d(this);if(!t.data("restoreAdded")){t.data("restoreAdded",true).click(b)}})},c=function(){d(".card_container a:has(img.player_card_img)").each(function(){var u=d(this);if(!u.data("rolloverAdded")){u.data("rolloverAdded",true);var w=u.classData("card_info"),v=d("<ul></ul").insertAfter(u).css({position:"absolute",left:"0px",width:"150px",bottom:"0px",opacity:0.75,padding:"10px 0px",background:"#000"});v.css("bottom",20+v.offset().top+v.height()-u.offset().top-u.height()).css("left",(v.parent().width()-150)/2+"px").hide();if(w&&w.rollover){if(d.inArray("auction",w.rollover)!==-1&&w.card_id){v.append('<a href="/auctions/create/'+w.card_id+'" class="bbb_modal">Auction This Card</a>')}if(d.inArray("vendor",w.rollover)!==-1&&w.card_id){d('<a href="/collections/vendoritem/'+w.card_id+'">Sell for '+w.tier+" ticket"+(w.tier>1?"s":"")+"</a>").click(i).appendTo(v)}if(d.inArray("owners",w.rollover)!==-1&&w.proto_id){v.append('<a href="/collections/viewowners/'+w.proto_id+'" class="bbb_modal">Show Card Owners</a>')}if(d.inArray("auctions",w.rollover)!==-1&&w.proto_id){v.append('<a href="/collections/viewauctions/'+w.proto_id+'" class="bbb_modal">Show Auctions</a>')}if(typeof(w.shoeboxes)=="string"){w.shoeboxes=[w.shoeboxes]}if(d.inArray("shoeboxes",w.rollover)!==-1){if(!j){j=true;d.get("/shoeboxes/view/0/json",null,function(x){m=x;l.fire({shoeboxes:x})},"json")}function t(y,x){if(x.shoeboxes&&x.shoeboxes.length){v.append("<li><strong>Shoeboxes</strong></li>");d.each(x.shoeboxes,function(){if(d.inArray(this.name,w.shoeboxes||[])!==-1){d('<a href="/shoeboxes/changetag/'+w.card_id+"/remove/"+escape(this.name)+'">REMOVE: '+this.name+"</a>").click(a).appendTo(v).wrap("<li></li>")}else{d('<a href="/shoeboxes/changetag/'+w.card_id+"/add/"+escape(this.name)+'">ADD: '+this.name+"</a>").click(a).appendTo(v).wrap("<li></li>")}})}l.unsubscribe(t)}l.subscribe(t)}v.find("a").wrap("<li></li>")}u.parent().hover(function(){v.show()},function(){v.hide()})}})},i=function(x){var w=d(this),u=w.parents(".card_container:first"),v=u.width(),t=u.height();d.get(this.href,null,function(y){if(y.message){if(y.message=="OK"){u.animate({opacity:0},1000,function(){u.empty().css({width:v+"px",height:t+"px"})})}else{alert(y.message)}}},"json");return false},a=function(w){var v=d(this),t=v.parent(),u=/\/add\//.test(this.href)?"add":"remove";d.get(this.href,null,function(x){if(x=="success"){if(u=="add"){v.attr("href",v.attr("href").replace(/\/add\//,"/remove/"));v.text(v.text().replace(/ADD\:/,"REMOVE:"))}else{v.attr("href",v.attr("href").replace(/\/remove\//,"/add/"));v.text(v.text().replace(/REMOVE\:/,"ADD:"))}}},"json");return false},b=function(){var t=d(this);d.get(this.href,null,function(u){if(u.message){alert(u.message)}else{t.parents("li:first").find("strong:first").text(u.new_condition);CG.Cache.reload("currency");if(response.new_condition=="Mint"){t.parents("span").replace()}else{t.text("Restore to "+r[u.new_condition])}}},"json");return false};h()})(jQuery);(function(f){var h,g,e,d=function(){Baseball.Tabs.events.load.subscribe(b);f("table#pack_table a").live("click",a)},b=function(j,i){h=f("table#pack_table").eq(0);if(h.length&&!h.data("packsLoaded")){h.data("packsLoaded",true);g=f("#pack_contents");c()}},c=function(){var i=h.find("tbody").empty(),j=h.find(".loading_row").show();if(!j.length){j=f('<tr class="loading_row"><td style="text-align:center;" colspan="4"><img src="/img/ajax_load.gif" /></td></tr>').appendTo(h)}f.get("/collections/bundledata",null,function(k){j.hide();if(k.length){f.each(k,function(l){h.append('<tr class="'+(l%2==0?"even":"odd")+'"><td>'+this.setname+"</td><td>"+this.type+"</td><td>"+this.count+'</td><td><a href="/collections/openpack/'+this.first_bundle_id+'">Open One</a></td></tr>')})}else{h.after('<div style="height: 100px; line-height: 100px; text-align: center; font-weight: bold; color: #DDD; font-size: 2em; text-transform: uppercase;">You have no packs to open</div>').hide()}},"json")},a=function(){if(!e){var i=this;e=true;g.html('<img id="packloadingimg" style="position: absolute; left: 472px; top: 175px;" src="/img/ajax_load.gif" />').animate(g.height()<100?{height:"300px",opacity:0}:{opacity:0},1000,function(){g.css({opacity:1})}).load(i.href,null,function(){CG.Cache.reload("packs");c();e=false;if(g.find("#packloadingimg").length){a.call(i)}})}return false};d()})(jQuery);(function(d){var f=0,b=false,c,a=false,k,p,i=[],o,h=function(){Baseball.events.startup.subscribe(e)},e=function(){k=d("#rotating_banners li");if(k.length){k.css("opacity",0).show().eq(f).css({opacity:1,zIndex:100});_container=d('<ul id="controls"></ul>');k.parent().after(_container);p={back:d('<a href="#">&larr;</a>').appendTo(_container).wrap("<li></li>").click(g),playtoggle:d('<a href="#"></a>').appendTo(_container).wrap("<li></li>").click(m),forward:d('<a href="#">&rarr;</a>').appendTo(_container).wrap("<li></li>").click(j)};n()}},g=function(){l(-1);return false},m=function(){n();return false},j=function(){l(1);return false},n=function(){if(!b){c=setInterval(j,5000);p.playtoggle.html("||");b=true}else{if(c){clearInterval(c);c=null}p.playtoggle.html("&gt;");b=false}},l=function(r){if(!o){o=true;var q=Number(f+r).mod(k.length);k.eq(q).css({zIndex:10,opacity:1}).end().eq(f).css("zIndex",100).animate({opacity:0},2000,function(){k.eq(f).css("zIndex",0);f=q;o=false})}};h()})(jQuery);(function(e){var d,c=function(){Baseball.events.startup.subscribe(a)},a=function(){var g=/^\/leagues\/view\//,h=window.location.pathname.replace(g,"").replace(/\//g,"");if(g.test(window.location.pathname)&&h&&h.length==36){d=e("#league_nav_list").change(b);d.attr("selectedIndex",d.find("option[value="+e("#lg_tabs .bbb_tab.selected").attr("rel")+"]").attr("index"));e("a").live("click",f)}},b=function(){var g=d.find(":selected");e(".bbb_tab[rel="+(g.text()=="League Home"?"leagueHome":g.attr("value"))+"]").click()},f=function(){var g=/((\/leagues\/linfo\/)|(\/seasons\/view\/))/;if(this.href&&this.href.match(g)){var h=this.href.replace(window.location.protocol+"//"+window.location.host,"").replace(g,"");d.attr("selectedIndex",d.find("option[value="+h+"]").attr("index")).change();return false}};c()})(jQuery);(function(g){var e=true,f=function(){Baseball.events.startup.subscribe(a);Baseball.Tabs.events.load.subscribe(b)},a=function(){if(/^\/marketplace\/store/.test(window.location.pathname)&&g("#alert_box").length){c()}},b=function(i,h){if(h&&h.tab&&h.tab.attr("href")&&h.tab.attr("href").match(/^\/marketplace\/cards/)&&!e){d();e=true}},c=function(){CG.Cache.events.set.unsubscribe(c);var i=g("#alert_box"),h=CG.Cache.getStatus("packs");if(h===CG.Cache.STATUS_SET&&CG.Cache.get("packs")){i.find(".rbox_content").html("You have "+CG.Cache.get("packs")+' packs to open! <a href="/collections/view/#/collection_tabs:packs">Go open one!</a>');if(i.is(":hidden")){i.css("opacity",0).show().animate({opacity:1})}}else{CG.Cache.events.set.subscribe(c)}},d=function(){var h={};g(".store_products").find("a").hide().end().find("tr").each(function(){var j=g(this).addClass("hasProducts"),i=g.extend(j.classData("data")||{},{row:j});if(i&&i.set_id&&i.bundle_type){h[i.set_id+"_"+i.bundle_type]=i}});g.get("/marketplace/getsetcount",null,function(i){if(i){g.each(i,function(){var k;if(k=h[this.set_id+"_"+this.bundle_type]){var j=this.num==0?'<span style="color: red;">SOLD OUT</span>':(this.num==-1?"":this.num+" REMAINING");k.row.find(".num_left").html(j);if(this.num==0){k.row.removeClass("hasProducts")}}});g(".store_products tr.hasProducts a").show()}},"json")};f()})(jQuery);(function(c){var b=function(){CG.MessageWindow.events.afterShow.subscribe(a)},a=function(f,d){c(".cg_message.cg_reminder").each(function(h,e){var e=c(e);if(!e.data("remindeImgFix")){e.data("remindeImgFix",true);var j=e.find(".cg_message_content a:first"),g=e.find("img.cg_message_reminder_image");if(j.length&&g.length){g.wrap('<a href="'+j.attr("href")+'"></a>')}}})};b()})(jQuery);(function(f){var d,c,e=function(){Baseball.events.startup.subscribe(a)},a=function(){d=f("#team_selector");if(d.length){c=d.find(".team_filters li a").click(b).each(function(){var h=f(this),g=(h.text().substr(0,h.text().indexOf(" "))||h.text()).toLowerCase();h.text(h.text()+" ("+d.find("li."+g).length+")")});c.eq(0).click()}},b=function(){var h=f(this),g=(h.text().substr(0,h.text().indexOf(" "))||h.text()).toLowerCase();d.find("ul.team_rows > li").hide().filter("."+g).show();c.removeClass("selected");h.addClass("selected");return false};e()})(jQuery);(function(e){var b,f,d=function(){Baseball.events.startup.subscribe(a)},a=function(){b=e("#relationship_info a.button").click(c);if(b.length){f=b.get(0).href.replace(/.*\/owners\/setrelationship\/\d\//,"")}},c=function(){b.animate({opacity:0});e.get(this.href,null,function(g){if(g&&typeof(g.new_relation)!=undefined){switch(Number(g.new_relation)){case 2:b.eq(0).attr("href","/owners/setrelationship/"+1+"/"+f).find("em").text("Make A Friend");b.eq(1).attr("href","/owners/setrelationship/"+0+"/"+f).find("em").text("Remove As Rival");break;case 1:b.eq(0).attr("href","/owners/setrelationship/"+0+"/"+f).find("em").text("Remove As Friend");b.eq(1).attr("href","/owners/setrelationship/"+2+"/"+f).find("em").text("Make A Rival");break;case 0:default:b.eq(0).attr("href","/owners/setrelationship/"+1+"/"+f).find("em").text("Add As Friend");b.eq(1).attr("href","/owners/setrelationship/"+2+"/"+f).find("em").text("Add As Rival");break}b.animate({opacity:1})}},"json");return false};d()})(jQuery);(function(d){var c=function(){Baseball.events.startup.subscribe(b);Baseball.Ajax.events.complete.subscribe(e)},b=function(){a()},e=function(){a()},a=function(){d(".comment_form").each(function(){var f=d(this);if(!f.data("addedComments")){f.data("addedComments",true);var g=(f.find("form").attr("action")||"").replace(/.*\/comments\/post\//,"");if(g){f.find("#comment_list").load("/comments/view/"+g).data("url","/comments/view/"+g)}}})};c()})(jQuery);(function(d){var c=function(){Baseball.events.startup.subscribe(a)},a=function(){d("#award_container .award img").hover(e,b)},e=function(){var f=d(this);if(!f.data("tipInited")){var g=f.siblings(".award_tip").show();f.data("tipInited",true).data("tip",g);g.appendTo(f.parents("#award_container").eq(0)).css({top:"10px",left:f.offset().left-g.offset().left+Math.round((f.width()-g.outerWidth())/2)+"px"})}f.data("tip").show()},b=function(h){var f=d(this),g=f.data("tip");if(h.relatedTarget===g.get(0)){function i(){g.unbind("mouseleave",i);g.hide()}g.bind("mouseleave",i)}else{g.hide()}};c()})(jQuery);(function(h){var l,d,k,o=function(){Baseball.events.startup.subscribe(g)},g=function(){if((l=h("#myteams_widget")).length){if(l.find("#allteams").length){d=h('<div class="loading_placeholder"></div>').insertAfter(l.find(".title:first")).hide()}else{h(".selectedteam").show()}c()}if((k=h("#milestones_widget")).length){m()}if(true){p()}},p=function(){h(".invite_link").live("click",i)},i=function(q){var r=this.id.replace(/fbid\_/,"");FB_RequireFeatures(["XFBML"],function(){FB.Facebook.get_sessionState().waitUntilReady(function(){var t='<fb:fbml><fb:request-form action="http://'+window.location.host+"/external_accounts/facebook/processinvites?next="+encodeURIComponent(window.location)+'" close_dialog="1" method="POST" invite="true" type="Baseball Boss" content="'+CG.options.FriendManager.FB.inviteMessage+"<fb:req-choice url='"+CG.options.FriendManager.FB.inviteLanding+"' label='Accept' />\"><fb:request-form-submit uid='"+r+"' /></fb:request-form></fb:fbml>",s=new FB.UI.FBMLPopupDialog("Play With Your Friends on Baseball Boss!",t);s.set_placement(FB.UI.PopupPlacement.topCenter);s.setContentWidth(620);s.show()})});return false},m=function(){k.find("select").change(n).change()},n=function(){var q=this.options[this.selectedIndex].id.replace(/option\_/,"");k.find(".milestone_container").hide().end().find("#milestone_"+q).show()},c=function(){l.find("#allteams a").click(a).end().find("#allteams .activeteam a").click().end().find("a.activeteam_info").live("click",f).end().find("a.activatelink").live("click",j)},a=function(r){var q=h(this),s=q.attr("id").replace(/button\_/,"");l.find(".selectedteam").hide().filter("#selectedteam_"+s).show();l.find("#allteams a").removeClass("selected");q.addClass("selected");return false},f=function(r){var q=h(this);b();h.get(this.href,function(t){var u=l.find("#allteams .activeteam a").attr("id").replace(/button\_/,""),s=q.parents("div.selectedteam:first").attr("id").replace(/selectedteam\_/,"");l.find("#allteams li:has(#button_"+u+")").removeClass("activeteam");l.find("#allteams li:has(#button_"+s+")").addClass("activeteam");l.find("#selectedteam div#selectedteam_"+u+" span.activeteam_info").replaceWith('<a class="ball_link activeteam_info" href="/owners/setteam/'+u+'">Set as Active Team</a>');l.find("#selectedteam div#selectedteam_"+s+" a.activeteam_info").replaceWith('<span class="activeteam_info"><strong>This is your active team</strong></span>');e()});return false},j=function(s){var q=h(this),r=/\/reactivate\//.test(this.href),t=q.parents("div.selectedteam").eq(0).attr("id").replace(/selectedteam\_/,"");b();h.get(this.href,function(u){q.attr("href",r?"/ladders/deactivate/"+t:"/ladders/reactivate/"+t).text(r?"Go Inactive":"Go Active");e()});return false},b=function(){d.show();l.find("#allteams").hide().end().find("#selectedteam").hide()},e=function(){d.hide();l.find("#allteams").show().end().find("#selectedteam").show()};o()})(jQuery);(function(a){a(function(){CG=typeof(CG)=="undefined"?{}:CG;var m=new CG.TopBarDropdown("#external_friend_manager"),t=false,n={defaultGame:null,urls:{everyone:"/social_widgets/social_widgets/relations/all",online:"/social_widgets/social_widgets/relations/online",pending:"/social_widgets/social_widgets/relations/pending",summary:"/social_widgets/social_widgets/relations/summary",detail:"/social_widgets/social_widgets/relations/detail/",invite:"/social_widgets/social_widgets/invite"},defaultGroup:"online",visibleGroupSize:7,FB:{inviteMessage:"Come play with me",inviteType:"Challenge Games",inviteTitle:"Invite Your Friends",inviteRedirect:window.location,inviteLanding:""}},h={dataLoaded:new CG.Event(),detailSelected:new CG.Event(),groupScroll:new CG.Event(),facebookStatusConfirmation:new CG.Event()},s={everyone:"All Friends",online:"Online Friends",pending:"Pending Invites"},i=m._topBar,o=m._container,l=m._title,r=a("span#friendmanager_count"),d=a("ul#frienditem_container"),j=a("div#frienditem_wrapper"),f=function(){a.extend(true,CG.FriendManager.options,CG.options&&CG.options.FriendManager?CG.options.FriendManager:{});var v=null,w=0;if(o.length){for(var u in s){var x=new b(u);if(u==n.defaultGroup){v=x}}new q();CG.TopBarDropdown.events.beforeShow.subscribe(function(z,y){if(y.id&&e(y.id)&&w==0&&v!=null){v.toggle()}w++});h.dataLoaded.subscribe(function(A,z){if(z.type=="summary"&&z.data.online!=null&&z.data.everyone!=null){var y=z.data.online;r.text("("+y+"/"+z.data.everyone+")");setTimeout(function(){r.css("width","50px");setTimeout(function(){r.css("width","auto")},500)},250);if(y){l.addClass("active")}else{l.removeClass("active")}}});p("summary")}},e=m._checkId,p=function(x,w){if(a.inArray(x,n.urls)){if(x=="summary"){var v={};var u=a.grep(document.cookie.split(";"),function(z){if(a.trim(z.split("=")[0]).indexOf("FriendManager."+x+".")===0){var y=a.trim(z.split("=")[0]).substr(("FriendManager."+x+".").length);v[y]=z.split("=")[1]||false}});v=k(v)?v:null}if(typeof(v)!="undefined"&&v){h.dataLoaded.fire({type:x,data:v,id:w})}else{a.getJSON(n.urls[x]+(w||"")+"?"+Math.random(),{},function(z,A){if(x=="summary"){var y=(new Date());y.setMinutes(y.getMinutes()+2);y=y.toGMTString();a.each(z,function(B,C){document.cookie="FriendManager."+x+"."+B+"="+escape(C)+";path=/;expires="+y})}h.dataLoaded.fire({type:x,data:z,id:w})})}}},k=function(w){var u=0;for(var v in w){if(w.hasOwnProperty(v)){u++}}return u},c=function(w,B,y,S,A,N,Z,E){var aa=this,Q=w,M=y,L=B,z=S,W=A,v=a("<span>"+(L||W)+"</span>").truncate(15).text(),U=N,H=U.length,G=U[0],T=Z==1,u=W=="invitation",D=W=="fbinvitation",J=u||D,P=a('<li class="frienditem_'+(T?"online":"offline")+'"><img src="/common/img/c.gif" alt="" class="game_account account_'+G+'"/></li>'),Y=a('<a href="#" onclick="return false;">'+a("<span>"+M+"</span>").truncate(J?25:10).text()+(J?"":" ("+v+")")+"</a>").appendTo(P),C,X=J?null:a('<a href="#" class="frienditem_selecticon" onclick="return false"><img src="/common/img/c.gif" alt="" /></a>').prependTo(P),I=function(){if(H>1){for(var ad=1;ad<H;ad++){Y.after(' <img src="/common/img/c.gif" class="game_account account_'+U[ad]+'" />')}}if(!J){Y.bind("click",V);X.bind("click",V)}else{if(u){var ac=a('<a href="#" class="frienditem_action" onclick="return false;">Remind</a>').prependTo(Y.parent()),ab=a('<img class="frienditem_action" src="/common/img/ajax_load.gif" />'),ae=a('<span class="frienditem_action completed">Reminded</span>');ac.click(function(af){af.stopPropagation();ac.replaceWith(ab);a.get("/social_widgets/remind/"+Q,{},function(){ab.replaceWith(ae)})})}}h.detailSelected.subscribe(R);CG.TopBarDropdown.events.beforeHide.subscribe(function(ag,af){if(af.id&&e(af.id)){R()}});h.groupScroll.subscribe(R)},V=function(ab){if(!C){C=new g(Q,z)}h.detailSelected.fire({detail:aa});C.show(P.offset().top-j.offset().top,j.innerWidth()+(j.outerWidth()-j.innerWidth())/2)},F=function(ab){},R=function(ac,ab){if(C&&(ab==undefined||ab.detail==undefined||ab.detail!=aa)){C.hide()}},x=function(){P.hide();return aa},O=function(){P.show();return aa},K=function(ab){P.appendTo(ab);return aa};this.hide=x;this.show=O;this.appendTo=K;I()},g=function(v,z){var H=v,A=a('<ul class="frienditem_detail" style="position: absolute; display: none; z-index: 1001;"><li class="loading_img" ><img src="/common/img/c.gif" alt="" /></li></ul>').appendTo(j),C=a('<li class="frienditem_detailimage"><img src="'+z+'" alt="" /></li>').appendTo(A).hide(),y=a('<li class="frienditem_detailaccounts"><span class="frienditem_accounts label">Accounts</span><ul></ul></li>').appendTo(A).hide(),E=a('<li class="frienditem_detailnews"><span class="frienditem_accounts label">Latest News</span><ul></ul></li>').appendTo(A).hide(),w=null,G=false,B=false,F=function(){h.dataLoaded.subscribe(u)},x=function(){A.hide()},D=function(J,I){A.css({top:J+"px",left:I+"px"}).show();if(!G&&!B){B=true;p("detail",v)}},u=function(M,L){if(L.type!=undefined&&L.type=="detail"&&L.id==H){var N=L.data.avatars.length,I=L.data.bulletins.length;B=false;G=true;A.find("li").show();A.find("li.loading_img").hide();a.each(L.data.avatars,function(){var O=this.icon;a('<li class="frienditem_'+(this.online?"online":"offline")+'"><img src="/common/img/c.gif" alt="" class="game_account account_'+this.game+'"/><a href="'+this.link+'">'+this.name+"</a></li>").appendTo(y.find("ul")).find("a, img").hover(function(){C.find("img").get(0).src=O},function(){C.find("img").get(0).src=z})});if(I){for(var J=0;J<I;J++){if(L.data.bulletins[J].type=="comment"){var K='New Comment: "'+L.data.bulletins[J].content+'"'}else{var K=L.data.bulletins[J].content}E.find("ul").append('<li><img src="/common/img/c.gif" alt="" class="game_account account_'+L.data.bulletins[J].game+'"/><span>'+K+"</span></li>")}}else{E.find("ul").append("<li>No recent news</li>")}}};this.hide=x;this.show=D;F()},b=function(N){var I={everyone:"No Friends",online:"No Online Friends",pending:"No Pending Invitations"},D=N,v=[],u=false,x=false,z=false,H=0,B=0,K=false,C=a('<li class="frienditem_group"><a href="#" onclick="return false;"><span class="frienditem_groupname">'+s[D]+"</span></a></li>").appendTo(d),F=a('<a href="#" onclick="return false"><img src="/common/img/c.gif" class="frienditem_groupselector" /></a>').prependTo(C),L=a('<span class="frienditem_groupcount">0</span>').prependTo(C),y=a('<div class="frienditem_groupwrapper"></div>').css({position:"relative",overflow:"hidden",display:"none"}).appendTo(C),J=a('<ul><li class="loading_img" ><img src="/common/img/c.gif" alt="" /></li></ul>').appendTo(y),A=function(){C.find("a").bind("click",E);h.dataLoaded.subscribe(G)},E=function(){if(u){C.removeClass("selected");y.hide();C.find(".frienditem_groupcontrols").hide()}else{C.addClass("selected");C.find(".frienditem_groupcontrols").show();y.show();if(!x&&!z){z=true;p(D)}}h.detailSelected.fire({detail:null});u=!u},G=function(U,S){var O=[];if(S.type=="summary"&&S.data[D]!=undefined){M(S.data[D])}else{if(S.type==D){z=false;x=true;H=S.data.length;J.find(".loading_img").hide();if(H){for(var Q=0;Q<H;Q++){var R=S.data[Q],P=(new c(R.user_id,R.user_name,R.avatar_name,R.user_image,R.relation_type,R.user_accounts,R.online,R.extras||{})).appendTo(J);v.push(P);if(Q>=n.visibleGroupSize){C.addClass("overflow");P.hide();O.push(P)}}}else{a("<li>"+I[D]+"</li>").appendTo(J)}function T(Y,X){if((X==undefined||(X.id&&e(X.id)))&&j.is(":visible")){var V=O.length;if(V){y.css({height:J.find("li:visible:first").height()*n.visibleGroupSize});for(var W=0;W<V;W++){O[W].show()}w();O=[]}}}CG.TopBarDropdown.events.beforeShow.subscribe(T);T()}}},w=function(){var R=a('<a href="#" onclick="return false;" class="navUp frienditem_groupcontrols"></a>').css({opacity:0.75}).insertBefore(y),P=a('<a class="navDown frienditem_groupcontrols" href="#" onclick="return false;"></a>').css({opacity:0.75}).insertBefore(y),S=J.find("li:eq(1)").height();function O(){B>0?R.show():R.hide();B+n.visibleGroupSize<H?P.show():P.hide()}function Q(Y){if(!K){K=true;var W=a(Y.target).hasClass("navUp"),U=W?-Math.min(n.visibleGroupSize,B):Math.min(n.visibleGroupSize,H-B-n.visibleGroupSize),X=J.find("li:visible:eq("+B+")").offset().top,T=J.find("li:visible:eq("+(B+U)+")"),V=X-T.offset().top;h.groupScroll.fire();J.animate({top:"+="+V+"px"},500,null,function(){J.css({top:(parseInt(J.css("top"),10)+X-T.offset().top)+"px"});B+=U;O();K=false})}}R.bind("click",Q);P.bind("click",Q);O()},M=function(O){L.text(O)};this.toggle=E;A()},q=function(){var x=false,v=false,u=false,B=a('<li class="misc_group"><ul></ul></li>').appendTo(d),C=a('<li style="display: none;"><a href="#" onclick="return false;"><img class="game_account account_facebook" src="/common/img/c.gif" />Connect Your Account With Facebook</a></li>').appendTo(B.find("ul")),A=a('<li style="display: none;"><a href="#" onclick="return false;"><img class="game_account account_cg" src="/common/img/c.gif" />Invite Your Friends</a><div id="invite_container" style="display: none;"><p>Add up to 5 email addresses separated by a comma:</p><textarea></textarea><a href="#" onclick="return false;">Submit</a><p id="message_response"></p></div></li>').appendTo(B.find("ul")),F=a('<li style="display: none;"><a href="#" onclick="return false;"><img class="game_account account_facebook" src="/common/img/c.gif" />Invite your Facebook Friends</a></li>').appendTo(B.find("ul")),E=function(){h.facebookStatusConfirmation.subscribe(z);if(typeof(FB)!="undefined"&&typeof(FB_RequireFeatures)!="undefined"){FB_RequireFeatures(["Connect","XFBML"],function(){FB.Connect.ifUserConnected(function(){x=true;h.facebookStatusConfirmation.fire()},function(){x=false;h.facebookStatusConfirmation.fire()})})}A.find("#invite_container a").click(D);A.show().find("> a").click(function(){A.find("#invite_container").toggle()})},z=function(){h.facebookStatusConfirmation.unsubscribe(z);if(x){if(typeof(n.FB.inviteLink)==="string"){F.show().find("a").attr({href:n.FB.inviteLink,onclick:""})}else{F.show().find("a").bind("click",y)}}else{C.show().find("a").bind("click",w)}u=true},w=function(H){try{FB.Connect.requireSession();FB.Facebook.get_sessionState().waitUntilReady(function(){setTimeout("window.location = '/users/facebookautoregister';",1200)})}catch(G){}},y=function(I){var H="",O=n.FB.inviteTitle,P=n.FB.inviteMessage,L=n.FB.inviteType,M="http://"+window.location.host+"/external_accounts/facebook/processinvites?next="+encodeURIComponent(n.FB.inviteRedirect),N=n.FB.inviteLanding,G=760,K='<fb:fbml><fb:request-form action="'+M+'" close_dialog="1" method="POST" invite="true" type="'+L+'" content="'+P+"<fb:req-choice url='"+N+'\' label=\'Accept\' />"><fb:multi-friend-selector rows="4" showborder="false" actiontext="'+O+'" exclude_ids="" /></fb:request-form></fb:fbml>',J=new FB.UI.FBMLPopupDialog(H,K);J.set_placement(FB.UI.PopupPlacement.topCenter);J.setContentWidth(G);J.show()},D=function(J){if(!v){var G=n.urls.invite,K=A.find("#invite_container textarea").get(0),H="An error occured while processing your emails, please try again later",I=A.find("#message_response");v=true;a.post(G,{invite_emails:K.value},function(L){v=false;if(L.emails){H="Invitations were successfully sent to the following emails:<br />"+L.emails.join("<br /> ")}else{if(L.message){H=L.message}}A.find("#invite_container").animate({opacity:1},250);I.html(H)},"json");K.value="";A.find("#invite_container").animate({opacity:0.01},2000)}};E()};CG.FriendManager=a.extend(m,{options:n});f()})})(jQuery);(function($){$.fn.animateScroll=function(offset,time,onComplete){$("html, body").show().animate({scrollTop:$(this).offset().top},time,onComplete);return this};$(function(){CGBulletin={init:function(){CGBulletin._processForms();CGBulletin._processActions()},_processForms:function(){$("ul.bulletin_feed form").each(function(index){this.onsubmit=function(){return false};$(this).bind("submit",CGBulletin._submit)})},_processActions:function(){$("ul.bulletin_feed li.bulletin_action_reply a").each(function(index){var el=$(this);el.bind("click",function(){el.parents("ul.bulletin_feed").eq(0).find("li.bulletin_item li.bulletin_post").hide();el.parents("li.bulletin_item").find("li.bulletin_post").show().find("textarea").get(0).focus()})});$("ul.bulletin_feed li.bulletin_action_rate a").each(function(index){var el=$(this),url="/messaging/bulletins/rate/json",rateableId=$(this).parents("li.bulletin_item").get(0).id.replace(/^bulletin_item_/,""),data={},that=this;el.bind("click",function(){data["data[BulletinClient][rateableId]"]=rateableId;data["data[BulletinClient][rating]"]=el.attr("title");$.post(url,data,function(data){$(that).parents("li.bulletin_action_rate").get(0).hide()})})})},_submit:function(){var _data={},_url=this.action,_isReply=$(this).parents("li.bulletin_item").length>0,_replyId=_isReply?$(this).parents("li.bulletin_item").get(0).id.replace(/^bulletin_item_/,""):null,_tempContainer=$('<li style="display: none;"></li>'),_feed=$(this).parents("ul.bulletin_feed"),_container=$(_feed.get(0).parentNode),_latest=_feed.find(".bulletin_item:first"),_latestId=_latest.length?_latest.get(0).id.replace(/^bulletin_item_/,""):null;if(!$(this).data("isSubmitting")){$(this).data("isSubmitting",true);$(this).find("input, textarea").each(function(){if(this.name&&this.value){_data[this.name]=this.value}});if(_isReply){_data["data[BulletinClient][replyId]"]=_replyId;_tempContainer.insertBefore("#bulletin_item_"+_replyId+" ul.bulletin_item_replies li.bulletin_post")}else{if(_latestId!=null){_data["data[BulletinClient][firstId]"]=_latestId;_tempContainer.insertBefore("#bulletin_item_"+_latestId)}else{_feed.append(_tempContainer)}}$(this).find("textarea").attr("value","");var that=this;if(_container!=undefined){$.post(_url,_data,function(data){$(that).data("isSubmitting",false);var _beginStr="<!-- BEGIN BULLETIN_DATA ",_endStr=" END BULLETIN_DATA -->",_beginIndex=data.indexOf(_beginStr),_endIndex=data.indexOf(_endStr),_bulletinString=_beginIndex!==-1?data.substr(_beginIndex+_beginStr.length,_endIndex-_beginIndex-_beginStr.length):null,_bulletinData=_bulletinString?eval("("+_bulletinString+")"):null;if(_bulletinData!=null){$('<li id="bulletin_item_'+_bulletinData.id+'" class="bulletin_item bulletin_type_comment">'+data+"</li>").hide().css({opacity:0}).insertBefore(_tempContainer).slideDown(1000).animate({opacity:1},1000);_tempContainer.remove()}})}}},_drawComment:function(){}}})})(jQuery);(function(a){a(function(){CG=typeof(CG)=="undefined"?{}:CG;var r=new CG.TopBarDropdown("#external_account_manager"),l=false,o=false,k=false,j={},p={url:"/users2/accounts/accounts"},g={dataLoaded:new CG.Event()},c=r._topBar,m=r._container,i=r._title,q=a("div#accountitem_wrapper"),f=a("ul#accountitem_container").html('<li class="loading_img" ><img src="/common/img/ajax_load.gif" alt="" /></li>'),n=function(){a.extend(true,p,CG.options&&CG.options.AccountManager?CG.options.AccountManager:{});CG.TopBarDropdown.events.beforeShow.subscribe(function(t,s){if(s.id&&h(s.id)){if(!o&&!k&&CG.GAMES){a.each(CG.GAMES,function(v,u){j[v]=new e(v,u.name,u.link)});f.append('<li id="accountitem_account_cg"><img src="/common/img/c.gif" alt="" class="game_account account_cg"/><a href="http://www.challengegames.com/">Challenge Games Corporate Site</a></li>');b()}}});g.dataLoaded.subscribe(function(t,s){m.find("li.loading_img").hide();if(s.accounts&&s.accounts.length){a.each(s.accounts,function(){if(j[this.game_id]){j[this.game_id].addAccount(new d(this.name,this.game_id,this.link,this.icon))}})}})},h=r._checkId,b=function(){k=true;a.getJSON(p.url,{},function(s,t){g.dataLoaded.fire({accounts:s});o=true;k=false})},e=function(z,t,v){var u=this,y=a("<li accountitem_account_"+z+'><img src="/common/img/c.gif" alt="" class="game_account account_'+z+'"/><a href="'+v+'">'+t+"</a></li>").appendTo(f),s=a('<ul style="display: none;"></ul>').appendTo(y),x=function(){a.extend(u,{addAccount:w})},w=function(A){A.appendTo(s.show())};x()},d=function(t,s,x,w){var v=this,z=a('<li><img src="'+w+'" alt="" /><a href="'+x+'">'+t+"</a></li>"),y=function(){a.extend(v,{appendTo:u})},u=function(A){z.appendTo(A);return v};y()};CG.AccountManager=a.extend(r,{options:p});n()})})(jQuery);(function(a){a(function(){CG=typeof(CG)=="undefined"?{}:CG;var m=new CG.TopBarDropdown("#external_award_manager"),s=false,d={all:false,summary:false},f={all:false,summary:false},n={urls:{all:"/users2/awards/transactions/RP",summary:"/users2/awards/summary/RP"},redeem:null,info:"http://www.challengegames.com/rewardpoints.php"},h={dataLoaded:new CG.Event()},j=m._topBar,o=m._container,l=m._title,r=a("span#awardmanager_count"),k=a("div#awarditem_wrapper"),c=a("ul#awarditem_container").html('<li class="loading_img" ><img src="/common/img/ajax_load.gif" alt="" /></li>'),i="dataLoaded",g=function(){a.extend(true,n,CG.options&&CG.options.AwardManager?CG.options.AwardManager:{});if(o.length){q("summary")}l.click(function(t){if(!d.all&&!f.all){q("all")}});h.dataLoaded.subscribe(function(z,y){if(y){if(y.type=="all"){var u=y?y.data:[],t=u?u.length:0;o.find("li.loading_img").hide();if(n.redeem||n.info){var v='<li class="misc_group"><ul>'+(n.redeem?'<li><a href="'+n.redeem+'">Redeem Reward Points</a></li>':"")+(n.info?"<li><a href='#' onclick=\"window.open('"+n.info+"', 'share', 'width=680,height=650,menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=1'); return false;\" target=\"_blank\">About Reward Points</a></li>":"")+"</ul></li>";c.html(v)}if(t>0){var x=a("<li>Last "+t+" Transactions:</li>").appendTo(c);for(var w=0;w<t;w++){new b(u[w].id,Math.floor(parseInt(u[w].amount,10)),u[w].transaction_date,""+u[w].transaction_type,""+u[w].memo)}l.addClass("active")}else{var x=a("<li>You have not earned any reward points.</li>").appendTo(c);l.removeClass("active")}}else{if(y.type=="summary"){r.html("("+(y.data||0)+")").show();setTimeout(function(){r.css("width","300px");setTimeout(function(){r.css("width","auto")},500)},500)}}}})},e=m._checkId,q=function(t){f[t]=true;if(a.inArray(t,n.urls)){a.getJSON(n.urls[t]+"?"+Math.random(),{},function(u,v){h.dataLoaded.fire({type:t,data:u});d[t]=true;f[t]=false})}},p=function(w){w+="";var x=w.split(".");var u=x[0];var t=x.length>1?"."+x[1]:"";var v=/(\d+)(\d{3})/;while(v.test(u)){u=u.replace(v,"$1,$2")}return u+t},b=function(y,v,u,x,t){var w=a('<li><img src="/common/img/c.gif" alt="" class="game_award"/></li>');var u=a('<span class="award_date">'+u.substr(0,16)+"</span>").appendTo(w),v=a('<span class="award_amount '+((v>0)?'award_amount_inc">+':'award_amount_dec">')+p(v)+"</span>").appendTo(w),t=a('<span class="award_memo" title="'+t.replace("'","\\'")+'">'+t+"</span>").truncate(20).appendTo(w);w.appendTo(c)};CG.AwardManager=a.extend(m,{options:n});g()})})(jQuery);(function(a){a(function(){CG=typeof(CG)=="undefined"?{}:CG;var o=new CG.TopBarDropdown("#external_feed_manager"),p={url:"/messaging/bulletins/feed"},j={afterDataLoad:new CG.Event(),afterFilterSelection:new CG.Event()},t=false,b=false,h=false,f=false,r=["January","February","March","April","May","June","July","August","September","October","November","December"],l=o._topBar,q=o._container,n=o._title,m=a("#feeditem_wrapper"),e=a("#feeditem_container"),i=function(){a.extend(true,p,CG.options&&CG.options.FeedManager?CG.options.FeedManager:{});j.afterDataLoad.subscribe(c);CG.TopBarDropdown.events.beforeShow.subscribe(function(v,u){if(u.id&&g(u.id)){if(!f&&!h){k();new s("all","All","cg");m.find("li.feedfilter_item").eq(0).click();if(CG.GAMES){a.each(CG.GAMES,function(x,w){if(w.hasBulletins){new s(x,w.name,x)}})}h=true}}})},g=o._checkId,k=function(){e.css({overflow:"auto"});m.prepend('<ul class="feedfilter_container"></ul>');e.append('<div class="loading_img" style="display: none;"><img src="/common/img/c.gif" /></div>')},c=function(x){var y=a(window).height(),w=a(window).scrollTop(),u=e.offset().top-w,v=(y-u-50);e.css("height",Math.min(e.height(),v)+"px")},d=function(Q,F,U,y,S,Y,z,A,C,x){var aa=this,w=Q,I,O,D,X,u,W,Z,N=[],V,T,H,E=function(){I=y=="comment";O=x?true:false;D=a('<li class="feeditem_itemcontainer feeditem_type_'+F+'"><div class="feeditem_bg">&nbsp;</div></li>');X=a('<div class="feeditem_authoricon"><img src="'+z.iconUrl+'" alt="" /><img class="game_account account_'+z.gameId+'" src="/common/img/c.gif" alt="" /></div>').appendTo(D);u=a('<div class="feeditem_content"><a class="feeditem_authorname feeditem_headline" href="'+z.linkUrl+'">'+z.name+"</a> </div>").appendTo(D);W=a('<ul class="feeditem_actions"></ul>').appendTo(D);D.append('<div class="clear_fix"></div>');Z=a('<ul class="feeditem_comments"></ul>').appendTo(D);T=x||a('<li class="feeditem_reply" style="display: none;"><div class="feeditem_bg"></div></li>');a.data(D.get(0),"itemObj",aa);if(I&&A){u.append('<span class="feeditem_headline">wrote on</span> <span class="feeditem_headline feeditem_feed">'+A.name+':</span><br /><span class="feeditem_text">'+U+"</span>")}else{u.append(U)}V=a('<a href="#" class="feeditem_reply" onclick="return false;">Reply</a>').appendTo(W).wrap("<li></li>");V.click(J);if(C){var ab=C.length,ac;if(ab){for(ac=0;ac<ab;ac++){N.push((new d(C[ac].id,F,C[ac].content,"comment",S,C[ac].created,C[ac].author,null,[],T)).appendTo(Z).hide())}if(ab>2){N[0].show();N[ab-1].show();H=a('<a href="#" onclick="return false;">Show all '+ab+" comments...</a>").insertAfter(Z.find("li.feeditem_itemcontainer:first")).wrap('<li class="feeditem_showmore"></li>');H.click(B)}else{for(ac=0;ac<ab;ac++){N[ac].show()}}}}if(!O){var ad=a('<a href="#" onclick="return false;">Submit</a>');ad.bind("click",P);T.append("<textarea></textarea>").append(ad).appendTo(Z)}},B=function(ad){if(H){H.parent().hide()}var ab=N.length;for(var ac=0;ac<ab;ac++){N[ac].show()}},P=function(ac){var ae=T.find("textarea").get(0),ab=ae.value,ad=a.data(T.parents(".feeditem_itemcontainer").get(0),"itemObj").id;T.animate({opacity:0.01},500).slideUp(500);if(ab){ae.value="";a.post("/messaging/bulletins/feedreply",{content:ab,id:ad},function(af){if(af.id){(new d(af.id,F,af.content,"comment",af.author.game_id,af.created,af.author,null,[],T)).hide().insertBefore(T).appear()}},"json")}},G=function(ab){D.appendTo(ab);return aa},R=function(ab){D.prependTo(ab);return aa},M=function(ab){D.insertBefore(ab);return aa},v=function(){D.css("display","none");return aa},L=function(){D.show();if(!D.find(".feeditem_bg").height()){setTimeout(function(){D.find(".feeditem_bg").css("height","100%")},50)}return aa},K=function(){D.hide().css("opacity",0).slideDown(1000).animate({opacity:1},1000);D.find(".feeditem_bg").css("height","100%");return aa},J=function(ab){e.find("li.feeditem_reply").hide();T.show().find("textarea").get(0).focus()};a.extend(this,{id:w,appendTo:G,prependTo:R,insertBefore:M,hide:v,show:L,appear:K});E()},s=function(v,u,z){var y=a('<li class="feedfilter_item"><a href="#" onclick="return false;"><img class="game_account account_'+z+'" src="/common/img/c.gif" />'+u+"</a></li>").appendTo(m.find("ul.feedfilter_container")),x=a('<ul class="feedfilter_filtercontainer"></ul>').appendTo(e),D=false,B=function(){y.bind("click",C);j.afterFilterSelection.subscribe(A)},w=function(E){if(!h){h=true;a.getJSON(p.url+"/"+(E=="all"?"":E),function(K){h=false;f=true;D=true;e.find("> .loading_img").hide();var J=K.length,H,F,G,I;if(J){for(H=0;H<J;H++){G=new Date(K[H].created);I=r[G.getUTCMonth()]+" "+G.getUTCDate()+", "+G.getUTCFullYear();if(F!=I){F=I;x.append('<li class="feeditem_type_'+E+' feeditem_date">'+I+"</li>")}(new d(K[H].id,E,K[H].content,K[H].type,K[H].game_id,G,K[H].author,K[H].feed,K[H].comments)).appendTo(x)}}else{e.append('<li class="no_items feeditem_type_'+E+'">No recent activity...</li>')}x.show();j.afterDataLoad.fire({id:E})})}},C=function(E){e.find("ul.feedfilter_filtercontainer").hide();e.find(".loading_img").show();if(!D){w(v)}else{e.find(".loading_img").hide();x.show()}j.afterFilterSelection.fire({id:v})},A=function(F,E){if(E.id==v){y.addClass("selected")}else{y.removeClass("selected")}};B()};CGFeedManager=a.extend(o,{options:p});i()})})(jQuery);(function(a){a(function(){CG=typeof(CG)=="undefined"?{}:CG;var q={url:"/messaging/bulletins/ticker",period:10,duration:2,visibleCount:5,widthPct:0.95,iconPath:""},g=[],l=true,w,c=false,f=false,v=[],r=a("#ticker"),o="dataLoaded",h="animationFinished",k="imageLoad",m=function(){if(!c){a.extend(true,q,CG.options&&CG.options.Ticker?CG.options.Ticker:{});var x=a(window).width(),y=r.width()>x*q.widthPct?x+"px":q.widthPct*100+"%";r.css({position:"relative",width:y});r.find("#ticker_message").text("Loading ...");s();r.bind(o,function(B,A){var z=0;u();r.bind(k,function(){if(++z==g.length){d()}});r.animate({opacity:1},1000)})}c=true},s=function(){a.getJSON(q.url,{},function(A){r.css("opacity",0).find("#ticker_message").html("&nbsp;");var x=A.length,y,z,B=Math.ceil(2*q.visibleCount/x);for(y=0;y<x*B;y++){z=new e(A[y%x].headline,A[y%x].content,A[y%x].icon);g.push(z)}r.trigger(o)})},j=function(){l=false;v=[];if(w){clearTimeout(w)}},u=function(){l=true;d();t();n()},n=function(){w=setTimeout(function(){i()},q.period*1000)},i=function(){var y=arguments[0]?arguments[0]:1,x=g.length,A,z=0,C=0,D=g[q.visibleCount+y-1].getWrapperWidth()-r.width();if(!f){f=true;p();function B(){if(++z==q.visibleCount+1){b(y);r.unbind(h,B);f=false}}r.bind(h,B);for(A=x-1;A>=0;A--){if(A<y){C+=g[A].getWrapperWidth()-g[A].getHeadlineWidth();g[A].animateContainer(-C+"px")}else{if(A==y){g[A].animateContainer(0)}else{if(A<q.visibleCount+y){g[A].animateWrapper("-"+D+"px")}else{}}}}}else{if(v.length<3){v.push(y)}}},p=function(){d()},b=function(y){y=y?y:1;for(var x=0;x<y;x++){g.push(g.shift())}d();t();if(l){n()}},t=function(){var x=g.length,y;for(y=0;y<x;y++){g[y].setZIndex(x-y)}},d=function(){var x=g.length,y,z=r.width(),A;for(y=q.visibleCount-1;y>=0;y--){if(y==0){g[y].setWrapperPosition(0).setWrapperWidth(z)}else{if(y<q.visibleCount){A=g[y].getHeadlineWidth();g[y].setWrapperPosition(0).setWrapperWidth(z).setContainerPosition(z-A);z-=A}}}z=r.width();for(y=q.visibleCount;y<x;y++){A=g[y].getHeadlineWidth();z+=A;g[y].setWrapperPosition(0).setWrapperWidth(z).setContainerPosition(z-A)}},e=function(I,M,N){var E=this,L,D,J,O,A,G=function(){var Q=a('<img class="ticker_item_icon" alt="" />');L=a('<div class="ticker_item_wrapper"></div>').appendTo(r).css({position:"absolute",left:r.width()+"px"});D=a('<div class="ticker_item_container"></div>').css({position:"absolute",left:"0px",width:"1000px"}).appendTo(L);J=a('<span class="ticker_item_headline"></span>').html('<a href="#" onclick="return false;">'+I+"</a>").appendTo(D);O=J.find("a");A=a('<span class="ticker_item_content"></span>').html(M).appendTo(D);Q.bind("load",function(){r.trigger(k)}).attr("src",N&&q.iconPath!=""?q.iconPath+N:"/messaging/img/default.gif").prependTo(J);O.bind("click",function(){var R=a.inArray(E,g);if(R>0){clearTimeout(w);i(R)}})},K=function(Q){L.css("zIndex",Q);return E},y=function(Q){L.css("left",Q+"px");return E},B=function(Q){L.css("width",Q+"px");return E},z=function(Q){D.css("left",Q+"px");return E},P=function(Q){L.animate({left:Q},q.duration*1000,"swing",function(){r.trigger(h)});return E},H=function(Q){D.animate({left:Q},q.duration*1000,"swing",function(){r.trigger(h)});return E},C=function(){return F()+A.width()},x=function(){return L.width()},F=function(){return J.width()+parseInt(J.css("marginLeft"),10)+parseInt(J.css("marginRight"),10)};this.setZIndex=K;this.setWrapperPosition=y;this.setWrapperWidth=B;this.setContainerPosition=z;this.animateWrapper=P;this.animateContainer=H;this.getWrapperWidth=x;this.getWidth=C;this.getHeadlineWidth=F;G()};CG.Ticker={options:q,items:g,stop:j,start:u};m()})})(jQuery);(function(g){var e=-1,a={threshold:100,expireInterval:24*60*60,cookieName:"CGRemind"},f=function(){g.extend(true,a,CG&&CG.Reminders&&CG.Reminders.options?Cg.Reminders.options:{});if(c()){h();e=-1}b()},h=function(){g.get("/messaging/reminders/check",{},function(j){if(j&&j.id){var k=[];if(j.terminatable){k.push(g('<a href="#" onclick="return false;">Don\'t remind me again</a>').click(function(){d(j.id)}))}var i={id:"reminders_"+j.id,"class":"cg_reminder",actions:k};if(j.icon){j.content='<img class="cg_message_reminder_image" src="'+j.icon+'" />'+j.content+'<div style="clear:both;"></div>'}g(function(){new CG.MessageWindow(j.content,j.title,i).show()})}},"json")},d=function(i){if(i){g.get("/messaging/reminders/remove/"+i)}},c=function(){var m=document.cookie.split(";"),j=m.length;for(var l=0;l<j;l++){var k=m[l].split("=");if(g.trim(k[0])==a.cookieName){e=Number(g.trim(k[1]));break}}if(e&&Number(e)>=a.threshold){return true}return false},b=function(){var j=e+1,i=new Date(new Date().getTime()+a.expireInterval*1000).toUTCString();document.cookie=a.cookieName+"="+j+";path=/;expires="+i};g(f)})(jQuery);