var Prototype={Version:"1.6.1",Browser:function(){var a=navigator.userAgent,b=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!b,Opera:b,WebKit:a.indexOf("AppleWebKit/")>-1,Gecko:a.indexOf("Gecko")>-1&&a.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(a)}}(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:function(){var a=window.Element||window.HTMLElement;return!!(a&&a.prototype)}(),
SpecificElementExtensions:function(){if(typeof window.HTMLDivElement!=="undefined")return true;var a=document.createElement("div"),b=document.createElement("form"),c=false;if(a.__proto__&&a.__proto__!==b.__proto__)c=true;return c}()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false;
var Abstract={},Try={these:function(){for(var a,b=0,c=arguments.length;b<c;b++){var e=arguments[b];try{a=e();break}catch(k){}}return a}},Class=function(){function a(){}function b(){function e(){this.initialize.apply(this,arguments)}var k=null,o=$A(arguments);if(Object.isFunction(o[0]))k=o.shift();Object.extend(e,Class.Methods);e.superclass=k;e.subclasses=[];if(k){a.prototype=k.prototype;e.prototype=new a;k.subclasses.push(e)}for(k=0;k<o.length;k++)e.addMethods(o[k]);if(!e.prototype.initialize)e.prototype.initialize=
Prototype.emptyFunction;return e.prototype.constructor=e}function c(e){var k=this.superclass&&this.superclass.prototype,o=Object.keys(e);if(!Object.keys({toString:true}).length){e.toString!=Object.prototype.toString&&o.push("toString");e.valueOf!=Object.prototype.valueOf&&o.push("valueOf")}for(var r=0,w=o.length;r<w;r++){var J=o[r],T=e[J];if(k&&Object.isFunction(T)&&T.argumentNames().first()=="$super"){var Z=T;T=function(X){return function(){return k[X].apply(this,arguments)}}(J).wrap(Z);T.valueOf=
Z.valueOf.bind(Z);T.toString=Z.toString.bind(Z)}this.prototype[J]=T}return this}return{create:b,Methods:{addMethods:c}}}();
(function(){function a(g,N){for(var da in N)g[da]=N[da];return g}function b(g){try{if(R(g))return"undefined";if(g===null)return"null";return g.inspect?g.inspect():String(g)}catch(N){if(N instanceof RangeError)return"...";throw N;}}function c(g){switch(typeof g){case "undefined":case "function":case "unknown":return;case "boolean":return g.toString()}if(g===null)return"null";if(g.toJSON)return g.toJSON();if(!J(g)){var N=[];for(var da in g){var F=c(g[da]);R(F)||N.push(da.toJSON()+": "+F)}return"{"+
N.join(", ")+"}"}}function e(g){return $H(g).toQueryString()}function k(g){return g&&g.toHTML?g.toHTML():String.interpret(g)}function o(g){var N=[];for(var da in g)N.push(da);return N}function r(g){var N=[];for(var da in g)N.push(g[da]);return N}function w(g){return a({},g)}function J(g){return!!(g&&g.nodeType==1)}function T(g){return ta.call(g)=="[object Array]"}function Z(g){return g instanceof Hash}function X(g){return typeof g==="function"}function ea(g){return ta.call(g)=="[object String]"}function fa(g){return ta.call(g)==
"[object Number]"}function R(g){return typeof g==="undefined"}var ta=Object.prototype.toString;a(Object,{extend:a,inspect:b,toJSON:c,toQueryString:e,toHTML:k,keys:o,values:r,clone:w,isElement:J,isArray:T,isHash:Z,isFunction:X,isString:ea,isNumber:fa,isUndefined:R})})();
Object.extend(Function.prototype,function(){function a(X,ea){for(var fa=X.length,R=ea.length;R--;)X[fa+R]=ea[R];return X}function b(X,ea){X=Z.call(X,0);return a(X,ea)}function c(){var X=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return X.length==1&&!X[0]?[]:X}function e(X){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var ea=this,fa=Z.call(arguments,1);return function(){var R=
b(fa,arguments);return ea.apply(X,R)}}function k(X){var ea=this,fa=Z.call(arguments,1);return function(R){R=a([R||window.event],fa);return ea.apply(X,R)}}function o(){if(!arguments.length)return this;var X=this,ea=Z.call(arguments,0);return function(){var fa=b(ea,arguments);return X.apply(this,fa)}}function r(X){var ea=this,fa=Z.call(arguments,1);X*=1E3;return window.setTimeout(function(){return ea.apply(ea,fa)},X)}function w(){return this.delay.apply(this,a([0.01],arguments))}function J(X){var ea=
this;return function(){var fa=a([ea.bind(this)],arguments);return X.apply(this,fa)}}function T(){if(this._methodized)return this._methodized;var X=this;return this._methodized=function(){var ea=a([this],arguments);return X.apply(null,ea)}}var Z=Array.prototype.slice;return{argumentNames:c,bind:e,bindAsEventListener:k,curry:o,delay:r,defer:w,wrap:J,methodize:T}}());
Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};
var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1E3)},execute:function(){this.callback(this)},stop:function(){if(this.timer){clearInterval(this.timer);this.timer=null}},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=
false;throw a;}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,function(){function a(M){if(Object.isFunction(M))return M;var W=new Template(M);return function(ba){return W.evaluate(ba)}}function b(M,W){var ba="",ha=this,oa;W=a(W);if(Object.isString(M))M=RegExp.escape(M);if(!(M.length||M.source)){W=W("");return W+ha.split("").join(W)+W}for(;ha.length>0;)if(oa=ha.match(M)){ba+=ha.slice(0,oa.index);ba+=String.interpret(W(oa));ha=ha.slice(oa.index+oa[0].length)}else{ba+=ha;ha=""}return ba}function c(M,W,ba){W=a(W);ba=Object.isUndefined(ba)?
1:ba;return this.gsub(M,function(ha){if(--ba<0)return ha[0];return W(ha)})}function e(M,W){this.gsub(M,W);return String(this)}function k(M,W){M=M||30;W=Object.isUndefined(W)?"...":W;return this.length>M?this.slice(0,M-W.length)+W:String(this)}function o(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function r(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function w(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function J(){var M=new RegExp(Prototype.ScriptFragment,
"img"),W=new RegExp(Prototype.ScriptFragment,"im");return(this.match(M)||[]).map(function(ba){return(ba.match(W)||["",""])[1]})}function T(){return this.extractScripts().map(function(M){return eval(M)})}function Z(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function X(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function ea(M){var W=this.strip().match(/([^?#]*)(#.*)?$/);if(!W)return{};return W[1].split(M||"&").inject({},
function(ba,ha){if((ha=ha.split("="))[0]){var oa=decodeURIComponent(ha.shift());ha=ha.length>1?ha.join("="):ha[0];if(ha!=undefined)ha=decodeURIComponent(ha);if(oa in ba){Object.isArray(ba[oa])||(ba[oa]=[ba[oa]]);ba[oa].push(ha)}else ba[oa]=ha}return ba})}function fa(){return this.split("")}function R(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function ta(M){return M<1?"":(new Array(M+1)).join(this)}function g(){var M=this.split("-"),W=M.length;if(W==
1)return M[0];for(var ba=this.charAt(0)=="-"?M[0].charAt(0).toUpperCase()+M[0].substring(1):M[0],ha=1;ha<W;ha++)ba+=M[ha].charAt(0).toUpperCase()+M[ha].substring(1);return ba}function N(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function da(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function F(){return this.replace(/_/g,"-")}function S(M){var W=this.replace(/[\x00-\x1f\\]/g,
function(ba){if(ba in String.specialChar)return String.specialChar[ba];return"\\u00"+ba.charCodeAt().toPaddedString(2,16)});if(M)return'"'+W.replace(/"/g,'\\"')+'"';return"'"+W.replace(/'/g,"\\'")+"'"}function O(){return this.inspect(true)}function H(M){return this.replace(M||Prototype.JSONFilter,"$1")}function u(){var M=this;if(M.blank())return false;M=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(M)}function x(M){var W=this.unfilterJSON();
try{if(!M||W.isJSON())return eval("("+W+")")}catch(ba){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());}function E(M){return this.indexOf(M)>-1}function Q(M){return this.indexOf(M)===0}function ga(M){var W=this.length-M.length;return W>=0&&this.lastIndexOf(M)===W}function la(){return this==""}function na(){return/^\s*$/.test(this)}function pa(M,W){return(new Template(this,W)).evaluate(M)}return{gsub:b,sub:c,scan:e,truncate:k,strip:String.prototype.trim?String.prototype.trim:o,
stripTags:r,stripScripts:w,extractScripts:J,evalScripts:T,escapeHTML:Z,unescapeHTML:X,toQueryParams:ea,parseQuery:ea,toArray:fa,succ:R,times:ta,camelize:g,capitalize:N,underscore:da,dasherize:F,inspect:S,toJSON:O,unfilterJSON:H,isJSON:u,evalJSON:x,include:E,startsWith:Q,endsWith:ga,empty:la,blank:na,interpolate:pa}}());
var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements))a=a.toTemplateReplacements();return this.template.gsub(this.pattern,function(b){if(a==null)return b[1]+"";var c=b[1]||"";if(c=="\\")return b[2];var e=a,k=b[3],o=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;b=o.exec(k);if(b==null)return c;for(;b!=null;){var r=b[1].startsWith("[")?b[2].replace(/\\\\]/g,"]"):b[1];e=e[r];if(null==
e||""==b[3])break;k=k.substring("["==b[3]?b[1].length:b[0].length);b=o.exec(k)}return c+String.interpret(e)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={},Enumerable=function(){function a(H,u){var x=0;try{this._each(function(Q){H.call(u,Q,x++)})}catch(E){if(E!=$break)throw E;}return this}function b(H,u,x){var E=-H,Q=[],ga=this.toArray();if(H<1)return ga;for(;(E+=H)<ga.length;)Q.push(ga.slice(E,E+H));return Q.collect(u,x)}function c(H,u){H=H||Prototype.K;var x=true;this.each(function(E,Q){x=x&&!!H.call(u,E,Q);if(!x)throw $break;});return x}function e(H,u){H=H||Prototype.K;var x=false;this.each(function(E,Q){if(x=!!H.call(u,E,Q))throw $break;
});return x}function k(H,u){H=H||Prototype.K;var x=[];this.each(function(E,Q){x.push(H.call(u,E,Q))});return x}function o(H,u){var x;this.each(function(E,Q){if(H.call(u,E,Q)){x=E;throw $break;}});return x}function r(H,u){var x=[];this.each(function(E,Q){H.call(u,E,Q)&&x.push(E)});return x}function w(H,u,x){u=u||Prototype.K;var E=[];if(Object.isString(H))H=new RegExp(RegExp.escape(H));this.each(function(Q,ga){H.match(Q)&&E.push(u.call(x,Q,ga))});return E}function J(H){if(Object.isFunction(this.indexOf))if(this.indexOf(H)!=
-1)return true;var u=false;this.each(function(x){if(x==H){u=true;throw $break;}});return u}function T(H,u){u=Object.isUndefined(u)?null:u;return this.eachSlice(H,function(x){for(;x.length<H;)x.push(u);return x})}function Z(H,u,x){this.each(function(E,Q){H=u.call(x,H,E,Q)});return H}function X(H){var u=$A(arguments).slice(1);return this.map(function(x){return x[H].apply(x,u)})}function ea(H,u){H=H||Prototype.K;var x;this.each(function(E,Q){E=H.call(u,E,Q);if(x==null||E>=x)x=E});return x}function fa(H,
u){H=H||Prototype.K;var x;this.each(function(E,Q){E=H.call(u,E,Q);if(x==null||E<x)x=E});return x}function R(H,u){H=H||Prototype.K;var x=[],E=[];this.each(function(Q,ga){(H.call(u,Q,ga)?x:E).push(Q)});return[x,E]}function ta(H){var u=[];this.each(function(x){u.push(x[H])});return u}function g(H,u){var x=[];this.each(function(E,Q){H.call(u,E,Q)||x.push(E)});return x}function N(H,u){return this.map(function(x,E){return{value:x,criteria:H.call(u,x,E)}}).sort(function(x,E){x=x.criteria;E=E.criteria;return x<
E?-1:x>E?1:0}).pluck("value")}function da(){return this.map()}function F(){var H=Prototype.K,u=$A(arguments);if(Object.isFunction(u.last()))H=u.pop();var x=[this].concat(u).map($A);return this.map(function(E,Q){return H(x.pluck(Q))})}function S(){return this.toArray().length}function O(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:a,eachSlice:b,all:c,every:c,any:e,some:e,collect:k,map:k,detect:o,findAll:r,select:r,filter:r,grep:w,include:J,member:J,inGroupsOf:T,inject:Z,invoke:X,
max:ea,min:fa,partition:R,pluck:ta,reject:g,sortBy:N,toArray:da,entries:da,zip:F,size:S,inspect:O,find:o}}();function $A(a){if(!a)return[];if("toArray"in Object(a))return a.toArray();for(var b=a.length||0,c=new Array(b);b--;)c[b]=a[b];return c}function $w(a){if(!Object.isString(a))return[];return(a=a.strip())?a.split(/\s+/):[]}Array.from=$A;
(function(){function a(S){for(var O=0,H=this.length;O<H;O++)S(this[O])}function b(){this.length=0;return this}function c(){return this[0]}function e(){return this[this.length-1]}function k(){return this.select(function(S){return S!=null})}function o(){return this.inject([],function(S,O){if(Object.isArray(O))return S.concat(O.flatten());S.push(O);return S})}function r(){var S=da.call(arguments,0);return this.select(function(O){return!S.include(O)})}function w(S){return(S!==false?this:this.toArray())._reverse()}
function J(S){return this.inject([],function(O,H,u){if(0==u||(S?O.last()!=H:!O.include(H)))O.push(H);return O})}function T(S){return this.uniq().findAll(function(O){return S.detect(function(H){return O===H})})}function Z(){return da.call(this,0)}function X(){return this.length}function ea(){return"["+this.map(Object.inspect).join(", ")+"]"}function fa(){var S=[];this.each(function(O){O=Object.toJSON(O);Object.isUndefined(O)||S.push(O)});return"["+S.join(", ")+"]"}function R(S,O){O||(O=0);var H=this.length;
if(O<0)O=H+O;for(;O<H;O++)if(this[O]===S)return O;return-1}function ta(S,O){O=isNaN(O)?this.length:(O<0?this.length+O:O)+1;S=this.slice(0,O).reverse().indexOf(S);return S<0?S:O-S-1}function g(){for(var S=da.call(this,0),O,H=0,u=arguments.length;H<u;H++){O=arguments[H];if(Object.isArray(O)&&!("callee"in O))for(var x=0,E=O.length;x<E;x++)S.push(O[x]);else S.push(O)}return S}var N=Array.prototype,da=N.slice,F=N.forEach;F||(F=a);Object.extend(N,Enumerable);if(!N._reverse)N._reverse=N.reverse;Object.extend(N,
{_each:F,clear:b,first:c,last:e,compact:k,flatten:o,without:r,reverse:w,uniq:J,intersect:T,clone:Z,toArray:Z,size:X,inspect:ea,toJSON:fa});if(function(){return[].concat(arguments)[0][0]!==1}(1,2))N.concat=g;if(!N.indexOf)N.indexOf=R;if(!N.lastIndexOf)N.lastIndexOf=ta})();function $H(a){return new Hash(a)}
var Hash=Class.create(Enumerable,function(){function a(g){this._object=Object.isHash(g)?g.toObject():Object.clone(g)}function b(g){for(var N in this._object){var da=this._object[N],F=[N,da];F.key=N;F.value=da;g(F)}}function c(g,N){return this._object[g]=N}function e(g){if(this._object[g]!==Object.prototype[g])return this._object[g]}function k(g){var N=this._object[g];delete this._object[g];return N}function o(){return Object.clone(this._object)}function r(){return this.pluck("key")}function w(){return this.pluck("value")}
function J(g){var N=this.detect(function(da){return da.value===g});return N&&N.key}function T(g){return this.clone().update(g)}function Z(g){return(new Hash(g)).inject(this,function(N,da){N.set(da.key,da.value);return N})}function X(g,N){if(Object.isUndefined(N))return g;return g+"="+encodeURIComponent(String.interpret(N))}function ea(){return this.inject([],function(g,N){var da=encodeURIComponent(N.key);if((N=N.value)&&typeof N=="object"){if(Object.isArray(N))return g.concat(N.map(X.curry(da)))}else g.push(X(da,
N));return g}).join("&")}function fa(){return"#<Hash:{"+this.map(function(g){return g.map(Object.inspect).join(": ")}).join(", ")+"}>"}function R(){return Object.toJSON(this.toObject())}function ta(){return new Hash(this)}return{initialize:a,_each:b,set:c,get:e,unset:k,toObject:o,toTemplateReplacements:o,keys:r,values:w,index:J,merge:T,update:Z,toQueryString:ea,inspect:fa,toJSON:R,clone:ta}}());Hash.from=$H;
Object.extend(Number.prototype,function(){function a(){return this.toPaddedString(2,16)}function b(){return this+1}function c(T,Z){$R(0,this,true).each(T,Z);return this}function e(T,Z){Z=this.toString(Z||10);return"0".times(T-Z.length)+Z}function k(){return isFinite(this)?this.toString():"null"}function o(){return Math.abs(this)}function r(){return Math.round(this)}function w(){return Math.ceil(this)}function J(){return Math.floor(this)}return{toColorPart:a,succ:b,times:c,toPaddedString:e,toJSON:k,
abs:o,round:r,ceil:w,floor:J}}());function $R(a,b,c){return new ObjectRange(a,b,c)}
var ObjectRange=Class.create(Enumerable,function(){function a(e,k,o){this.start=e;this.end=k;this.exclusive=o}function b(e){for(var k=this.start;this.include(k);){e(k);k=k.succ()}}function c(e){if(e<this.start)return false;if(this.exclusive)return e<this.end;return e<=this.end}return{initialize:a,_each:b,include:c}}()),Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||
false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){this.include(a)||this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(a,b,c,e){this.each(function(k){if(Object.isFunction(k[a]))try{k[a].apply(k,[b,c,e])}catch(o){}})}};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,c){$super(c);this.transport=Ajax.getTransport();this.request(b)},request:function(a){this.url=a;this.method=this.options.method;a=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){a._method=this.method;this.method="post"}this.parameters=a;if(a=Object.toQueryString(a))if(this.method=="get")this.url+=(this.url.include("?")?"&":"?")+a;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))a+=
"&_=";try{var b=new Ajax.Response(this);this.options.onCreate&&this.options.onCreate(b);Ajax.Responders.dispatch("onCreate",this,b);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);this.options.asynchronous&&this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?this.options.postBody||a:null;this.transport.send(this.body);!this.options.asynchronous&&this.transport.overrideMimeType&&
this.onStateChange()}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;a>1&&!(a==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){a["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:
"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)a.Connection="close"}if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(Object.isFunction(b.push))for(var c=0,e=b.length;c<e;c+=2)a[b[c]]=b[c+1];else $H(b).each(function(o){a[o.key]=o.value})}for(var k in a)this.transport.setRequestHeader(k,a[k])},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){a=Ajax.Request.Events[a];var b=new Ajax.Response(this);if(a=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(c){this.dispatchException(c)}var e=b.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&e&&e.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))this.evalResponse()}try{(this.options["on"+
a]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+a,this,b,b.headerJSON)}catch(k){this.dispatchException(k)}if(a=="Complete")this.transport.onreadystatechange=Prototype.emptyFunction},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return!a||a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""})},getHeader:function(a){try{return this.transport.getResponseHeader(a)||
null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(a){this.dispatchException(a)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(a){this.request=a;a=this.transport=a.transport;var b=this.readyState=a.readyState;if(b>2&&!Prototype.Browser.IE||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(a.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){a=a.responseXML;this.responseXML=Object.isUndefined(a)?null:a;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,
getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a)return null;a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||
!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json")||this.responseText.blank())return null;try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});
Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,b,c,e){this.container={success:b.success||b,failure:b.failure||(b.success?null:b)};e=Object.clone(e);var k=e.onComplete;e.onComplete=function(o,r){this.updateContent(o.responseText);Object.isFunction(k)&&k(o,r)}.bind(this);$super(c,e)},updateContent:function(a){var b=this.container[this.success()?"success":"failure"],c=this.options;c.evalScripts||(a=a.stripScripts());if(b=$(b))if(c.insertion)if(Object.isString(c.insertion)){var e=
{};e[c.insertion]=a;b.insert(e)}else c.insertion(b,a);else b.update(a)}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,e){$super(e);this.onComplete=this.options.onComplete;this.frequency=this.options.frequency||2;this.decay=this.options.decay||1;this.updater={};this.container=b;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},
updateComplete:function(a){if(this.options.decay){this.decay=a.responseText==this.lastText?this.decay*this.options.decay:1;this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});
function $(a){if(arguments.length>1){for(var b=0,c=[],e=arguments.length;b<e;b++)c.push($(arguments[b]));return c}if(Object.isString(a))a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath)document._getElementsByXPath=function(a,b){var c=[];a=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);b=0;for(var e=a.snapshotLength;b<e;b++)c.push(Element.extend(a.snapshotItem(b)));return c};if(!window.Node)var Node={};
Node.ELEMENT_NODE||Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});
(function(a){var b=function(){var e=document.createElement("form"),k=document.createElement("input"),o=document.documentElement;k.setAttribute("name","test");e.appendChild(k);o.appendChild(e);k=e.elements?typeof e.elements.test=="undefined":null;o.removeChild(e);return k}(),c=a.Element;a.Element=function(e,k){k=k||{};e=e.toLowerCase();var o=Element.cache;if(b&&k.name){e="<"+e+' name="'+k.name+'">';delete k.name;return Element.writeAttribute(document.createElement(e),k)}o[e]||(o[e]=Element.extend(document.createElement(e)));
return Element.writeAttribute(o[e].cloneNode(false),k)};Object.extend(a.Element,c||{});if(c)a.Element.prototype=c.prototype})(this);Element.cache={};Element.idCounter=1;
Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(){function a(k,o){k=$(k);if(o&&o.toElement)o=o.toElement();if(Object.isElement(o))return k.update().insert(o);o=Object.toHTML(o);var r=k.tagName.toUpperCase();
if(r==="SCRIPT"&&e){k.text=o;return k}if(b||c)if(r in Element._insertionTranslations.tags){for(;k.firstChild;)k.removeChild(k.firstChild);Element._getContentFromAnonymousElement(r,o.stripScripts()).each(function(w){k.appendChild(w)})}else k.innerHTML=o.stripScripts();else k.innerHTML=o.stripScripts();o.evalScripts.bind(o).defer();return k}var b=function(){var k=document.createElement("select"),o=true;k.innerHTML='<option value="test">test</option>';if(k.options&&k.options[0])o=k.options[0].nodeName.toUpperCase()!==
"OPTION";return o}(),c=function(){try{var k=document.createElement("table");if(k&&k.tBodies){k.innerHTML="<tbody><tr><td>test</td></tr></tbody>";return typeof k.tBodies[0]=="undefined"}}catch(o){return true}}(),e=function(){var k=document.createElement("script"),o=false;try{k.appendChild(document.createTextNode(""));o=!k.firstChild||k.firstChild&&k.firstChild.nodeType!==3}catch(r){o=true}return o}();return a}(),replace:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();else if(!Object.isElement(b)){b=
Object.toHTML(b);var c=a.ownerDocument.createRange();c.selectNode(a);b.evalScripts.bind(b).defer();b=c.createContextualFragment(b.stripScripts())}a.parentNode.replaceChild(b,a);return a},insert:function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||b&&(b.toElement||b.toHTML))b={bottom:b};var c,e,k;for(var o in b){c=b[o];o=o.toLowerCase();e=Element._insertionTranslations[o];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c))e(a,c);else{c=Object.toHTML(c);k=(o=="before"||
o=="after"?a.parentNode:a).tagName.toUpperCase();k=Element._getContentFromAnonymousElement(k,c.stripScripts());if(o=="top"||o=="after")k.reverse();k.each(e.curry(a));c.evalScripts.bind(c).defer()}}return a},wrap:function(a,b,c){a=$(a);if(Object.isElement(b))$(b).writeAttribute(c||{});else b=Object.isString(b)?new Element(b,c):new Element("div",b);a.parentNode&&a.parentNode.replaceChild(b,a);b.appendChild(a);return b},inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(c){var e=
c.first();c=c.last();if(e=(a[e]||"").toString())b+=" "+c+"="+e.inspect(true)});return b+">"},recursivelyCollect:function(a,b){a=$(a);for(var c=[];a=a[b];)a.nodeType==1&&c.push(Element.extend(a));return c},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){for(a=$(a).firstChild;a&&a.nodeType!=1;)a=a.nextSibling;return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];for(;a&&
a.nodeType!=1;)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(a,b){if(Object.isString(b))b=new Selector(b);return b.match($(a))},up:function(a,b,c){a=$(a);if(arguments.length==1)return $(a.parentNode);
var e=Element.ancestors(a);return Object.isNumber(b)?e[b]:Selector.findElement(e,b,c)},down:function(a,b,c){a=$(a);if(arguments.length==1)return Element.firstDescendant(a);return Object.isNumber(b)?Element.descendants(a)[b]:Element.select(a,b)[c||0]},previous:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(a));var e=Element.previousSiblings(a);return Object.isNumber(b)?e[b]:Selector.findElement(e,b,c)},next:function(a,b,c){a=$(a);if(arguments.length==
1)return $(Selector.handlers.nextElementSibling(a));var e=Element.nextSiblings(a);return Object.isNumber(b)?e[b]:Selector.findElement(e,b,c)},select:function(a){var b=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(a,b)},adjacent:function(a){var b=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(a.parentNode,b).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b)return b;do b="anonymous_element_"+Element.idCounter++;while($(b));
Element.writeAttribute(a,"id",b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var c=Element._attributeTranslations.read;if(c.values[b])return c.values[b](a,b);if(c.names[b])b=c.names[b];if(b.include(":"))return!a.attributes||!a.attributes[b]?null:a.attributes[b].value}return a.getAttribute(b)},writeAttribute:function(a,b,c){a=$(a);var e={},k=Element._attributeTranslations.write;if(typeof b=="object")e=b;else e[b]=Object.isUndefined(c)?true:c;for(var o in e){b=k.names[o]||
o;c=e[o];if(k.values[o])b=k.values[o](a,c);if(c===false||c===null)a.removeAttribute(b);else c===true?a.setAttribute(b,b):a.setAttribute(b,c)}return a},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(a=$(a)){a=a.className;return a.length>0&&(a==b||(new RegExp("(^|\\s)"+b+"(\\s|$)")).test(a))}},addClassName:function(a,b){if(a=$(a)){Element.hasClassName(a,
b)||(a.className+=(a.className?" ":"")+b);return a}},removeClassName:function(a,b){if(a=$(a)){a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a}},toggleClassName:function(a,b){if(a=$(a))return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(a){a=$(a);for(var b=a.firstChild;b;){var c=b.nextSibling;b.nodeType==3&&!/\S/.test(b.nodeValue)&&a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.blank()},
descendantOf:function(a,b){a=$(a);b=$(b);if(a.compareDocumentPosition)return(a.compareDocumentPosition(b)&8)===8;if(b.contains)return b.contains(a)&&b!==a;for(;a=a.parentNode;)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);b=b=="float"?"cssFloat":b.camelize();var c=a.style[b];if(!c||c=="auto")c=(a=document.defaultView.getComputedStyle(a,null))?a[b]:null;if(b=="opacity")return c?parseFloat(c):
1;return c=="auto"?null:c},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(a,b){a=$(a);var c=a.style;if(Object.isString(b)){a.style.cssText+=";"+b;return b.include("opacity")?a.setOpacity(b.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var e in b)if(e=="opacity")a.setOpacity(b[e]);else c[e=="float"||e=="cssFloat"?Object.isUndefined(c.styleFloat)?"cssFloat":"styleFloat":e]=b[e];return a},setOpacity:function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;return a},getDimensions:function(a){a=
$(a);var b=Element.getStyle(a,"display");if(b!="none"&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};b=a.style;var c=b.visibility,e=b.position,k=b.display;b.visibility="hidden";if(e!="fixed")b.position="absolute";b.display="block";var o=a.clientWidth;a=a.clientHeight;b.display=k;b.position=e;b.visibility=c;return{width:o,height:a}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=
0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden")a.style.overflow="hidden";return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},
cumulativeOffset:function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;a=a.offsetParent}while(a);return Element._returnOffset(c,b)},positionedOffset:function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;if(a=a.offsetParent){if(a.tagName.toUpperCase()=="BODY")break;if(Element.getStyle(a,"position")!=="static")break}}while(a);return Element._returnOffset(c,b)},absolutize:function(a){a=$(a);if(Element.getStyle(a,"position")=="absolute")return a;var b=Element.positionedOffset(a),c=
b[1];b=b[0];var e=a.clientWidth,k=a.clientHeight;a._originalLeft=b-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position="absolute";a.style.top=c+"px";a.style.left=b+"px";a.style.width=e+"px";a.style.height=k+"px";return a},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative")return a;a.style.position="relative";var b=parseFloat(a.style.top||0)-(a._originalTop||0),c=parseFloat(a.style.left||
0)-(a._originalLeft||0);a.style.top=b+"px";a.style.left=c+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(a){var b=0,c=0;do{b+=a.scrollTop||0;c+=a.scrollLeft||0;a=a.parentNode}while(a);return Element._returnOffset(c,b)},getOffsetParent:function(a){if(a.offsetParent)return $(a.offsetParent);if(a==document.body)return $(a);for(;(a=a.parentNode)&&a!=document.body;)if(Element.getStyle(a,"position")!="static")return $(a);return $(document.body)},
viewportOffset:function(a){var b=0,c=0,e=a;do{b+=e.offsetTop||0;c+=e.offsetLeft||0;if(e.offsetParent==document.body&&Element.getStyle(e,"position")=="absolute")break}while(e=e.offsetParent);e=a;do if(!Prototype.Browser.Opera||e.tagName&&e.tagName.toUpperCase()=="BODY"){b-=e.scrollTop||0;c-=e.scrollLeft||0}while(e=e.parentNode);return Element._returnOffset(c,b)},clonePosition:function(a,b,c){c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},c||{});b=$(b);
var e=Element.viewportOffset(b);a=$(a);var k=[0,0],o=null;if(Element.getStyle(a,"position")=="absolute"){o=Element.getOffsetParent(a);k=Element.viewportOffset(o)}if(o==document.body){k[0]-=document.body.offsetLeft;k[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=e[0]-k[0]+c.offsetLeft+"px";if(c.setTop)a.style.top=e[1]-k[1]+c.offsetTop+"px";if(c.setWidth)a.style.width=b.offsetWidth+"px";if(c.setHeight)a.style.height=b.offsetHeight+"px";return a}};
Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};
if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(a,b,c){switch(c){case "left":case "top":case "right":case "bottom":if(a(b,"position")==="static")return null;case "height":case "width":if(!Element.visible(b))return null;var e=parseInt(a(b,c),10);if(e!==b["offset"+c.capitalize()])return e+"px";return(c==="height"?["border-top-width","padding-top","padding-bottom","border-bottom-width"]:["border-left-width","padding-left","padding-right","border-right-width"]).inject(e,
function(k,o){o=a(b,o);return o===null?k:k-parseInt(o,10)})+"px";default:return a(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(a,b,c){if(c==="title")return b.title;return a(b,c)})}else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(a,b){b=$(b);var c=b.getStyle("position");if(c!=="static")return a(b);b.setStyle({position:"relative"});a=a(b);b.setStyle({position:c});return a});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=
Element.Methods[a].wrap(function(b,c){c=$(c);var e=c.getStyle("position");if(e!=="static")return b(c);var k=c.getOffsetParent();k&&k.getStyle("position")==="fixed"&&k.setStyle({zoom:1});c.setStyle({position:"relative"});b=b(c);c.setStyle({position:e});return b})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(a,b){return a(b)});Element.Methods.getStyle=function(a,b){a=$(a);b=b=="float"||b=="cssFloat"?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle)c=
a.currentStyle[b];if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/))if(c[1])return parseFloat(c[1])/100;return 1}if(c=="auto"){if((b=="width"||b=="height")&&a.getStyle("display")!="none")return a["offset"+b.capitalize()]+"px";return null}return c};Element.Methods.setOpacity=function(a,b){function c(o){return o.replace(/alpha\([^\)]*\)/gi,"")}a=$(a);var e=a.currentStyle;if(e&&!e.hasLayout||!e&&a.style.zoom=="normal")a.style.zoom=1;e=a.getStyle("filter");var k=a.style;
if(b==1||b===""){(e=c(e))?(k.filter=e):k.removeAttribute("filter");return a}else if(b<1.0E-5)b=0;k.filter=c(e)+"alpha(opacity="+b*100+")";return a};Element._attributeTranslations=function(){var a="className",b="for",c=document.createElement("div");c.setAttribute(a,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x")a="class"}c=null;c=document.createElement("label");c.setAttribute(b,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x")b="htmlFor"}c=null;
return{read:{names:{"class":a,className:a,"for":b,htmlFor:b},values:{_getAttr:function(e,k){return e.getAttribute(k)},_getAttr2:function(e,k){return e.getAttribute(k,2)},_getAttrNode:function(e,k){return(e=e.getAttributeNode(k))?e.value:""},_getEv:function(){var e=document.createElement("div");e.onclick=Prototype.emptyFunction;e=e.getAttribute("onclick");var k;if(String(e).indexOf("{")>-1)k=function(o,r){r=o.getAttribute(r);if(!r)return null;r=r.toString();r=r.split("{")[1];r=r.split("}")[0];return r.strip()};
else if(e==="")k=function(o,r){r=o.getAttribute(r);if(!r)return null;return r.strip()};e=null;return k}(),_flag:function(e,k){return $(e).hasAttribute(k)?k:null},style:function(e){return e.style.cssText.toLowerCase()},title:function(e){return e.title}}}}}();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};
Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,
onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);Prototype.BrowserFeatures.ElementExtensions&&function(){function a(b){b=b.getElementsByTagName("*");for(var c=[],e=0,k;k=b[e];e++)k.tagName!=="!"&&c.push(k);return c}Element.Methods.down=function(b,
c,e){b=$(b);if(arguments.length==1)return b.firstDescendant();return Object.isNumber(c)?a(b)[c]:Element.select(b,c)[e||0]}}()}else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent))Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=b==1?0.999999:b===""?"":b<1.0E-5?0:b;return a};else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;if(b==1)if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else try{var c=
document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(e){}return a};Element.Methods.cumulativeOffset=function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,"position")=="absolute")break;a=a.offsetParent}while(a);return Element._returnOffset(c,b)}}
if("outerHTML"in document.documentElement)Element.Methods.replace=function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b)){a.parentNode.replaceChild(b,a);return a}b=Object.toHTML(b);var c=a.parentNode,e=c.tagName.toUpperCase();if(Element._insertionTranslations.tags[e]){var k=a.next();e=Element._getContentFromAnonymousElement(e,b.stripScripts());c.removeChild(a);k?e.each(function(o){c.insertBefore(o,k)}):e.each(function(o){c.appendChild(o)})}else a.outerHTML=b.stripScripts();
b.evalScripts.bind(b).defer();return a};Element._returnOffset=function(a,b){var c=[a,b];c.left=a;c.top=b;return c};Element._getContentFromAnonymousElement=function(a,b){var c=new Element("div");if(a=Element._insertionTranslations.tags[a]){c.innerHTML=a[0]+b+a[1];a[2].times(function(){c=c.firstChild})}else c.innerHTML=b;return $A(c.childNodes)};
Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,b){b=Element._attributeTranslations.has[b]||b;a=$(a).getAttributeNode(b);return!!(a&&a.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);
(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}})(document.createElement("div"));
Element.extend=function(){function a(o){if(typeof window.Element!="undefined"){var r=window.Element.prototype;if(r){var w="_"+(Math.random()+"").slice(2);o=document.createElement(o);r[w]="x";o=o[w]!=="x";delete r[w];return o}}return false}function b(o,r){for(var w in r){var J=r[w];if(Object.isFunction(J)&&!(w in o))o[w]=J.methodize()}}var c=a("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(c)return function(o){if(o&&typeof o._extendedByPrototype=="undefined"){var r=o.tagName;
if(r&&/^(?:object|applet|embed)$/i.test(r)){b(o,Element.Methods);b(o,Element.Methods.Simulated);b(o,Element.Methods.ByTag[r.toUpperCase()])}}return o};return Prototype.K}var e={},k=Element.Methods.ByTag;c=Object.extend(function(o){if(!o||typeof o._extendedByPrototype!="undefined"||o.nodeType!=1||o==window)return o;var r=Object.clone(e),w=o.tagName.toUpperCase();k[w]&&Object.extend(r,k[w]);b(o,r);o._extendedByPrototype=Prototype.emptyFunction;return o},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(e,
Element.Methods);Object.extend(e,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(a){function b(J){J=J.toUpperCase();Element.Methods.ByTag[J]||(Element.Methods.ByTag[J]={});Object.extend(Element.Methods.ByTag[J],a)}function c(J,T,Z){Z=Z||false;for(var X in J){var ea=J[X];if(Object.isFunction(ea))if(!Z||!(X in T))T[X]=ea.methodize()}}function e(J){var T,Z={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(Z[J])T="HTML"+Z[J]+"Element";if(window[T])return window[T];T="HTML"+J+"Element";if(window[T])return window[T];T="HTML"+J.capitalize()+"Element";if(window[T])return window[T];J=document.createElement(J);return J.__proto__||J.constructor.prototype}
var k=Prototype.BrowserFeatures,o=Element.Methods.ByTag;if(!a){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var r=a;a=arguments[1]}if(r)Object.isArray(r)?r.each(b):b(r);else Object.extend(Element.Methods,a||{});r=window.HTMLElement?HTMLElement.prototype:
Element.prototype;if(k.ElementExtensions){c(Element.Methods,r);c(Element.Methods.Simulated,r,true)}if(k.SpecificElementExtensions)for(var w in Element.Methods.ByTag){k=e(w);Object.isUndefined(k)||c(o[w],k.prototype)}Object.extend(Element,Element.Methods);delete Element.ByTag;Element.extend.refresh&&Element.extend.refresh();Element.cache={}};
document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};
(function(a){function b(){if(e.WebKit&&!k.evaluate)return document;if(e.Opera&&window.parseFloat(window.opera.version())<9.5)return document.body;return document.documentElement}function c(w){o||(o=b());r[w]="client"+w;a["get"+w]=function(){return o[r[w]]};return a["get"+w]()}var e=Prototype.Browser,k=document,o,r={};a.getWidth=c.curry("Width");a.getHeight=c.curry("Height")})(document.viewport);Element.Storage={UID:1};
Element.addMethods({getStorage:function(a){if(a=$(a)){if(a===window)a=0;else{if(typeof a._prototypeUID==="undefined")a._prototypeUID=[Element.Storage.UID++];a=a._prototypeUID[0]}Element.Storage[a]||(Element.Storage[a]=$H());return Element.Storage[a]}},store:function(a,b,c){if(a=$(a)){arguments.length===2?Element.getStorage(a).update(b):Element.getStorage(a).set(b,c);return a}},retrieve:function(a,b,c){if(a=$(a)){a=Element.getStorage(a);var e=a.get(b);if(Object.isUndefined(e)){a.set(b,c);e=c}return e}},
clone:function(a,b){if(a=$(a)){a=a.cloneNode(b);a._prototypeUID=void 0;if(b){b=Element.select(a,"*");for(var c=b.length;c--;)b[c]._prototypeUID=void 0}return Element.extend(a)}}});
var Selector=Class.create({initialize:function(a){this.expression=a.strip();if(this.shouldUseSelectorsAPI())this.mode="selectorsAPI";else if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}},shouldUseXPath:function(){var a=function(){var b=false;if(document.evaluate&&window.XPathResult){b=document.createElement("div");b.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";b=document.evaluate(".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']",
b,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength!==2}return b}();return function(){if(!Prototype.BrowserFeatures.XPath)return false;var b=this.expression;if(Prototype.Browser.WebKit&&(b.include("-of-type")||b.include(":empty")))return false;if(/(\[[\w-]*?:|:checked)/.test(b))return false;if(a)return false;return true}}(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI)return false;if(Selector.CASE_INSENSITIVE_CLASS_NAMES)return false;if(!Selector._div)Selector._div=
new Element("div");try{Selector._div.querySelector(this.expression)}catch(a){return false}return true},compileMatcher:function(){var a=this.expression,b=Selector.patterns,c=Selector.criteria,e,k,o=b.length,r;if(Selector._cache[a])this.matcher=Selector._cache[a];else{for(this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];a&&e!=a&&/\S/.test(a);){e=a;for(var w=0;w<o;w++){k=b[w].re;r=b[w].name;if(k=a.match(k)){this.matcher.push(Object.isFunction(c[r])?
c[r](k):(new Template(c[r])).evaluate(k));a=a.replace(k[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher}},compileXPathMatcher:function(){var a=this.expression,b=Selector.patterns,c=Selector.xpath,e,k,o=b.length,r;if(Selector._cache[a])this.xpath=Selector._cache[a];else{for(this.matcher=[".//*"];a&&e!=a&&/\S/.test(a);){e=a;for(var w=0;w<o;w++){r=b[w].name;if(k=a.match(b[w].re)){this.matcher.push(Object.isFunction(c[r])?
c[r](k):(new Template(c[r])).evaluate(k));a=a.replace(k[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath}},findElements:function(a){a=a||document;var b=this.expression;switch(this.mode){case "selectorsAPI":if(a!==document){var c=a.id,e=$(a).identify();e=e.replace(/([\.:])/g,"\\$1");b="#"+e+" "+b}b=$A(a.querySelectorAll(b)).map(Element.extend);a.id=c;return b;case "xpath":return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(a){this.tokens=
[];for(var b=this.expression,c=Selector.patterns,e=Selector.assertions,k,o,r=c.length,w;b&&k!==b&&/\S/.test(b);){k=b;for(var J=0;J<r;J++){o=c[J].re;w=c[J].name;if(o=b.match(o))if(e[w]){this.tokens.push([w,Object.clone(o)]);b=b.replace(o[0],"")}else return this.findElements(document).include(a)}}b=true;for(J=0;c=this.tokens[J];J++){w=c[0];c=c[1];if(!Selector.assertions[w](a,c)){b=false;break}}return b},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+
">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat")Selector.CASE_INSENSITIVE_CLASS_NAMES=function(){var a=document.createElement("div"),b=document.createElement("span");a.id="prototype_test_id";b.className="Test";a.appendChild(b);return a.querySelector("#prototype_test_id .test")!==null}();
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(a){for(var b=a[6],c=Selector.patterns,e=Selector.xpath,k,o,r=c.length,w=[];b&&k!=b&&/\S/.test(b);){k=b;for(var J=0;J<r;J++){o=c[J].name;if(a=b.match(c[J].re)){o=
Object.isFunction(e[o])?e[o](a):(new Template(e[o])).evaluate(a);w.push("("+o.substring(1,o.length-1)+")");b=b.replace(a[0],"");break}}}return"[not("+w.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(a,b){var c=b[6];if(c=="even")c="2n+0";if(c=="odd")c="2n+1";if(b=c.match(/^(\d+)$/))return"["+a+"= "+b[1]+"]";if(b=c.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(b[1]=="-")b[1]=-1;c=b[1]?Number(b[1]):1;b=b[2]?
Number(b[2]):0;return(new Template("[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]")).evaluate({fragment:a,a:c,b:b})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=a[5]||a[6];return(new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;')).evaluate(a)},
pseudo:function(a){if(a[6])a[6]=a[6].replace(/"/g,'\\"');return(new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;')).evaluate(a)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},
{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,
b[1])},attr:function(a,b){return(a=Element.readAttribute(a,b[1]))&&Selector.operators[b[2]](a,b[5]||b[6])}},handlers:{concat:function(a,b){for(var c=0,e;e=b[c];c++)a.push(e);return a},mark:function(a){for(var b=Prototype.emptyFunction,c=0,e;e=a[c];c++)e._countedByPrototype=b;return a},unmark:function(){return function(){var a=document.createElement("div"),b=false;a._countedByPrototype="x";return b=a.getAttribute("_countedByPrototype")==="x"}()?function(a){for(var b=0,c;c=a[b];b++)c.removeAttribute("_countedByPrototype");
return a}:function(a){for(var b=0,c;c=a[b];b++)c._countedByPrototype=void 0;return a}}(),index:function(a,b,c){a._countedByPrototype=Prototype.emptyFunction;if(b){a=a.childNodes;b=a.length-1;for(var e=1;b>=0;b--){var k=a[b];if(k.nodeType==1&&(!c||k._countedByPrototype))k.nodeIndex=e++}}else{b=0;e=1;for(a=a.childNodes;k=a[b];b++)if(k.nodeType==1&&(!c||k._countedByPrototype))k.nodeIndex=e++}},unique:function(a){if(a.length==0)return a;for(var b=[],c,e=0,k=a.length;e<k;e++)if(typeof(c=a[e])._countedByPrototype==
"undefined"){c._countedByPrototype=Prototype.emptyFunction;b.push(Element.extend(c))}return Selector.handlers.unmark(b)},descendant:function(a){for(var b=Selector.handlers,c=0,e=[],k;k=a[c];c++)b.concat(e,k.getElementsByTagName("*"));return e},child:function(a){for(var b=0,c=[],e;e=a[b];b++)for(var k=0,o;o=e.childNodes[k];k++)o.nodeType==1&&o.tagName!="!"&&c.push(o);return c},adjacent:function(a){for(var b=0,c=[],e;e=a[b];b++)(e=this.nextElementSibling(e))&&c.push(e);return c},laterSibling:function(a){for(var b=
Selector.handlers,c=0,e=[],k;k=a[c];c++)b.concat(e,Element.nextSiblings(k));return e},nextElementSibling:function(a){for(;a=a.nextSibling;)if(a.nodeType==1)return a;return null},previousElementSibling:function(a){for(;a=a.previousSibling;)if(a.nodeType==1)return a;return null},tagName:function(a,b,c,e){var k=c.toUpperCase(),o=[],r=Selector.handlers;if(a){if(e){if(e=="descendant"){for(b=0;e=a[b];b++)r.concat(o,e.getElementsByTagName(c));return o}else a=this[e](a);if(c=="*")return a}for(b=0;e=a[b];b++)e.tagName.toUpperCase()===
k&&o.push(e);return o}else return b.getElementsByTagName(c)},id:function(a,b,c,e){var k=$(c),o=Selector.handlers;if(b==document){if(!k)return[];if(!a)return[k]}else if(!b.sourceIndex||b.sourceIndex<1){a=b.getElementsByTagName("*");for(var r=0,w;w=a[r];r++)if(w.id===c)return[w]}if(a){if(e)if(e=="child")for(b=0;w=a[b];b++){if(k.parentNode==w)return[k]}else if(e=="descendant")for(b=0;w=a[b];b++){if(Element.descendantOf(k,w))return[k]}else if(e=="adjacent")for(b=0;w=a[b];b++){if(Selector.handlers.previousElementSibling(k)==
w)return[k]}else a=o[e](a);for(b=0;w=a[b];b++)if(w==k)return[k];return[]}return k&&Element.descendantOf(k,b)?[k]:[]},className:function(a,b,c,e){if(a&&e)a=this[e](a);return Selector.handlers.byClassName(a,b,c)},byClassName:function(a,b,c){a||(a=Selector.handlers.descendant([b]));b=" "+c+" ";for(var e=0,k=[],o,r;o=a[e];e++){r=o.className;if(r.length!=0)if(r==c||(" "+r+" ").include(b))k.push(o)}return k},attrPresence:function(a,b,c,e){a||(a=b.getElementsByTagName("*"));if(a&&e)a=this[e](a);b=[];e=0;
for(var k;k=a[e];e++)Element.hasAttribute(k,c)&&b.push(k);return b},attr:function(a,b,c,e,k,o){a||(a=b.getElementsByTagName("*"));if(a&&o)a=this[o](a);b=Selector.operators[k];k=[];o=0;for(var r;r=a[o];o++){var w=Element.readAttribute(r,c);w!==null&&b(w,e)&&k.push(r)}return k},pseudo:function(a,b,c,e,k){if(a&&k)a=this[k](a);a||(a=e.getElementsByTagName("*"));return Selector.pseudos[b](a,c,e)}},pseudos:{"first-child":function(a){for(var b=0,c=[],e;e=a[b];b++)Selector.handlers.previousElementSibling(e)||
c.push(e);return c},"last-child":function(a){for(var b=0,c=[],e;e=a[b];b++)Selector.handlers.nextElementSibling(e)||c.push(e);return c},"only-child":function(a){for(var b=Selector.handlers,c=0,e=[],k;k=a[c];c++)!b.previousElementSibling(k)&&!b.nextElementSibling(k)&&e.push(k);return e},"nth-child":function(a,b,c){return Selector.pseudos.nth(a,b,c)},"nth-last-child":function(a,b,c){return Selector.pseudos.nth(a,b,c,true)},"nth-of-type":function(a,b,c){return Selector.pseudos.nth(a,b,c,false,true)},
"nth-last-of-type":function(a,b,c){return Selector.pseudos.nth(a,b,c,true,true)},"first-of-type":function(a,b,c){return Selector.pseudos.nth(a,"1",c,false,true)},"last-of-type":function(a,b,c){return Selector.pseudos.nth(a,"1",c,true,true)},"only-of-type":function(a,b,c){var e=Selector.pseudos;return e["last-of-type"](e["first-of-type"](a,b,c),b,c)},getIndices:function(a,b,c){if(a==0)return b>0?[b]:[];return $R(1,c).inject([],function(e,k){0==(k-b)%a&&(k-b)/a>=0&&e.push(k);return e})},nth:function(a,
b,c,e,k){if(a.length==0)return[];if(b=="even")b="2n+0";if(b=="odd")b="2n+1";c=Selector.handlers;var o=[],r=[],w;c.mark(a);for(var J=0;w=a[J];J++)if(!w.parentNode._countedByPrototype){c.index(w.parentNode,e,k);r.push(w.parentNode)}if(b.match(/^\d+$/)){b=Number(b);for(J=0;w=a[J];J++)w.nodeIndex==b&&o.push(w)}else if(w=b.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(w[1]=="-")w[1]=-1;J=w[1]?Number(w[1]):1;w=w[2]?Number(w[2]):0;b=Selector.pseudos.getIndices(J,w,a.length);J=0;for(e=b.length;w=a[J];J++)for(k=0;k<
e;k++)w.nodeIndex==b[k]&&o.push(w)}c.unmark(a);c.unmark(r);return o},empty:function(a){for(var b=0,c=[],e;e=a[b];b++)e.tagName=="!"||e.firstChild||c.push(e);return c},not:function(a,b,c){var e=Selector.handlers;b=(new Selector(b)).findElements(c);e.mark(b);c=0;for(var k=[],o;o=a[c];c++)o._countedByPrototype||k.push(o);e.unmark(b);return k},enabled:function(a){for(var b=0,c=[],e;e=a[b];b++)if(!e.disabled&&(!e.type||e.type!=="hidden"))c.push(e);return c},disabled:function(a){for(var b=0,c=[],e;e=a[b];b++)e.disabled&&
c.push(e);return c},checked:function(a){for(var b=0,c=[],e;e=a[b];b++)e.checked&&c.push(e);return c}},operators:{"=":function(a,b){return a==b},"!=":function(a,b){return a!=b},"^=":function(a,b){return a==b||a&&a.startsWith(b)},"$=":function(a,b){return a==b||a&&a.endsWith(b)},"*=":function(a,b){return a==b||a&&a.include(b)},"~=":function(a,b){return(" "+a+" ").include(" "+b+" ")},"|=":function(a,b){return("-"+(a||"").toUpperCase()+"-").include("-"+(b||"").toUpperCase()+"-")}},split:function(a){var b=
[];a.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){b.push(c[1].strip())});return b},matchElements:function(a,b){b=$$(b);var c=Selector.handlers;c.mark(b);for(var e=0,k=[],o;o=a[e];e++)o._countedByPrototype&&k.push(o);c.unmark(b);return k},findElement:function(a,b,c){if(Object.isNumber(b)){c=b;b=false}return Selector.matchElements(a,b||"*")[c||0]},findChildElements:function(a,b){b=Selector.split(b.join(","));for(var c=[],e=Selector.handlers,k=0,o=b.length,r;k<o;k++){r=new Selector(b[k].strip());
e.concat(c,r.findElements(a))}return o>1?e.unique(c):c}});Prototype.Browser.IE&&Object.extend(Selector.handlers,{concat:function(a,b){for(var c=0,e;e=b[c];c++)e.tagName!=="!"&&a.push(e);return a}});function $$(){return Selector.findChildElements(document,$A(arguments))}
var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(a,b){if(typeof b!="object")b={hash:!!b};else if(Object.isUndefined(b.hash))b.hash=true;var c,e,k=false,o=b.submit;a=a.inject({},function(r,w){if(!w.disabled&&w.name){c=w.name;e=$(w).getValue();if(e!=null&&w.type!="file"&&(w.type!="submit"||!k&&o!==false&&(!o||c==o)&&(k=true)))if(c in r){Object.isArray(r[c])||(r[c]=[r[c]]);r[c].push(e)}else r[c]=e}return r});return b.hash?a:Object.toQueryString(a)}};
Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(a){a=$(a).getElementsByTagName("*");for(var b,c=[],e=Form.Element.Serializers,k=0;b=a[k];k++)c.push(b);return c.inject([],function(o,r){e[r.tagName.toLowerCase()]&&o.push(Element.extend(r));return o})},getInputs:function(a,b,c){a=$(a);a=a.getElementsByTagName("input");if(!b&&!c)return $A(a).map(Element.extend);for(var e=0,k=[],o=a.length;e<o;e++){var r=a[e];b&&r.type!=b||c&&r.name!=c||
k.push(Element.extend(r))}return k},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(a){a=$(a).getElements().findAll(function(c){return"hidden"!=c.type&&!c.disabled});var b=a.findAll(function(c){return c.hasAttribute("tabIndex")&&c.tabIndex>=0}).sortBy(function(c){return c.tabIndex}).first();return b?b:a.find(function(c){return/^(?:input|select|textarea)$/i.test(c.tagName)})},
focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(a,b){a=$(a);b=Object.clone(b||{});var c=b.parameters,e=a.readAttribute("action")||"";if(e.blank())e=window.location.href;b.parameters=a.serialize(true);if(c){if(Object.isString(c))c=c.toQueryParams();Object.extend(b.parameters,c)}if(a.hasAttribute("method")&&!b.method)b.method=a.method;return new Ajax.Request(e,b)}};
Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};
Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();
if(a.select&&(a.tagName.toLowerCase()!="input"||!/^(?:button|reset|submit)$/i.test(a.type)))a.select()}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element,$F=Form.Element.Methods.getValue;
Form.Element.Serializers={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(a,b){if(Object.isUndefined(b))return this[a.type=="select-one"?"selectOne":"selectMany"](a);
else for(var c,e,k=!Object.isArray(b),o=0,r=a.length;o<r;o++){c=a.options[o];e=this.optionValue(c);if(k){if(e==b){c.selected=true;return}}else c.selected=b.include(e)}},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,c=a.length;if(!c)return null;var e=0;for(b=[];e<c;e++){var k=a.options[e];k.selected&&b.push(this.optionValue(k))}return b},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,e){$super(e,c);this.element=$(b);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});
Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});
Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();this.element.tagName.toLowerCase()=="form"?this.registerFormCallbacks():this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type)switch(a.type.toLowerCase()){case "checkbox":case "radio":Event.observe(a,
"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});
(function(){function a(u){return N(u,0)}function b(u){return N(u,1)}function c(u){return N(u,2)}function e(u){u=R.extend(u);var x=u.target,E=u.type;if((u=u.currentTarget)&&u.tagName)if(E==="load"||E==="error"||E==="click"&&u.tagName.toLowerCase()==="input"&&u.type==="radio")x=u;if(x.nodeType==Node.TEXT_NODE)x=x.parentNode;return Element.extend(x)}function k(u,x){u=R.element(u);if(!x)return u;u=[u].concat(u.ancestors());return Selector.findElement(u,x,0)}function o(u){return{x:r(u),y:w(u)}}function r(u){var x=
document.documentElement,E=document.body||{scrollLeft:0};return u.pageX||u.clientX+(x.scrollLeft||E.scrollLeft)-(x.clientLeft||0)}function w(u){var x=document.documentElement,E=document.body||{scrollTop:0};return u.pageY||u.clientY+(x.scrollTop||E.scrollTop)-(x.clientTop||0)}function J(u){R.extend(u);u.preventDefault();u.stopPropagation();u.stopped=true}function T(u,x,E){var Q=Element.retrieve(u,"prototype_event_registry");if(Object.isUndefined(Q)){O.push(u);Q=Element.retrieve(u,"prototype_event_registry",
$H())}var ga=Q.get(x);if(Object.isUndefined(ga)){ga=[];Q.set(x,ga)}if(ga.pluck("handler").include(E))return false;var la;if(x.include(":"))la=function(na){if(Object.isUndefined(na.eventName))return false;if(na.eventName!==x)return false;R.extend(na,u);E.call(u,na)};else if(!g&&(x==="mouseenter"||x==="mouseleave")){if(x==="mouseenter"||x==="mouseleave")la=function(na){R.extend(na,u);for(var pa=na.relatedTarget;pa&&pa!==u;)try{pa=pa.parentNode}catch(M){pa=u}pa!==u&&E.call(u,na)}}else la=function(na){R.extend(na,
u);E.call(u,na)};la.handler=E;ga.push(la);return la}function Z(){for(var u=0,x=O.length;u<x;u++){R.stopObserving(O[u]);O[u]=null}}function X(u,x,E){u=$(u);E=T(u,x,E);if(!E)return u;if(x.include(":"))if(u.addEventListener)u.addEventListener("dataavailable",E,false);else{u.attachEvent("ondataavailable",E);u.attachEvent("onfilterchange",E)}else{x=H(x);u.addEventListener?u.addEventListener(x,E,false):u.attachEvent("on"+x,E)}return u}function ea(u,x,E){u=$(u);var Q=Element.retrieve(u,"prototype_event_registry");
if(Object.isUndefined(Q))return u;if(x&&!E){var ga=Q.get(x);if(Object.isUndefined(ga))return u;ga.each(function(pa){Element.stopObserving(u,x,pa.handler)});return u}else if(!x){Q.each(function(pa){var M=pa.key;pa.value.each(function(W){Element.stopObserving(u,M,W.handler)})});return u}if(ga=Q.get(x)){var la=ga.find(function(pa){return pa.handler===E});if(!la)return u;var na=H(x);if(x.include(":"))if(u.removeEventListener)u.removeEventListener("dataavailable",la,false);else{u.detachEvent("ondataavailable",
la);u.detachEvent("onfilterchange",la)}else u.removeEventListener?u.removeEventListener(na,la,false):u.detachEvent("on"+na,la);Q.set(x,ga.without(la));return u}}function fa(u,x,E,Q){u=$(u);if(Object.isUndefined(Q))Q=true;if(u==document&&document.createEvent&&!u.dispatchEvent)u=document.documentElement;var ga;if(document.createEvent){ga=document.createEvent("HTMLEvents");ga.initEvent("dataavailable",true,true)}else{ga=document.createEventObject();ga.eventType=Q?"ondataavailable":"onfilterchange"}ga.eventName=
x;ga.memo=E||{};document.createEvent?u.dispatchEvent(ga):u.fireEvent(ga.eventType,ga);return R.extend(ga)}var R={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:{}},ta=document.documentElement,g="onmouseenter"in ta&&"onmouseleave"in ta,N;if(Prototype.Browser.IE){var da={0:1,1:4,2:2};N=function(u,x){return u.button===da[x]}}else N=Prototype.Browser.WebKit?function(u,
x){switch(x){case 0:return u.which==1&&!u.metaKey;case 1:return u.which==1&&u.metaKey;default:return false}}:function(u,x){return u.which?u.which===x+1:u.button===x};R.Methods={isLeftClick:a,isMiddleClick:b,isRightClick:c,element:e,findElement:k,pointer:o,pointerX:r,pointerY:w,stop:J};var F=Object.keys(R.Methods).inject({},function(u,x){u[x]=R.Methods[x].methodize();return u});if(Prototype.Browser.IE){var S=function(u){switch(u.type){case "mouseover":u=u.fromElement;break;case "mouseout":u=u.toElement;
break;default:return null}return Element.extend(u)};Object.extend(F,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});R.extend=function(u,x){if(!u)return false;if(u._extendedByPrototype)return u;u._extendedByPrototype=Prototype.emptyFunction;var E=R.pointer(u);Object.extend(u,{target:u.srcElement||x,relatedTarget:S(u),pageX:E.x,pageY:E.y});return Object.extend(u,F)}}else{R.prototype=window.Event.prototype||
document.createEvent("HTMLEvents").__proto__;Object.extend(R.prototype,F);R.extend=Prototype.K}var O=[];Prototype.Browser.IE&&window.attachEvent("onunload",Z);Prototype.Browser.WebKit&&window.addEventListener("unload",Prototype.emptyFunction,false);var H=Prototype.K;g||(H=function(u){var x={mouseenter:"mouseover",mouseleave:"mouseout"};return u in x?x[u]:u});Object.extend(R,R.Methods);Object.extend(R,{fire:fa,observe:X,stopObserving:ea});Element.addMethods({fire:fa,observe:X,stopObserving:ea});Object.extend(document,
{fire:fa.methodize(),observe:X.methodize(),stopObserving:ea.methodize(),loaded:false});if(window.Event)Object.extend(window.Event,R);else window.Event=R})();
(function(){function a(){if(!document.loaded){e&&window.clearTimeout(e);document.loaded=true;document.fire("dom:loaded")}}function b(){if(document.readyState==="complete"){document.stopObserving("readystatechange",b);a()}}function c(){try{document.documentElement.doScroll("left")}catch(k){e=c.defer();return}a()}var e;if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);else{document.observe("readystatechange",b);if(window==top)e=c.defer()}Event.observe(window,"load",
a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}},$continue=new Error('"throw $continue" is deprecated, use "return" instead'),Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||
document.documentElement.scrollTop||document.body.scrollTop||0},within:function(a,b,c){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,b,c);this.xcomp=b;this.ycomp=c;this.offset=Element.cumulativeOffset(a);return c>=this.offset[1]&&c<this.offset[1]+a.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+a.offsetWidth},withinIncludingScrolloffsets:function(a,b,c){var e=Element.cumulativeScrollOffset(a);this.xcomp=b+e[0]-this.deltaX;this.ycomp=c+e[1]-this.deltaY;this.offset=Element.cumulativeOffset(a);
return this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth},overlap:function(a,b){if(!a)return 0;if(a=="vertical")return(this.offset[1]+b.offsetHeight-this.ycomp)/b.offsetHeight;if(a=="horizontal")return(this.offset[0]+b.offsetWidth-this.xcomp)/b.offsetWidth},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},
relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(a,b,c){c=c||{};return Element.clonePosition(b,a,c)}};
if(!document.getElementsByClassName)document.getElementsByClassName=function(a){function b(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}a.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();return(e=/\s/.test(e)?$w(e).map(b).join(""):b(e))?document._getElementsByXPath(".//*"+e,c):[]}:function(c,e){e=e.toString().strip();var k=[],o=/\s/.test(e)?$w(e):null;if(!o&&!e)return k;c=$(c).getElementsByTagName("*");e=" "+e+" ";for(var r=
0,w,J;w=c[r];r++)if(w.className&&(J=" "+w.className+" ")&&(J.include(e)||o&&o.all(function(T){return!T.toString().blank()&&J.include(" "+T+" ")})))k.push(Element.extend(w));return k};return function(c,e){return $(e||document.body).getElementsByClassName(c)}}(Element.Methods);Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){this.include(a)||this.set($A(this).concat(a).join(" "))},remove:function(a){this.include(a)&&this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);
var Scriptaculous={Version:"1.8.3",require:function(a){try{document.write('<script type="text/javascript" src="'+a+'"><\/script>')}catch(b){var c=document.createElement("script");c.type="text/javascript";c.src=a;document.getElementsByTagName("head")[0].appendChild(c)}},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function a(b){var c=b.replace(/_.*|\./g,"");c=parseInt(c+"0".times(4-c.length));return b.indexOf("_")>-1?c-1:c}if(typeof Prototype=="undefined"||typeof Element=="undefined"||typeof Element.Methods==
"undefined"||a(Prototype.Version)<a(Scriptaculous.REQUIRED_PROTOTYPE))throw"script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE;}};Scriptaculous.load();
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a,b,c){a=a.toUpperCase();var e=document.createElement(this.NODEMAP[a]||"div");try{e.innerHTML="<"+a+"></"+a+">"}catch(k){}var o=e.firstChild||null;if(o&&o.tagName.toUpperCase()!=a)o=o.getElementsByTagName(a)[0];o||(o=document.createElement(a));if(o){if(b)if(this._isStringOrNumber(b)||
b instanceof Array||b.tagName)this._children(o,b);else{var r=this._attributes(b);if(r.length){try{e.innerHTML="<"+a+" "+r+"></"+a+">"}catch(w){}o=e.firstChild||null;if(!o){o=document.createElement(a);for(attr in b)o[attr=="class"?"className":attr]=b[attr]}if(o.tagName.toUpperCase()!=a)o=e.getElementsByTagName(a)[0]}}c&&this._children(o,c);return $(o)}},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];for(attribute in a)b.push((attribute in
this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"');return b.join(" ")},_children:function(a,b){if(b.tagName)a.appendChild(b);else if(typeof b=="object")b.flatten().each(function(c){if(typeof c=="object")a.appendChild(c);else Builder._isStringOrNumber(c)&&a.appendChild(Builder._text(c))});else Builder._isStringOrNumber(b)&&a.appendChild(Builder._text(b))},_isStringOrNumber:function(a){return typeof a=="string"||typeof a=="number"},build:function(a){var b=
this.node("div");$(b).update(a.strip());return b.down()},dump:function(a){if(typeof a!="object"&&typeof a!="function")a=window;"A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR".split(/\s+/).each(function(b){a[b]=
function(){return Builder.node.apply(Builder,[b].concat($A(arguments)))}})}};String.prototype.parseColor=function(a){var b="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(","),e=0;do b+=parseInt(c[e]).toColorPart();while(++e<3)}else if(this.slice(0,1)=="#"){if(this.length==4)for(e=1;e<4;e++)b+=(this.charAt(e)+this.charAt(e)).toLowerCase();if(this.length==7)b=this.toLowerCase()}return b.length==7?b:a||this};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return b.nodeType==3?b.nodeValue:b.hasChildNodes()?Element.collectTextNodes(b):""}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return c.nodeType==3?c.nodeValue:c.hasChildNodes()&&!Element.hasClassName(c,b)?Element.collectTextNodesIgnoreClass(c,b):""}).flatten().join("")};
Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:b/100+"em"});Prototype.Browser.WebKit&&window.scrollBy(0,0);return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var b=document.createTextNode(" ");a.appendChild(b);a.removeChild(b)}catch(c){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return-Math.cos(a*Math.PI)/2+0.5},reverse:function(a){return 1-a},flicker:function(a){a=-Math.cos(a*Math.PI)/4+0.75+Math.random()/4;return a>1?1:a},wobble:function(a){return-Math.cos(a*Math.PI*9*a)/2+0.5},pulse:function(a,b){return-Math.cos(a*((b||5)-0.5)*2*Math.PI)/2+0.5},spring:function(a){return 1-
Math.cos(a*4.5*Math.PI)*Math.exp(-a*6)},none:function(){return 0},full:function(){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE)b+=";zoom:1";a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(e){a.insertBefore((new Element("span",{style:b})).update(e==" "?String.fromCharCode(160):e),c)});Element.remove(c)}})},multiple:function(a,b,c){a=
(typeof a=="object"||Object.isFunction(a))&&a.length?a:$(a).childNodes;var e=Object.extend({speed:0.1,delay:0},c||{}),k=e.delay;$A(a).each(function(o,r){new b(o,Object.extend(e,{delay:r*e.speed+k}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(a,b,c){a=$(a);b=(b||"appear").toLowerCase();return Effect[Effect.PAIRS[b][a.visible()?1:0]](a,Object.extend({queue:{position:"end",scope:a.id||"global",limit:1}},c||{}))}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=(new Date).getTime();switch(Object.isString(a.options.queue)?a.options.queue:a.options.queue.position){case "front":this.effects.findAll(function(c){return c.state=="idle"}).each(function(c){c.startOn+=a.finishOn;c.finishOn+=a.finishOn});break;case "with-last":b=this.effects.pluck("startOn").max()||b;break;case "end":b=this.effects.pluck("finishOn").max()||
b;break}a.startOn+=b;a.finishOn+=b;if(!a.options.queue.limit||this.effects.length<a.options.queue.limit)this.effects.push(a);if(!this.interval)this.interval=setInterval(this.loop.bind(this),15)},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){for(var a=(new Date).getTime(),b=0,c=this.effects.length;b<c;b++)this.effects[b]&&this.effects[b].loop(a)}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a))return a;return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue)}};Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){if(a&&a.transition===false)a.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1E3;this.finishOn=this.startOn+this.options.duration*1E3;this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=function(){function b(c,
e){c.options[e+"Internal"]&&c.options[e+"Internal"](c);c.options[e]&&c.options[e](c)}return function(c){if(this.state==="idle"){this.state="running";b(this,"beforeSetup");this.setup&&this.setup();b(this,"afterSetup")}if(this.state==="running"){this.position=c=this.options.transition(c)*this.fromToDelta+this.options.from;b(this,"beforeUpdate");this.update&&this.update(c);b(this,"afterUpdate")}}}();this.event("beforeStart");this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":
this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn)if(a>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");this.finish&&this.finish();this.event("afterFinish")}else{a=(a-this.startOn)/this.totalTime;var b=(a*this.totalFrames).round();if(b>this.currentFrame){this.render(a);this.currentFrame=b}}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);this.state="finished"},
event:function(a){this.options[a+"Internal"]&&this.options[a+"Internal"](this);this.options[a]&&this.options[a](this)},inspect:function(){var a=$H();for(property in this)Object.isFunction(this[property])||a.set(property,this[property]);return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a,b){this.effects=a||[];this.start(b)},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");b.finish&&b.finish(a);b.event("afterFinish")})}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(a,b,c){a=Object.isString(a)?$(a):a;var e=$A(arguments),k=e.last();e=e.length==5?e[3]:null;this.method=Object.isFunction(k)?k.bind(a):Object.isFunction(a[k])?a[k].bind(a):function(o){a[k]=o};this.start(Object.extend({from:b,to:c},e||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(a){this.start(Object.extend({duration:0},a||{}))},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});this.start(Object.extend({from:this.element.getOpacity()||0,to:1},b||{}))},update:function(a){this.element.setOpacity(a)}});
Effect.Move=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({x:0,y:0,mode:"relative"},b||{}))},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x-=this.originalLeft;this.options.y-=this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*
a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(a,b,c,e){return new Effect.Move(a,Object.extend({x:c,y:b},e||{}))};
Effect.Scale=Class.create(Effect.Base,{initialize:function(a,b,c){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:b},c||{}))},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=
this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box")this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=
[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){a=this.options.scaleFrom/100+this.factor*a;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*a+this.fontSizeType});this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var c={};
if(this.options.scaleX)c.width=b.round()+"px";if(this.options.scaleY)c.height=a.round()+"px";if(this.options.scaleFromCenter){a=(a-this.dims[0])/2;b=(b-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY)c.top=this.originalTop-a+"px";if(this.options.scaleX)c.left=this.originalLeft-b+"px"}else{if(this.options.scaleY)c.top=-a+"px";if(this.options.scaleX)c.left=-b+"px"}}this.element.setStyle(c)}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({startcolor:"#ffff99"},b||{}))},setup:function(){if(this.element.getStyle("display")=="none")this.cancel();else{this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor)this.options.endcolor=
this.element.getStyle("background-color").parseColor("#ffffff");if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle("background-color");this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))}},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,e){return b+
(this._base[e]+this._delta[e]*a).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(a,b){b=b||{};var c=document.viewport.getScrollOffsets();a=$(a).cumulativeOffset();if(b.offset)a[1]+=b.offset;return new Effect.Tween(null,c.top,a[1],b,function(e){scrollTo(c.left,e.round())})};
Effect.Fade=function(a,b){a=$(a);var c=a.getInlineOpacity();b=Object.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(e){e.options.to==0&&e.element.hide().setStyle({opacity:c})}},b||{});return new Effect.Opacity(a,b)};
Effect.Appear=function(a,b){a=$(a);b=Object.extend({from:a.getStyle("display")=="none"?0:a.getOpacity()||0,to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},b||{});return new Effect.Opacity(a,b)};
Effect.Puff=function(a,b){a=$(a);var c={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return new Effect.Parallel([new Effect.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(c)}},
b||{}))};Effect.BlindUp=function(a,b){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(c){c.element.hide().undoClipping()}},b||{}))};
Effect.BlindDown=function(a,b){a=$(a);var c=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},b||{}))};
Effect.SwitchOff=function(a,b){a=$(a);var c=a.getInlineOpacity();return new Effect.Appear(a,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(k){k.element.makePositioned().makeClipping()},afterFinishInternal:function(k){k.element.hide().undoClipping().undoPositioned().setStyle({opacity:c})}})}},b||{}))};
Effect.DropOut=function(a,b){a=$(a);var c={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(c)}},b||{}))};
Effect.Shake=function(a,b){a=$(a);b=Object.extend({distance:20,duration:0.5},b||{});var c=parseFloat(b.distance),e=parseFloat(b.duration)/10,k={top:a.getStyle("top"),left:a.getStyle("left")};return new Effect.Move(a,{x:c,y:0,duration:e,afterFinishInternal:function(o){new Effect.Move(o.element,{x:-c*2,y:0,duration:e*2,afterFinishInternal:function(r){new Effect.Move(r.element,{x:c*2,y:0,duration:e*2,afterFinishInternal:function(w){new Effect.Move(w.element,{x:-c*2,y:0,duration:e*2,afterFinishInternal:function(J){new Effect.Move(J.element,
{x:c*2,y:0,duration:e*2,afterFinishInternal:function(T){new Effect.Move(T.element,{x:-c,y:0,duration:e,afterFinishInternal:function(Z){Z.element.undoPositioned().setStyle(k)}})}})}})}})}})}})};
Effect.SlideDown=function(a,b){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom"),e=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:e.height,originalWidth:e.width},restoreAfterFinish:true,afterSetup:function(k){k.element.makePositioned();k.element.down().makePositioned();window.opera&&k.element.setStyle({top:""});k.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(k){k.element.down().setStyle({bottom:k.dims[0]-
k.element.clientHeight+"px"})},afterFinishInternal:function(k){k.element.undoClipping().undoPositioned();k.element.down().undoPositioned().setStyle({bottom:c})}},b||{}))};
Effect.SlideUp=function(a,b){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom"),e=a.getDimensions();return new Effect.Scale(a,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:e.height,originalWidth:e.width},restoreAfterFinish:true,afterSetup:function(k){k.element.makePositioned();k.element.down().makePositioned();window.opera&&k.element.setStyle({top:""});k.element.makeClipping().show()},afterUpdateInternal:function(k){k.element.down().setStyle({bottom:k.dims[0]-
k.element.clientHeight+"px"})},afterFinishInternal:function(k){k.element.hide().undoClipping().undoPositioned();k.element.down().undoPositioned().setStyle({bottom:c})}},b||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};
Effect.Grow=function(a,b){a=$(a);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},b||{}),e={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},k=a.getDimensions(),o,r,w,J;switch(c.direction){case "top-left":o=r=w=J=0;break;case "top-right":o=k.width;r=J=0;w=-k.width;break;case "bottom-left":o=w=0;r=k.height;J=-k.height;break;
case "bottom-right":o=k.width;r=k.height;w=-k.width;J=-k.height;break;case "center":o=k.width/2;r=k.height/2;w=-k.width/2;J=-k.height/2;break}return new Effect.Move(a,{x:o,y:r,duration:0.01,beforeSetup:function(T){T.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(T){new Effect.Parallel([new Effect.Opacity(T.element,{sync:true,to:1,from:0,transition:c.opacityTransition}),new Effect.Move(T.element,{x:w,y:J,sync:true,transition:c.moveTransition}),new Effect.Scale(T.element,
100,{scaleMode:{originalHeight:k.height,originalWidth:k.width},sync:true,scaleFrom:window.opera?1:0,transition:c.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(Z){Z.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(Z){Z.effects[0].element.undoClipping().undoPositioned().setStyle(e)}},c))}})};
Effect.Shrink=function(a,b){a=$(a);b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},b||{});var c={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},e=a.getDimensions(),k,o;switch(b.direction){case "top-left":k=o=0;break;case "top-right":k=e.width;o=0;break;case "bottom-left":k=0;o=e.height;break;case "bottom-right":k=e.width;o=
e.height;break;case "center":k=e.width/2;o=e.height/2;break}return new Effect.Parallel([new Effect.Opacity(a,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(a,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(a,{x:k,y:o,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(r){r.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(r){r.effects[0].element.hide().undoClipping().undoPositioned().setStyle(c)}},
b))};Effect.Pulsate=function(a,b){a=$(a);var c=b||{},e=a.getInlineOpacity(),k=c.transition||Effect.Transitions.linear;return new Effect.Opacity(a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(o){o.element.setStyle({opacity:e})}},c),{transition:function(o){return 1-k(-Math.cos(o*(c.pulses||5)*2*Math.PI)/2+0.5)}}))};
Effect.Fold=function(a,b){a=$(a);var c={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};a.makeClipping();return new Effect.Scale(a,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(){new Effect.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(e){e.element.hide().undoClipping().setStyle(c)}})}},b||{}))};
Effect.Morph=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;a=Object.extend({style:{}},b||{});if(Object.isString(a.style))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 c=this.element.getStyles();this.style=this.style.reject(function(e){return e.value==c[e.key]});a.afterFinishInternal=function(e){e.element.addClassName(e.options.style);
e.transforms.each(function(k){e.element.style[k.style]=""})}}else this.style=$H(a.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(b){var c=b[0];b=b[1];var e=null;if(b.parseColor("#zzzzzz")!="#zzzzzz"){b=b.parseColor();e="color"}else if(c=="opacity"){b=parseFloat(b);Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&
this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(b)){e=b.match(/^([\+\-]?[0-9\.]+)(.*)$/);b=parseFloat(e[1]);e=e.length==3?e[2]:null}var k=this.element.getStyle(c);return{style:c.camelize(),originalValue:e=="color"?a(k):parseFloat(k||0),targetValue:e=="color"?a(b):b,unit:e}}.bind(this)).reject(function(b){return b.originalValue==b.targetValue||b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))})},update:function(a){for(var b={},c,e=this.transforms.length;e--;)b[(c=this.transforms[e]).style]=
c.unit=="color"?"#"+Math.round(c.originalValue[0]+(c.targetValue[0]-c.originalValue[0])*a).toColorPart()+Math.round(c.originalValue[1]+(c.targetValue[1]-c.originalValue[1])*a).toColorPart()+Math.round(c.originalValue[2]+(c.targetValue[2]-c.originalValue[2])*a).toColorPart():(c.originalValue+(c.targetValue-c.originalValue)*a).toFixed(3)+(c.unit===null?"":c.unit);this.element.setStyle(b,true)}});
Effect.Transform=Class.create({initialize:function(a,b){this.tracks=[];this.options=b||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=a.get("ids"),c=a.get("effect"),e=a.get("options");return[$(b)||$$(b)].flatten().map(function(k){return new c(k,Object.extend({sync:true},
e))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var a,b=$H();if(Prototype.Browser.WebKit)a=(new Element("div",{style:this})).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';a=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){a[c]&&b.set(c,a[c])});Prototype.Browser.IE&&this.include("opacity")&&b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return b};
Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=document.defaultView.getComputedStyle($(a),null);return Element.CSS_PROPERTIES.inject({},function(c,e){c[e]=b[e];return c})}:function(a){a=$(a);var b=a.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(e,k){e[k]=b[k];return e});if(!c.opacity)c.opacity=a.getOpacity();return c};
Effect.Methods={morph:function(a,b,c){a=$(a);new Effect.Morph(a,Object.extend({style:b},c||{}));return a},visualEffect:function(a,b,c){a=$(a);b=b.dasherize().camelize();b=b.charAt(0).toUpperCase()+b.substring(1);new Effect[b](a,c);return a},highlight:function(a,b){a=$(a);new Effect.Highlight(a,b);return a}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(b,c){b=$(b);Effect[a.charAt(0).toUpperCase()+a.substring(1)](b,c);return b}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);
if(Object.isUndefined(Effect))throw"dragdrop.js requires including script.aculo.us' effects.js library";
var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(a,b){a=$(a);var c=Object.extend({greedy:true,hoverclass:null,tree:false},b||{});if(c.containment){c._containers=[];b=c.containment;Object.isArray(b)?b.each(function(e){c._containers.push($(e))}):c._containers.push($(b))}if(c.accept)c.accept=[c.accept].flatten();Element.makePositioned(a);c.element=a;this.drops.push(c)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i)if(Element.isParent(a[i].element,
deepest.element))deepest=a[i];return deepest},isContained:function(a,b){var c;c=b.tree?a.treeNode:a.parentNode;return b._containers.detect(function(e){return c==e})},isAffected:function(a,b,c){return c.element!=b&&(!c._containers||this.isContained(b,c))&&(!c.accept||Element.classNames(b).detect(function(e){return c.accept.include(e)}))&&Position.within(c.element,a[0],a[1])},deactivate:function(a){a.hoverclass&&Element.removeClassName(a.element,a.hoverclass);this.last_active=null},activate:function(a){a.hoverclass&&
Element.addClassName(a.element,a.hoverclass);this.last_active=a},show:function(a,b){if(this.drops.length){var c,e=[];this.drops.each(function(k){Droppables.isAffected(a,b,k)&&e.push(k)});if(e.length>0)c=Droppables.findDeepestChild(e);this.last_active&&this.last_active!=c&&this.deactivate(this.last_active);if(c){Position.within(c.element,a[0],a[1]);c.onHover&&c.onHover(b,c.element,Position.overlap(c.overlap,c.element));c!=this.last_active&&Droppables.activate(c)}}},fire:function(a,b){if(this.last_active){Position.prepare();
if(this.isAffected([Event.pointerX(a),Event.pointerY(a)],b,this.last_active))if(this.last_active.onDrop){this.last_active.onDrop(b,this.last_active.element,a);return true}}},reset:function(){this.last_active&&this.deactivate(this.last_active)}},Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);
Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay)this._timeout=
setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay);else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(this.activeDraggable){var b=[Event.pointerX(a),Event.pointerY(a)];if(!(this._lastPointer&&this._lastPointer.inspect()==b.inspect())){this._lastPointer=b;this.activeDraggable.updateDrag(a,b)}}},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=
null}if(this.activeDraggable){this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null}},keyPress:function(a){this.activeDraggable&&this.activeDraggable.keyPress(a)},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(a,b,c){this[a+"Count"]>0&&this.observers.each(function(e){e[a]&&e[a](a,b,c)});b.options[a]&&
b.options[a](b,c)},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}},Draggable=Class.create({initialize:function(a,b){var c={handle:false,reverteffect:function(e,k,o){var r=Math.sqrt(Math.abs(k^2)+Math.abs(o^2))*0.02;new Effect.Move(e,{x:-o,y:-k,duration:r,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var k=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e,
{duration:0.2,from:0.7,to:k,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=false}})},zindex:1E3,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!b||Object.isUndefined(b.endeffect))Object.extend(c,{starteffect:function(e){e._opacity=Element.getOpacity(e);Draggable._dragging[e]=true;new Effect.Opacity(e,{duration:0.2,from:e._opacity,to:0.7})}});b=Object.extend(c,b||{});this.element=$(a);if(b.handle&&Object.isString(b.handle))this.handle=
this.element.down("."+b.handle,0);if(!this.handle)this.handle=$(b.handle);if(!this.handle)this.handle=this.element;if(b.scroll&&!b.scroll.scrollTo&&!b.scroll.outerHTML){b.scroll=$(b.scroll);this._isScrollChild=Element.childOf(this.element,b.scroll)}Element.makePositioned(this.element);this.options=b;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,
"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return[parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]},initDrag:function(a){if(!(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]))if(Event.isLeftClick(a))if(!((tag_name=Event.element(a).tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA"))){var b=
[Event.pointerX(a),Event.pointerY(a)],c=this.element.cumulativeOffset();this.offset=[0,1].map(function(e){return b[e]-c[e]});Draggables.activate(this);Event.stop(a)}},startDrag:function(a){this.dragging=true;if(!this.delta)this.delta=this.currentDelta();if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);(this._originallyAbsolute=this.element.getStyle("position")==
"absolute")||Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll)if(this.options.scroll==window){var b=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=b.left;this.originalScrollTop=b.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}Draggables.notify("onStart",this,a);this.options.starteffect&&this.options.starteffect(this.element)},updateDrag:function(a,
b){this.dragging||this.startDrag(a);if(!this.options.quiet){Position.prepare();Droppables.show(b,this.element)}Draggables.notify("onDrag",this,a);this.draw(b);this.options.change&&this.options.change(this);if(this.options.scroll){this.stopScrolling();var c;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll))c=[left,top,left+width,top+height];else{c=Position.page(this.options.scroll);c[0]+=this.options.scroll.scrollLeft+Position.deltaX;c[1]+=this.options.scroll.scrollTop+
Position.deltaY;c.push(c[0]+this.options.scroll.offsetWidth);c.push(c[1]+this.options.scroll.offsetHeight)}var e=[0,0];if(b[0]<c[0]+this.options.scrollSensitivity)e[0]=b[0]-(c[0]+this.options.scrollSensitivity);if(b[1]<c[1]+this.options.scrollSensitivity)e[1]=b[1]-(c[1]+this.options.scrollSensitivity);if(b[0]>c[2]-this.options.scrollSensitivity)e[0]=b[0]-(c[2]-this.options.scrollSensitivity);if(b[1]>c[3]-this.options.scrollSensitivity)e[1]=b[1]-(c[3]-this.options.scrollSensitivity);this.startScrolling(e)}Prototype.Browser.WebKit&&
window.scrollBy(0,0);Event.stop(a)},finishDrag:function(a,b){this.dragging=false;if(this.options.quiet){Position.prepare();var c=[Event.pointerX(a),Event.pointerY(a)];Droppables.show(c,this.element)}if(this.options.ghosting){this._originallyAbsolute||Position.relativize(this.element);delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}c=false;if(b)(c=Droppables.fire(a,this.element))||(c=false);c&&this.options.onDropped&&this.options.onDropped(this.element);Draggables.notify("onEnd",
this,a);if((a=this.options.revert)&&Object.isFunction(a))a=a(this.element);b=this.currentDelta();if(a&&this.options.reverteffect){if(c==0||a!="failure")this.options.reverteffect(this.element,b[1]-this.delta[1],b[0]-this.delta[0])}else this.delta=b;if(this.options.zindex)this.element.style.zIndex=this.originalZ;this.options.endeffect&&this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode==Event.KEY_ESC){this.finishDrag(a,false);Event.stop(a)}},
endDrag:function(a){if(this.dragging){this.stopScrolling();this.finishDrag(a,true);Event.stop(a)}},draw:function(a){var b=this.element.cumulativeOffset();if(this.options.ghosting){var c=Position.realOffset(this.element);b[0]+=c[0]-Position.deltaX;b[1]+=c[1]-Position.deltaY}c=this.currentDelta();b[0]-=c[0];b[1]-=c[1];if(this.options.scroll&&this.options.scroll!=window&&this._isScrollChild){b[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;b[1]-=this.options.scroll.scrollTop-this.originalScrollTop}c=
[0,1].map(function(k){return a[k]-b[k]-this.offset[k]}.bind(this));if(this.options.snap)c=Object.isFunction(this.options.snap)?this.options.snap(c[0],c[1],this):Object.isArray(this.options.snap)?c.map(function(k,o){return(k/this.options.snap[o]).round()*this.options.snap[o]}.bind(this)):c.map(function(k){return(k/this.options.snap).round()*this.options.snap}.bind(this));var e=this.element.style;if(!this.options.constraint||this.options.constraint=="horizontal")e.left=c[0]+"px";if(!this.options.constraint||
this.options.constraint=="vertical")e.top=c[1]+"px";if(e.visibility=="hidden")e.visibility=""},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(a[0]||a[1]){this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date;this.scrollInterval=setInterval(this.scroll.bind(this),10)}},scroll:function(){var a=new Date,b=a-this.lastScrolled;
this.lastScrolled=a;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){a=b/1E3;this.options.scroll.scrollTo(left+a*this.scrollSpeed[0],top+a*this.scrollSpeed[1])}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*b/1E3;this.options.scroll.scrollTop+=this.scrollSpeed[1]*b/1E3}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=
Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*b/1E3;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*b/1E3;if(Draggables._lastScrollPointer[0]<0)Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer)}this.options.change&&this.options.change(this)},_getWindowScroll:function(a){var b,c,e;with(a.document){if(a.document.documentElement&&
documentElement.scrollTop){b=documentElement.scrollTop;c=documentElement.scrollLeft}else if(a.document.body){b=body.scrollTop;c=body.scrollLeft}if(a.innerWidth){e=a.innerWidth;a=a.innerHeight}else if(a.document.documentElement&&documentElement.clientWidth){e=documentElement.clientWidth;a=documentElement.clientHeight}else{e=body.offsetWidth;a=body.offsetHeight}}return{top:b,left:c,width:e,height:a}}});Draggable._dragging={};
var SortableObserver=Class.create({initialize:function(a,b){this.element=$(a);this.observer=b;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();this.lastValue!=Sortable.serialize(this.element)&&this.observer(this.element)}}),Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){for(;a.tagName.toUpperCase()!="BODY";){if(a.id&&Sortable.sortables[a.id])return a;
a=a.parentNode}},options:function(a){if(a=Sortable._findRootElement($(a)))return Sortable.sortables[a.id]},destroy:function(a){a=$(a);if(a=Sortable.sortables[a.id]){Draggables.removeObserver(a.element);a.droppables.each(function(b){Droppables.remove(b)});a.draggables.invoke("destroy");delete Sortable.sortables[a.element.id]}},create:function(a,b){a=$(a);var c=Object.extend({element:a,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:a,handle:false,
only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},b||{});this.destroy(a);var e={revert:true,quiet:c.quiet,scroll:c.scroll,scrollSpeed:c.scrollSpeed,scrollSensitivity:c.scrollSensitivity,delay:c.delay,ghosting:c.ghosting,constraint:c.constraint,handle:c.handle};if(c.starteffect)e.starteffect=c.starteffect;if(c.reverteffect)e.reverteffect=
c.reverteffect;else if(c.ghosting)e.reverteffect=function(r){r.style.top=0;r.style.left=0};if(c.endeffect)e.endeffect=c.endeffect;if(c.zindex)e.zindex=c.zindex;var k={overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass,onHover:Sortable.onHover},o={onHover:Sortable.onEmptyHover,overlap:c.overlap,containment:c.containment,hoverclass:c.hoverclass};Element.cleanWhitespace(a);c.draggables=[];c.droppables=[];if(c.dropOnEmpty||c.tree){Droppables.add(a,o);c.droppables.push(a)}(c.elements||
this.findElements(a,c)||[]).each(function(r,w){w=c.handles?$(c.handles[w]):c.handle?$(r).select("."+c.handle)[0]:r;c.draggables.push(new Draggable(r,Object.extend(e,{handle:w})));Droppables.add(r,k);if(c.tree)r.treeNode=a;c.droppables.push(r)});if(c.tree)(Sortable.findTreeElements(a,c)||[]).each(function(r){Droppables.add(r,o);r.treeNode=a;c.droppables.push(r)});this.sortables[a.identify()]=c;Draggables.addObserver(new SortableObserver(a,c.onUpdate))},findElements:function(a,b){return Element.findChildren(a,
b.only,b.tree?true:false,b.tag)},findTreeElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.treeTag)},onHover:function(a,b,c){if(!Element.isParent(b,a))if(!(c>0.33&&c<0.66&&Sortable.options(b).tree))if(c>0.5){Sortable.mark(b,"before");if(b.previousSibling!=a){c=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,b);b.parentNode!=c&&Sortable.options(c).onChange(a);Sortable.options(b.parentNode).onChange(a)}}else{Sortable.mark(b,"after");var e=b.nextSibling||
null;if(e!=a){c=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,e);b.parentNode!=c&&Sortable.options(c).onChange(a);Sortable.options(b.parentNode).onChange(a)}}},onEmptyHover:function(a,b,c){var e=a.parentNode,k=Sortable.options(b);if(!Element.isParent(b,a)){var o=Sortable.findElements(b,{tag:k.tag,only:k.only}),r=null;if(o){var w=Element.offsetSize(b,k.overlap)*(1-c);for(c=0;c<o.length;c+=1)if(w-Element.offsetSize(o[c],k.overlap)>=0)w-=Element.offsetSize(o[c],k.overlap);else{r=
w-Element.offsetSize(o[c],k.overlap)/2>=0?c+1<o.length?o[c+1]:null:o[c];break}}b.insertBefore(a,r);Sortable.options(e).onChange(a);k.onChange(a)}},unmark:function(){Sortable._marker&&Sortable._marker.hide()},mark:function(a,b){var c=Sortable.options(a.parentNode);if(!(c&&!c.ghosting)){if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var e=
a.cumulativeOffset();Sortable._marker.setStyle({left:e[0]+"px",top:e[1]+"px"});if(b=="after")c.overlap=="horizontal"?Sortable._marker.setStyle({left:e[0]+a.clientWidth+"px"}):Sortable._marker.setStyle({top:e[1]+a.clientHeight+"px"});Sortable._marker.show()}},_tree:function(a,b,c){for(var e=Sortable.findElements(a,b)||[],k=0;k<e.length;++k){var o=e[k].id.match(b.format);if(o){o={id:encodeURIComponent(o?o[1]:null),element:a,parent:c,children:[],position:c.children.length,container:$(e[k]).down(b.treeTag)};
o.container&&this._tree(o.container,b,o);c.children.push(o)}}return c},tree:function(a,b){a=$(a);var c=this.options(a);b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:a.id,format:c.format},b||{});return Sortable._tree(a,b,{id:null,parent:null,children:[],container:a,position:0})},_constructIndex:function(a){var b="";do if(a.id)b="["+a.position+"]"+b;while((a=a.parent)!=null);return b},sequence:function(a,b){a=$(a);var c=Object.extend(this.options(a),b||{});return $(this.findElements(a,
c)||[]).map(function(e){return e.id.match(c.format)?e.id.match(c.format)[1]:""})},setSequence:function(a,b,c){a=$(a);var e=Object.extend(this.options(a),c||{}),k={};this.findElements(a,e).each(function(o){if(o.id.match(e.format))k[o.id.match(e.format)[1]]=[o,o.parentNode];o.parentNode.removeChild(o)});b.each(function(o){var r=k[o];if(r){r[1].appendChild(r[0]);delete k[o]}})},serialize:function(a,b){a=$(a);var c=Object.extend(Sortable.options(a),b||{}),e=encodeURIComponent(b&&b.name?b.name:a.id);return c.tree?
Sortable.tree(a,b).children.map(function(k){return[e+Sortable._constructIndex(k)+"[id]="+encodeURIComponent(k.id)].concat(k.children.map(arguments.callee))}).flatten().join("&"):Sortable.sequence(a,b).map(function(k){return e+"[]="+encodeURIComponent(k)}).join("&")}};Element.isParent=function(a,b){if(!a.parentNode||a==b)return false;if(a.parentNode==b)return true;return Element.isParent(a.parentNode,b)};
Element.findChildren=function(a,b,c,e){if(!a.hasChildNodes())return null;e=e.toUpperCase();if(b)b=[b].flatten();var k=[];$A(a.childNodes).each(function(o){if(o.tagName&&o.tagName.toUpperCase()==e&&(!b||Element.classNames(o).detect(function(r){return b.include(r)})))k.push(o);if(c)(o=Element.findChildren(o,b,c,e))&&k.push(o)});return k.length>0?k.flatten():[]};Element.offsetSize=function(a,b){return a["offset"+(b=="vertical"||b=="height"?"Height":"Width")]};
if(typeof Effect=="undefined")throw"controls.js requires including script.aculo.us' effects.js library";var Autocompleter={};
Autocompleter.Base=Class.create({baseInitialize:function(a,b,c){this.element=a=$(a);this.update=$(b);this.active=this.changed=this.hasFocus=false;this.entryCount=this.index=0;this.oldElementValue=this.element.value;if(this.setOptions)this.setOptions(c);else this.options=c||{};this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=
this.options.onShow||function(e,k){if(!k.style.position||k.style.position=="absolute"){k.style.position="absolute";Position.clone(e,k,{setHeight:false,offsetTop:e.offsetHeight})}Effect.Appear(k,{duration:0.15})};this.options.onHide=this.options.onHide||function(e,k){new Effect.Fade(k,{duration:0.15})};if(typeof this.options.tokens=="string")this.options.tokens=new Array(this.options.tokens);this.options.tokens.include("\n")||this.options.tokens.push("\n");this.observer=null;this.element.setAttribute("autocomplete",
"off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){Element.getStyle(this.update,"display")=="none"&&this.options.onShow(this.element,this.update);if(!this.iefix&&Prototype.Browser.IE&&Element.getStyle(this.update,"position")=="absolute"){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
this.iefix=$(this.update.id+"_iefix")}this.iefix&&setTimeout(this.fixIEOverlapping.bind(this),50)},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:!this.update.style.height});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();Element.getStyle(this.update,"display")!="none"&&this.options.onHide(this.element,this.update);this.iefix&&Element.hide(this.iefix)},startIndicator:function(){this.options.indicator&&Element.show(this.options.indicator)},
stopIndicator:function(){this.options.indicator&&Element.hide(this.options.indicator)},onKeyPress:function(a){if(this.active)switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(a);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(a);return}else if(a.keyCode==Event.KEY_TAB||
a.keyCode==Event.KEY_RETURN||Prototype.Browser.WebKit>0&&a.keyCode==0)return;this.hasFocus=this.changed=true;this.observer&&clearTimeout(this.observer);this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1E3)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(a){var b=Event.findElement(a,"LI");if(this.index!=b.autocompleteIndex){this.index=b.autocompleteIndex;this.render()}Event.stop(a)},onClick:function(a){this.index=
Event.findElement(a,"LI").autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(){setTimeout(this.hide.bind(this),250);this.active=this.hasFocus=false},render:function(){if(this.entryCount>0){for(var a=0;a<this.entryCount;a++)this.index==a?Element.addClassName(this.getEntry(a),"selected"):Element.removeClassName(this.getEntry(a),"selected");if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0)this.index--;else this.index=
this.entryCount-1;this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1)this.index++;else this.index=0;this.getEntry(this.index).scrollIntoView(false)},getEntry:function(a){return this.update.firstChild.childNodes[a]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(a){if(this.options.updateElement)this.options.updateElement(a);else{var b=
"";if(this.options.select){var c=$(a).select("."+this.options.select)||[];if(c.length>0)b=Element.collectTextNodes(c[0],this.options.select)}else b=Element.collectTextNodesIgnoreClass(a,"informal");c=this.getTokenBounds();if(c[0]!=-1){var e=this.element.value.substr(0,c[0]),k=this.element.value.substr(c[0]).match(/^\s+/);if(k)e+=k[0];this.element.value=e+b+this.element.value.substr(c[1])}else this.element.value=b;this.oldElementValue=this.element.value;this.element.focus();this.options.afterUpdateElement&&
this.options.afterUpdateElement(this.element,a)}},updateChoices:function(a){if(!this.changed&&this.hasFocus){this.update.innerHTML=a;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(a=0;a<this.entryCount;a++){var b=this.getEntry(a);b.autocompleteIndex=a;this.addObservers(b)}}else this.entryCount=0;this.stopIndicator();this.index=0;if(this.entryCount==1&&
this.options.autoSelect){this.selectEntry();this.hide()}else this.render()}},addObservers:function(a){Event.observe(a,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(a,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars)this.getUpdatedChoices();else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var a=this.getTokenBounds();
return this.element.value.substring(a[0],a[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds)return this.tokenBounds;var a=this.element.value;if(a.strip().empty())return[-1,0];for(var b=arguments.callee.getFirstDifferencePos(a,this.oldElementValue),c=b==this.oldElementValue.length?1:0,e=-1,k=a.length,o,r=0,w=this.options.tokens.length;r<w;++r){o=a.lastIndexOf(this.options.tokens[r],b+c-1);if(o>e)e=o;o=a.indexOf(this.options.tokens[r],b+c);if(-1!=o&&o<k)k=o}return this.tokenBounds=[e+
1,k]}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(a,b){for(var c=Math.min(a.length,b.length),e=0;e<c;++e)if(a[e]!=b[e])return e;return c};
Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(a,b,c,e){this.baseInitialize(a,b,e);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=c},getUpdatedChoices:function(){this.startIndicator();var a=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,a):a;if(this.options.defaultParams)this.options.parameters+=
"&"+this.options.defaultParams;new Ajax.Request(this.url,this.options)},onComplete:function(a){this.updateChoices(a.responseText)}});
Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(a,b,c,e){this.baseInitialize(a,b,e);this.options.array=c},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(a){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(b){for(var c=[],e=[],k=b.getToken(),o=0;o<b.options.array.length&&c.length<b.options.choices;o++)for(var r=b.options.array[o],w=b.options.ignoreCase?
r.toLowerCase().indexOf(k.toLowerCase()):r.indexOf(k);w!=-1;){if(w==0&&r.length!=k.length){c.push("<li><strong>"+r.substr(0,k.length)+"</strong>"+r.substr(k.length)+"</li>");break}else if(k.length>=b.options.partialChars&&b.options.partialSearch&&w!=-1)if(b.options.fullSearch||/\s/.test(r.substr(w-1,1))){e.push("<li>"+r.substr(0,w)+"<strong>"+r.substr(w,k.length)+"</strong>"+r.substr(w+k.length)+"</li>");break}w=b.options.ignoreCase?r.toLowerCase().indexOf(k.toLowerCase(),w+1):r.indexOf(k,w+1)}if(e.length)c=
c.concat(e.slice(0,b.options.choices-c.length));return"<ul>"+c.join("")+"</ul>"}},a||{})}});Field.scrollFreeActivate=function(a){setTimeout(function(){Field.activate(a)},1)};
Ajax.InPlaceEditor=Class.create({initialize:function(a,b,c){this.url=b;this.element=a=$(a);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(c);Object.extend(this.options,c||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId))this.options.formId=""}if(this.options.externalControl)this.options.externalControl=$(this.options.externalControl);if(!this.options.externalControl)this.options.externalControlOnly=
false;this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(a){if(!(!this._editing||
a.ctrlKey||a.altKey||a.shiftKey))if(Event.KEY_ESC==a.keyCode)this.handleFormCancellation(a);else Event.KEY_RETURN==a.keyCode&&this.handleFormSubmission(a)},createControl:function(a,b,c){var e=this.options[a+"Control"];b=this.options[a+"Text"];if("button"==e){c=document.createElement("input");c.type="submit";c.value=b;c.className="editor_"+a+"_button";if("cancel"==a)c.onclick=this._boundCancelHandler;this._form.appendChild(c);this._controls[a]=c}else if("link"==e){e=document.createElement("a");e.href=
"#";e.appendChild(document.createTextNode(b));e.onclick="cancel"==a?this._boundCancelHandler:this._boundSubmitHandler;e.className="editor_"+a+"_link";if(c)e.className+=" "+c;this._form.appendChild(e);this._controls[a]=e}},createEditField:function(){var a=this.options.loadTextURL?this.options.loadingText:this.getText(),b;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){b=document.createElement("input");b.type="text";var c=this.options.size||this.options.cols||0;if(0<c)b.size=c}else{b=document.createElement("textarea");
b.rows=1>=this.options.rows?this.options.autoRows:this.options.rows;b.cols=this.options.cols||40}b.name=this.options.paramName;b.value=a;b.className="editor_field";if(this.options.submitOnBlur)b.onblur=this._boundSubmitHandler;this._controls.editor=b;this.options.loadTextURL&&this.loadExternalText();this._form.appendChild(this._controls.editor)},createForm:function(){function a(c,e){c=b.options["text"+c+"Controls"];!c||e===false||b._form.appendChild(document.createTextNode(c))}var b=this;this._form=
$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();"textarea"==this._controls.editor.tagName.toLowerCase()&&this._form.appendChild(document.createElement("br"));this.options.onFormCustomization&&this.options.onFormCustomization(this,this._form);a("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);a("Between",
this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");a("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML)this.element.innerHTML=this._oldInnerHTML;this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(a){if(!(this._saving||this._editing)){this._editing=true;this.triggerCallback("onEnterEditMode");this.options.externalControl&&this.options.externalControl.hide();
this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);this.options.loadTextURL||this.postProcessEditField();a&&Event.stop(a)}},enterHover:function(){this.options.hoverClassName&&this.element.addClassName(this.options.hoverClassName);this._saving||this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(a){this.triggerCallback("onFailure",a);if(this._oldInnerHTML){this.element.innerHTML=
this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(a){this.wrapUp();a&&Event.stop(a)},handleFormSubmission:function(a){var b=this._form,c=$F(this._controls.editor);this.prepareSubmission();b=this.options.callback(b,c)||"";if(Object.isString(b))b=b.toQueryParams();b.editorId=this.element.id;if(this.options.htmlResponse){c=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(c,{parameters:b,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});
new Ajax.Updater({success:this.element},this.url,c)}else{c=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(c,{parameters:b,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,c)}a&&Event.stop(a)},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();this.options.externalControl&&this.options.externalControl.show();
this._editing=this._saving=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(){this.options.hoverClassName&&this.element.removeClassName(this.options.hoverClassName);this._saving||this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),
onComplete:Prototype.emptyFunction,onSuccess:function(b){this._form.removeClassName(this.options.loadingClassName);b=b.responseText;if(this.options.stripLoadedTextTags)b=b.stripTags();this._controls.editor.value=b;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,a)},postProcessEditField:function(){var a=this.options.fieldPostCreation;if(a)$(this._controls.editor)["focus"==a?"focus":"activate"]()},
prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(a){Object.extend(this.options,a)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var a;$H(Ajax.InPlaceEditor.Listeners).each(function(b){a=this[b.value].bind(this);this._listeners[b.key]=
a;this.options.externalControlOnly||this.element.observe(b.key,a);this.options.externalControl&&this.options.externalControl.observe(b.key,a)}.bind(this))},removeForm:function(){if(this._form){this._form.remove();this._form=null;this._controls={}}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(a,
b){"function"==typeof this.options[a]&&this.options[a](this,b)},unregisterListeners:function(){$H(this._listeners).each(function(a){this.options.externalControlOnly||this.element.stopObserving(a.key,a.value);this.options.externalControl&&this.options.externalControl.stopObserving(a.key,a.value)}.bind(this))},wrapUp:function(a){this.leaveEditMode();this._boundComplete(a,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});
Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,b,c,e){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(b,c,e)},createEditField:function(){var a=document.createElement("select");a.name=this.options.paramName;a.size=1;this._controls.editor=a;this._collection=this.options.collection||[];this.options.loadCollectionURL?this.loadCollection():this.checkForExternalText();this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);
this.showLoadingText(this.options.loadingCollectionText);var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(b){b=b.responseText.strip();if(!/^\[.*\]$/.test(b))throw"Server returned an invalid collection representation.";this._collection=eval(b);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,a)},
showLoadingText:function(a){this._controls.editor.disabled=true;var b=this._controls.editor.firstChild;if(!b){b=document.createElement("option");b.value="";this._controls.editor.appendChild(b);b.selected=true}b.update((a||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();this.options.loadTextURL?this.loadExternalText():this.buildOptionList()},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var a=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(b){this._text=b.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,a)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(e){return 2===e.length?e:[e,e].flatten()});var a="value"in this.options?this.options.value:this._text,
b=this._collection.any(function(e){return e[0]==a}.bind(this));this._controls.editor.update("");var c;this._collection.each(function(e,k){c=document.createElement("option");c.value=e[0];c.selected=b?e[0]==a:0==k;c.appendChild(document.createTextNode(e[1]));this._controls.editor.appendChild(c)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});
Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(a){function b(c,e){c in a||e===undefined||(a[c]=e)}if(a){b("cancelControl",a.cancelLink?"link":a.cancelButton?"button":a.cancelLink==a.cancelButton==false?false:undefined);b("okControl",a.okLink?"link":a.okButton?"button":a.okLink==a.okButton==false?false:undefined);b("highlightColor",a.highlightcolor);b("highlightEndColor",a.highlightendcolor)}};
Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",
savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(a){return Form.serialize(a)},onComplete:function(a,b){new Effect.Highlight(b,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(a){a.element.style.backgroundColor=a.options.highlightColor;a._effect&&a._effect.cancel()},onFailure:function(a){alert("Error communication with the server: "+
a.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(a){a._effect=new Effect.Highlight(a.element,{startcolor:a.options.highlightColor,endcolor:a.options.highlightEndColor,restorecolor:a._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};
Form.Element.DelayedObserver=Class.create({initialize:function(a,b,c){this.delay=b||0.5;this.element=$(a);this.callback=c;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(){if(this.lastValue!=$F(this.element)){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1E3);this.lastValue=$F(this.element)}},onTimerEvent:function(){this.timer=null;this.callback(this.element,
$F(this.element))}});if(!Control)var Control={};
Control.Slider=Class.create({initialize:function(a,b,c){var e=this;this.handles=Object.isArray(a)?a.collect(function(k){return $(k)}):[$(a)];this.track=$(b);this.options=c||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(k){return $(k)}):false;this.options.startSpan=
$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,
""):this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,"");this.disabled=this.dragging=this.active=false;this.options.disabled&&this.setDisabled();if(this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);
this.handles.each(function(k,o){o=e.handles.length-1-o;e.setValue(parseFloat((Object.isArray(e.options.sliderValue)?e.options.sliderValue[o]:e.options.sliderValue)||e.range.start),o);k.makePositioned().observe("mousedown",e.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var a=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);
Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(b){Event.stopObserving(b,"mousedown",a.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(a){if(this.allowedValues){if(a>=this.allowedValues.max())return this.allowedValues.max();if(a<=this.allowedValues.min())return this.allowedValues.min();var b=Math.abs(this.allowedValues[0]-
a),c=this.allowedValues[0];this.allowedValues.each(function(e){var k=Math.abs(e-a);if(k<=b){c=e;b=k}});return c}if(a>this.range.end)return this.range.end;if(a<this.range.start)return this.range.start;return a},setValue:function(a,b){if(!this.active){this.activeHandleIdx=b||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}b=b||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if(b>0&&a<this.values[b-1])a=this.values[b-1];if(b<this.handles.length-1&&a>this.values[b+
1])a=this.values[b+1]}a=this.getNearestValue(a);this.values[b]=a;this.value=this.values[0];this.handles[b].style[this.isVertical()?"top":"left"]=this.translateToPx(a);this.drawSpans();if(!this.dragging||!this.event)this.updateFinished()},setValueBy:function(a,b){this.setValue(this.values[b||this.activeHandleIdx||0]+a,b||this.activeHandleIdx||0)},translateToPx:function(a){return Math.round((this.trackLength-this.handleLength)/(this.range.end-this.range.start)*(a-this.range.start))+"px"},translateToValue:function(a){return a/
(this.trackLength-this.handleLength)*(this.range.end-this.range.start)+this.range.start},getRange:function(a){var b=this.values.sortBy(Prototype.K);a=a||0;return $R(b[a],b[a+1])},minimumOffset:function(){return this.isVertical()?this.alignY:this.alignX},maximumOffset:function(){return this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-
this.alignX},isVertical:function(){return this.axis=="vertical"},drawSpans:function(){var a=this;this.spans&&$R(0,this.spans.length-1).each(function(b){a.setSpan(a.spans[b],a.getRange(b))});if(this.options.startSpan)this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));if(this.options.endSpan)this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))},setSpan:function(a,b){if(this.isVertical()){a.style.top=
this.translateToPx(b.start);a.style.height=this.translateToPx(b.end-b.start+this.range.start)}else{a.style.left=this.translateToPx(b.start);a.style.width=this.translateToPx(b.end-b.start+this.range.start)}},updateStyles:function(){this.handles.each(function(a){Element.removeClassName(a,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(a){if(Event.isLeftClick(a)){if(!this.disabled){this.active=true;var b=Event.element(a),c=[Event.pointerX(a),Event.pointerY(a)];if(b==
this.track){b=this.track.cumulativeOffset();this.event=a;this.setValue(this.translateToValue((this.isVertical()?c[1]-b[1]:c[0]-b[0])-this.handleLength/2));b=this.activeHandle.cumulativeOffset();this.offsetX=c[0]-b[0];this.offsetY=c[1]-b[1]}else{for(;this.handles.indexOf(b)==-1&&b.parentNode;)b=b.parentNode;if(this.handles.indexOf(b)!=-1){this.activeHandle=b;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();b=this.activeHandle.cumulativeOffset();this.offsetX=c[0]-b[0];
this.offsetY=c[1]-b[1]}}}Event.stop(a)}},update:function(a){if(this.active){if(!this.dragging)this.dragging=true;this.draw(a);Prototype.Browser.WebKit&&window.scrollBy(0,0);Event.stop(a)}},draw:function(a){var b=[Event.pointerX(a),Event.pointerY(a)],c=this.track.cumulativeOffset();b[0]-=this.offsetX+c[0];b[1]-=this.offsetY+c[1];this.event=a;this.setValue(this.translateToValue(this.isVertical()?b[1]:b[0]));if(this.initialized&&this.options.onSlide)this.options.onSlide(this.values.length>1?this.values:
this.value,this)},endDrag:function(a){if(this.active&&this.dragging){this.finishDrag(a,true);Event.stop(a)}this.dragging=this.active=false},finishDrag:function(){this.dragging=this.active=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange)this.options.onChange(this.values.length>1?this.values:this.value,this);this.event=null}});
Sound={tracks:{},_enabled:true,template:new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),enable:function(){Sound._enabled=true},disable:function(){Sound._enabled=false},play:function(a,b){if(Sound._enabled){var c=Object.extend({track:"global",url:a,replace:false},b||{});if(c.replace&&this.tracks[c.track]){$R(0,this.tracks[c.track].id).each(function(e){e=$("sound_"+c.track+"_"+e);e.Stop&&e.Stop();e.remove()});this.tracks[c.track]=
null}if(this.tracks[c.track])this.tracks[c.track].id++;else this.tracks[c.track]={id:0};c.id=this.tracks[c.track].id;$$("body")[0].insert(Prototype.Browser.IE?new Element("bgsound",{id:"sound_"+c.track+"_"+c.id,src:c.url,loop:1,autostart:true}):Sound.template.evaluate(c))}}};
if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0)if(navigator.plugins&&$A(navigator.plugins).detect(function(a){return a.name.indexOf("QuickTime")!=-1}))Sound.template=new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');else if(navigator.plugins&&$A(navigator.plugins).detect(function(a){return a.name.indexOf("Windows Media")!=-1}))Sound.template=new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>');
else if(navigator.plugins&&$A(navigator.plugins).detect(function(a){return a.name.indexOf("RealPlayer")!=-1}))Sound.template=new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>');else Sound.play=function(){};(function(a,b){function c(){if(!g.isReady){try{F.documentElement.doScroll("left")}catch(d){setTimeout(c,1);return}g.ready()}}function e(d,f){f.src?g.ajax({url:f.src,async:false,dataType:"script"}):g.globalEval(f.text||f.textContent||f.innerHTML||"");f.parentNode&&f.parentNode.removeChild(f)}function k(d,f,h,n,l,s){var t=d.length;if(typeof f==="object"){for(var D in f)k(d,D,f[D],n,l,h);return d}if(h!==b){n=!s&&n&&g.isFunction(h);for(D=0;D<t;D++)l(d[D],f,n?h.call(d[D],D,l(d[D],f)):h,s);return d}return t?
l(d[0],f):b}function o(){return(new Date).getTime()}function r(){return false}function w(){return true}function J(d,f,h){h[0].type=d;return g.event.handle.apply(f,h)}function T(d){var f,h=[],n=[],l=arguments,s,t,D,y,C,K;t=g.data(this,"events");if(!(d.liveFired===this||!t||!t.live||d.button&&d.type==="click")){d.liveFired=this;var Y=t.live.slice(0);for(y=0;y<Y.length;y++){t=Y[y];t.origType.replace(wa,"")===d.type?n.push(t.selector):Y.splice(y--,1)}s=g(d.target).closest(n,d.currentTarget);C=0;for(K=
s.length;C<K;C++)for(y=0;y<Y.length;y++){t=Y[y];if(s[C].selector===t.selector){D=s[C].elem;n=null;if(t.preType==="mouseenter"||t.preType==="mouseleave")n=g(d.relatedTarget).closest(t.selector)[0];if(!n||n!==D)h.push({elem:D,handleObj:t})}}C=0;for(K=h.length;C<K;C++){s=h[C];d.currentTarget=s.elem;d.data=s.handleObj.data;d.handleObj=s.handleObj;if(s.handleObj.origHandler.apply(s.elem,l)===false){f=false;break}}return f}}function Z(d,f){return"live."+(d&&d!=="*"?d+".":"")+f.replace(/\./g,"`").replace(/ /g,
"&")}function X(d){return!d||!d.parentNode||d.parentNode.nodeType===11}function ea(d,f){var h=0;f.each(function(){if(this.nodeName===(d[h]&&d[h].nodeName)){var n=g.data(d[h++]),l=g.data(this,n);if(n=n&&n.events){delete l.handle;l.events={};for(var s in n)for(var t in n[s])g.event.add(this,s,n[s][t],n[s][t].data)}}})}function fa(d,f,h){var n,l,s;f=f&&f[0]?f[0].ownerDocument||f[0]:F;if(d.length===1&&typeof d[0]==="string"&&d[0].length<512&&f===F&&!Va.test(d[0])&&(g.support.checkClone||!Wa.test(d[0]))){l=
true;if(s=g.fragments[d[0]])if(s!==1)n=s}if(!n){n=f.createDocumentFragment();g.clean(d,f,n,h)}if(l)g.fragments[d[0]]=s?n:1;return{fragment:n,cacheable:l}}function R(d,f){var h={};g.each(Xa.concat.apply([],Xa.slice(0,f)),function(){h[this]=d});return h}function ta(d){return"scrollTo"in d&&d.document?d:d.nodeType===9?d.defaultView||d.parentWindow:false}var g=function(d,f){return new g.fn.init(d,f)},N=a.jQuery,da=a.$,F=a.document,S,O=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,H=/^.[^:#\[\.,]*$/,u=/\S/,x=
/^(\s|\u00A0)+|(\s|\u00A0)+$/g,E=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Q=navigator.userAgent,ga=false,la=[],na,pa=Object.prototype.toString,M=Object.prototype.hasOwnProperty,W=Array.prototype.push,ba=Array.prototype.slice,ha=Array.prototype.indexOf;g.fn=g.prototype={init:function(d,f){var h,n;if(!d)return this;if(d.nodeType){this.context=this[0]=d;this.length=1;return this}if(d==="body"&&!f){this.context=F;this[0]=F.body;this.selector="body";this.length=1;return this}if(typeof d==="string")if((h=O.exec(d))&&
(h[1]||!f))if(h[1]){n=f?f.ownerDocument||f:F;if(d=E.exec(d))if(g.isPlainObject(f)){d=[F.createElement(d[1])];g.fn.attr.call(d,f,true)}else d=[n.createElement(d[1])];else{d=fa([h[1]],[n]);d=(d.cacheable?d.fragment.cloneNode(true):d.fragment).childNodes}return g.merge(this,d)}else{if(f=F.getElementById(h[2])){if(f.id!==h[2])return S.find(d);this.length=1;this[0]=f}this.context=F;this.selector=d;return this}else if(!f&&/^\w+$/.test(d)){this.selector=d;this.context=F;d=F.getElementsByTagName(d);return g.merge(this,
d)}else return!f||f.jquery?(f||S).find(d):g(f).find(d);else if(g.isFunction(d))return S.ready(d);if(d.selector!==b){this.selector=d.selector;this.context=d.context}return g.makeArray(d,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return ba.call(this,0)},get:function(d){return d==null?this.toArray():d<0?this.slice(d)[0]:this[d]},pushStack:function(d,f,h){var n=g();g.isArray(d)?W.apply(n,d):g.merge(n,d);n.prevObject=this;n.context=this.context;if(f===
"find")n.selector=this.selector+(this.selector?" ":"")+h;else if(f)n.selector=this.selector+"."+f+"("+h+")";return n},each:function(d,f){return g.each(this,d,f)},ready:function(d){g.bindReady();if(g.isReady)d.call(F,g);else la&&la.push(d);return this},eq:function(d){return d===-1?this.slice(d):this.slice(d,+d+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(ba.apply(this,arguments),"slice",ba.call(arguments).join(","))},map:function(d){return this.pushStack(g.map(this,
function(f,h){return d.call(f,h,f)}))},end:function(){return this.prevObject||g(null)},push:W,sort:[].sort,splice:[].splice};g.fn.init.prototype=g.fn;g.extend=g.fn.extend=function(){var d=arguments[0]||{},f=1,h=arguments.length,n=false,l,s,t,D;if(typeof d==="boolean"){n=d;d=arguments[1]||{};f=2}if(typeof d!=="object"&&!g.isFunction(d))d={};if(h===f){d=this;--f}for(;f<h;f++)if((l=arguments[f])!=null)for(s in l){t=d[s];D=l[s];if(d!==D)if(n&&D&&(g.isPlainObject(D)||g.isArray(D))){t=t&&(g.isPlainObject(t)||
g.isArray(t))?t:g.isArray(D)?[]:{};d[s]=g.extend(n,t,D)}else if(D!==b)d[s]=D}return d};g.extend({noConflict:function(d){a.$=da;if(d)a.jQuery=N;return g},isReady:false,ready:function(){if(!g.isReady){if(!F.body)return setTimeout(g.ready,13);g.isReady=true;if(la){for(var d,f=0;d=la[f++];)d.call(F,g);la=null}g.fn.triggerHandler&&g(F).triggerHandler("ready")}},bindReady:function(){if(!ga){ga=true;if(F.readyState==="complete")return g.ready();if(F.addEventListener){F.addEventListener("DOMContentLoaded",
na,false);a.addEventListener("load",g.ready,false)}else if(F.attachEvent){F.attachEvent("onreadystatechange",na);a.attachEvent("onload",g.ready);var d=false;try{d=a.frameElement==null}catch(f){}F.documentElement.doScroll&&d&&c()}}},isFunction:function(d){return pa.call(d)==="[object Function]"},isArray:function(d){return pa.call(d)==="[object Array]"},isPlainObject:function(d){if(!d||pa.call(d)!=="[object Object]"||d.nodeType||d.setInterval)return false;if(d.constructor&&!M.call(d,"constructor")&&
!M.call(d.constructor.prototype,"isPrototypeOf"))return false;var f;for(f in d);return f===b||M.call(d,f)},isEmptyObject:function(d){for(var f in d)return false;return true},error:function(d){throw d;},parseJSON:function(d){if(typeof d!=="string"||!d)return null;d=g.trim(d);if(/^[\],:{}\s]*$/.test(d.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(d):
(new Function("return "+d))();else g.error("Invalid JSON: "+d)},noop:function(){},globalEval:function(d){if(d&&u.test(d)){var f=F.getElementsByTagName("head")[0]||F.documentElement,h=F.createElement("script");h.type="text/javascript";if(g.support.scriptEval)h.appendChild(F.createTextNode(d));else h.text=d;f.insertBefore(h,f.firstChild);f.removeChild(h)}},nodeName:function(d,f){return d.nodeName&&d.nodeName.toUpperCase()===f.toUpperCase()},each:function(d,f,h){var n,l=0,s=d.length,t=s===b||g.isFunction(d);
if(h)if(t)for(n in d){if(f.apply(d[n],h)===false)break}else for(;l<s;){if(f.apply(d[l++],h)===false)break}else if(t)for(n in d){if(f.call(d[n],n,d[n])===false)break}else for(h=d[0];l<s&&f.call(h,l,h)!==false;h=d[++l]);return d},trim:function(d){return(d||"").replace(x,"")},makeArray:function(d,f){f=f||[];if(d!=null)d.length==null||typeof d==="string"||g.isFunction(d)||typeof d!=="function"&&d.setInterval?W.call(f,d):g.merge(f,d);return f},inArray:function(d,f){if(f.indexOf)return f.indexOf(d);for(var h=
0,n=f.length;h<n;h++)if(f[h]===d)return h;return-1},merge:function(d,f){var h=d.length,n=0;if(typeof f.length==="number")for(var l=f.length;n<l;n++)d[h++]=f[n];else for(;f[n]!==b;)d[h++]=f[n++];d.length=h;return d},grep:function(d,f,h){for(var n=[],l=0,s=d.length;l<s;l++)!h!==!f(d[l],l)&&n.push(d[l]);return n},map:function(d,f,h){for(var n=[],l,s=0,t=d.length;s<t;s++){l=f(d[s],s,h);if(l!=null)n[n.length]=l}return n.concat.apply([],n)},guid:1,proxy:function(d,f,h){if(arguments.length===2)if(typeof f===
"string"){h=d;d=h[f];f=b}else if(f&&!g.isFunction(f)){h=f;f=b}if(!f&&d)f=function(){return d.apply(h||this,arguments)};if(d)f.guid=d.guid=d.guid||f.guid||g.guid++;return f},uaMatch:function(d){d=d.toLowerCase();d=/(webkit)[ \/]([\w.]+)/.exec(d)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(d)||/(msie) ([\w.]+)/.exec(d)||!/compatible/.test(d)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(d)||[];return{browser:d[1]||"",version:d[2]||"0"}},browser:{}});Q=g.uaMatch(Q);if(Q.browser){g.browser[Q.browser]=true;g.browser.version=
Q.version}if(g.browser.webkit)g.browser.safari=true;if(ha)g.inArray=function(d,f){return ha.call(f,d)};S=g(F);if(F.addEventListener)na=function(){F.removeEventListener("DOMContentLoaded",na,false);g.ready()};else if(F.attachEvent)na=function(){if(F.readyState==="complete"){F.detachEvent("onreadystatechange",na);g.ready()}};(function(){g.support={};var d=F.documentElement,f=F.createElement("script"),h=F.createElement("div"),n="script"+o();h.style.display="none";h.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var l=h.getElementsByTagName("*"),s=h.getElementsByTagName("a")[0];if(!(!l||!l.length||!s)){g.support={leadingWhitespace:h.firstChild.nodeType===3,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/red/.test(s.getAttribute("style")),hrefNormalized:s.getAttribute("href")==="/a",opacity:/^0.55$/.test(s.style.opacity),cssFloat:!!s.style.cssFloat,checkOn:h.getElementsByTagName("input")[0].value==="on",optSelected:F.createElement("select").appendChild(F.createElement("option")).selected,
parentNode:h.removeChild(h.appendChild(F.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};f.type="text/javascript";try{f.appendChild(F.createTextNode("window."+n+"=1;"))}catch(t){}d.insertBefore(f,d.firstChild);if(a[n]){g.support.scriptEval=true;delete a[n]}try{delete f.test}catch(D){g.support.deleteExpando=false}d.removeChild(f);if(h.attachEvent&&h.fireEvent){h.attachEvent("onclick",function y(){g.support.noCloneEvent=
false;h.detachEvent("onclick",y)});h.cloneNode(true).fireEvent("onclick")}h=F.createElement("div");h.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";d=F.createDocumentFragment();d.appendChild(h.firstChild);g.support.checkClone=d.cloneNode(true).cloneNode(true).lastChild.checked;g(function(){var y=F.createElement("div");y.style.width=y.style.paddingLeft="1px";F.body.appendChild(y);g.boxModel=g.support.boxModel=y.offsetWidth===2;F.body.removeChild(y).style.display="none"});d=function(y){var C=
F.createElement("div");y="on"+y;var K=y in C;if(!K){C.setAttribute(y,"return;");K=typeof C[y]==="function"}return K};g.support.submitBubbles=d("submit");g.support.changeBubbles=d("change");d=f=h=l=s=null}})();g.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var oa="jQuery"+o(),Da=0,U={};g.extend({cache:{},expando:oa,noData:{embed:true,object:true,
applet:true},data:function(d,f,h){if(!(d.nodeName&&g.noData[d.nodeName.toLowerCase()])){d=d==a?U:d;var n=d[oa],l=g.cache;if(!n&&typeof f==="string"&&h===b)return null;n||(n=++Da);if(typeof f==="object"){d[oa]=n;l[n]=g.extend(true,{},f)}else if(!l[n]){d[oa]=n;l[n]={}}d=l[n];if(h!==b)d[f]=h;return typeof f==="string"?d[f]:d}},removeData:function(d,f){if(!(d.nodeName&&g.noData[d.nodeName.toLowerCase()])){d=d==a?U:d;var h=d[oa],n=g.cache,l=n[h];if(f){if(l){delete l[f];g.isEmptyObject(l)&&g.removeData(d)}}else{if(g.support.deleteExpando)delete d[g.expando];
else d.removeAttribute&&d.removeAttribute(g.expando);delete n[h]}}}});g.fn.extend({data:function(d,f){if(typeof d==="undefined"&&this.length)return g.data(this[0]);else if(typeof d==="object")return this.each(function(){g.data(this,d)});var h=d.split(".");h[1]=h[1]?"."+h[1]:"";if(f===b){var n=this.triggerHandler("getData"+h[1]+"!",[h[0]]);if(n===b&&this.length)n=g.data(this[0],d);return n===b&&h[1]?this.data(h[0]):n}else return this.trigger("setData"+h[1]+"!",[h[0],f]).each(function(){g.data(this,
d,f)})},removeData:function(d){return this.each(function(){g.removeData(this,d)})}});g.extend({queue:function(d,f,h){if(d){f=(f||"fx")+"queue";var n=g.data(d,f);if(!h)return n||[];if(!n||g.isArray(h))n=g.data(d,f,g.makeArray(h));else n.push(h);return n}},dequeue:function(d,f){f=f||"fx";var h=g.queue(d,f),n=h.shift();if(n==="inprogress")n=h.shift();if(n){f==="fx"&&h.unshift("inprogress");n.call(d,function(){g.dequeue(d,f)})}}});g.fn.extend({queue:function(d,f){if(typeof d!=="string"){f=d;d="fx"}if(f===
b)return g.queue(this[0],d);return this.each(function(){var h=g.queue(this,d,f);d==="fx"&&h[0]!=="inprogress"&&g.dequeue(this,d)})},dequeue:function(d){return this.each(function(){g.dequeue(this,d)})},delay:function(d,f){d=g.fx?g.fx.speeds[d]||d:d;f=f||"fx";return this.queue(f,function(){var h=this;setTimeout(function(){g.dequeue(h,f)},d)})},clearQueue:function(d){return this.queue(d||"fx",[])}});var v=/[\n\t]/g,z=/\s+/,L=/\r/g,P=/href|src|style/,ka=/(button|input)/i,qa=/(button|input|object|select|textarea)/i,
ua=/^(a|area)$/i,ma=/radio|checkbox/;g.fn.extend({attr:function(d,f){return k(this,d,f,true,g.attr)},removeAttr:function(d){return this.each(function(){g.attr(this,d,"");this.nodeType===1&&this.removeAttribute(d)})},addClass:function(d){if(g.isFunction(d))return this.each(function(C){var K=g(this);K.addClass(d.call(this,C,K.attr("class")))});if(d&&typeof d==="string")for(var f=(d||"").split(z),h=0,n=this.length;h<n;h++){var l=this[h];if(l.nodeType===1)if(l.className){for(var s=" "+l.className+" ",
t=l.className,D=0,y=f.length;D<y;D++)if(s.indexOf(" "+f[D]+" ")<0)t+=" "+f[D];l.className=g.trim(t)}else l.className=d}return this},removeClass:function(d){if(g.isFunction(d))return this.each(function(y){var C=g(this);C.removeClass(d.call(this,y,C.attr("class")))});if(d&&typeof d==="string"||d===b)for(var f=(d||"").split(z),h=0,n=this.length;h<n;h++){var l=this[h];if(l.nodeType===1&&l.className)if(d){for(var s=(" "+l.className+" ").replace(v," "),t=0,D=f.length;t<D;t++)s=s.replace(" "+f[t]+" "," ");
l.className=g.trim(s)}else l.className=""}return this},toggleClass:function(d,f){var h=typeof d,n=typeof f==="boolean";if(g.isFunction(d))return this.each(function(l){var s=g(this);s.toggleClass(d.call(this,l,s.attr("class"),f),f)});return this.each(function(){if(h==="string")for(var l,s=0,t=g(this),D=f,y=d.split(z);l=y[s++];){D=n?D:!t.hasClass(l);t[D?"addClass":"removeClass"](l)}else if(h==="undefined"||h==="boolean"){this.className&&g.data(this,"__className__",this.className);this.className=this.className||
d===false?"":g.data(this,"__className__")||""}})},hasClass:function(d){d=" "+d+" ";for(var f=0,h=this.length;f<h;f++)if((" "+this[f].className+" ").replace(v," ").indexOf(d)>-1)return true;return false},val:function(d){if(d===b){var f=this[0];if(f){if(g.nodeName(f,"option"))return(f.attributes.value||{}).specified?f.value:f.text;if(g.nodeName(f,"select")){var h=f.selectedIndex,n=[],l=f.options;f=f.type==="select-one";if(h<0)return null;var s=f?h:0;for(h=f?h+1:l.length;s<h;s++){var t=l[s];if(t.selected){d=
g(t).val();if(f)return d;n.push(d)}}return n}if(ma.test(f.type)&&!g.support.checkOn)return f.getAttribute("value")===null?"on":f.value;return(f.value||"").replace(L,"")}return b}var D=g.isFunction(d);return this.each(function(y){var C=g(this),K=d;if(this.nodeType===1){if(D)K=d.call(this,y,C.val());if(typeof K==="number")K+="";if(g.isArray(K)&&ma.test(this.type))this.checked=g.inArray(C.val(),K)>=0;else if(g.nodeName(this,"select")){var Y=g.makeArray(K);g("option",this).each(function(){this.selected=
g.inArray(g(this).val(),Y)>=0});if(!Y.length)this.selectedIndex=-1}else this.value=K}})}});g.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(d,f,h,n){if(!d||d.nodeType===3||d.nodeType===8)return b;if(n&&f in g.attrFn)return g(d)[f](h);n=d.nodeType!==1||!g.isXMLDoc(d);var l=h!==b;f=n&&g.props[f]||f;if(d.nodeType===1){var s=P.test(f);if(f in d&&n&&!s){if(l){f==="type"&&ka.test(d.nodeName)&&d.parentNode&&g.error("type property can't be changed");
d[f]=h}if(g.nodeName(d,"form")&&d.getAttributeNode(f))return d.getAttributeNode(f).nodeValue;if(f==="tabIndex")return(f=d.getAttributeNode("tabIndex"))&&f.specified?f.value:qa.test(d.nodeName)||ua.test(d.nodeName)&&d.href?0:b;return d[f]}if(!g.support.style&&n&&f==="style"){if(l)d.style.cssText=""+h;return d.style.cssText}l&&d.setAttribute(f,""+h);d=!g.support.hrefNormalized&&n&&s?d.getAttribute(f,2):d.getAttribute(f);return d===null?b:d}return g.style(d,f,h)}});var wa=/\.(.*)$/,va=function(d){return d.replace(/[^\w\s\.\|`]/g,
function(f){return"\\"+f})};g.event={add:function(d,f,h,n){if(!(d.nodeType===3||d.nodeType===8)){if(d.setInterval&&d!==a&&!d.frameElement)d=a;var l,s;if(h.handler){l=h;h=l.handler}if(!h.guid)h.guid=g.guid++;if(s=g.data(d)){var t=s.events=s.events||{},D=s.handle;if(!D)s.handle=D=function(){return typeof g!=="undefined"&&!g.event.triggered?g.event.handle.apply(D.elem,arguments):b};D.elem=d;f=f.split(" ");for(var y,C=0,K;y=f[C++];){s=l?g.extend({},l):{handler:h,data:n};if(y.indexOf(".")>-1){K=y.split(".");
y=K.shift();s.namespace=K.slice(0).sort().join(".")}else{K=[];s.namespace=""}s.type=y;s.guid=h.guid;var Y=t[y],ja=g.event.special[y]||{};if(!Y){Y=t[y]=[];if(!ja.setup||ja.setup.call(d,n,K,D)===false)if(d.addEventListener)d.addEventListener(y,D,false);else d.attachEvent&&d.attachEvent("on"+y,D)}if(ja.add){ja.add.call(d,s);if(!s.handler.guid)s.handler.guid=h.guid}Y.push(s);g.event.global[y]=true}d=null}}},global:{},remove:function(d,f,h,n){if(!(d.nodeType===3||d.nodeType===8)){var l,s=0,t,D,y,C,K,Y,
ja=g.data(d),sa=ja&&ja.events;if(ja&&sa){if(f&&f.type){h=f.handler;f=f.type}if(!f||typeof f==="string"&&f.charAt(0)==="."){f=f||"";for(l in sa)g.event.remove(d,l+f)}else{for(f=f.split(" ");l=f[s++];){C=l;t=l.indexOf(".")<0;D=[];if(!t){D=l.split(".");l=D.shift();y=new RegExp("(^|\\.)"+g.map(D.slice(0).sort(),va).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(K=sa[l])if(h){C=g.event.special[l]||{};for(ra=n||0;ra<K.length;ra++){Y=K[ra];if(h.guid===Y.guid){if(t||y.test(Y.namespace)){n==null&&K.splice(ra--,1);C.remove&&
C.remove.call(d,Y)}if(n!=null)break}}if(K.length===0||n!=null&&K.length===1){if(!C.teardown||C.teardown.call(d,D)===false)xa(d,l,ja.handle);delete sa[l]}}else for(var ra=0;ra<K.length;ra++){Y=K[ra];if(t||y.test(Y.namespace)){g.event.remove(d,C,Y.handler,ra);K.splice(ra--,1)}}}if(g.isEmptyObject(sa)){if(f=ja.handle)f.elem=null;delete ja.events;delete ja.handle;g.isEmptyObject(ja)&&g.removeData(d)}}}}},trigger:function(d,f,h,n){var l=d.type||d;if(!n){d=typeof d==="object"?d[oa]?d:g.extend(g.Event(l),
d):g.Event(l);if(l.indexOf("!")>=0){d.type=l=l.slice(0,-1);d.exclusive=true}if(!h){d.stopPropagation();g.event.global[l]&&g.each(g.cache,function(){this.events&&this.events[l]&&g.event.trigger(d,f,this.handle.elem)})}if(!h||h.nodeType===3||h.nodeType===8)return b;d.result=b;d.target=h;f=g.makeArray(f);f.unshift(d)}d.currentTarget=h;(n=g.data(h,"handle"))&&n.apply(h,f);n=h.parentNode||h.ownerDocument;try{if(!(h&&h.nodeName&&g.noData[h.nodeName.toLowerCase()]))if(h["on"+l]&&h["on"+l].apply(h,f)===false)d.result=
false}catch(s){}if(!d.isPropagationStopped()&&n)g.event.trigger(d,f,n,true);else if(!d.isDefaultPrevented()){n=d.target;var t,D=g.nodeName(n,"a")&&l==="click",y=g.event.special[l]||{};if((!y._default||y._default.call(h,d)===false)&&!D&&!(n&&n.nodeName&&g.noData[n.nodeName.toLowerCase()])){try{if(n[l]){if(t=n["on"+l])n["on"+l]=null;g.event.triggered=true;n[l]()}}catch(C){}if(t)n["on"+l]=t;g.event.triggered=false}}},handle:function(d){var f,h,n,l;d=arguments[0]=g.event.fix(d||a.event);d.currentTarget=
this;f=d.type.indexOf(".")<0&&!d.exclusive;if(!f){h=d.type.split(".");d.type=h.shift();n=new RegExp("(^|\\.)"+h.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}l=g.data(this,"events");h=l[d.type];if(l&&h){h=h.slice(0);l=0;for(var s=h.length;l<s;l++){var t=h[l];if(f||n.test(t.namespace)){d.handler=t.handler;d.data=t.data;d.handleObj=t;t=t.handler.apply(this,arguments);if(t!==b){d.result=t;if(t===false){d.preventDefault();d.stopPropagation()}}if(d.isImmediatePropagationStopped())break}}}return d.result},
props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(d){if(d[oa])return d;var f=d;d=g.Event(f);for(var h=this.props.length,n;h;){n=this.props[--h];d[n]=f[n]}if(!d.target)d.target=d.srcElement||
F;if(d.target.nodeType===3)d.target=d.target.parentNode;if(!d.relatedTarget&&d.fromElement)d.relatedTarget=d.fromElement===d.target?d.toElement:d.fromElement;if(d.pageX==null&&d.clientX!=null){f=F.documentElement;h=F.body;d.pageX=d.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0);d.pageY=d.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}if(!d.which&&(d.charCode||d.charCode===0?d.charCode:d.keyCode))d.which=d.charCode||d.keyCode;if(!d.metaKey&&
d.ctrlKey)d.metaKey=d.ctrlKey;if(!d.which&&d.button!==b)d.which=d.button&1?1:d.button&2?3:d.button&4?2:0;return d},guid:1E8,proxy:g.proxy,special:{ready:{setup:g.bindReady,teardown:g.noop},live:{add:function(d){g.event.add(this,d.origType,g.extend({},d,{handler:T}))},remove:function(d){var f=true,h=d.origType.replace(wa,"");g.each(g.data(this,"events").live||[],function(){if(h===this.origType.replace(wa,""))return f=false});f&&g.event.remove(this,d.origType,T)}},beforeunload:{setup:function(d,f,h){if(this.setInterval)this.onbeforeunload=
h;return false},teardown:function(d,f){if(this.onbeforeunload===f)this.onbeforeunload=null}}}};var xa=F.removeEventListener?function(d,f,h){d.removeEventListener(f,h,false)}:function(d,f,h){d.detachEvent("on"+f,h)};g.Event=function(d){if(!this.preventDefault)return new g.Event(d);if(d&&d.type){this.originalEvent=d;this.type=d.type}else this.type=d;this.timeStamp=o();this[oa]=true};g.Event.prototype={preventDefault:function(){this.isDefaultPrevented=w;var d=this.originalEvent;if(d){d.preventDefault&&
d.preventDefault();d.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=w;var d=this.originalEvent;if(d){d.stopPropagation&&d.stopPropagation();d.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=w;this.stopPropagation()},isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r};var Ea=function(d){var f=d.relatedTarget;try{for(;f&&f!==this;)f=f.parentNode;if(f!==this){d.type=d.data;g.event.handle.apply(this,arguments)}}catch(h){}},
Ha=function(d){d.type=d.data;g.event.handle.apply(this,arguments)};g.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(d,f){g.event.special[d]={setup:function(h){g.event.add(this,f,h&&h.selector?Ha:Ea,d)},teardown:function(h){g.event.remove(this,f,h&&h.selector?Ha:Ea)}}});if(!g.support.submitBubbles)g.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){g.event.add(this,"click.specialSubmit",function(d){var f=d.target,h=f.type;if((h==="submit"||h==="image")&&
g(f).closest("form").length)return J("submit",this,arguments)});g.event.add(this,"keypress.specialSubmit",function(d){var f=d.target,h=f.type;if((h==="text"||h==="password")&&g(f).closest("form").length&&d.keyCode===13)return J("submit",this,arguments)})}else return false},teardown:function(){g.event.remove(this,".specialSubmit")}};if(!g.support.changeBubbles){var Ba=/textarea|input|select/i,Ca,Ya=function(d){var f=d.type,h=d.value;if(f==="radio"||f==="checkbox")h=d.checked;else if(f==="select-multiple")h=
d.selectedIndex>-1?g.map(d.options,function(n){return n.selected}).join("-"):"";else if(d.nodeName.toLowerCase()==="select")h=d.selectedIndex;return h},Oa=function(d,f){var h=d.target,n,l;if(!(!Ba.test(h.nodeName)||h.readOnly)){n=g.data(h,"_change_data");l=Ya(h);if(d.type!=="focusout"||h.type!=="radio")g.data(h,"_change_data",l);if(!(n===b||l===n))if(n!=null||l){d.type="change";return g.event.trigger(d,f,h)}}};g.event.special.change={filters:{focusout:Oa,click:function(d){var f=d.target,h=f.type;
if(h==="radio"||h==="checkbox"||f.nodeName.toLowerCase()==="select")return Oa.call(this,d)},keydown:function(d){var f=d.target,h=f.type;if(d.keyCode===13&&f.nodeName.toLowerCase()!=="textarea"||d.keyCode===32&&(h==="checkbox"||h==="radio")||h==="select-multiple")return Oa.call(this,d)},beforeactivate:function(d){d=d.target;g.data(d,"_change_data",Ya(d))}},setup:function(){if(this.type==="file")return false;for(var d in Ca)g.event.add(this,d+".specialChange",Ca[d]);return Ba.test(this.nodeName)},teardown:function(){g.event.remove(this,
".specialChange");return Ba.test(this.nodeName)}};Ca=g.event.special.change.filters}F.addEventListener&&g.each({focus:"focusin",blur:"focusout"},function(d,f){function h(n){n=g.event.fix(n);n.type=f;return g.event.handle.call(this,n)}g.event.special[f]={setup:function(){this.addEventListener(d,h,true)},teardown:function(){this.removeEventListener(d,h,true)}}});g.each(["bind","one"],function(d,f){g.fn[f]=function(h,n,l){if(typeof h==="object"){for(var s in h)this[f](s,n,h[s],l);return this}if(g.isFunction(n)){l=
n;n=b}var t=f==="one"?g.proxy(l,function(y){g(this).unbind(y,t);return l.apply(this,arguments)}):l;if(h==="unload"&&f!=="one")this.one(h,n,l);else{s=0;for(var D=this.length;s<D;s++)g.event.add(this[s],h,t,n)}return this}});g.fn.extend({unbind:function(d,f){if(typeof d==="object"&&!d.preventDefault)for(var h in d)this.unbind(h,d[h]);else{h=0;for(var n=this.length;h<n;h++)g.event.remove(this[h],d,f)}return this},delegate:function(d,f,h,n){return this.live(f,h,n,d)},undelegate:function(d,f,h){return arguments.length===
0?this.unbind("live"):this.die(f,null,h,d)},trigger:function(d,f){return this.each(function(){g.event.trigger(d,f,this)})},triggerHandler:function(d,f){if(this[0]){d=g.Event(d);d.preventDefault();d.stopPropagation();g.event.trigger(d,f,this[0]);return d.result}},toggle:function(d){for(var f=arguments,h=1;h<f.length;)g.proxy(d,f[h++]);return this.click(g.proxy(d,function(n){var l=(g.data(this,"lastToggle"+d.guid)||0)%h;g.data(this,"lastToggle"+d.guid,l+1);n.preventDefault();return f[l].apply(this,
arguments)||false}))},hover:function(d,f){return this.mouseenter(d).mouseleave(f||d)}});var Za={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};g.each(["live","die"],function(d,f){g.fn[f]=function(h,n,l,s){var t,D=0,y,C,K=s||this.selector,Y=s?this:g(this.context);if(g.isFunction(n)){l=n;n=b}for(h=(h||"").split(" ");(t=h[D++])!=null;){s=wa.exec(t);y="";if(s){y=s[0];t=t.replace(wa,"")}if(t==="hover")h.push("mouseenter"+y,"mouseleave"+y);else{C=t;if(t==="focus"||t==="blur"){h.push(Za[t]+
y);t+=y}else t=(Za[t]||t)+y;f==="live"?Y.each(function(){g.event.add(this,Z(t,K),{data:n,selector:K,handler:l,origType:t,origHandler:l,preType:C})}):Y.unbind(Z(t,K),l)}}return this}});g.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(d,f){g.fn[f]=function(h){return h?this.bind(f,h):this.trigger(f)};if(g.attrFn)g.attrFn[f]=true});a.attachEvent&&
!a.addEventListener&&a.attachEvent("onunload",function(){for(var d in g.cache)if(g.cache[d].handle)try{g.event.remove(g.cache[d].handle.elem)}catch(f){}});(function(){function d(p){for(var q="",A,B=0;p[B];B++){A=p[B];if(A.nodeType===3||A.nodeType===4)q+=A.nodeValue;else if(A.nodeType!==8)q+=d(A.childNodes)}return q}function f(p,q,A,B,I,G){I=0;for(var aa=B.length;I<aa;I++){var V=B[I];if(V){V=V[p];for(var ia=false;V;){if(V.sizcache===A){ia=B[V.sizset];break}if(V.nodeType===1&&!G){V.sizcache=A;V.sizset=
I}if(V.nodeName.toLowerCase()===q){ia=V;break}V=V[p]}B[I]=ia}}}function h(p,q,A,B,I,G){I=0;for(var aa=B.length;I<aa;I++){var V=B[I];if(V){V=V[p];for(var ia=false;V;){if(V.sizcache===A){ia=B[V.sizset];break}if(V.nodeType===1){if(!G){V.sizcache=A;V.sizset=I}if(typeof q!=="string"){if(V===q){ia=true;break}}else if(y.filter(q,[V]).length>0){ia=V;break}}V=V[p]}B[I]=ia}}}var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
l=0,s=Object.prototype.toString,t=false,D=true;[0,0].sort(function(){D=false;return 0});var y=function(p,q,A,B){A=A||[];var I=q=q||F;if(q.nodeType!==1&&q.nodeType!==9)return[];if(!p||typeof p!=="string")return A;for(var G=[],aa,V,ia,Ka,Fa=true,Ia=ca(q),Ga=p;(n.exec(""),aa=n.exec(Ga))!==null;){Ga=aa[3];G.push(aa[1]);if(aa[2]){Ka=aa[3];break}}if(G.length>1&&K.exec(p))if(G.length===2&&C.relative[G[0]])V=Pa(G[0]+G[1],q);else for(V=C.relative[G[0]]?[q]:y(G.shift(),q);G.length;){p=G.shift();if(C.relative[p])p+=
G.shift();V=Pa(p,V)}else{if(!B&&G.length>1&&q.nodeType===9&&!Ia&&C.match.ID.test(G[0])&&!C.match.ID.test(G[G.length-1])){aa=y.find(G.shift(),q,Ia);q=aa.expr?y.filter(aa.expr,aa.set)[0]:aa.set[0]}if(q){aa=B?{expr:G.pop(),set:ja(B)}:y.find(G.pop(),G.length===1&&(G[0]==="~"||G[0]==="+")&&q.parentNode?q.parentNode:q,Ia);V=aa.expr?y.filter(aa.expr,aa.set):aa.set;if(G.length>0)ia=ja(V);else Fa=false;for(;G.length;){var ya=G.pop();aa=ya;if(C.relative[ya])aa=G.pop();else ya="";if(aa==null)aa=q;C.relative[ya](ia,
aa,Ia)}}else ia=[]}ia||(ia=V);ia||y.error(ya||p);if(s.call(ia)==="[object Array]")if(Fa)if(q&&q.nodeType===1)for(p=0;ia[p]!=null;p++){if(ia[p]&&(ia[p]===true||ia[p].nodeType===1&&za(q,ia[p])))A.push(V[p])}else for(p=0;ia[p]!=null;p++)ia[p]&&ia[p].nodeType===1&&A.push(V[p]);else A.push.apply(A,ia);else ja(ia,A);if(Ka){y(Ka,I,A,B);y.uniqueSort(A)}return A};y.uniqueSort=function(p){if(ra){t=D;p.sort(ra);if(t)for(var q=1;q<p.length;q++)p[q]===p[q-1]&&p.splice(q--,1)}return p};y.matches=function(p,q){return y(p,
null,null,q)};y.find=function(p,q,A){var B,I;if(!p)return[];for(var G=0,aa=C.order.length;G<aa;G++){var V=C.order[G];if(I=C.leftMatch[V].exec(p)){var ia=I[1];I.splice(1,1);if(ia.substr(ia.length-1)!=="\\"){I[1]=(I[1]||"").replace(/\\/g,"");B=C.find[V](I,q,A);if(B!=null){p=p.replace(C.match[V],"");break}}}}B||(B=q.getElementsByTagName("*"));return{set:B,expr:p}};y.filter=function(p,q,A,B){for(var I=p,G=[],aa=q,V,ia,Ka=q&&q[0]&&ca(q[0]);p&&q.length;){for(var Fa in C.filter)if((V=C.leftMatch[Fa].exec(p))!=
null&&V[2]){var Ia=C.filter[Fa],Ga,ya;ya=V[1];ia=false;V.splice(1,1);if(ya.substr(ya.length-1)!=="\\"){if(aa===G)G=[];if(C.preFilter[Fa])if(V=C.preFilter[Fa](V,aa,A,G,B,Ka)){if(V===true)continue}else ia=Ga=true;if(V)for(var La=0;(ya=aa[La])!=null;La++)if(ya){Ga=Ia(ya,V,La,aa);var $a=B^!!Ga;if(A&&Ga!=null)if($a)ia=true;else aa[La]=false;else if($a){G.push(ya);ia=true}}if(Ga!==b){A||(aa=G);p=p.replace(C.match[Fa],"");if(!ia)return[];break}}}if(p===I)if(ia==null)y.error(p);else break;I=p}return aa};
y.error=function(p){throw"Syntax error, unrecognized expression: "+p;};var C=y.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\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(p){return p.getAttribute("href")}},relative:{"+":function(p,q){var A=typeof q==="string",B=A&&!/\W/.test(q);A=A&&!B;if(B)q=q.toLowerCase();B=0;for(var I=p.length,G;B<I;B++)if(G=p[B]){for(;(G=G.previousSibling)&&G.nodeType!==1;);p[B]=A||G&&G.nodeName.toLowerCase()===q?G||false:G===q}A&&y.filter(q,p,true)},">":function(p,q){var A=typeof q===
"string";if(A&&!/\W/.test(q)){q=q.toLowerCase();for(var B=0,I=p.length;B<I;B++){var G=p[B];if(G){A=G.parentNode;p[B]=A.nodeName.toLowerCase()===q?A:false}}}else{B=0;for(I=p.length;B<I;B++)if(G=p[B])p[B]=A?G.parentNode:G.parentNode===q;A&&y.filter(q,p,true)}},"":function(p,q,A){var B=l++,I=h;if(typeof q==="string"&&!/\W/.test(q)){var G=q=q.toLowerCase();I=f}I("parentNode",q,B,p,G,A)},"~":function(p,q,A){var B=l++,I=h;if(typeof q==="string"&&!/\W/.test(q)){var G=q=q.toLowerCase();I=f}I("previousSibling",
q,B,p,G,A)}},find:{ID:function(p,q,A){if(typeof q.getElementById!=="undefined"&&!A)return(p=q.getElementById(p[1]))?[p]:[]},NAME:function(p,q){if(typeof q.getElementsByName!=="undefined"){var A=[];q=q.getElementsByName(p[1]);for(var B=0,I=q.length;B<I;B++)q[B].getAttribute("name")===p[1]&&A.push(q[B]);return A.length===0?null:A}},TAG:function(p,q){return q.getElementsByTagName(p[1])}},preFilter:{CLASS:function(p,q,A,B,I,G){p=" "+p[1].replace(/\\/g,"")+" ";if(G)return p;G=0;for(var aa;(aa=q[G])!=null;G++)if(aa)if(I^
(aa.className&&(" "+aa.className+" ").replace(/[\t\n]/g," ").indexOf(p)>=0))A||B.push(aa);else if(A)q[G]=false;return false},ID:function(p){return p[1].replace(/\\/g,"")},TAG:function(p){return p[1].toLowerCase()},CHILD:function(p){if(p[1]==="nth"){var q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(p[2]==="even"&&"2n"||p[2]==="odd"&&"2n+1"||!/\D/.test(p[2])&&"0n+"+p[2]||p[2]);p[2]=q[1]+(q[2]||1)-0;p[3]=q[3]-0}p[0]=l++;return p},ATTR:function(p,q,A,B,I,G){q=p[1].replace(/\\/g,"");if(!G&&C.attrMap[q])p[1]=C.attrMap[q];
if(p[2]==="~=")p[4]=" "+p[4]+" ";return p},PSEUDO:function(p,q,A,B,I){if(p[1]==="not")if((n.exec(p[3])||"").length>1||/^\w/.test(p[3]))p[3]=y(p[3],null,null,q);else{p=y.filter(p[3],q,A,true^I);A||B.push.apply(B,p);return false}else if(C.match.POS.test(p[0])||C.match.CHILD.test(p[0]))return true;return p},POS:function(p){p.unshift(true);return p}},filters:{enabled:function(p){return p.disabled===false&&p.type!=="hidden"},disabled:function(p){return p.disabled===true},checked:function(p){return p.checked===
true},selected:function(p){return p.selected===true},parent:function(p){return!!p.firstChild},empty:function(p){return!p.firstChild},has:function(p,q,A){return!!y(A[3],p).length},header:function(p){return/h\d/i.test(p.nodeName)},text:function(p){return"text"===p.type},radio:function(p){return"radio"===p.type},checkbox:function(p){return"checkbox"===p.type},file:function(p){return"file"===p.type},password:function(p){return"password"===p.type},submit:function(p){return"submit"===p.type},image:function(p){return"image"===
p.type},reset:function(p){return"reset"===p.type},button:function(p){return"button"===p.type||p.nodeName.toLowerCase()==="button"},input:function(p){return/input|select|textarea|button/i.test(p.nodeName)}},setFilters:{first:function(p,q){return q===0},last:function(p,q,A,B){return q===B.length-1},even:function(p,q){return q%2===0},odd:function(p,q){return q%2===1},lt:function(p,q,A){return q<A[3]-0},gt:function(p,q,A){return q>A[3]-0},nth:function(p,q,A){return A[3]-0===q},eq:function(p,q,A){return A[3]-
0===q}},filter:{PSEUDO:function(p,q,A,B){var I=q[1],G=C.filters[I];if(G)return G(p,A,q,B);else if(I==="contains")return(p.textContent||p.innerText||d([p])||"").indexOf(q[3])>=0;else if(I==="not"){q=q[3];A=0;for(B=q.length;A<B;A++)if(q[A]===p)return false;return true}else y.error("Syntax error, unrecognized expression: "+I)},CHILD:function(p,q){var A=q[1],B=p;switch(A){case "only":case "first":for(;B=B.previousSibling;)if(B.nodeType===1)return false;if(A==="first")return true;B=p;case "last":for(;B=
B.nextSibling;)if(B.nodeType===1)return false;return true;case "nth":A=q[2];var I=q[3];if(A===1&&I===0)return true;q=q[0];var G=p.parentNode;if(G&&(G.sizcache!==q||!p.nodeIndex)){var aa=0;for(B=G.firstChild;B;B=B.nextSibling)if(B.nodeType===1)B.nodeIndex=++aa;G.sizcache=q}p=p.nodeIndex-I;return A===0?p===0:p%A===0&&p/A>=0}},ID:function(p,q){return p.nodeType===1&&p.getAttribute("id")===q},TAG:function(p,q){return q==="*"&&p.nodeType===1||p.nodeName.toLowerCase()===q},CLASS:function(p,q){return(" "+
(p.className||p.getAttribute("class"))+" ").indexOf(q)>-1},ATTR:function(p,q){var A=q[1];p=C.attrHandle[A]?C.attrHandle[A](p):p[A]!=null?p[A]:p.getAttribute(A);A=p+"";var B=q[2];q=q[4];return p==null?B==="!=":B==="="?A===q:B==="*="?A.indexOf(q)>=0:B==="~="?(" "+A+" ").indexOf(q)>=0:!q?A&&p!==false:B==="!="?A!==q:B==="^="?A.indexOf(q)===0:B==="$="?A.substr(A.length-q.length)===q:B==="|="?A===q||A.substr(0,q.length+1)===q+"-":false},POS:function(p,q,A,B){var I=C.setFilters[q[2]];if(I)return I(p,A,q,
B)}}},K=C.match.POS;for(var Y in C.match){C.match[Y]=new RegExp(C.match[Y].source+/(?![^\[]*\])(?![^\(]*\))/.source);C.leftMatch[Y]=new RegExp(/(^(?:.|\r|\n)*?)/.source+C.match[Y].source.replace(/\\(\d+)/g,function(p,q){return"\\"+(q-0+1)}))}var ja=function(p,q){p=Array.prototype.slice.call(p,0);if(q){q.push.apply(q,p);return q}return p};try{Array.prototype.slice.call(F.documentElement.childNodes,0)}catch(sa){ja=function(p,q){q=q||[];if(s.call(p)==="[object Array]")Array.prototype.push.apply(q,p);
else if(typeof p.length==="number")for(var A=0,B=p.length;A<B;A++)q.push(p[A]);else for(A=0;p[A];A++)q.push(p[A]);return q}}var ra;if(F.documentElement.compareDocumentPosition)ra=function(p,q){if(!p.compareDocumentPosition||!q.compareDocumentPosition){if(p==q)t=true;return p.compareDocumentPosition?-1:1}p=p.compareDocumentPosition(q)&4?-1:p===q?0:1;if(p===0)t=true;return p};else if("sourceIndex"in F.documentElement)ra=function(p,q){if(!p.sourceIndex||!q.sourceIndex){if(p==q)t=true;return p.sourceIndex?
-1:1}p=p.sourceIndex-q.sourceIndex;if(p===0)t=true;return p};else if(F.createRange)ra=function(p,q){if(!p.ownerDocument||!q.ownerDocument){if(p==q)t=true;return p.ownerDocument?-1:1}var A=p.ownerDocument.createRange(),B=q.ownerDocument.createRange();A.setStart(p,0);A.setEnd(p,0);B.setStart(q,0);B.setEnd(q,0);p=A.compareBoundaryPoints(Range.START_TO_END,B);if(p===0)t=true;return p};(function(){var p=F.createElement("div"),q="script"+(new Date).getTime();p.innerHTML="<a name='"+q+"'/>";var A=F.documentElement;
A.insertBefore(p,A.firstChild);if(F.getElementById(q)){C.find.ID=function(B,I,G){if(typeof I.getElementById!=="undefined"&&!G)return(I=I.getElementById(B[1]))?I.id===B[1]||typeof I.getAttributeNode!=="undefined"&&I.getAttributeNode("id").nodeValue===B[1]?[I]:b:[]};C.filter.ID=function(B,I){var G=typeof B.getAttributeNode!=="undefined"&&B.getAttributeNode("id");return B.nodeType===1&&G&&G.nodeValue===I}}A.removeChild(p);A=p=null})();(function(){var p=F.createElement("div");p.appendChild(F.createComment(""));
if(p.getElementsByTagName("*").length>0)C.find.TAG=function(q,A){A=A.getElementsByTagName(q[1]);if(q[1]==="*"){q=[];for(var B=0;A[B];B++)A[B].nodeType===1&&q.push(A[B]);A=q}return A};p.innerHTML="<a href='#'></a>";if(p.firstChild&&typeof p.firstChild.getAttribute!=="undefined"&&p.firstChild.getAttribute("href")!=="#")C.attrHandle.href=function(q){return q.getAttribute("href",2)};p=null})();F.querySelectorAll&&function(){var p=y,q=F.createElement("div");q.innerHTML="<p class='TEST'></p>";if(!(q.querySelectorAll&&
q.querySelectorAll(".TEST").length===0)){y=function(B,I,G,aa){I=I||F;if(!aa&&I.nodeType===9&&!ca(I))try{return ja(I.querySelectorAll(B),G)}catch(V){}return p(B,I,G,aa)};for(var A in p)y[A]=p[A];q=null}}();(function(){var p=F.createElement("div");p.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!p.getElementsByClassName||p.getElementsByClassName("e").length===0)){p.lastChild.className="e";if(p.getElementsByClassName("e").length!==1){C.order.splice(1,0,"CLASS");C.find.CLASS=function(q,
A,B){if(typeof A.getElementsByClassName!=="undefined"&&!B)return A.getElementsByClassName(q[1])};p=null}}})();var za=F.compareDocumentPosition?function(p,q){return!!(p.compareDocumentPosition(q)&16)}:function(p,q){return p!==q&&(p.contains?p.contains(q):true)},ca=function(p){return(p=(p?p.ownerDocument||p:0).documentElement)?p.nodeName!=="HTML":false},Pa=function(p,q){var A=[],B="",I;for(q=q.nodeType?[q]:q;I=C.match.PSEUDO.exec(p);){B+=I[0];p=p.replace(C.match.PSEUDO,"")}p=C.relative[p]?p+"*":p;I=
0;for(var G=q.length;I<G;I++)y(p,q[I],A);return y.filter(B,A)};g.find=y;g.expr=y.selectors;g.expr[":"]=g.expr.filters;g.unique=y.uniqueSort;g.text=d;g.isXMLDoc=ca;g.contains=za})();var ib=/Until$/,jb=/^(?:parents|prevUntil|prevAll)/,kb=/,/;ba=Array.prototype.slice;var ab=function(d,f,h){if(g.isFunction(f))return g.grep(d,function(l,s){return!!f.call(l,s,l)===h});else if(f.nodeType)return g.grep(d,function(l){return l===f===h});else if(typeof f==="string"){var n=g.grep(d,function(l){return l.nodeType===
1});if(H.test(f))return g.filter(f,n,!h);else f=g.filter(f,n)}return g.grep(d,function(l){return g.inArray(l,f)>=0===h})};g.fn.extend({find:function(d){for(var f=this.pushStack("","find",d),h=0,n=0,l=this.length;n<l;n++){h=f.length;g.find(d,this[n],f);if(n>0)for(var s=h;s<f.length;s++)for(var t=0;t<h;t++)if(f[t]===f[s]){f.splice(s--,1);break}}return f},has:function(d){var f=g(d);return this.filter(function(){for(var h=0,n=f.length;h<n;h++)if(g.contains(this,f[h]))return true})},not:function(d){return this.pushStack(ab(this,
d,false),"not",d)},filter:function(d){return this.pushStack(ab(this,d,true),"filter",d)},is:function(d){return!!d&&g.filter(d,this).length>0},closest:function(d,f){if(g.isArray(d)){var h=[],n=this[0],l,s={},t;if(n&&d.length){l=0;for(var D=d.length;l<D;l++){t=d[l];s[t]||(s[t]=g.expr.match.POS.test(t)?g(t,f||this.context):t)}for(;n&&n.ownerDocument&&n!==f;){for(t in s){l=s[t];if(l.jquery?l.index(n)>-1:g(n).is(l)){h.push({selector:t,elem:n});delete s[t]}}n=n.parentNode}}return h}var y=g.expr.match.POS.test(d)?
g(d,f||this.context):null;return this.map(function(C,K){for(;K&&K.ownerDocument&&K!==f;){if(y?y.index(K)>-1:g(K).is(d))return K;K=K.parentNode}return null})},index:function(d){if(!d||typeof d==="string")return g.inArray(this[0],d?g(d):this.parent().children());return g.inArray(d.jquery?d[0]:d,this)},add:function(d,f){d=typeof d==="string"?g(d,f||this.context):g.makeArray(d);f=g.merge(this.get(),d);return this.pushStack(X(d[0])||X(f[0])?f:g.unique(f))},andSelf:function(){return this.add(this.prevObject)}});
g.each({parent:function(d){return(d=d.parentNode)&&d.nodeType!==11?d:null},parents:function(d){return g.dir(d,"parentNode")},parentsUntil:function(d,f,h){return g.dir(d,"parentNode",h)},next:function(d){return g.nth(d,2,"nextSibling")},prev:function(d){return g.nth(d,2,"previousSibling")},nextAll:function(d){return g.dir(d,"nextSibling")},prevAll:function(d){return g.dir(d,"previousSibling")},nextUntil:function(d,f,h){return g.dir(d,"nextSibling",h)},prevUntil:function(d,f,h){return g.dir(d,"previousSibling",
h)},siblings:function(d){return g.sibling(d.parentNode.firstChild,d)},children:function(d){return g.sibling(d.firstChild)},contents:function(d){return g.nodeName(d,"iframe")?d.contentDocument||d.contentWindow.document:g.makeArray(d.childNodes)}},function(d,f){g.fn[d]=function(h,n){var l=g.map(this,f,h);ib.test(d)||(n=h);if(n&&typeof n==="string")l=g.filter(n,l);l=this.length>1?g.unique(l):l;if((this.length>1||kb.test(n))&&jb.test(d))l=l.reverse();return this.pushStack(l,d,ba.call(arguments).join(","))}});
g.extend({filter:function(d,f,h){if(h)d=":not("+d+")";return g.find.matches(d,f)},dir:function(d,f,h){var n=[];for(d=d[f];d&&d.nodeType!==9&&(h===b||d.nodeType!==1||!g(d).is(h));){d.nodeType===1&&n.push(d);d=d[f]}return n},nth:function(d,f,h){f=f||1;for(var n=0;d;d=d[h])if(d.nodeType===1&&++n===f)break;return d},sibling:function(d,f){for(var h=[];d;d=d.nextSibling)d.nodeType===1&&d!==f&&h.push(d);return h}});var bb=/ jQuery\d+="(?:\d+|null)"/g,Ma=/^\s+/,cb=/(<([\w:]+)[^>]*?)\/>/g,lb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
db=/<([\w:]+)/,mb=/<tbody/i,nb=/<|&#?\w+;/,Va=/<script|<object|<embed|<option|<style/i,Wa=/checked\s*(?:[^=]|=\s*.checked.)/i,eb=function(d,f,h){return lb.test(h)?d:f+"></"+h+">"},Aa={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,
"",""]};Aa.optgroup=Aa.option;Aa.tbody=Aa.tfoot=Aa.colgroup=Aa.caption=Aa.thead;Aa.th=Aa.td;if(!g.support.htmlSerialize)Aa._default=[1,"div<div>","</div>"];g.fn.extend({text:function(d){if(g.isFunction(d))return this.each(function(f){var h=g(this);h.text(d.call(this,f,h.text()))});if(typeof d!=="object"&&d!==b)return this.empty().append((this[0]&&this[0].ownerDocument||F).createTextNode(d));return g.text(this)},wrapAll:function(d){if(g.isFunction(d))return this.each(function(h){g(this).wrapAll(d.call(this,
h))});if(this[0]){var f=g(d,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&f.insertBefore(this[0]);f.map(function(){for(var h=this;h.firstChild&&h.firstChild.nodeType===1;)h=h.firstChild;return h}).append(this)}return this},wrapInner:function(d){if(g.isFunction(d))return this.each(function(f){g(this).wrapInner(d.call(this,f))});return this.each(function(){var f=g(this),h=f.contents();h.length?h.wrapAll(d):f.append(d)})},wrap:function(d){return this.each(function(){g(this).wrapAll(d)})},
unwrap:function(){return this.parent().each(function(){g.nodeName(this,"body")||g(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(d){this.nodeType===1&&this.appendChild(d)})},prepend:function(){return this.domManip(arguments,true,function(d){this.nodeType===1&&this.insertBefore(d,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(f){this.parentNode.insertBefore(f,this)});else if(arguments.length){var d=
g(arguments[0]);d.push.apply(d,this.toArray());return this.pushStack(d,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(f){this.parentNode.insertBefore(f,this.nextSibling)});else if(arguments.length){var d=this.pushStack(this,"after",arguments);d.push.apply(d,g(arguments[0]).toArray());return d}},remove:function(d,f){for(var h=0,n;(n=this[h])!=null;h++)if(!d||g.filter(d,[n]).length){if(!f&&n.nodeType===1){g.cleanData(n.getElementsByTagName("*"));
g.cleanData([n])}n.parentNode&&n.parentNode.removeChild(n)}return this},empty:function(){for(var d=0,f;(f=this[d])!=null;d++)for(f.nodeType===1&&g.cleanData(f.getElementsByTagName("*"));f.firstChild;)f.removeChild(f.firstChild);return this},clone:function(d){var f=this.map(function(){if(!g.support.noCloneEvent&&!g.isXMLDoc(this)){var h=this.outerHTML,n=this.ownerDocument;if(!h){h=n.createElement("div");h.appendChild(this.cloneNode(true));h=h.innerHTML}return g.clean([h.replace(bb,"").replace(/=([^="'>\s]+\/)>/g,
'="$1">').replace(Ma,"")],n)[0]}else return this.cloneNode(true)});if(d===true){ea(this,f);ea(this.find("*"),f.find("*"))}return f},html:function(d){if(d===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(bb,""):null;else if(typeof d==="string"&&!Va.test(d)&&(g.support.leadingWhitespace||!Ma.test(d))&&!Aa[(db.exec(d)||["",""])[1].toLowerCase()]){d=d.replace(cb,eb);try{for(var f=0,h=this.length;f<h;f++)if(this[f].nodeType===1){g.cleanData(this[f].getElementsByTagName("*"));this[f].innerHTML=
d}}catch(n){this.empty().append(d)}}else g.isFunction(d)?this.each(function(l){var s=g(this),t=s.html();s.empty().append(function(){return d.call(this,l,t)})}):this.empty().append(d);return this},replaceWith:function(d){if(this[0]&&this[0].parentNode){if(g.isFunction(d))return this.each(function(f){var h=g(this),n=h.html();h.replaceWith(d.call(this,f,n))});if(typeof d!=="string")d=g(d).detach();return this.each(function(){var f=this.nextSibling,h=this.parentNode;g(this).remove();f?g(f).before(d):
g(h).append(d)})}else return this.pushStack(g(g.isFunction(d)?d():d),"replaceWith",d)},detach:function(d){return this.remove(d,true)},domManip:function(d,f,h){function n(Y){return g.nodeName(Y,"table")?Y.getElementsByTagName("tbody")[0]||Y.appendChild(Y.ownerDocument.createElement("tbody")):Y}var l,s,t=d[0],D=[],y;if(!g.support.checkClone&&arguments.length===3&&typeof t==="string"&&Wa.test(t))return this.each(function(){g(this).domManip(d,f,h,true)});if(g.isFunction(t))return this.each(function(Y){var ja=
g(this);d[0]=t.call(this,Y,f?ja.html():b);ja.domManip(d,f,h)});if(this[0]){l=t&&t.parentNode;l=g.support.parentNode&&l&&l.nodeType===11&&l.childNodes.length===this.length?{fragment:l}:fa(d,this,D);y=l.fragment;if(s=y.childNodes.length===1?(y=y.firstChild):y.firstChild){f=f&&g.nodeName(s,"tr");for(var C=0,K=this.length;C<K;C++)h.call(f?n(this[C],s):this[C],C>0||l.cacheable||this.length>1?y.cloneNode(true):y)}D.length&&g.each(D,e)}return this}});g.fragments={};g.each({appendTo:"append",prependTo:"prepend",
insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(d,f){g.fn[d]=function(h){var n=[];h=g(h);var l=this.length===1&&this[0].parentNode;if(l&&l.nodeType===11&&l.childNodes.length===1&&h.length===1){h[f](this[0]);return this}else{l=0;for(var s=h.length;l<s;l++){var t=(l>0?this.clone(true):this).get();g.fn[f].apply(g(h[l]),t);n=n.concat(t)}return this.pushStack(n,d,h.selector)}}});g.extend({clean:function(d,f,h,n){f=f||F;if(typeof f.createElement==="undefined")f=f.ownerDocument||
f[0]&&f[0].ownerDocument||F;for(var l=[],s=0,t;(t=d[s])!=null;s++){if(typeof t==="number")t+="";if(t){if(typeof t==="string"&&!nb.test(t))t=f.createTextNode(t);else if(typeof t==="string"){t=t.replace(cb,eb);var D=(db.exec(t)||["",""])[1].toLowerCase(),y=Aa[D]||Aa._default,C=y[0],K=f.createElement("div");for(K.innerHTML=y[1]+t+y[2];C--;)K=K.lastChild;if(!g.support.tbody){C=mb.test(t);D=D==="table"&&!C?K.firstChild&&K.firstChild.childNodes:y[1]==="<table>"&&!C?K.childNodes:[];for(y=D.length-1;y>=0;--y)g.nodeName(D[y],
"tbody")&&!D[y].childNodes.length&&D[y].parentNode.removeChild(D[y])}!g.support.leadingWhitespace&&Ma.test(t)&&K.insertBefore(f.createTextNode(Ma.exec(t)[0]),K.firstChild);t=K.childNodes}if(t.nodeType)l.push(t);else l=g.merge(l,t)}}if(h)for(s=0;l[s];s++)if(n&&g.nodeName(l[s],"script")&&(!l[s].type||l[s].type.toLowerCase()==="text/javascript"))n.push(l[s].parentNode?l[s].parentNode.removeChild(l[s]):l[s]);else{l[s].nodeType===1&&l.splice.apply(l,[s+1,0].concat(g.makeArray(l[s].getElementsByTagName("script"))));
h.appendChild(l[s])}return l},cleanData:function(d){for(var f,h,n=g.cache,l=g.event.special,s=g.support.deleteExpando,t=0,D;(D=d[t])!=null;t++)if(h=D[g.expando]){f=n[h];if(f.events)for(var y in f.events)l[y]?g.event.remove(D,y):xa(D,y,f.handle);if(s)delete D[g.expando];else D.removeAttribute&&D.removeAttribute(g.expando);delete n[h]}}});var ob=/z-?index|font-?weight|opacity|zoom|line-?height/i,fb=/alpha\([^)]*\)/,gb=/opacity=([^)]*)/,Qa=/float/i,Ra=/-([a-z])/ig,pb=/([A-Z])/g,qb=/^-?\d+(?:px)?$/i,
rb=/^-?\d/,sb={position:"absolute",visibility:"hidden",display:"block"},tb=["Left","Right"],ub=["Top","Bottom"],vb=F.defaultView&&F.defaultView.getComputedStyle,hb=g.support.cssFloat?"cssFloat":"styleFloat",Sa=function(d,f){return f.toUpperCase()};g.fn.css=function(d,f){return k(this,d,f,true,function(h,n,l){if(l===b)return g.curCSS(h,n);if(typeof l==="number"&&!ob.test(n))l+="px";g.style(h,n,l)})};g.extend({style:function(d,f,h){if(!d||d.nodeType===3||d.nodeType===8)return b;if((f==="width"||f===
"height")&&parseFloat(h)<0)h=b;var n=d.style||d,l=h!==b;if(!g.support.opacity&&f==="opacity"){if(l){n.zoom=1;f=parseInt(h,10)+""==="NaN"?"":"alpha(opacity="+h*100+")";d=n.filter||g.curCSS(d,"filter")||"";n.filter=fb.test(d)?d.replace(fb,f):f}return n.filter&&n.filter.indexOf("opacity=")>=0?parseFloat(gb.exec(n.filter)[1])/100+"":""}if(Qa.test(f))f=hb;f=f.replace(Ra,Sa);if(l)n[f]=h;return n[f]},css:function(d,f,h,n){if(f==="width"||f==="height"){var l,s=f==="width"?tb:ub;h=function(){l=f==="width"?
d.offsetWidth:d.offsetHeight;n!=="border"&&g.each(s,function(){n||(l-=parseFloat(g.curCSS(d,"padding"+this,true))||0);if(n==="margin")l+=parseFloat(g.curCSS(d,"margin"+this,true))||0;else l-=parseFloat(g.curCSS(d,"border"+this+"Width",true))||0})};d.offsetWidth!==0?h():g.swap(d,sb,h);return Math.max(0,Math.round(l))}return g.curCSS(d,f,h)},curCSS:function(d,f,h){var n,l=d.style;if(!g.support.opacity&&f==="opacity"&&d.currentStyle){n=gb.test(d.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":
"";return n===""?"1":n}if(Qa.test(f))f=hb;if(!h&&l&&l[f])n=l[f];else if(vb){if(Qa.test(f))f="float";f=f.replace(pb,"-$1").toLowerCase();l=d.ownerDocument.defaultView;if(!l)return null;if(d=l.getComputedStyle(d,null))n=d.getPropertyValue(f);if(f==="opacity"&&n==="")n="1"}else if(d.currentStyle){h=f.replace(Ra,Sa);n=d.currentStyle[f]||d.currentStyle[h];if(!qb.test(n)&&rb.test(n)){f=l.left;var s=d.runtimeStyle.left;d.runtimeStyle.left=d.currentStyle.left;l.left=h==="fontSize"?"1em":n||0;n=l.pixelLeft+
"px";l.left=f;d.runtimeStyle.left=s}}return n},swap:function(d,f,h){var n={};for(var l in f){n[l]=d.style[l];d.style[l]=f[l]}h.call(d);for(l in f)d.style[l]=n[l]}});if(g.expr&&g.expr.filters){g.expr.filters.hidden=function(d){var f=d.offsetWidth,h=d.offsetHeight,n=d.nodeName.toLowerCase()==="tr";return f===0&&h===0&&!n?true:f>0&&h>0&&!n?false:g.curCSS(d,"display")==="none"};g.expr.filters.visible=function(d){return!g.expr.filters.hidden(d)}}var wb=o(),xb=/<script(.|\s)*?\/script>/gi,yb=/select|textarea/i,
zb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,Ja=/=\?(&|$)/,Ta=/\?/,Ab=/(\?|&)_=.*?(&|$)/,Bb=/^(\w+:)?\/\/([^\/?#]+)/,Cb=/%20/g,Db=g.fn.load;g.fn.extend({load:function(d,f,h){if(typeof d!=="string")return Db.call(this,d);else if(!this.length)return this;var n=d.indexOf(" ");if(n>=0){var l=d.slice(n,d.length);d=d.slice(0,n)}n="GET";if(f)if(g.isFunction(f)){h=f;f=null}else if(typeof f==="object"){f=g.param(f,g.ajaxSettings.traditional);n="POST"}var s=
this;g.ajax({url:d,type:n,dataType:"html",data:f,complete:function(t,D){if(D==="success"||D==="notmodified")s.html(l?g("<div />").append(t.responseText.replace(xb,"")).find(l):t.responseText);h&&s.each(h,[t.responseText,D,t])}});return this},serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?g.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||yb.test(this.nodeName)||
zb.test(this.type))}).map(function(d,f){d=g(this).val();return d==null?null:g.isArray(d)?g.map(d,function(h){return{name:f.name,value:h}}):{name:f.name,value:d}}).get()}});g.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(d,f){g.fn[f]=function(h){return this.bind(f,h)}});g.extend({get:function(d,f,h,n){if(g.isFunction(f)){n=n||h;h=f;f=null}return g.ajax({type:"GET",url:d,data:f,success:h,dataType:n})},getScript:function(d,f){return g.get(d,null,f,"script")},
getJSON:function(d,f,h){return g.get(d,f,h,"json")},post:function(d,f,h,n){if(g.isFunction(f)){n=n||h;h=f;f={}}return g.ajax({type:"POST",url:d,data:f,success:h,dataType:n})},ajaxSetup:function(d){g.extend(g.ajaxSettings,d)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:a.XMLHttpRequest&&(a.location.protocol!=="file:"||!a.ActiveXObject)?function(){return new a.XMLHttpRequest}:function(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(d){}},
accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(d){function f(){l.success&&l.success.call(y,D,t,ca);l.global&&n("ajaxSuccess",[ca,l])}function h(){l.complete&&l.complete.call(y,ca,t);l.global&&n("ajaxComplete",[ca,l]);l.global&&!--g.active&&g.event.trigger("ajaxStop")}function n(I,G){(l.context?g(l.context):g.event).trigger(I,
G)}var l=g.extend(true,{},g.ajaxSettings,d),s,t,D,y=d&&d.context||l,C=l.type.toUpperCase();if(l.data&&l.processData&&typeof l.data!=="string")l.data=g.param(l.data,l.traditional);if(l.dataType==="jsonp"){if(C==="GET")Ja.test(l.url)||(l.url+=(Ta.test(l.url)?"&":"?")+(l.jsonp||"callback")+"=?");else if(!l.data||!Ja.test(l.data))l.data=(l.data?l.data+"&":"")+(l.jsonp||"callback")+"=?";l.dataType="json"}if(l.dataType==="json"&&(l.data&&Ja.test(l.data)||Ja.test(l.url))){s=l.jsonpCallback||"jsonp"+wb++;
if(l.data)l.data=(l.data+"").replace(Ja,"="+s+"$1");l.url=l.url.replace(Ja,"="+s+"$1");l.dataType="script";a[s]=a[s]||function(I){D=I;f();h();a[s]=b;try{delete a[s]}catch(G){}ja&&ja.removeChild(sa)}}if(l.dataType==="script"&&l.cache===null)l.cache=false;if(l.cache===false&&C==="GET"){var K=o(),Y=l.url.replace(Ab,"$1_="+K+"$2");l.url=Y+(Y===l.url?(Ta.test(l.url)?"&":"?")+"_="+K:"")}if(l.data&&C==="GET")l.url+=(Ta.test(l.url)?"&":"?")+l.data;l.global&&!g.active++&&g.event.trigger("ajaxStart");K=(K=
Bb.exec(l.url))&&(K[1]&&K[1]!==location.protocol||K[2]!==location.host);if(l.dataType==="script"&&C==="GET"&&K){var ja=F.getElementsByTagName("head")[0]||F.documentElement,sa=F.createElement("script");sa.src=l.url;if(l.scriptCharset)sa.charset=l.scriptCharset;if(!s){var ra=false;sa.onload=sa.onreadystatechange=function(){if(!ra&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){ra=true;f();h();sa.onload=sa.onreadystatechange=null;ja&&sa.parentNode&&ja.removeChild(sa)}}}ja.insertBefore(sa,
ja.firstChild);return b}var za=false,ca=l.xhr();if(ca){l.username?ca.open(C,l.url,l.async,l.username,l.password):ca.open(C,l.url,l.async);try{if(l.data||d&&d.contentType)ca.setRequestHeader("Content-Type",l.contentType);if(l.ifModified){g.lastModified[l.url]&&ca.setRequestHeader("If-Modified-Since",g.lastModified[l.url]);g.etag[l.url]&&ca.setRequestHeader("If-None-Match",g.etag[l.url])}K||ca.setRequestHeader("X-Requested-With","XMLHttpRequest");ca.setRequestHeader("Accept",l.dataType&&l.accepts[l.dataType]?
l.accepts[l.dataType]+", */*":l.accepts._default)}catch(Pa){}if(l.beforeSend&&l.beforeSend.call(y,ca,l)===false){l.global&&!--g.active&&g.event.trigger("ajaxStop");ca.abort();return false}l.global&&n("ajaxSend",[ca,l]);var p=ca.onreadystatechange=function(I){if(!ca||ca.readyState===0||I==="abort"){za||h();za=true;if(ca)ca.onreadystatechange=g.noop}else if(!za&&ca&&(ca.readyState===4||I==="timeout")){za=true;ca.onreadystatechange=g.noop;t=I==="timeout"?"timeout":!g.httpSuccess(ca)?"error":l.ifModified&&
g.httpNotModified(ca,l.url)?"notmodified":"success";var G;if(t==="success")try{D=g.httpData(ca,l.dataType,l)}catch(aa){t="parsererror";G=aa}if(t==="success"||t==="notmodified")s||f();else g.handleError(l,ca,t,G);h();I==="timeout"&&ca.abort();if(l.async)ca=null}};try{var q=ca.abort;ca.abort=function(){ca&&q.call(ca);p("abort")}}catch(A){}l.async&&l.timeout>0&&setTimeout(function(){ca&&!za&&p("timeout")},l.timeout);try{ca.send(C==="POST"||C==="PUT"||C==="DELETE"?l.data:null)}catch(B){g.handleError(l,
ca,null,B);h()}l.async||p();return ca}},handleError:function(d,f,h,n){if(d.error)d.error.call(d.context||d,f,h,n);if(d.global)(d.context?g(d.context):g.event).trigger("ajaxError",[f,d,n])},active:0,httpSuccess:function(d){try{return!d.status&&location.protocol==="file:"||d.status>=200&&d.status<300||d.status===304||d.status===1223||d.status===0}catch(f){}return false},httpNotModified:function(d,f){var h=d.getResponseHeader("Last-Modified"),n=d.getResponseHeader("Etag");if(h)g.lastModified[f]=h;if(n)g.etag[f]=
n;return d.status===304||d.status===0},httpData:function(d,f,h){var n=d.getResponseHeader("content-type")||"",l=f==="xml"||!f&&n.indexOf("xml")>=0;d=l?d.responseXML:d.responseText;l&&d.documentElement.nodeName==="parsererror"&&g.error("parsererror");if(h&&h.dataFilter)d=h.dataFilter(d,f);if(typeof d==="string")if(f==="json"||!f&&n.indexOf("json")>=0)d=g.parseJSON(d);else if(f==="script"||!f&&n.indexOf("javascript")>=0)g.globalEval(d);return d},param:function(d,f){function h(t,D){if(g.isArray(D))g.each(D,
function(y,C){f||/\[\]$/.test(t)?n(t,C):h(t+"["+(typeof C==="object"||g.isArray(C)?y:"")+"]",C)});else!f&&D!=null&&typeof D==="object"?g.each(D,function(y,C){h(t+"["+y+"]",C)}):n(t,D)}function n(t,D){D=g.isFunction(D)?D():D;l[l.length]=encodeURIComponent(t)+"="+encodeURIComponent(D)}var l=[];if(f===b)f=g.ajaxSettings.traditional;if(g.isArray(d)||d.jquery)g.each(d,function(){n(this.name,this.value)});else for(var s in d)h(s,d[s]);return l.join("&").replace(Cb,"+")}});var Ua={},Eb=/toggle|show|hide/,
Fb=/^([+-]=)?([\d+-.]+)(.*)$/,Na,Xa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];g.fn.extend({show:function(d,f){if(d||d===0)return this.animate(R("show",3),d,f);else{d=0;for(f=this.length;d<f;d++){var h=g.data(this[d],"olddisplay");this[d].style.display=h||"";if(g.css(this[d],"display")==="none"){h=this[d].nodeName;var n;if(Ua[h])n=Ua[h];else{var l=g("<"+h+" />").appendTo("body");n=l.css("display");
if(n==="none")n="block";l.remove();Ua[h]=n}g.data(this[d],"olddisplay",n)}}d=0;for(f=this.length;d<f;d++)this[d].style.display=g.data(this[d],"olddisplay")||"";return this}},hide:function(d,f){if(d||d===0)return this.animate(R("hide",3),d,f);else{d=0;for(f=this.length;d<f;d++){var h=g.data(this[d],"olddisplay");!h&&h!=="none"&&g.data(this[d],"olddisplay",g.css(this[d],"display"))}d=0;for(f=this.length;d<f;d++)this[d].style.display="none";return this}},_toggle:g.fn.toggle,toggle:function(d,f){var h=
typeof d==="boolean";if(g.isFunction(d)&&g.isFunction(f))this._toggle.apply(this,arguments);else d==null||h?this.each(function(){var n=h?d:g(this).is(":hidden");g(this)[n?"show":"hide"]()}):this.animate(R("toggle",3),d,f);return this},fadeTo:function(d,f,h){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:f},d,h)},animate:function(d,f,h,n){var l=g.speed(f,h,n);if(g.isEmptyObject(d))return this.each(l.complete);return this[l.queue===false?"each":"queue"](function(){var s=
g.extend({},l),t,D=this.nodeType===1&&g(this).is(":hidden"),y=this;for(t in d){var C=t.replace(Ra,Sa);if(t!==C){d[C]=d[t];delete d[t];t=C}if(d[t]==="hide"&&D||d[t]==="show"&&!D)return s.complete.call(this);if((t==="height"||t==="width")&&this.style){s.display=g.css(this,"display");s.overflow=this.style.overflow}if(g.isArray(d[t])){(s.specialEasing=s.specialEasing||{})[t]=d[t][1];d[t]=d[t][0]}}if(s.overflow!=null)this.style.overflow="hidden";s.curAnim=g.extend({},d);g.each(d,function(K,Y){var ja=new g.fx(y,
s,K);if(Eb.test(Y))ja[Y==="toggle"?D?"show":"hide":Y](d);else{var sa=Fb.exec(Y),ra=ja.cur(true)||0;if(sa){Y=parseFloat(sa[2]);var za=sa[3]||"px";if(za!=="px"){y.style[K]=(Y||1)+za;ra=(Y||1)/ja.cur(true)*ra;y.style[K]=ra+za}if(sa[1])Y=(sa[1]==="-="?-1:1)*Y+ra;ja.custom(ra,Y,za)}else ja.custom(ra,Y,"")}});return true})},stop:function(d,f){var h=g.timers;d&&this.queue([]);this.each(function(){for(var n=h.length-1;n>=0;n--)if(h[n].elem===this){f&&h[n](true);h.splice(n,1)}});f||this.dequeue();return this}});
g.each({slideDown:R("show",1),slideUp:R("hide",1),slideToggle:R("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(d,f){g.fn[d]=function(h,n){return this.animate(f,h,n)}});g.extend({speed:function(d,f,h){var n=d&&typeof d==="object"?d:{complete:h||!h&&f||g.isFunction(d)&&d,duration:d,easing:h&&f||f&&!g.isFunction(f)&&f};n.duration=g.fx.off?0:typeof n.duration==="number"?n.duration:g.fx.speeds[n.duration]||g.fx.speeds._default;n.old=n.complete;n.complete=function(){n.queue!==false&&
g(this).dequeue();g.isFunction(n.old)&&n.old.call(this)};return n},easing:{linear:function(d,f,h,n){return h+n*d},swing:function(d,f,h,n){return(-Math.cos(d*Math.PI)/2+0.5)*n+h}},timers:[],fx:function(d,f,h){this.options=f;this.elem=d;this.prop=h;if(!f.orig)f.orig={}}});g.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(g.fx.step[this.prop]||g.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display=
"block"},cur:function(d){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(d=parseFloat(g.css(this.elem,this.prop,d)))&&d>-10000?d:parseFloat(g.curCSS(this.elem,this.prop))||0},custom:function(d,f,h){function n(s){return l.step(s)}this.startTime=o();this.start=d;this.end=f;this.unit=h||this.unit||"px";this.now=this.start;this.pos=this.state=0;var l=this;n.elem=this.elem;if(n()&&g.timers.push(n)&&!Na)Na=setInterval(g.fx.tick,13)},
show:function(){this.options.orig[this.prop]=g.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());g(this.elem).show()},hide:function(){this.options.orig[this.prop]=g.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(d){var f=o(),h=true;if(d||f>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var n in this.options.curAnim)if(this.options.curAnim[n]!==
true)h=false;if(h){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;d=g.data(this.elem,"olddisplay");this.elem.style.display=d?d:this.options.display;if(g.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&g(this.elem).hide();if(this.options.hide||this.options.show)for(var l in this.options.curAnim)g.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{l=f-this.startTime;this.state=l/this.options.duration;
d=this.options.easing||(g.easing.swing?"swing":"linear");this.pos=g.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||d](this.state,l,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};g.extend(g.fx,{tick:function(){for(var d=g.timers,f=0;f<d.length;f++)d[f]()||d.splice(f--,1);d.length||g.fx.stop()},stop:function(){clearInterval(Na);Na=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(d){g.style(d.elem,
"opacity",d.now)},_default:function(d){if(d.elem.style&&d.elem.style[d.prop]!=null)d.elem.style[d.prop]=(d.prop==="width"||d.prop==="height"?Math.max(0,d.now):d.now)+d.unit;else d.elem[d.prop]=d.now}}});if(g.expr&&g.expr.filters)g.expr.filters.animated=function(d){return g.grep(g.timers,function(f){return d===f.elem}).length};g.fn.offset="getBoundingClientRect"in F.documentElement?function(d){var f=this[0];if(d)return this.each(function(l){g.offset.setOffset(this,d,l)});if(!f||!f.ownerDocument)return null;
if(f===f.ownerDocument.body)return g.offset.bodyOffset(f);var h=f.getBoundingClientRect(),n=f.ownerDocument;f=n.body;n=n.documentElement;return{top:h.top+(self.pageYOffset||g.support.boxModel&&n.scrollTop||f.scrollTop)-(n.clientTop||f.clientTop||0),left:h.left+(self.pageXOffset||g.support.boxModel&&n.scrollLeft||f.scrollLeft)-(n.clientLeft||f.clientLeft||0)}}:function(d){var f=this[0];if(d)return this.each(function(K){g.offset.setOffset(this,d,K)});if(!f||!f.ownerDocument)return null;if(f===f.ownerDocument.body)return g.offset.bodyOffset(f);
g.offset.initialize();var h=f.offsetParent,n=f,l=f.ownerDocument,s,t=l.documentElement,D=l.body;n=(l=l.defaultView)?l.getComputedStyle(f,null):f.currentStyle;for(var y=f.offsetTop,C=f.offsetLeft;(f=f.parentNode)&&f!==D&&f!==t;){if(g.offset.supportsFixedPosition&&n.position==="fixed")break;s=l?l.getComputedStyle(f,null):f.currentStyle;y-=f.scrollTop;C-=f.scrollLeft;if(f===h){y+=f.offsetTop;C+=f.offsetLeft;if(g.offset.doesNotAddBorder&&!(g.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.nodeName))){y+=
parseFloat(s.borderTopWidth)||0;C+=parseFloat(s.borderLeftWidth)||0}n=h;h=f.offsetParent}if(g.offset.subtractsBorderForOverflowNotVisible&&s.overflow!=="visible"){y+=parseFloat(s.borderTopWidth)||0;C+=parseFloat(s.borderLeftWidth)||0}n=s}if(n.position==="relative"||n.position==="static"){y+=D.offsetTop;C+=D.offsetLeft}if(g.offset.supportsFixedPosition&&n.position==="fixed"){y+=Math.max(t.scrollTop,D.scrollTop);C+=Math.max(t.scrollLeft,D.scrollLeft)}return{top:y,left:C}};g.offset={initialize:function(){var d=
F.body,f=F.createElement("div"),h,n,l,s=parseFloat(g.curCSS(d,"marginTop",true))||0;g.extend(f.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});f.innerHTML="<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>";
d.insertBefore(f,d.firstChild);h=f.firstChild;n=h.firstChild;l=h.nextSibling.firstChild.firstChild;this.doesNotAddBorder=n.offsetTop!==5;this.doesAddBorderForTableAndCells=l.offsetTop===5;n.style.position="fixed";n.style.top="20px";this.supportsFixedPosition=n.offsetTop===20||n.offsetTop===15;n.style.position=n.style.top="";h.style.overflow="hidden";h.style.position="relative";this.subtractsBorderForOverflowNotVisible=n.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=d.offsetTop!==s;d.removeChild(f);
g.offset.initialize=g.noop},bodyOffset:function(d){var f=d.offsetTop,h=d.offsetLeft;g.offset.initialize();if(g.offset.doesNotIncludeMarginInBodyOffset){f+=parseFloat(g.curCSS(d,"marginTop",true))||0;h+=parseFloat(g.curCSS(d,"marginLeft",true))||0}return{top:f,left:h}},setOffset:function(d,f,h){if(/static/.test(g.curCSS(d,"position")))d.style.position="relative";var n=g(d),l=n.offset(),s=parseInt(g.curCSS(d,"top",true),10)||0,t=parseInt(g.curCSS(d,"left",true),10)||0;if(g.isFunction(f))f=f.call(d,
h,l);h={top:f.top-l.top+s,left:f.left-l.left+t};"using"in f?f.using.call(d,h):n.css(h)}};g.fn.extend({position:function(){if(!this[0])return null;var d=this[0],f=this.offsetParent(),h=this.offset(),n=/^body|html$/i.test(f[0].nodeName)?{top:0,left:0}:f.offset();h.top-=parseFloat(g.curCSS(d,"marginTop",true))||0;h.left-=parseFloat(g.curCSS(d,"marginLeft",true))||0;n.top+=parseFloat(g.curCSS(f[0],"borderTopWidth",true))||0;n.left+=parseFloat(g.curCSS(f[0],"borderLeftWidth",true))||0;return{top:h.top-
n.top,left:h.left-n.left}},offsetParent:function(){return this.map(function(){for(var d=this.offsetParent||F.body;d&&!/^body|html$/i.test(d.nodeName)&&g.css(d,"position")==="static";)d=d.offsetParent;return d})}});g.each(["Left","Top"],function(d,f){var h="scroll"+f;g.fn[h]=function(n){var l=this[0],s;if(!l)return null;if(n!==b)return this.each(function(){if(s=ta(this))s.scrollTo(!d?n:g(s).scrollLeft(),d?n:g(s).scrollTop());else this[h]=n});else return(s=ta(l))?"pageXOffset"in s?s[d?"pageYOffset":
"pageXOffset"]:g.support.boxModel&&s.document.documentElement[h]||s.document.body[h]:l[h]}});g.each(["Height","Width"],function(d,f){var h=f.toLowerCase();g.fn["inner"+f]=function(){return this[0]?g.css(this[0],h,false,"padding"):null};g.fn["outer"+f]=function(n){return this[0]?g.css(this[0],h,false,n?"margin":"border"):null};g.fn[h]=function(n){var l=this[0];if(!l)return n==null?null:this;if(g.isFunction(n))return this.each(function(s){var t=g(this);t[h](n.call(this,s,t[h]()))});return"scrollTo"in
l&&l.document?l.document.compatMode==="CSS1Compat"&&l.document.documentElement["client"+f]||l.document.body["client"+f]:l.nodeType===9?Math.max(l.documentElement["client"+f],l.body["scroll"+f],l.documentElement["scroll"+f],l.body["offset"+f],l.documentElement["offset"+f]):n===b?g.css(l,h):this.css(h,typeof n==="string"?n:n+"px")}});a.jQuery=a.$=g})(window);var $j=jQuery.noConflict();var swfobject=function(){function a(){if(M.readyState=="complete"){M.parentNode.removeChild(M);b()}}function b(){if(!oa){if(U.ie&&U.win){var v=R("span");try{var z=E.getElementsByTagName("body")[0].appendChild(v);z.parentNode.removeChild(z)}catch(L){return}}oa=true;if(W){clearInterval(W);W=null}v=ga.length;for(z=0;z<v;z++)ga[z]()}}function c(v){if(oa)v();else ga[ga.length]=v}function e(v){if(typeof x.addEventListener!=S)x.addEventListener("load",v,false);else if(typeof E.addEventListener!=S)E.addEventListener("load",
v,false);else if(typeof x.attachEvent!=S)ta(x,"onload",v);else if(typeof x.onload=="function"){var z=x.onload;x.onload=function(){z();v()}}else x.onload=v}function k(){for(var v=la.length,z=0;z<v;z++){var L=la[z].id;if(U.pv[0]>0){var P=fa(L);if(P){la[z].width=P.getAttribute("width")?P.getAttribute("width"):"0";la[z].height=P.getAttribute("height")?P.getAttribute("height"):"0";if(g(la[z].swfVersion)){U.webkit&&U.webkit<312&&o(P);da(L,true)}else la[z].expressInstall&&!Da&&g("6.0.65")&&(U.win||U.mac)?
r(la[z]):w(P)}}else da(L,true)}}function o(v){var z=v.getElementsByTagName(O)[0];if(z){var L=R("embed"),P=z.attributes;if(P)for(var ka=P.length,qa=0;qa<ka;qa++)P[qa].nodeName=="DATA"?L.setAttribute("src",P[qa].nodeValue):L.setAttribute(P[qa].nodeName,P[qa].nodeValue);if(z=z.childNodes){P=z.length;for(ka=0;ka<P;ka++)z[ka].nodeType==1&&z[ka].nodeName=="PARAM"&&L.setAttribute(z[ka].getAttribute("name"),z[ka].getAttribute("value"))}v.parentNode.replaceChild(L,v)}}function r(v){Da=true;var z=fa(v.id);
if(z){if(v.altContentId){var L=fa(v.altContentId);if(L){ba=L;ha=v.altContentId}}else ba=J(z);if(!/%$/.test(v.width)&&parseInt(v.width,10)<310)v.width="310";if(!/%$/.test(v.height)&&parseInt(v.height,10)<137)v.height="137";E.title=E.title.slice(0,47)+" - Flash Player Installation";L="MMredirectURL="+x.location+"&MMplayerType="+(U.ie&&U.win?"ActiveX":"PlugIn")+"&MMdoctitle="+E.title;var P=v.id;if(U.ie&&U.win&&z.readyState!=4){var ka=R("div");P+="SWFObjectNew";ka.setAttribute("id",P);z.parentNode.insertBefore(ka,
z);z.style.display="none";ta(x,"onload",function(){z.parentNode.removeChild(z)})}T({data:v.expressInstall,id:u,width:v.width,height:v.height},{flashvars:L},P)}}function w(v){if(U.ie&&U.win&&v.readyState!=4){var z=R("div");v.parentNode.insertBefore(z,v);z.parentNode.replaceChild(J(v),z);v.style.display="none";ta(x,"onload",function(){v.parentNode.removeChild(v)})}else v.parentNode.replaceChild(J(v),v)}function J(v){var z=R("div");if(U.win&&U.ie)z.innerHTML=v.innerHTML;else if(v=v.getElementsByTagName(O)[0])if(v=
v.childNodes)for(var L=v.length,P=0;P<L;P++)!(v[P].nodeType==1&&v[P].nodeName=="PARAM")&&v[P].nodeType!=8&&z.appendChild(v[P].cloneNode(true));return z}function T(v,z,L){var P,ka=fa(L);if(ka){if(typeof v.id==S)v.id=L;if(U.ie&&U.win){var qa="";for(var ua in v)if(v[ua]!=Object.prototype[ua])if(ua.toLowerCase()=="data")z.movie=v[ua];else if(ua.toLowerCase()=="styleclass")qa+=' class="'+v[ua]+'"';else if(ua.toLowerCase()!="classid")qa+=" "+ua+'="'+v[ua]+'"';ua="";for(var ma in z)if(z[ma]!=Object.prototype[ma])ua+=
'<param name="'+ma+'" value="'+z[ma]+'" />';ka.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+qa+">"+ua+"</object>";na[na.length]=v.id;P=fa(v.id)}else if(U.webkit&&U.webkit<312){ma=R("embed");ma.setAttribute("type",H);for(qa in v)if(v[qa]!=Object.prototype[qa])if(qa.toLowerCase()=="data")ma.setAttribute("src",v[qa]);else if(qa.toLowerCase()=="styleclass")ma.setAttribute("class",v[qa]);else qa.toLowerCase()!="classid"&&ma.setAttribute(qa,v[qa]);for(var wa in z)z[wa]!=Object.prototype[wa]&&
wa.toLowerCase()!="movie"&&ma.setAttribute(wa,z[wa]);ka.parentNode.replaceChild(ma,ka);P=ma}else{ma=R(O);ma.setAttribute("type",H);for(var va in v)if(v[va]!=Object.prototype[va])if(va.toLowerCase()=="styleclass")ma.setAttribute("class",v[va]);else va.toLowerCase()!="classid"&&ma.setAttribute(va,v[va]);for(var xa in z)z[xa]!=Object.prototype[xa]&&xa.toLowerCase()!="movie"&&Z(ma,xa,z[xa]);ka.parentNode.replaceChild(ma,ka);P=ma}}return P}function Z(v,z,L){var P=R("param");P.setAttribute("name",z);P.setAttribute("value",
L);v.appendChild(P)}function X(v){var z=fa(v);if(z&&(z.nodeName=="OBJECT"||z.nodeName=="EMBED"))if(U.ie&&U.win)z.readyState==4?ea(v):x.attachEvent("onload",function(){ea(v)});else z.parentNode.removeChild(z)}function ea(v){if(v=fa(v)){for(var z in v)if(typeof v[z]=="function")v[z]=null;v.parentNode.removeChild(v)}}function fa(v){var z=null;try{z=E.getElementById(v)}catch(L){}return z}function R(v){return E.createElement(v)}function ta(v,z,L){v.attachEvent(z,L);pa[pa.length]=[v,z,L]}function g(v){var z=
U.pv;v=v.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return z[0]>v[0]||z[0]==v[0]&&z[1]>v[1]||z[0]==v[0]&&z[1]==v[1]&&z[2]>=v[2]?true:false}function N(v,z){if(!(U.ie&&U.mac)){var L=E.getElementsByTagName("head")[0],P=R("style");P.setAttribute("type","text/css");P.setAttribute("media","screen");!(U.ie&&U.win)&&typeof E.createTextNode!=S&&P.appendChild(E.createTextNode(v+" {"+z+"}"));L.appendChild(P);if(U.ie&&U.win&&typeof E.styleSheets!=S&&E.styleSheets.length>
0){L=E.styleSheets[E.styleSheets.length-1];typeof L.addRule==O&&L.addRule(v,z)}}}function da(v,z){z=z?"visible":"hidden";if(oa&&fa(v))fa(v).style.visibility=z;else N("#"+v,"visibility:"+z)}function F(v){return/[\\\"<>\.;]/.exec(v)!=null?encodeURIComponent(v):v}var S="undefined",O="object",H="application/x-shockwave-flash",u="SWFObjectExprInst",x=window,E=document,Q=navigator,ga=[],la=[],na=[],pa=[],M,W=null,ba=null,ha=null,oa=false,Da=false,U=function(){var v=typeof E.getElementById!=S&&typeof E.getElementsByTagName!=
S&&typeof E.createElement!=S,z=[0,0,0],L=null;if(typeof Q.plugins!=S&&typeof Q.plugins["Shockwave Flash"]==O){if((L=Q.plugins["Shockwave Flash"].description)&&!(typeof Q.mimeTypes!=S&&Q.mimeTypes[H]&&!Q.mimeTypes[H].enabledPlugin)){L=L.replace(/^.*\s+(\S+\s+\S+$)/,"$1");z[0]=parseInt(L.replace(/^(.*)\..*$/,"$1"),10);z[1]=parseInt(L.replace(/^.*\.(.*)\s.*$/,"$1"),10);z[2]=/r/.test(L)?parseInt(L.replace(/^.*r(.*)$/,"$1"),10):0}}else if(typeof x.ActiveXObject!=S){var P=null,ka=false;try{P=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(qa){try{P=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");z=[6,0,21];P.AllowScriptAccess="always"}catch(ua){if(z[0]==6)ka=true}if(!ka)try{P=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(ma){}}if(!ka&&P)try{if(L=P.GetVariable("$version")){L=L.split(" ")[1].split(",");z=[parseInt(L[0],10),parseInt(L[1],10),parseInt(L[2],10)]}}catch(wa){}}ka=Q.userAgent.toLowerCase();var va=Q.platform.toLowerCase();L=/webkit/.test(ka)?parseFloat(ka.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;P=va?/win/.test(va):
/win/.test(ka);ka=va?/mac/.test(va):/mac/.test(ka);return{w3cdom:v,pv:z,webkit:L,ie:false,win:P,mac:ka}}();(function(){if(U.w3cdom){c(k);if(U.ie&&U.win)try{E.write("<script id=__ie_ondomload defer=true src=//:><\/script>");(M=fa("__ie_ondomload"))&&ta(M,"onreadystatechange",a)}catch(v){}if(U.webkit&&typeof E.readyState!=S)W=setInterval(function(){/loaded|complete/.test(E.readyState)&&b()},10);typeof E.addEventListener!=S&&E.addEventListener("DOMContentLoaded",b,null);e(b)}})();(function(){U.ie&&U.win&&
window.attachEvent("onunload",function(){for(var v=pa.length,z=0;z<v;z++)pa[z][0].detachEvent(pa[z][1],pa[z][2]);v=na.length;for(z=0;z<v;z++)X(na[z]);for(var L in U)U[L]=null;U=null;for(var P in swfobject)swfobject[P]=null;swfobject=null})})();return{registerObject:function(v,z,L){if(!(!U.w3cdom||!v||!z)){var P={};P.id=v;P.swfVersion=z;P.expressInstall=L?L:false;la[la.length]=P;da(v,false)}},getObjectById:function(v){var z=null;if(U.w3cdom)if(v=fa(v)){var L=v.getElementsByTagName(O)[0];if(!L||L&&
typeof v.SetVariable!=S)z=v;else if(typeof L.SetVariable!=S)z=L}return z},embedSWF:function(v,z,L,P,ka,qa,ua,ma,wa){if(!(!U.w3cdom||!v||!z||!L||!P||!ka)){L+="";P+="";if(g(ka)){da(z,false);var va={};if(wa&&typeof wa===O)for(var xa in wa)if(wa[xa]!=Object.prototype[xa])va[xa]=wa[xa];va.data=v;va.width=L;va.height=P;var Ea={};if(ma&&typeof ma===O)for(var Ha in ma)if(ma[Ha]!=Object.prototype[Ha])Ea[Ha]=ma[Ha];if(ua&&typeof ua===O)for(var Ba in ua)if(ua[Ba]!=Object.prototype[Ba])if(typeof Ea.flashvars!=
S)Ea.flashvars+="&"+Ba+"="+ua[Ba];else Ea.flashvars=Ba+"="+ua[Ba];c(function(){T(va,Ea,z);va.id==z&&da(z,true)})}else if(qa&&!Da&&g("6.0.65")&&(U.win||U.mac)){Da=true;da(z,false);c(function(){var Ca={};Ca.id=Ca.altContentId=z;Ca.width=L;Ca.height=P;Ca.expressInstall=qa;r(Ca)})}}},getFlashPlayerVersion:function(){return{major:U.pv[0],minor:U.pv[1],release:U.pv[2]}},hasFlashPlayerVersion:g,createSWF:function(v,z,L){if(U.w3cdom)return T(v,z,L)},removeSWF:function(v){U.w3cdom&&X(v)},createCSS:function(v,
z){U.w3cdom&&N(v,z)},addDomLoadEvent:c,addLoadEvent:e,getQueryParamValue:function(v){var z=E.location.search||E.location.hash;if(v==null)return F(z);if(z){z=z.substring(1).split("&");for(var L=0;L<z.length;L++)if(z[L].substring(0,z[L].indexOf("="))==v)return F(z[L].substring(z[L].indexOf("=")+1))}return""},expressInstallCallback:function(){if(Da&&ba){var v=fa(u);if(v){v.parentNode.replaceChild(ba,v);if(ha){da(ha,true);if(U.ie&&U.win)ba.style.display="block"}ha=ba=null;Da=false}}}}}();function hidecat(a,b){}function onoff(a,b){};function jSetCookie(a,b,c){var e=new Date,k=new Date;if(c==null||c==0)c=1;k.setTime(e.getTime()+864E5*c);document.cookie=a+"="+escape(b)+";expires="+k.toGMTString()}function readCookie(a){a=a+"=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var e=b[c];e.charAt(0)==" ";)e=e.substring(1,e.length);if(e.indexOf(a)==0)return e.substring(a.length,e.length)}return null}function switchchart(a,b){$(a).style.display="block";$(b).style.display="none"}
function itemOver(a,b){document.getElementById(a).style.backgroundColor=b}function itemOut(a){document.getElementById(a).style.backgroundColor="transparent"}function imgitemOver(a,b){a.style.backgroundColor=b;a.style.borderColor=b}function imgitemOut(a){a.style.backgroundColor="transparent";a.style.borderColor="#999"}function errdismiss(){new Effect.Fade(document.getElementById("errordisplay"))}
function switchbox3(a,b,c){$(a).style.display="block";$(b).style.display="none";$(c).style.display="none"}function scrlr(a,b,c,e,k,o,r){xajax_scrlr(a,b,c,e,k,o,r)}function scrlr_test(a,b,c,e){xajax_scrlr_test(a,b,c,e)}function scrlr_test_s(a,b,c,e){xajax_scrlr_test_s(a,b,c,e)}function scrlr_s(a,b,c,e,k,o,r){xajax_scrlr_s(a,b,c,e,k,o,r)}
function klapperstrauss(a,b,c,e){if($("bx_"+a).getStyle("display")=="none"){$("bx_"+a).setStyle({display:"block"});xajax_klapperstrauss("bx_"+a,1,b,c,e)}else{$("bx_"+a).setStyle({display:"none"});xajax_klapperstrauss("bx_"+a,0,b,c,e)}}function klapperstrauss_s(a,b){if($("bx_"+a).getStyle("display")=="none"){$("bx_"+a).setStyle({display:"block"});xajax_klapperstrauss_s("bx_"+a,1)}else{$("bx_"+a).setStyle({display:"none"});xajax_klapperstrauss_s("bx_"+a,0)}}
function klapperstrauss_o(a,b){$("bx_"+a).setStyle({display:"block"});$("bx_"+b).setStyle({display:"none"});xajax_klapperstrauss_o("bx_"+a,"bx_"+b)}function affetot(a){$(a).getStyle("display")=="none"?$(a).setStyle({display:"block"}):$(a).setStyle({display:"none"})}function switchswitch(a,b){if($(a).getStyle("display")=="none"){$(a).setStyle({display:"block"});$(b).setStyle({display:"none"})}else{$(b).setStyle({display:"block"});$(a).setStyle({display:"none"})}}
function showpix(a){if(a==1){a="block";$("showpix_0").setStyle({display:"block"});$("showpix_1").setStyle({display:"none"})}else{a="none";$("showpix_1").setStyle({display:"block"});$("showpix_0").setStyle({display:"none"})}allNodes=document.getElementsByClassName("imgborder");for(i=0;i<allNodes.length;i++)allNodes[i].style.display=a}function get_newmsg(){xajax_new_msg();setTimeout("xajax_new_msg()",1E4)}
function submit_pn(){xajax.$("abschicken").disabled=true;xajax_send_pn(xajax.getFormValues("pn_form"));return false}function answer_pn(a,b){xajax.$("abschicken_"+a).disabled=true;xajax_send_pn(xajax.getFormValues("pn_form_"+a));return false}function submit_gb(){dissub("abschicken","Einen Moment...");xajax.$("abschicken").disabled=true;xajax_send_gb(xajax.getFormValues("gb_form"));return false}
function answer_gb(a,b){dissub("abschicken_"+a,"Einen Moment...");xajax.$("abschicken_"+a).disabled=true;xajax_send_gb(xajax.getFormValues("gb_form_"+a));return false}function submit_sb(){dissub("shoutthis","Einen Moment...");xajax.$("shoutthis").disabled=true;xajax_shoutboxshout(xajax.getFormValues("shoutthisform"));return false}var Prototip={Version:"1.3.5.1"},Tips={options:{className:"default",closeButtons:false,zIndex:6E3}};
eval(function(a,b,c,e,k,o){k=function(r){return(r<b?"":k(parseInt(r/b)))+((r%=b)>35?String.fromCharCode(r+29):r.toString(36))};if(!"".replace(/^/,String)){for(;c--;)o[k(c)]=e[c]||k(c);e=[function(r){return o[r]}];k=function(){return"\\w+"};c=1}for(;c--;)if(e[c])a=a.replace(new RegExp("\\b"+k(c)+"\\b","g"),e[c]);return a}('q.1z(z,{3R:"1.6.0.2",3P:"1.8.1",2N:c(){5.28("25");f.24();t.10(2m,"2j",5.2j)},28:c(A){b((3u 2m[A]=="3s")||(5.2i(2m[A].3k)<5.2i(5["2z"+A]))){3e("37 4c "+A+" >= "+5["2z"+A]);}},2i:c(A){i B=A.40(/31.*|\\./g,"");B=3T(B+"0".3S(4-B.1Z));r A.3J("31")>-1?B-1:B},1H:c(A){b(!25.2T.2R){A=A.1V(c(E,D){i C=q.2f(5)?5:5.e,B=D.3q;b(B!=C&&!$A(C.2E("*")).3m(B)){E(D)}})}r A},1C:c(B){B=$(B);i A=B.3j(),C=[],E=[];A.1p(B);A.20(c(F){b(F!=B&&F.s()){r}C.1p(F);E.1p({1v:F.1u("1v"),1g:F.1u("1g"),Y:F.1u("Y")});F.j({1v:"47",1g:"44",Y:"s"})});i D={N:B.3Z,P:B.3V};C.20(c(G,F){G.j(E[F])});r D},2j:c(){f.30()}});q.1z(f,{Z:[],s:[],24:c(){5.23=5.13},19:(c(A){r{1i:(A?"1N":"1i"),X:(A?"1J":"X"),1N:(A?"1N":"1i"),1J:(A?"1J":"X")}})(25.2T.2R),1f:(c(B){i A=v 3K("3I ([\\\\d.]+)").3H(B);r A?(3E(A[1])<7):U})(3z.3y),2O:c(A){5.Z.1p(A)},1h:c(A){i B=5.Z.3v(c(C){r C.e==$(A)});b(B){B.2M();b(B.Q){B.h.1h();b(f.1f){B.17.1h()}}5.Z=5.Z.2I(B)}},30:c(){5.Z.20(c(A){5.1h(A.e)}.18(5))},2c:c(B){b(B.2e){r}b(5.s.1Z==0){5.23=5.9.13;1U(i A=0;A<5.Z.1Z;A++){5.Z[A].h.j({13:5.9.13})}}B.h.j({13:5.23++});b(B.k){B.k.j({13:5.23})}1U(i A=0;A<5.Z.1Z;A++){5.Z[A].2e=U}B.2e=1y},2Q:c(A){5.27(A);5.s.1p(A)},27:c(A){5.s=5.s.2I(A)},T:c(B,E){B=$(B),E=$(E);i I=q.1z({e:"2C",m:"3i",15:{x:0,y:0}},2X[2]||{});i D=E.2n();D.11+=I.15.x;D.V+=I.15.y;i C=E.38(),A=1I.1P.2w();D.11+=(-1*(C[0]-A[0]));D.V+=(-1*(C[1]-A[1]));i G={e:z.1C(B),m:z.1C(E)},H={e:q.2u(D),m:q.2u(D)};1U(i F 34 H){4a(I[F]){1r"48":H[F][0]+=G[F].N;1w;1r"46":H[F][0]+=(G[F].N/2);1w;1r"45":H[F][0]+=G[F].N;H[F][1]+=(G[F].P/2);1w;1r"2C":H[F][1]+=G[F].P;1w;1r"43":H[F][0]+=G[F].N;H[F][1]+=G[F].P;1w;1r"42":H[F][0]+=(G[F].N/2);H[F][1]+=G[F].P;1w;1r"41":H[F][1]+=(G[F].P/2);1w}}D.11+=-1*(H.e[0]-H.m[0]);D.V+=-1*(H.e[1]-H.m[1]);B.j({11:D.11+"1G",V:D.V+"1G"})}});f.24();i 3Y=3X.3W({24:c(C,D){5.e=$(C);f.1h(5.e);i A=(q.2q(D)||q.2f(D)),B=A?2X[2]||[]:D;5.1j=A?D:2p;5.9=q.1z({O:U,R:f.9.R,14:f.9.3U,1e:!(B.p&&B.p=="1D")?0.12:U,1O:0.3,S:U,1t:U,1s:"1J",T:B.T,15:B.T?{x:0,y:0}:{x:16,y:16},1m:B.T?1y:U,p:"21",m:5.e,u:U,1P:B.T?U:1y},B);5.m=$(5.9.m);b(5.9.O){5.9.O.9=q.1z({2o:25.3O},5.9.O.9||{})}5.2W();b(5.9.S){z.28("3N");5.1q={1g:"3M",3L:1,2l:5.h.2V()}}f.2O(5);5.2U()},2W:c(){5.h=v t("1c",{R:"1X"}).j({1v:"22",13:f.9.13});5.h.2V();b(f.1f){5.17=v t("3G",{R:"17",3F:"3D:U;",3C:0}).j({1v:"22",13:f.9.13-1,3A:0})}b(5.9.O){5.1L=5.1L.1V(5.2S)}5.1B=v t("1c",{R:"1j"});5.u=v t("1c",{R:"u"}).n();b(5.9.14||(5.9.1s.e&&5.9.1s.e=="14")){5.14=v t("a",{3x:"#",R:"2P"})}},2h:c(){b(f.1f){$(1I.26).W(5.17)}b(5.9.O){$(1I.26).W(5.k=v t("1c",{R:"3w"}).n())}i A="h";b(5.9.S){A="o";5.h.W(5.o=v t("1c",{R:"o"}))}5[A].W(5.Q=v t("1c",{R:"Q "+5.9.R}).W(5.1o=v t("1c",{R:"1o"}).W(5.u)));5.Q.W(5.1B).W(v t("1c").j("2L:2K"));$(1I.26).W(5.h);b(!5.9.O){5.1K({u:5.9.u,1j:5.1j})}},1K:c(E){i A=5.Q.1u("Y"),B=5.h.j("P:1x;N:1x;").1u("Y");[5.Q,5.h].1A("j","Y:2J;");5.1o.j("N: 1x;");b(5.9.S){5.o.j("P:1x;N:1x;")}b(E.u){5.u.l().1K(E.u);5.1o.l()}1n{b(!5.14){5.u.n();5.1o.n()}}b(q.2q(E.1j)||q.2f(E.1j)){5.1B.1K(E.1j).W(v t("1c").j("2L:2K;"))}i C={N:z.1C(5.h).N+"1G"},D=[5.h];b(5.9.S){D.1p(5.o)}b(f.1f){D.1p(5.17)}b(5.14){5.u.l().W({V:5.14});5.1o.l()}5.1o.j("N: 3t%;");C.P=2p;5.h.j({Y:B});5.Q.j({Y:A});D.1A("j",C)},2U:c(){5.2g=5.1L.1d(5);5.2H=5.n.1d(5);b(5.9.1m&&5.9.p=="21"){5.9.p="1i"}b(5.9.p==5.9.1s){5.1k=5.2G.1d(5);5.e.10(5.9.p,5.1k)}i C={e:5.1k?[]:[5.e],m:5.1k?[]:[5.m],1B:5.1k?[]:[5.h],14:[],22:[]};i A=5.9.1s.e;5.2d=A||(!5.9.1s?"22":"e");5.1l=C[5.2d];b(!5.1l&&A&&q.2q(A)){5.1l=5.1B.2E(A)}i D={1N:"1i",1J:"X"};$w("l n").20(c(H){i G=H.3r(),F=(5.9[H+"2F"].2s||5.9[H+"2F"]);5[H+"2Y"]=F;b(["1N","1J","1i","X"].3p(F)){5[H+"2Y"]=(f.19[F]||F);5["2s"+G]=z.1H(5["2s"+G])}}.18(5));b(!5.1k){5.e.10(5.9.p,5.2g)}b(5.1l){5.1l.1A("10",5.3o,5.2H)}b(!5.9.1m&&5.9.p=="1D"){5.1Q=5.1g.1d(5);5.e.10("21",5.1Q)}5.2D=5.n.1V(c(G,F){i E=F.3n(".2P");b(E){F.3l();E.3B();G(F)}}).1d(5);b(5.14){5.h.10("1D",5.2D)}b(5.9.p!="1D"&&(5.2d!="e")){5.1T=z.1H(c(){5.1b("l")}).1d(5);5.e.10(f.19.X,5.1T)}i B=[5.e,5.h];5.2b=z.1H(c(){f.2c(5);5.2k()}).1d(5);5.2a=z.1H(5.1t).1d(5);B.1A("10",f.19.1i,5.2b).1A("10",f.19.X,5.2a);b(5.9.O&&5.9.p!="1D"){5.1W=z.1H(5.2B).1d(5);5.e.10(f.19.X,5.1W)}},2M:c(){b(5.9.p==5.9.1s){5.e.1a(5.9.p,5.1k)}1n{5.e.1a(5.9.p,5.2g);b(5.1l){5.1l.1A("1a")}}b(5.1Q){5.e.1a("21",5.1Q)}b(5.1T){5.e.1a("X",5.1T)}5.h.1a();5.e.1a(f.19.1i,5.2b).1a(f.19.X,5.2a);b(5.1W){5.e.1a(f.19.X,5.1W)}},2S:c(C,B){b(!5.Q){5.2h()}5.1g(B);b(5.29){C(B);r}1n{b(5.1M){r}}i D={2A:{1S:1R.1S(B),1Y:1R.1Y(B)}};i A=q.2u(5.9.O.9);A.2o=A.2o.1V(c(F,E){5.1K({u:5.9.u,1j:E.3h});5.1g(D);b(5.k&&!5.k.s()){5.29=1y;5.1M=U;r}(c(){F(E);b(5.k&&5.k.s()){5.l()}5.1b("k");5.k.1h();5.29=1y;5.1M=U}.18(5)).1e(0.3)}.18(5));5.3g=t.l.1e(5.9.1e,5.k);5.h.n();5.1M=1y;(c(){5.3f=v 3Q.3d(5.9.O.3c,A)}.18(5)).1e(5.9.1e)},2B:c(){5.1b("k")},1L:c(A){b(!5.Q){5.2h()}b(!5.9.O){5.1g(A)}b(5.h.s()){r}5.1b("l");5.3b=5.l.18(5).1e(5.9.1e)},1b:c(A){b(5[A+"2Z"]){3a(5[A+"2Z"])}},l:c(){b(5.h.s()&&5.9.S!="39"){r}b(f.1f){5.17.l()}f.2Q(5.h);b(5.9.S){5.o.j({P:z.1C(5.o).P+"1G"});5.Q.n();5.o.n();5.h.l();b(5.1F){1E.2y.33(5.1q.2l).1h(5.1F)}5.1F=1E[1E.2x[5.9.S][0]](5.o,{36:t.l.35(5.Q),1O:5.9.1O,1q:5.1q,32:c(){5.o.j({P:"1x"});5.e.2r("1X:2v")}.18(5)})}1n{5.Q.l();5.h.l();5.e.2r("1X:2v")}},1t:c(A){b(5.9.O){b(5.k&&5.9.p!="1D"){5.k.n()}5.1b("O");5.1M=2p}b(!5.9.1t){r}5.2k();5.4b=5.n.18(5).1e(5.9.1t)},2k:c(){b(5.9.1t){5.1b("1t")}},n:c(){5.1b("l");5.1b("k");b(!5.h.s()){r}b(5.9.S){b(5.1F){1E.2y.33(5.1q.2l).1h(5.1F)}5.1F=1E[1E.2x[5.9.S][1]](5.o,{1O:5.9.1O,1q:5.1q,32:5.2t.18(5)})}1n{5.2t()}},2t:c(){b(f.1f){5.17.n()}b(5.k){5.k.n()}5.h.n();f.27(5.h);5.e.2r("1X:2J")},2G:c(A){b(5.h&&5.h.s()){5.n(A)}1n{5.1L(A)}},1g:c(A){f.2c(5);b(5.9.S){i D=5.o.1u("Y"),E=5.o.1u("1v");5.o.j({Y:"s"}).l()}b(5.9.T){i L=q.1z({15:5.9.15},{e:5.9.T.1B,m:5.9.T.m});f.T(5.h,5.m,L);b(5.k){f.T(5.k,5.m,L)}b(f.1f){f.T(5.17,5.m,L)}}1n{i G=5.m.2n(),K=z.1C(5.h),C=A.2A||{},H={11:((5.9.1m)?G[0]:C.1S||1R.1S(A))+5.9.15.x,V:((5.9.1m)?G[1]:C.1Y||1R.1Y(A))+5.9.15.y};b(!5.9.1m&&5.e!==5.m){i B=5.e.2n();H.11+=-1*(B[0]-G[0]);H.V+=-1*(B[1]-G[1])}b(!5.9.1m&&5.9.1P){i M=1I.1P.2w(),I=1I.1P.49(),F={11:"N",V:"P"};1U(i J 34 F){b((H[J]+K[F[J]]-M[J])>I[F[J]]){H[J]=H[J]-K[F[J]]-2*5.9.15[J=="V"?"x":"y"]}}}H={11:H.11+"1G",V:H.V+"1G"};5.h.j(H);b(5.k){5.k.j(H)}b(f.1f){5.17.j(H)}}b(5.9.S){5.o.j({Y:D,1v:E})}}});z.2N();',
62,261,"|||||this||||options||if|function||element|Tips||wrapper|var|setStyle|loader|show|target|hide|effectWrapper|showOn|Object|return|visible|Element|title|new||||Prototip||||||||||||||width|ajax|height|tooltip|className|effect|hook|false|top|insert|mouseout|visibility|tips|observe|left||zIndex|closeButton|offset||iframeShim|bind|useEvent|stopObserving|clearTimer|div|bindAsEventListener|delay|fixIE|position|remove|mouseover|content|eventToggle|hideTargets|fixed|else|toolbar|push|queue|case|hideOn|hideAfter|getStyle|display|break|auto|true|extend|invoke|tip|getHiddenDimensions|click|Effect|activeEffect|px|capture|document|mouseleave|update|showDelayed|ajaxContentLoading|mouseenter|duration|viewport|eventPosition|Event|pointerX|eventCheckDelay|for|wrap|ajaxHideEvent|prototip|pointerY|length|each|mousemove|none|zIndexTop|initialize|Prototype|body|removeVisible|require|ajaxContentLoaded|activityLeave|activityEnter|raise|hideElement|highest|isElement|eventShow|build|convertVersionString|unload|cancelHideAfter|scope|window|cumulativeOffset|onComplete|null|isString|fire|event|afterHide|clone|shown|getScrollOffsets|PAIRS|Queues|REQUIRED_|ajaxPointer|ajaxHide|bottomLeft|buttonEvent|select|On|toggle|eventHide|without|hidden|both|clear|deactivate|start|add|close|addVisibile|IE|ajaxShow|Browser|activate|identify|setup|arguments|Action|Timer|removeAll|_|afterFinish|get|in|curry|beforeStart|Lightview|cumulativeScrollOffset|appear|clearTimeout|showTimer|url|Request|throw|ajaxTimer|loaderTimer|responseText|topLeft|ancestors|Version|stop|member|findElement|hideAction|include|relatedTarget|capitalize|undefined|100|typeof|find|prototipLoader|href|userAgent|navigator|opacity|blur|frameBorder|javascript|parseFloat|src|iframe|exec|MSIE|indexOf|RegExp|limit|end|Scriptaculous|emptyFunction|REQUIRED_Scriptaculous|Ajax|REQUIRED_Prototype|times|parseInt|closeButtons|clientHeight|create|Class|Tip|clientWidth|replace|leftMiddle|bottomMiddle|bottomRight|absolute|rightMiddle|topMiddle|block|topRight|getDimensions|switch|hideAfterTimer|requires".split("|"),
0,{}));
Event.simulateMouse=function(a,b,c){c=Object.extend({pointerX:0,pointerY:0,buttons:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},c||{});var e=document.createEvent("MouseEvents");e.initMouseEvent(b,true,true,document.defaultView,c.buttons,c.pointerX,c.pointerY,c.pointerX,c.pointerY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,0,$(a));this.mark&&Element.remove(this.mark);this.mark=document.createElement("div");this.mark.appendChild(document.createTextNode(" "));document.body.appendChild(this.mark);this.mark.style.position=
"absolute";this.mark.style.top=c.pointerY+"px";this.mark.style.left=c.pointerX+"px";this.mark.style.width="5px";this.mark.style.height="5px;";this.mark.style.borderTop="1px solid red;";this.mark.style.borderLeft="1px solid red;";this.step&&alert("["+(new Date).getTime().toString()+"] "+b+"/"+Test.Unit.inspect(c));$(a).dispatchEvent(e)};
Event.simulateKey=function(a,b,c){c=Object.extend({ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,keyCode:0,charCode:0},c||{});var e=document.createEvent("KeyEvents");e.initKeyEvent(b,true,true,window,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.keyCode,c.charCode);$(a).dispatchEvent(e)};Event.simulateKeys=function(a,b){for(var c=0;c<b.length;c++)Event.simulateKey(a,"keypress",{charCode:b.charCodeAt(c)})};var Test={};Test.Unit={};Test.Unit.inspect=Object.inspect;Test.Unit.Logger=Class.create();
Test.Unit.Logger.prototype={initialize:function(a){(this.log=$(a))&&this._createLogTable()},start:function(a){if(this.log){this.testName=a;this.lastLogLine=document.createElement("tr");this.statusCell=document.createElement("td");this.nameCell=document.createElement("td");this.nameCell.className="nameCell";this.nameCell.appendChild(document.createTextNode(a));this.messageCell=document.createElement("td");this.lastLogLine.appendChild(this.statusCell);this.lastLogLine.appendChild(this.nameCell);this.lastLogLine.appendChild(this.messageCell);
this.loglines.appendChild(this.lastLogLine)}},finish:function(a,b){if(this.log){this.lastLogLine.className=a;this.statusCell.innerHTML=a;this.messageCell.innerHTML=this._toHTML(b);this.addLinksToResults()}},message:function(a){if(this.log)this.messageCell.innerHTML=this._toHTML(a)},summary:function(a){if(this.log)this.logsummary.innerHTML=this._toHTML(a)},_createLogTable:function(){this.log.innerHTML='<div id="logsummary"></div><table id="logtable"><thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead><tbody id="loglines"></tbody></table>';
this.logsummary=$("logsummary");this.loglines=$("loglines")},_toHTML:function(a){return a.escapeHTML().replace(/\n/g,"<br/>")},addLinksToResults:function(){$$("tr.failed .nameCell").each(function(a){a.title="Run only this test";Event.observe(a,"click",function(){window.location.search="?tests="+a.innerHTML})});$$("tr.passed .nameCell").each(function(a){a.title="Run all tests";Event.observe(a,"click",function(){window.location.search=""})})}};Test.Unit.Runner=Class.create();
Test.Unit.Runner.prototype={initialize:function(a,b){this.options=Object.extend({testLog:"testlog"},b||{});this.options.resultsURL=this.parseResultsURLQueryParameter();this.options.tests=this.parseTestsQueryParameter();if(this.options.testLog)this.options.testLog=$(this.options.testLog)||null;if(this.options.tests){this.tests=[];for(b=0;b<this.options.tests.length;b++)/^test/.test(this.options.tests[b])&&this.tests.push(new Test.Unit.Testcase(this.options.tests[b],a[this.options.tests[b]],a.setup,
a.teardown))}else if(this.options.test)this.tests=[new Test.Unit.Testcase(this.options.test,a[this.options.test],a.setup,a.teardown)];else{this.tests=[];for(var c in a)if(/^test/.test(c))this.tests.push(new Test.Unit.Testcase(this.options.context?" -> "+this.options.titles[c]:c,a[c],a.setup,a.teardown))}this.currentTest=0;this.logger=new Test.Unit.Logger(this.options.testLog);setTimeout(this.runTests.bind(this),1E3)},parseResultsURLQueryParameter:function(){return window.location.search.parseQuery().resultsURL},
parseTestsQueryParameter:function(){if(window.location.search.parseQuery().tests)return window.location.search.parseQuery().tests.split(",")},getResult:function(){for(var a=false,b=0;b<this.tests.length;b++){if(this.tests[b].errors>0)return"ERROR";if(this.tests[b].failures>0)a=true}return a?"FAILURE":"SUCCESS"},postResults:function(){this.options.resultsURL&&new Ajax.Request(this.options.resultsURL,{method:"get",parameters:"result="+this.getResult(),asynchronous:false})},runTests:function(){var a=
this.tests[this.currentTest];if(a){a.isWaiting||this.logger.start(a.name);a.run();if(a.isWaiting){this.logger.message("Waiting for "+a.timeToWait+"ms");setTimeout(this.runTests.bind(this),a.timeToWait||1E3)}else{this.logger.finish(a.status(),a.summary());this.currentTest++;this.runTests()}}else{this.postResults();this.logger.summary(this.summary())}},summary:function(){for(var a=0,b=0,c=0,e=0;e<this.tests.length;e++){a+=this.tests[e].assertions;b+=this.tests[e].failures;c+=this.tests[e].errors}return(this.options.context?
this.options.context+": ":"")+this.tests.length+" tests, "+a+" assertions, "+b+" failures, "+c+" errors"}};Test.Unit.Assertions=Class.create();
Test.Unit.Assertions.prototype={initialize:function(){this.errors=this.failures=this.assertions=0;this.messages=[]},summary:function(){return this.assertions+" assertions, "+this.failures+" failures, "+this.errors+" errors\n"+this.messages.join("\n")},pass:function(){this.assertions++},fail:function(a){this.failures++;this.messages.push("Failure: "+a)},info:function(a){this.messages.push("Info: "+a)},error:function(a){this.errors++;this.messages.push(a.name+": "+a.message+"("+Test.Unit.inspect(a)+
")")},status:function(){if(this.failures>0)return"failed";if(this.errors>0)return"error";return"passed"},assert:function(a,b){b=b||'assert: got "'+Test.Unit.inspect(a)+'"';try{a?this.pass():this.fail(b)}catch(c){this.error(c)}},assertEqual:function(a,b,c){c=c||"assertEqual";try{a==b?this.pass():this.fail(c+': expected "'+Test.Unit.inspect(a)+'", actual "'+Test.Unit.inspect(b)+'"')}catch(e){this.error(e)}},assertInspect:function(a,b,c){c=c||"assertInspect";try{a==b.inspect()?this.pass():this.fail(c+
': expected "'+Test.Unit.inspect(a)+'", actual "'+Test.Unit.inspect(b)+'"')}catch(e){this.error(e)}},assertEnumEqual:function(a,b,c){c=c||"assertEnumEqual";try{$A(a).length==$A(b).length&&a.zip(b).all(function(k){return k[0]==k[1]})?this.pass():this.fail(c+": expected "+Test.Unit.inspect(a)+", actual "+Test.Unit.inspect(b))}catch(e){this.error(e)}},assertNotEqual:function(a,b,c){c=c||"assertNotEqual";try{a!=b?this.pass():this.fail(c+': got "'+Test.Unit.inspect(b)+'"')}catch(e){this.error(e)}},assertIdentical:function(a,
b,c){c=c||"assertIdentical";try{a===b?this.pass():this.fail(c+': expected "'+Test.Unit.inspect(a)+'", actual "'+Test.Unit.inspect(b)+'"')}catch(e){this.error(e)}},assertNotIdentical:function(a,b,c){c=c||"assertNotIdentical";try{a!==b?this.pass():this.fail(c+': expected "'+Test.Unit.inspect(a)+'", actual "'+Test.Unit.inspect(b)+'"')}catch(e){this.error(e)}},assertNull:function(a,b){b=b||"assertNull";try{a==null?this.pass():this.fail(b+': got "'+Test.Unit.inspect(a)+'"')}catch(c){this.error(c)}},assertMatch:function(a,
b,c){c=c||"assertMatch";var e=new RegExp(a);try{e.exec(b)?this.pass():this.fail(c+' : regex: "'+Test.Unit.inspect(a)+" did not match: "+Test.Unit.inspect(b)+'"')}catch(k){this.error(k)}},assertHidden:function(a,b){this.assertEqual("none",a.style.display,b||"assertHidden")},assertNotNull:function(a,b){this.assert(a!=null,b||"assertNotNull")},assertType:function(a,b,c){c=c||"assertType";try{b.constructor==a?this.pass():this.fail(c+': expected "'+Test.Unit.inspect(a)+'", actual "'+b.constructor+'"')}catch(e){this.error(e)}},
assertNotOfType:function(a,b,c){c=c||"assertNotOfType";try{b.constructor!=a?this.pass():this.fail(c+': expected "'+Test.Unit.inspect(a)+'", actual "'+b.constructor+'"')}catch(e){this.error(e)}},assertInstanceOf:function(a,b,c){c=c||"assertInstanceOf";try{b instanceof a?this.pass():this.fail(c+": object was not an instance of the expected type")}catch(e){this.error(e)}},assertNotInstanceOf:function(a,b,c){c=c||"assertNotInstanceOf";try{!(b instanceof a)?this.pass():this.fail(c+": object was an instance of the not expected type")}catch(e){this.error(e)}},
assertRespondsTo:function(a,b,c){c=c||"assertRespondsTo";try{b[a]&&typeof b[a]=="function"?this.pass():this.fail(c+": object doesn't respond to ["+a+"]")}catch(e){this.error(e)}},assertReturnsTrue:function(a,b,c){c=c||"assertReturnsTrue";try{var e=b[a];e||(e=b["is"+a.charAt(0).toUpperCase()+a.slice(1)]);e()?this.pass():this.fail(c+": method returned false")}catch(k){this.error(k)}},assertReturnsFalse:function(a,b,c){c=c||"assertReturnsFalse";try{var e=b[a];e||(e=b["is"+a.charAt(0).toUpperCase()+a.slice(1)]);
!e()?this.pass():this.fail(c+": method returned true")}catch(k){this.error(k)}},assertRaise:function(a,b,c){c=c||"assertRaise";try{b();this.fail(c+": exception expected but none was raised")}catch(e){a==null||e.name==a?this.pass():this.error(e)}},assertElementsMatch:function(){var a=$A(arguments),b=$A(a.shift());if(b.length!=a.length){this.fail("assertElementsMatch: size mismatch: "+b.length+" elements, "+a.length+" expressions");return false}b.zip(a).all(function(c,e){var k=$(c.first());c=c.last();
if(k.match(c))return true;this.fail("assertElementsMatch: (in index "+e+") expected "+c.inspect()+" but got "+k.inspect())}.bind(this))&&this.pass()},assertElementMatches:function(a,b){this.assertElementsMatch([a],b)},benchmark:function(a,b,c){var e=new Date;(b||1).times(a);a=new Date-e;this.info((c||"Operation")+" finished "+b+" iterations in "+a/1E3+"s");return a},_isVisible:function(a){a=$(a);if(!a.parentNode)return true;this.assertNotNull(a);if(a.style&&Element.getStyle(a,"display")=="none")return false;
return this._isVisible(a.parentNode)},assertNotVisible:function(a,b){this.assert(!this._isVisible(a),Test.Unit.inspect(a)+" was not hidden and didn't have a hidden parent either. "+b)},assertVisible:function(a,b){this.assert(this._isVisible(a),Test.Unit.inspect(a)+" was not visible. "+b)},benchmark:function(a,b,c){var e=new Date;(b||1).times(a);a=new Date-e;this.info((c||"Operation")+" finished "+b+" iterations in "+a/1E3+"s");return a}};Test.Unit.Testcase=Class.create();
Object.extend(Object.extend(Test.Unit.Testcase.prototype,Test.Unit.Assertions.prototype),{initialize:function(a,b,c,e){Test.Unit.Assertions.prototype.initialize.bind(this)();this.name=a;if(typeof b=="string"){b=b.gsub(/(\.should[^\(]+\()/,"#{0}this,");b=b.gsub(/(\.should[^\(]+)\(this,\)/,"#{1}(this)");this.test=function(){eval("with(this){"+b+"}")}}else this.test=b||function(){};this.setup=c||function(){};this.teardown=e||function(){};this.isWaiting=false;this.timeToWait=1E3},wait:function(a,b){this.isWaiting=
true;this.test=b;this.timeToWait=a},run:function(){try{try{this.isWaiting||this.setup.bind(this)();this.isWaiting=false;this.test.bind(this)()}finally{this.isWaiting||this.teardown.bind(this)()}}catch(a){this.error(a)}}});
Test.setupBDDExtensionMethods=function(){var a={shouldEqual:"assertEqual",shouldNotEqual:"assertNotEqual",shouldEqualEnum:"assertEnumEqual",shouldBeA:"assertType",shouldNotBeA:"assertNotOfType",shouldBeAn:"assertType",shouldNotBeAn:"assertNotOfType",shouldBeNull:"assertNull",shouldNotBeNull:"assertNotNull",shouldBe:"assertReturnsTrue",shouldNotBe:"assertReturnsFalse",shouldRespondTo:"assertRespondsTo"};Test.BDDMethods={};for(m in a)Test.BDDMethods[m]=eval("function(){var args = $A(arguments);var scope = args.shift();scope."+
a[m]+".apply(scope,(args || []).concat([this])); }");[Array.prototype,String.prototype,Number.prototype].each(function(b){Object.extend(b,Test.BDDMethods)})};
Test.context=function(a,b,c){Test.setupBDDExtensionMethods();var e={},k={};for(specName in b)switch(specName){case "setup":case "teardown":e[specName]=b[specName];break;default:var o="test"+specName.gsub(/\s+/,"-").camelize(),r=b[specName].toString().split("\n").slice(1);if(/^\{/.test(r[0]))r=r.slice(1);r.pop();r=r.map(function(w){return w.strip()});e[o]=r.join("\n");k[o]=specName}new Test.Unit.Runner(e,{titles:k,testLog:c||"testlog",context:a})};
if(typeof Effect=="undefined")throw"lightwindow.js requires including script.aculo.us' effects.js library!";try{document.execCommand("BackgroundImageCache",false,true)}catch(e$$54){}var lightwindow=Class.create();
lightwindow.prototype={element:null,contentToFetch:null,windowActive:false,dataEffects:[],dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},pageDimensions:{width:null,height:null},preloadImage:[],preloadedImage:[],galleries:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},scrollbarOffset:18,navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},
activeGallery:false,galleryLocation:{current:0,total:0},initialize:function(a){this.options=Object.extend({resizeSpeed:8,contentOffset:{height:20,width:20},dimensions:{image:{height:250,width:250},page:{height:250,width:250},inline:{height:250,width:250},media:{height:250,width:250},external:{height:250,width:250},titleHeight:25},classNames:{standard:"lightwindow",action:"lightwindow_action"},fileTypes:{page:["asp","aspx","cgi","cfm","htm","html","pl","php4","php3","php","php5","phtml","rhtml","shtml",
"txt","vbs","rb"],media:["aif","aiff","asf","avi","divx","m1v","m2a","m2v","m3u","mid","midi","mov","moov","movie","mp2","mp3","mpa","mpa","mpe","mpeg","mpg","mpg","mpga","pps","qt","rm","ram","swf","viv","vivo","wav"],image:["bmp","gif","jpg","png","tiff"]},mimeTypes:{avi:"video/avi",aif:"audio/aiff",aiff:"audio/aiff",gif:"image/gif",bmp:"image/bmp",jpeg:"image/jpeg",m1v:"video/mpeg",m2a:"audio/mpeg",m2v:"video/mpeg",m3u:"audio/x-mpequrl",mid:"audio/x-midi",midi:"audio/x-midi",mjpg:"video/x-motion-jpeg",
moov:"video/quicktime",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp3:"audio/mpeg3",mpa:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"audio/mpeg",mpg:"video/mpeg",mpga:"audio/mpeg",pdf:"application/pdf",png:"image/png",pps:"application/mspowerpoint",qt:"video/quicktime",ram:"audio/x-pn-realaudio-plugin",rm:"application/vnd.rn-realmedia",swf:"application/x-shockwave-flash",tiff:"image/tiff",viv:"video/vivo",vivo:"video/vivo",wav:"audio/wav",wmv:"application/x-mplayer2"},
classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",wmv:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"},viewportPadding:10,EOLASFix:"swf,wmv,fla,flv",overlay:{opacity:0.7,image:"/css/window/black.png",
presetImage:"/css/window/black-70.png"},skin:{main:'<div id="lightwindow_container" ><div id="lightwindow_title_bar" ><div id="lightwindow_title_bar_inner" ><a id="lightwindow_title_bar_close_link" >close</a><span id="lightwindow_title_bar_title"></span></div></div><div id="lightwindow_stage" ><div id="lightwindow_contents" ></div><div id="lightwindow_navigation" ><a href="#" id="lightwindow_previous" ><span id="lightwindow_previous_title"></span></a><a href="#" id="lightwindow_next" ><span id="lightwindow_next_title"></span></a><iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div><div id="lightwindow_galleries"><div id="lightwindow_galleries_tab_container" ><a href="#" id="lightwindow_galleries_tab" ><span id="lightwindow_galleries_tab_span" class="up" >Galleries</span></a></div><div id="lightwindow_galleries_list" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_gallery_container" ><span id="lightwindow_data_gallery_current"></span> of <span id="lightwindow_data_gallery_total"></span></div><div id="lightwindow_data_author_container" >by <span id="lightwindow_data_author"></span></div></div><div id="lightwindow_data_caption" ></div></div></div></div>',
loading:'<div id="lightwindow_loading" ><img src="/css/window/ajax-loading.gif" alt="loading" /><span>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></span><iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div>',iframe:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body>{body_replace}</body></html>',
gallery:{top:'<div class="lightwindow_galleries_list"><h1>{gallery_title_replace}</h1><ul>',middle:"<li>{gallery_link_replace}</li>",bottom:"</ul></div>"}},formMethod:"get",hideFlash:false,hideGalleryTab:false,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false,galleryAnimationHandler:false,showGalleryCount:true},a||{});this.duration=(11-this.options.resizeSpeed)*0.15;this._setupLinks();this._getScroll();this._getPageDimensions();
this._browserDimensions();this._addLightWindowMarkup(false);this._setupDimensions();this.buildGalleryList()},activate:function(a,b){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(b);this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},deactivate:function(){this.activeGallery=
this.windowActive=false;this.options.hideGalleryTab||this._handleGalleryAnimation(false);this.animating=false;this.element=null;this._displayLightWindow("none","visible");this._clearWindowContents(false);Effect.Queues.get("lightwindowAnimation").each(function(a){a.cancel()});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false)},createWindow:function(a){this._processLink($(a))},activateWindow:function(a){this.element=Object.extend({href:null,
title:null,author:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null},a||{});this.contentToFetch=this.element.href;this.windowType=this.element.type?this.element.type:this._fileType(this.element.href);this._clearWindowContents(true);this._addLoadingWindowMarkup();this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block",
"hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},submitForm:function(a){this.options.formHandler?this.options.formHandler(a):this._defaultFormHandler(a)},openWindow:function(a){a=$(a);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(a);this._setStatus(true);this._handleTransition()},navigateWindow:function(a){this._handleNavigation(false);if(a=="previous")this.openWindow(this.navigationObservers.previous);
else a=="next"&&this.openWindow(this.navigationObservers.next)},buildGalleryList:function(){var a="",b;for(i in this.galleries)if(typeof this.galleries[i]=="object"){a+=this.options.skin.gallery.top.replace("{gallery_title_replace}",unescape(i));for(j in this.galleries[i])if(typeof this.galleries[i][j]=="object"){b='<a href="#" id="lightwindow_gallery_'+i+"_"+j+'" >'+unescape(j)+"</a>";a+=this.options.skin.gallery.middle.replace("{gallery_link_replace}",b)}a+=this.options.skin.gallery.bottom}new Insertion.Top("lightwindow_galleries_list",
a);for(i in this.galleries)if(typeof this.galleries[i]=="object")for(j in this.galleries[i])if(typeof this.galleries[i][j]=="object"){Event.observe($("lightwindow_gallery_"+i+"_"+j),"click",this.openWindow.bind(this,this.galleries[i][j][0]),false);$("lightwindow_gallery_"+i+"_"+j).onclick=function(){return false}}},_setupLinks:function(){$$("."+this.options.classNames.standard).each(function(a){this._processLink(a)}.bind(this))},_processLink:function(a){if(this._fileType(a.getAttribute("href"))==
"image"||this._fileType(a.getAttribute("href"))=="media")if(gallery=this._getGalleryInfo(a.rel)){this.galleries[gallery[0]]||(this.galleries[gallery[0]]=[]);this.galleries[gallery[0]][gallery[1]]||(this.galleries[gallery[0]][gallery[1]]=[]);this.galleries[gallery[0]][gallery[1]].push(a)}var b=a.getAttribute("href");if(b.indexOf("?")>-1)b=b.substring(0,b.indexOf("?"));b=b.substring(b.indexOf("#")+1);$(b)&&$(b).setStyle({display:"none"});Event.observe(a,"click",this.activate.bindAsEventListener(this,
a),false);a.onclick=function(){return false}},_setupActions:function(){$$("#lightwindow_container ."+this.options.classNames.action).each(function(a){Event.observe(a,"click",this[a.getAttribute("rel")].bindAsEventListener(this,a),false);a.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(){var a=Element.extend(document.createElement("div"));a.setAttribute("id","lightwindow_overlay");Prototype.Browser.Gecko?a.setStyle({backgroundImage:"url("+this.options.overlay.presetImage+
")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"}):a.setStyle({opacity:this.options.overlay.opacity,backgroundImage:"url("+this.options.overlay.image+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"});var b=document.createElement("div");b.setAttribute("id","lightwindow");b.innerHTML=this.options.skin.main;var c=document.getElementsByTagName("body")[0];c.appendChild(a);c.appendChild(b);if($("lightwindow_title_bar_close_link")){Event.observe("lightwindow_title_bar_close_link",
"click",this.deactivate.bindAsEventListener(this));$("lightwindow_title_bar_close_link").onclick=function(){return false}}Event.observe($("lightwindow_previous"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous").onclick=function(){return false};Event.observe($("lightwindow_next"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next").onclick=function(){return false};if(!this.options.hideGalleryTab){Event.observe($("lightwindow_galleries_tab"),"click",
this._handleGalleryAnimation.bind(this,true),false);$("lightwindow_galleries_tab").onclick=function(){return false}}Prototype.Browser.IE?Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false):Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false);Event.observe(a,"click",this.deactivate.bindAsEventListener(this),false);a.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.options.skin.loading},
_setupWindowElements:function(a){this.element=a;this.element.title=a.getAttribute("title");this.element.author=a.getAttribute("author");this.element.caption=a.getAttribute("caption");this.element.rel=a.getAttribute("rel");this.element.params=a.getAttribute("params");this.contentToFetch=this.element.href;this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch)},_clearWindowContents:function(a){$("lightwindow_iframe")&&Element.remove($("lightwindow_iframe"));
if($("lightwindow_media_primary")){try{$("lightwindow_media_primary").Stop()}catch(b){}Element.remove($("lightwindow_media_primary"))}if($("lightwindow_media_secondary")){try{$("lightwindow_media_secondary").Stop()}catch(c){}Element.remove($("lightwindow_media_secondary"))}this.activeGallery=false;this._handleNavigation(this.activeGallery);if(a){$("lightwindow_contents").innerHTML="";$("lightwindow_contents").setStyle({overflow:"hidden"});if(!this.windowActive){$("lightwindow_data_slide_inner").setStyle({display:"none"});
$("lightwindow_title_bar_title").innerHTML=""}$("lightwindow_data_slide").setStyle({height:"auto"})}this.resizeTo.height=null;this.resizeTo.width=null},_setStatus:function(a){(this.animating=a)&&Element.show("lightwindow_loading");/MSIE 6./i.test(navigator.userAgent)||this._fixedWindow(a)},_fixedWindow:function(a){if(a)if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"absolute",top:parseFloat($("lightwindow").getStyle("top"))+this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))+
this.pagePosition.x+"px"})}else $("lightwindow").setStyle({position:"absolute"});else if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"fixed",top:parseFloat($("lightwindow").getStyle("top"))-this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))-this.pagePosition.x+"px"})}else{$("lightwindow_iframe")&&this._browserDimensions();$("lightwindow").setStyle({position:"fixed",top:parseFloat(this._getParameter("lightwindow_top"))?parseFloat(this._getParameter("lightwindow_top"))+
"px":this.dimensions.viewport.height/2+"px",left:parseFloat(this._getParameter("lightwindow_left"))?parseFloat(this._getParameter("lightwindow_left"))+"px":this.dimensions.viewport.width/2+"px"})}},_prepareIE:function(a){if(Prototype.Browser.IE){a=a?"100%":"auto";var b=document.getElementsByTagName("body")[0];document.getElementsByTagName("html")[0].style.height=b.style.height=a}},_stopScrolling:function(a){if(this.animating){a.preventDefault&&a.preventDefault();a.returnValue=false}},_getScroll:function(){if(typeof window.pageYOffset==
"number"){this.pagePosition.x=window.pageXOffset;this.pagePosition.y=window.pageYOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){this.pagePosition.x=document.body.scrollLeft;this.pagePosition.y=document.body.scrollTop}else if(document.documentElement){this.pagePosition.x=document.documentElement.scrollLeft;this.pagePosition.y=document.documentElement.scrollTop}},_setScroll:function(a,b){document.documentElement.scrollLeft=a;document.documentElement.scrollTop=b},
_toggleTroubleElements:function(a,b){for(var c=b?$("lightwindow_contents").getElementsByTagName("select"):document.getElementsByTagName("select"),e=0;e<c.length;e++)c[e].style.visibility=a;if(!b){if(this.options.hideFlash){b=document.getElementsByTagName("object");for(e=0;e!=b.length;e++)b[e].style.visibility=a;b=document.getElementsByTagName("embed");for(e=0;e!=b.length;e++)b[e].style.visibility=a}b=document.getElementsByTagName("iframe");for(e=0;e!=b.length;e++)b[e].style.visibility=a}},_getPageDimensions:function(){var a,
b;if(window.innerHeight&&window.scrollMaxY){a=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){a=document.body.scrollWidth;b=document.body.scrollHeight}else{a=document.body.offsetWidth;b=document.body.offsetHeight}var c,e;if(self.innerHeight){c=self.innerWidth;e=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;e=document.documentElement.clientHeight}else if(document.body){c=
document.body.clientWidth;e=document.body.clientHeight}this.pageDimensions.height=b<e?e:b;this.pageDimensions.width=a<c?c:a},_displayLightWindow:function(a,b){$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=a;$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=b},_setupDimensions:function(){var a,b;switch(this.windowType){case "page":a=this.options.dimensions.page.height;
b=this.options.dimensions.page.width;break;case "image":a=this.options.dimensions.image.height;b=this.options.dimensions.image.width;break;case "media":a=this.options.dimensions.media.height;b=this.options.dimensions.media.width;break;case "external":a=this.options.dimensions.external.height;b=this.options.dimensions.external.width;break;case "inline":a=this.options.dimensions.inline.height;b=this.options.dimensions.inline.width;break;default:a=this.options.dimensions.page.height;b=this.options.dimensions.page.width;
break}var c=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y,e=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$("lightwindow").setStyle({top:c+"px",left:e+"px"});$("lightwindow_container").setStyle({height:a+"px",width:b+"px",left:-(b/2)+"px",top:-(a/2)+"px"});$("lightwindow_contents").setStyle({height:a+
"px",width:b+"px"})},_fileType:function(a){if((new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i")).test(a))return"image";if(a.indexOf("#")>-1&&document.domain==this._getDomain(a))return"inline";if(a.indexOf("?")>-1)a=a.substring(0,a.indexOf("?"));var b="unknown",c=new RegExp("[^.].("+this.options.fileTypes.page.join("|")+")s*$","i"),e=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(a))b="external";if(e.test(a))b="media";
if(b=="external"||b=="media")return b;if(c.test(a)||a.substr(a.length-1,a.length)=="/")b="page";return b},_fileExtension:function(a){if(a.indexOf("?")>-1)a=a.substring(0,a.indexOf("?"));for(var b="",c=a.length-1;c>-1;c--){if(a.charAt(c)==".")return b;b=a.charAt(c)+b}},_monitorKeyboard:function(a){document.onkeydown=a?this._eventKeypress.bind(this):""},_eventKeypress:function(a){a=a==null?event.keyCode:a.which;switch(a){case 27:this.deactivate();break;case 13:return;default:break}if(this.animating)return false;
switch(String.fromCharCode(a).toLowerCase()){case "p":this.navigationObservers.previous&&this.navigateWindow("previous");break;case "n":this.navigationObservers.next&&this.navigateWindow("next");break;default:break}},_getGalleryInfo:function(a){if(!a)return false;return a.indexOf("[")>-1?new Array(escape(a.substring(0,a.indexOf("["))),escape(a.substring(a.indexOf("[")+1,a.indexOf("]")))):false},_getDomain:function(a){var b=a.indexOf("//")+2;a=a.substring(b,a.length);b=a.indexOf("/");a=a.substring(0,
b);if(a.indexOf(":")>-1){b=a.indexOf(":");a=a.substring(0,b)}return a},_getParameter:function(a,b){if(!this.element)return false;if(a=="lightwindow_top"&&this.element.top)return unescape(this.element.top);else if(a=="lightwindow_left"&&this.element.left)return unescape(this.element.left);else if(a=="lightwindow_type"&&this.element.type)return unescape(this.element.type);else if(a=="lightwindow_show_images"&&this.element.showImages)return unescape(this.element.showImages);else if(a=="lightwindow_height"&&
this.element.height)return unescape(this.element.height);else if(a=="lightwindow_width"&&this.element.width)return unescape(this.element.width);else if(a=="lightwindow_loading_animation"&&this.element.loadingAnimation)return unescape(this.element.loadingAnimation);else if(a=="lightwindow_iframe_embed"&&this.element.iframeEmbed)return unescape(this.element.iframeEmbed);else if(a=="lightwindow_form"&&this.element.form)return unescape(this.element.form);else{if(!b)if(this.element.params)b=this.element.params;
else return;var c;b=b.split(",");a=a+"=";for(var e=a.length,k=0;k<b.length;k++)if(b[k].substr(0,e)==a){c=b[k].split("=")[1];break}return c?unescape(c):false}},_browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth}else{this.dimensions.viewport.height=window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth}},_getScrollerWidth:function(){var a=
Element.extend(document.createElement("div"));a.setAttribute("id","lightwindow_scroll_div");a.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});var b=Element.extend(document.createElement("div"));b.setAttribute("id","lightwindow_content_scroll_div");b.setStyle({width:"100%",height:"200px"});a.appendChild(b);document.getElementsByTagName("body")[0].appendChild(a);b=$("lightwindow_content_scroll_div").offsetWidth;a.style.overflow="auto";a=
$("lightwindow_content_scroll_div").offsetWidth;Element.remove($("lightwindow_scroll_div"));this.scrollbarOffset=b-a},_addParamToObject:function(a,b,c,e){var k=document.createElement("param");k.setAttribute("value",b);k.setAttribute("name",a);e&&k.setAttribute("id",e);c.appendChild(k);return c},_outerHTML:function(a){if(Prototype.Browser.IE)return a.outerHTML;else{a=a.cloneNode(true);var b=document.createElement("div");b.appendChild(a);return b.innerHTML}},_convertToMarkup:function(a,b){var c=this._outerHTML(a).replace("</"+
b+">","");if(Prototype.Browser.IE){for(var e=0;e<a.childNodes.length;e++)c+=this._outerHTML(a.childNodes[e]);c+="</"+b+">"}return c},_appendObject:function(a,b,c){if(Prototype.Browser.IE){c.innerHTML+=this._convertToMarkup(a,b);if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){a=document.getElementsByTagName("object");for(b=0;b<a.length;b++){a[b].getAttribute("data")&&a[b].removeAttribute("data");a[b].outerHTML=a[b].outerHTML;a[b].style.visibility="visible"}}}else c.appendChild(a)},
_appendIframe:function(a){var b=document.createElement("iframe");b.setAttribute("id","lightwindow_iframe");b.setAttribute("name","lightwindow_iframe");b.setAttribute("src","about:blank");b.setAttribute("height","100%");b.setAttribute("width","100%");b.setAttribute("frameborder","0");b.setAttribute("marginwidth","0");b.setAttribute("marginheight","0");b.setAttribute("scrolling",a);this._appendObject(b,"iframe",$("lightwindow_contents"))},_writeToIframe:function(a){var b=this.options.skin.iframe;b=
b.replace("{body_replace}",a);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(b);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(b);$("lightwindow_iframe").contentDocument.close()}},_loadWindow:function(){switch(this.windowType){case "image":var a=0,b=[];this.checkImage=[];this.resizeTo.height=
this.resizeTo.width=0;this.imageCount=this._getParameter("lightwindow_show_images")?parseInt(this._getParameter("lightwindow_show_images")):1;if(gallery=this._getGalleryInfo(this.element.rel)){for(a=0;a<this.galleries[gallery[0]][gallery[1]].length;a++)if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][a].href)>-1)break;this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][a-this.imageCount]?this.galleries[gallery[0]][gallery[1]][a-this.imageCount]:false;this.navigationObservers.next=
this.galleries[gallery[0]][gallery[1]][a+this.imageCount]?this.galleries[gallery[0]][gallery[1]][a+this.imageCount]:false;this.activeGallery=true}else{this.navigationObservers.previous=false;this.activeGallery=this.navigationObservers.next=false}for(var c=a;c<a+this.imageCount;c++){if(gallery&&this.galleries[gallery[0]][gallery[1]][c]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][c].href;this.galleryLocation={current:(c+1)/this.imageCount,total:this.galleries[gallery[0]][gallery[1]].length/
this.imageCount};if(this.galleries[gallery[0]][gallery[1]][c+this.imageCount]){$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][c+this.imageCount].title}else $("lightwindow_next").setStyle({display:"none"});if(this.galleries[gallery[0]][gallery[1]][c-this.imageCount]){$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][c-this.imageCount].title}else $("lightwindow_previous").setStyle({display:"none"})}b[c]=
document.createElement("img");b[c].setAttribute("id","lightwindow_image_"+c);b[c].setAttribute("border","0");b[c].setAttribute("src",this.contentToFetch);$("lightwindow_contents").appendChild(b[c]);this.checkImage[c]=new PeriodicalExecuter(function(e){if(!(typeof $("lightwindow_image_"+e).naturalWidth!="undefined"&&$("lightwindow_image_"+e).naturalWidth==0)){this.checkImage[e].stop();var k=$("lightwindow_image_"+e).getHeight();if(k>this.resizeTo.height)this.resizeTo.height=k;this.resizeTo.width+=
$("lightwindow_image_"+e).getWidth();this.imageCount--;$("lightwindow_image_"+e).setStyle({height:"100%"});this.imageCount==0&&this._processWindow()}}.bind(this,c),1)}break;case "media":a=0;this.resizeTo.height=this.resizeTo.width=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(a=0;a<this.galleries[gallery[0]][gallery[1]].length;a++)if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][a].href)>-1)break;this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][a-
1]?this.galleries[gallery[0]][gallery[1]][a-1]:false;this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][a+1]?this.galleries[gallery[0]][gallery[1]][a+1]:false;this.activeGallery=true}else{this.navigationObservers.previous=false;this.activeGallery=this.navigationObservers.next=false}if(gallery&&this.galleries[gallery[0]][gallery[1]][a]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][a].href;this.galleryLocation={current:a+1,total:this.galleries[gallery[0]][gallery[1]].length};
if(this.galleries[gallery[0]][gallery[1]][a+1]){$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][a+1].title}else $("lightwindow_next").setStyle({display:"none"});if(this.galleries[gallery[0]][gallery[1]][a-1]){$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][a-1].title}else $("lightwindow_previous").setStyle({display:"none"})}if(this._getParameter("lightwindow_iframe_embed")){this.resizeTo.height=
this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width}else{this.resizeTo.height=this._getParameter("lightwindow_height");this.resizeTo.width=this._getParameter("lightwindow_width")}this._processWindow();break;case "external":this._appendIframe("auto");this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width;this._processWindow();break;case "page":new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(e){$("lightwindow_contents").innerHTML+=
e.responseText;this.resizeTo.height=$("lightwindow_contents").scrollHeight+this.options.contentOffset.height;this.resizeTo.width=$("lightwindow_contents").scrollWidth+this.options.contentOffset.width;this._processWindow()}.bind(this)});break;case "inline":a=this.contentToFetch;if(a.indexOf("?")>-1)a=a.substring(0,a.indexOf("?"));a=a.substring(a.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(a).innerHTML);this.resizeTo.height=$("lightwindow_contents").scrollHeight+this.options.contentOffset.height;
this.resizeTo.width=$("lightwindow_contents").scrollWidth+this.options.contentOffset.width;this._toggleTroubleElements("hidden",true);this._processWindow();break;default:throw"Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch;}},_resizeWindowToFit:function(){if(this.resizeTo.height+this.dimensions.cruft.height>this.dimensions.viewport.height){var a=this.resizeTo.height/this.resizeTo.width;this.resizeTo.height=this.dimensions.viewport.height-this.dimensions.cruft.height-
2*this.options.viewportPadding;if(this.windowType=="image"||this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed")){this.resizeTo.width=this.resizeTo.height/a;$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"})}}if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){a=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=this.dimensions.viewport.width-2*this.dimensions.cruft.width-2*this.options.viewportPadding;if(this.windowType==
"image"||this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed")){this.resizeTo.height=this.resizeTo.width/a;$("lightwindow_data_slide_inner").setStyle({height:this.resizeTo.height+"px"})}}},_presetWindowSize:function(){if(this._getParameter("lightwindow_height"))this.resizeTo.height=parseFloat(this._getParameter("lightwindow_height"));if(this._getParameter("lightwindow_width"))this.resizeTo.width=parseFloat(this._getParameter("lightwindow_width"))},_processWindow:function(){this.dimensions.dataEffects=
[];if(this.element.caption||this.element.author||this.activeGallery&&this.options.showGalleryCount){if(this.element.caption){$("lightwindow_data_caption").innerHTML=this.element.caption;$("lightwindow_data_caption").setStyle({display:"block"})}else $("lightwindow_data_caption").setStyle({display:"none"});if(this.element.author){$("lightwindow_data_author").innerHTML=this.element.author;$("lightwindow_data_author_container").setStyle({display:"block"})}else $("lightwindow_data_author_container").setStyle({display:"none"});
if(this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_gallery_current").innerHTML=this.galleryLocation.current;$("lightwindow_data_gallery_total").innerHTML=this.galleryLocation.total;$("lightwindow_data_gallery_container").setStyle({display:"block"})}else $("lightwindow_data_gallery_container").setStyle({display:"none"});$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px",height:"auto",visibility:"visible",display:"block"});$("lightwindow_data_slide").setStyle({height:$("lightwindow_data_slide").getHeight()+
"px",width:"1px",overflow:"hidden",display:"block"})}else{$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});$("lightwindow_data_slide_inner").setStyle({display:"none",visibility:"hidden",width:this.resizeTo.width+"px",height:"0px"})}if(this.element.title!="null")$("lightwindow_title_bar_title").innerHTML=this.element.title;else $("lightwindow_title_bar_title").innerHTML="";var a={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};$("lightwindow_container").setStyle({height:"auto",
width:$("lightwindow_container").getWidth()+this.options.contentOffset.width-(this.windowActive?this.options.contentOffset.width:0)+"px"});var b={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.containerChange={height:a.height-b.height,width:a.width-b.width};this.dimensions.container={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.dimensions.cruft={height:this.dimensions.container.height-$("lightwindow_contents").getHeight()+
this.options.contentOffset.height,width:this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.options.contentOffset.width};this._presetWindowSize();this._resizeWindowToFit();this.windowActive||$("lightwindow_container").setStyle({left:-(this.dimensions.container.width/2)+"px",top:-(this.dimensions.container.height/2)+"px"});$("lightwindow_container").setStyle({height:this.dimensions.container.height+"px",width:this.dimensions.container.width+"px"});this._displayLightWindow("block",
"visible");this._animateLightWindow()},_animateLightWindow:function(){this.options.animationHandler?this.options.animationHandler().bind(this):this._defaultAnimationHandler()},_handleNavigation:function(a){this.options.navigationHandler?this.options.navigationHandler().bind(this,a):this._defaultDisplayNavigation(a)},_handleTransition:function(){this.options.transitionHandler?this.options.transitionHandler().bind(this):this._defaultTransitionHandler()},_handleFinalWindowAnimation:function(a){this.options.finalAnimationHandler?
this.options.finalAnimationHandler().bind(this,a):this._defaultfinalWindowAnimationHandler(a)},_handleGalleryAnimation:function(a){this.options.galleryAnimationHandler?this.options.galleryAnimationHandler().bind(this,a):this._defaultGalleryAnimationHandler(a)},_defaultDisplayNavigation:function(a){a?$("lightwindow_navigation").setStyle({display:"block",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.options.dimensions.titleHeight+"px"}):$("lightwindow_navigation").setStyle({display:"none",
height:"auto",width:"auto"})},_defaultAnimationHandler:function(){if(this.element.caption||this.element.author||this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});this.dimensions.dataEffects.push(new Effect.SlideDown("lightwindow_data_slide",{sync:true}),new Effect.Appear("lightwindow_data_slide",{sync:true,from:0,to:1}))}$("lightwindow_title_bar_inner").setStyle({height:"0px",marginTop:this.options.dimensions.titleHeight+"px"});
this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:this.options.dimensions.titleHeight+"px",marginTop:"0px"}}),new Effect.Appear("lightwindow_title_bar_inner",{sync:true,from:0,to:1}));if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false);if($("lightwindow_galleries_tab_container").getHeight()==0){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"20px",marginTop:"0px"}}));
$("lightwindow_galleries").setStyle({width:"0px"})}}var a=false,b=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;b!=$("lightwindow_container").getWidth()&&new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.width/$("lightwindow_contents").getWidth()),{scaleFrom:100*($("lightwindow_contents").getWidth()/($("lightwindow_contents").getWidth()+this.options.contentOffset.width)),sync:true,scaleY:false,
scaleContent:false}),new Effect.Scale("lightwindow_container",100*(b/this.dimensions.container.width),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}});b=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.options.contentOffset.height;if(b!=$("lightwindow_container").getHeight()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.height/
$("lightwindow_contents").getHeight()),{scaleFrom:100*($("lightwindow_contents").getHeight()/($("lightwindow_contents").getHeight()+this.options.contentOffset.height)),sync:true,scaleX:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(b/this.dimensions.container.height),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){if(this.dimensions.dataEffects.length>0){this.options.hideGalleryTab||$("lightwindow_galleries").setStyle({width:this.resizeTo.width+
"px"});new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}});a=true}!a&&this.dimensions.dataEffects.length>0&&new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){this.options.hideGalleryTab||$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"});if(this.containerChange.height!=
0||this.containerChange.width!=0)new Effect.MoveBy("lightwindow_container",this.containerChange.height,this.containerChange.width,{transition:Effect.Transitions.sinoidal})}.bind(this),afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultfinalWindowAnimationHandler:function(){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._handleNavigation(this.activeGallery);
this._setStatus(false)}else Effect.Fade("lightwindow_loading",{duration:0.75,delay:1,afterFinish:function(){this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"&&$("lightwindow_contents").setStyle({overflow:"auto"});this._handleNavigation(this.activeGallery);this._defaultGalleryAnimationHandler();this._setStatus(false)}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultGalleryAnimationHandler:function(a){if(this.activeGallery){$("lightwindow_galleries").setStyle({display:"block",
marginBottom:$("lightwindow_data_slide").getHeight()+this.options.contentOffset.height/2+"px"});$("lightwindow_navigation").setStyle({height:$("lightwindow_contents").getHeight()-20+"px"})}else{$("lightwindow_galleries").setStyle({display:"none"});$("lightwindow_galleries_tab_container").setStyle({height:"0px",marginTop:"20px"});$("lightwindow_galleries_list").setStyle({height:"0px"});return false}if(a){if($("lightwindow_galleries_list").getHeight()==0){a=$("lightwindow_contents").getHeight()*0.8;
$("lightwindow_galleries_tab_span").className="down"}else{a=0;$("lightwindow_galleries_tab_span").className="up"}new Effect.Morph("lightwindow_galleries_list",{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:a+"px"},beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})},queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultTransitionHandler:function(){this.dimensions.dataEffects=
[];$("lightwindow_data_slide").getStyle("display")!="none"&&this.dimensions.dataEffects.push(new Effect.SlideUp("lightwindow_data_slide",{sync:true}),new Effect.Fade("lightwindow_data_slide",{sync:true,from:1,to:0}));if(!this.options.hideGalleryTab){$("lightwindow_galleries").getHeight()!=0&&!this.options.hideGalleryTab&&this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"0px",marginTop:"20px"}}));if($("lightwindow_galleries_list").getHeight()!=
0){$("lightwindow_galleries_tab_span").className="up";this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_list",{sync:true,style:{height:"0px"},transition:Effect.Transitions.sinoidal,beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})}}))}}this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:"0px",marginTop:this.options.dimensions.titleHeight+
"px"}}),new Effect.Fade("lightwindow_title_bar_inner",{sync:true,from:1,to:0}));new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._loadWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultFormHandler:function(a){a=Event.element(a).parentNode;var b=Form.serialize(this._getParameter("lightwindow_form",a.getAttribute("params")));if(this.options.formMethod=="post")new Ajax.Request(a.href,{method:"post",postBody:b,onComplete:this.openWindow.bind(this,
a)});else this.options.formMethod=="get"&&new Ajax.Request(a.href,{method:"get",parameters:b,onComplete:this.openWindow.bind(this,a)})},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.element.href);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var a=document.createElement("object");a.setAttribute("classid",this.options.classids[this._fileExtension(this.contentToFetch)]);a.setAttribute("codebase",this.options.codebases[this._fileExtension(this.contentToFetch)]);
a.setAttribute("id","lightwindow_media_primary");a.setAttribute("name","lightwindow_media_primary");a.setAttribute("width",this.resizeTo.width);a.setAttribute("height",this.resizeTo.height);a=this._addParamToObject("movie",this.contentToFetch,a);a=this._addParamToObject("src",this.contentToFetch,a);a=this._addParamToObject("controller","true",a);a=this._addParamToObject("wmode","transparent",a);a=this._addParamToObject("cache","false",a);a=this._addParamToObject("quality","high",a);if(!Prototype.Browser.IE){var b=
document.createElement("object");b.setAttribute("type",this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);b.setAttribute("data",this.contentToFetch);b.setAttribute("id","lightwindow_media_secondary");b.setAttribute("name","lightwindow_media_secondary");b.setAttribute("width",this.resizeTo.width);b.setAttribute("height",this.resizeTo.height);b=this._addParamToObject("controller","true",b);b=this._addParamToObject("wmode","transparent",b);b=this._addParamToObject("cache","false",b);b=
this._addParamToObject("quality","high",b);a.appendChild(b)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(a,"object"))}else this._appendObject(a,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}this._setupActions()}};Event.observe(window,"load",lightwindowInit,false);var myLightWindow=null;function lightwindowInit(){myLightWindow=new lightwindow}
function win(a,b,c,e,k,o,r){self.name="Haupt";OpenWin=this.open(a,b,"width="+c+",height="+e+",left="+k+",top="+o+",location=no,scrollbars="+r+",menubars=no,toolbars=no,resizable=no");closetime&&setTimeout("Profil.close();",closetime*1E3)};
