var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=h;d.subclasses=[];if(h){a.prototype=h.prototype;d.prototype=new a;h.subclasses.push(d)}for(var f=0;f<g.length;f++){d.addMethods(g[f])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(l){var g=this.superclass&&this.superclass.prototype;var f=Object.keys(l);if(!Object.keys({toString:true}).length){if(l.toString!=Object.prototype.toString){f.push("toString")}if(l.valueOf!=Object.prototype.valueOf){f.push("valueOf")}}for(var d=0,h=f.length;d<h;d++){var k=f[d],j=l[k];if(g&&Object.isFunction(j)&&j.argumentNames().first()=="$super"){var m=j;j=(function(i){return function(){return g[i].apply(this,arguments)}})(k).wrap(m);j.valueOf=m.valueOf.bind(m);j.toString=m.toString.bind(m)}this.prototype[k]=j}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function j(r,u){for(var t in u){r[t]=u[t]}return r}function m(r){try{if(f(r)){return"undefined"}if(r===null){return"null"}return r.inspect?r.inspect():String(r)}catch(t){if(t instanceof RangeError){return"..."}throw t}}function l(r){var u=typeof r;switch(u){case"undefined":case"function":case"unknown":return;case"boolean":return r.toString()}if(r===null){return"null"}if(r.toJSON){return r.toJSON()}if(i(r)){return}var t=[];for(var w in r){var v=l(r[w]);if(!f(v)){t.push(w.toJSON()+": "+v)}}return"{"+t.join(", ")+"}"}function c(r){return $H(r).toQueryString()}function g(r){return r&&r.toHTML?r.toHTML():String.interpret(r)}function p(r){var t=[];for(var u in r){t.push(u)}return t}function n(r){var t=[];for(var u in r){t.push(r[u])}return t}function k(r){return j({},r)}function i(r){return !!(r&&r.nodeType==1)}function h(r){return d.call(r)=="[object Array]"}function q(r){return r instanceof Hash}function b(r){return typeof r==="function"}function a(r){return d.call(r)=="[object String]"}function o(r){return d.call(r)=="[object Number]"}function f(r){return typeof r==="undefined"}j(Object,{extend:j,inspect:m,toJSON:l,toQueryString:c,toHTML:g,keys:p,values:n,clone:k,isElement:i,isArray:h,isHash:q,isFunction:b,isString:a,isNumber:o,isUndefined:f})})();Object.extend(Function.prototype,(function(){var l=Array.prototype.slice;function d(p,m){var o=p.length,n=m.length;while(n--){p[o+n]=m[n]}return p}function j(n,m){n=l.call(n,0);return d(n,m)}function h(){var m=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return m.length==1&&!m[0]?[]:m}function i(o){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var m=this,n=l.call(arguments,1);return function(){var p=j(n,arguments);return m.apply(o,p)}}function g(o){var m=this,n=l.call(arguments,1);return function(q){var p=d([q||window.event],n);return m.apply(o,p)}}function k(){if(!arguments.length){return this}var m=this,n=l.call(arguments,0);return function(){var o=j(n,arguments);return m.apply(this,o)}}function f(o){var m=this,n=l.call(arguments,1);o=o*1000;return window.setTimeout(function(){return m.apply(m,n)},o)}function a(){var m=d([0.01],arguments);return this.delay.apply(this,m)}function c(n){var m=this;return function(){var o=d([m.bind(this)],arguments);return n.apply(this,o)}}function b(){if(this._methodized){return this._methodized}var m=this;return this._methodized=function(){var n=d([this],arguments);return m.apply(null,n)}}return{argumentNames:h,bind:i,bindAsEventListener:g,curry:k,delay:f,defer:a,wrap:c,methodize:b}})());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(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(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(d){if(a==null){return(d[1]+"")}var g=d[1]||"";if(g=="\\"){return d[2]}var b=a,h=d[3];var f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=f.exec(h);if(d==null){return g}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}h=h.substring("["==d[3]?d[1].length:d[0].length);d=f.exec(h)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(A,z){var y=0;try{this._each(function(C){A.call(z,C,y++)})}catch(B){if(B!=$break){throw B}}return this}function t(B,A,z){var y=-B,C=[],D=this.toArray();if(B<1){return D}while((y+=B)<D.length){C.push(D.slice(y,y+B))}return C.collect(A,z)}function b(A,z){A=A||Prototype.K;var y=true;this.each(function(C,B){y=y&&!!A.call(z,C,B);if(!y){throw $break}});return y}function j(A,z){A=A||Prototype.K;var y=false;this.each(function(C,B){if(y=!!A.call(z,C,B)){throw $break}});return y}function k(A,z){A=A||Prototype.K;var y=[];this.each(function(C,B){y.push(A.call(z,C,B))});return y}function v(A,z){var y;this.each(function(C,B){if(A.call(z,C,B)){y=C;throw $break}});return y}function i(A,z){var y=[];this.each(function(C,B){if(A.call(z,C,B)){y.push(C)}});return y}function h(B,A,z){A=A||Prototype.K;var y=[];if(Object.isString(B)){B=new RegExp(RegExp.escape(B))}this.each(function(D,C){if(B.match(D)){y.push(A.call(z,D,C))}});return y}function a(y){if(Object.isFunction(this.indexOf)){if(this.indexOf(y)!=-1){return true}}var z=false;this.each(function(A){if(A==y){z=true;throw $break}});return z}function r(z,y){y=Object.isUndefined(y)?null:y;return this.eachSlice(z,function(A){while(A.length<z){A.push(y)}return A})}function m(y,A,z){this.each(function(C,B){y=A.call(z,y,C,B)});return y}function x(z){var y=$A(arguments).slice(1);return this.map(function(A){return A[z].apply(A,y)})}function q(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C>=y){y=C}});return y}function o(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C<y){y=C}});return y}function f(B,z){B=B||Prototype.K;var A=[],y=[];this.each(function(D,C){(B.call(z,D,C)?A:y).push(D)});return[A,y]}function g(z){var y=[];this.each(function(A){y.push(A[z])});return y}function d(A,z){var y=[];this.each(function(C,B){if(!A.call(z,C,B)){y.push(C)}});return y}function n(z,y){return this.map(function(B,A){return{value:B,criteria:z.call(y,B,A)}}).sort(function(D,C){var B=D.criteria,A=C.criteria;return B<A?-1:B>A?1:0}).pluck("value")}function p(){return this.map()}function u(){var z=Prototype.K,y=$A(arguments);if(Object.isFunction(y.last())){z=y.pop()}var A=[this].concat(y).map($A);return this.map(function(C,B){return z(A.pluck(B))})}function l(){return this.toArray().length}function w(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:c,eachSlice:t,all:b,every:b,any:j,some:j,collect:k,map:k,detect:v,findAll:i,select:i,filter:i,grep:h,include:a,member:a,inGroupsOf:r,inject:m,invoke:x,max:q,min:o,partition:f,pluck:g,reject:d,sortBy:n,toArray:p,entries:p,zip:u,size:l,inspect:w,find:v}})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var u=Array.prototype,n=u.slice,p=u.forEach;function b(y){for(var x=0,z=this.length;x<z;x++){y(this[x])}}if(!p){p=b}function m(){this.length=0;return this}function d(){return this[0]}function h(){return this[this.length-1]}function j(){return this.select(function(x){return x!=null})}function w(){return this.inject([],function(y,x){if(Object.isArray(x)){return y.concat(x.flatten())}y.push(x);return y})}function i(){var x=n.call(arguments,0);return this.select(function(y){return !x.include(y)})}function g(x){return(x!==false?this:this.toArray())._reverse()}function l(x){return this.inject([],function(A,z,y){if(0==y||(x?A.last()!=z:!A.include(z))){A.push(z)}return A})}function q(x){return this.uniq().findAll(function(y){return x.detect(function(z){return y===z})})}function r(){return n.call(this,0)}function k(){return this.length}function v(){return"["+this.map(Object.inspect).join(", ")+"]"}function t(){var x=[];this.each(function(y){var z=Object.toJSON(y);if(!Object.isUndefined(z)){x.push(z)}});return"["+x.join(", ")+"]"}function a(z,x){x||(x=0);var y=this.length;if(x<0){x=y+x}for(;x<y;x++){if(this[x]===z){return x}}return -1}function o(y,x){x=isNaN(x)?this.length:(x<0?this.length+x:x)+1;var z=this.slice(0,x).reverse().indexOf(y);return(z<0)?z:x-z-1}function c(){var C=n.call(this,0),A;for(var y=0,z=arguments.length;y<z;y++){A=arguments[y];if(Object.isArray(A)&&!("callee" in A)){for(var x=0,B=A.length;x<B;x++){C.push(A[x])}}else{C.push(A)}}return C}Object.extend(u,Enumerable);if(!u._reverse){u._reverse=u.reverse}Object.extend(u,{_each:p,clear:m,first:d,last:h,compact:j,flatten:w,without:i,reverse:g,uniq:l,intersect:q,clone:r,toArray:r,size:k,inspect:v,toJSON:t});var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){u.concat=c}if(!u.indexOf){u.indexOf=a}if(!u.lastIndexOf){u.lastIndexOf=o}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function f(r){this._object=Object.isHash(r)?r.toObject():Object.clone(r)}function g(t){for(var r in this._object){var u=this._object[r],v=[r,u];v.key=r;v.value=u;t(v)}}function l(r,t){return this._object[r]=t}function c(r){if(this._object[r]!==Object.prototype[r]){return this._object[r]}}function o(r){var t=this._object[r];delete this._object[r];return t}function q(){return Object.clone(this._object)}function p(){return this.pluck("key")}function n(){return this.pluck("value")}function h(t){var r=this.detect(function(u){return u.value===t});return r&&r.key}function j(r){return this.clone().update(r)}function d(r){return new Hash(r).inject(this,function(t,u){t.set(u.key,u.value);return t})}function b(r,t){if(Object.isUndefined(t)){return r}return r+"="+encodeURIComponent(String.interpret(t))}function a(){return this.inject([],function(u,v){var t=encodeURIComponent(v.key),r=v.value;if(r&&typeof r=="object"){if(Object.isArray(r)){return u.concat(r.map(b.curry(t)))}}else{u.push(b(t,r))}return u}).join("&")}function m(){return"#<Hash:{"+this.map(function(r){return r.map(Object.inspect).join(": ")}).join(", ")+"}>"}function k(){return Object.toJSON(this.toObject())}function i(){return new Hash(this)}return{initialize:f,_each:g,set:l,get:c,unset:o,toObject:q,toTemplateReplacements:q,keys:p,values:n,index:h,merge:j,update:d,toQueryString:a,inspect:m,toJSON:k,clone:i}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function f(){return this+1}function a(l,k){$R(0,this,true).each(l,k);return this}function b(m,l){var k=this.toString(l||10);return"0".times(m-k.length)+k}function g(){return isFinite(this)?this.toString():"null"}function j(){return Math.abs(this)}function i(){return Math.round(this)}function h(){return Math.ceil(this)}function c(){return Math.floor(this)}return{toColorPart:d,succ:f,times:a,toPaddedString:b,toJSON:g,abs:j,round:i,ceil:h,floor:c}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,d,f){this.start=g;this.end=d;this.exclusive=f}function c(d){var f=this.start;while(this.include(f)){d(f);f=f.succ()}}function a(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:b,_each:c,include:a}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){d._method=this.method;this.method="post"}this.parameters=d;if(d=Object.toQueryString(d)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_="}}}try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){f["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){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){f[c[b]]=c[b+1]}}else{$H(c).each(function(g){f[g.key]=g.value})}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(d)){d(f,g)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var c=[];var f=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=f.snapshotLength;b<d;b++){c.push(Element.extend(f.snapshotItem(b)))}return c}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(c){var b=(function(){var g=document.createElement("form");var f=document.createElement("input");var d=document.documentElement;f.setAttribute("name","test");g.appendChild(f);d.appendChild(g);var h=g.elements?(typeof g.elements.test=="undefined"):null;d.removeChild(g);g=f=null;return h})();var a=c.Element;c.Element=function(g,f){f=f||{};g=g.toLowerCase();var d=Element.cache;if(b&&f.name){g="<"+g+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(g),f)}if(!d[g]){d[g]=Element.extend(document.createElement(g))}return Element.writeAttribute(d[g].cloneNode(false),f)};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.prototype}})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var b=(function(){var f=document.createElement("select"),g=true;f.innerHTML='<option value="test">test</option>';if(f.options&&f.options[0]){g=f.options[0].nodeName.toUpperCase()!=="OPTION"}f=null;return g})();var a=(function(){try{var f=document.createElement("table");if(f&&f.tBodies){f.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var h=typeof f.tBodies[0]=="undefined";f=null;return h}}catch(g){return true}})();var d=(function(){var f=document.createElement("script"),h=false;try{f.appendChild(document.createTextNode(""));h=!f.firstChild||f.firstChild&&f.firstChild.nodeType!==3}catch(g){h=true}f=null;return h})();function c(g,h){g=$(g);if(h&&h.toElement){h=h.toElement()}if(Object.isElement(h)){return g.update().insert(h)}h=Object.toHTML(h);var f=g.tagName.toUpperCase();if(f==="SCRIPT"&&d){g.text=h;return g}if(b||a){if(f in Element._insertionTranslations.tags){while(g.firstChild){g.removeChild(g.firstChild)}Element._getContentFromAnonymousElement(f,h.stripScripts()).each(function(i){g.appendChild(i)})}else{g.innerHTML=h.stripScripts()}}else{g.innerHTML=h.stripScripts()}h.evalScripts.bind(h).defer();return g}return c})(),replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,f){c=$(c);if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}}var d,g,b,h;for(var a in f){d=f[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){g(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){h.reverse()}h.each(g.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),c=g.last();var d=(b[f]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]}while(a&&a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){if(Object.isString(a)){a=new Selector(a)}return a.match($(b))},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=Element.ancestors(b);return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,d,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var c=Element.previousSiblings(b);return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=Element.nextSiblings(c);return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},select:function(b){var a=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(b,a)},adjacent:function(b){var a=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(f,c,g){f=$(f);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(g)?true:g}for(var a in b){c=d.names[a]||a;g=b[a];if(d.values[a]){c=d.values[a](f,g)}if(g===false||g===null){f.removeAttribute(c)}else{if(g===true){f.setAttribute(c,c)}else{f.setAttribute(c,g)}}}return f},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))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var f=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{f[(d=="float"||d=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},getDimensions:function(c){c=$(c);var h=Element.getStyle(c,"display");if(h!="none"&&h!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var g=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";if(d!="fixed"){b.position="absolute"}b.display="block";var i=c.clientWidth;var f=c.clientHeight;b.display=a;b.position=d;b.visibility=g;return{width:i,height:f}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},cumulativeOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(c,a)},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName.toUpperCase()=="BODY"){break}var c=Element.getStyle(b,"position");if(c!=="static"){break}}}while(b);return Element._returnOffset(d,a)},absolutize:function(b){b=$(b);if(Element.getStyle(b,"position")=="absolute"){return b}var d=Element.positionedOffset(b);var g=d[1];var f=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=f-parseFloat(b.style.left||0);b._originalTop=g-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=g+"px";b.style.left=f+"px";b.style.width=c+"px";b.style.height=a+"px";return b},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative"){return a}a.style.position="relative";var c=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=c+"px";a.style.left=b+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(c,a)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return $(a)}}return $(document.body)},viewportOffset:function(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body&&Element.getStyle(b,"position")=="absolute"){break}}while(b=b.offsetParent);b=d;do{if(!Prototype.Browser.Opera||(b.tagName&&(b.tagName.toUpperCase()=="BODY"))){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(c,a)},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var f=Element.viewportOffset(d);b=$(b);var g=[0,0];var c=null;if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);g=Element.viewportOffset(c)}if(c==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"left":case"top":case"right":case"bottom":if(d(b,"position")==="static"){return null}case"height":case"width":if(!Element.visible(b)){return null}var f=parseInt(d(b,c),10);if(f!==b["offset"+c.capitalize()]){return f+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(f,function(g,h){var i=d(b,h);return i===null?g:g-parseInt(i,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);try{b.offsetParent}catch(f){return $(document.body)}var a=b.getStyle("position");if(a!=="static"){return c(b)}b.setStyle({position:"relative"});var d=c(b);b.setStyle({position:a});return d});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,c){c=$(c);try{c.offsetParent}catch(h){return Element._returnOffset(0,0)}var b=c.getStyle("position");if(b!=="static"){return f(c)}var d=c.getOffsetParent();if(d&&d.getStyle("position")==="fixed"){d.setStyle({zoom:1})}c.setStyle({position:"relative"});var g=f(c);c.setStyle({position:b});return g})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent}catch(c){return Element._returnOffset(0,0)}return b(a)});Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(f==1||f===""){(d=g(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(f<0.00001){f=0}}c.filter=g(d)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var b="className";var a="for";var c=document.createElement("div");c.setAttribute(b,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x"){b="class"}}c=null;c=document.createElement("label");c.setAttribute(a,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x"){a="htmlFor"}}c=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,f){return d.getAttribute(f)},_getAttr2:function(d,f){return d.getAttribute(f,2)},_getAttrNode:function(d,g){var f=d.getAttributeNode(g);return f?f.value:""},_getEv:(function(){var d=document.createElement("div");d.onclick=Prototype.emptyFunction;var h=d.getAttribute("onclick");var g;if(String(h).indexOf("{")>-1){g=function(f,i){i=f.getAttribute(i);if(!i){return null}i=i.toString();i=i.split("{")[1];i=i.split("}")[0];return i.strip()}}else{if(h===""){g=function(f,i){i=f.getAttribute(i);if(!i){return null}return i.strip()}}}d=null;return g})(),_flag:function(d,f){return $(d).hasAttribute(f)?f:null},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),d=[];for(var c=0,g;g=b[c];c++){if(g.tagName!=="!"){d.push(g)}}return d}Element.Methods.down=function(c,d,b){c=$(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a};Element.Methods.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}b=b.offsetParent}while(b);return Element._returnOffset(c,a)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,f){c=$(c);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){c.parentNode.replaceChild(f,c);return c}f=Object.toHTML(f);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var g=c.next();var a=Element._getContentFromAnonymousElement(b,f.stripScripts());d.removeChild(c);if(g){a.each(function(h){d.insertBefore(h,g)})}else{a.each(function(h){d.appendChild(h)})}}else{c.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(c,b){var d=new Element("div"),a=Element._insertionTranslations.tags[c];if(a){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else{d.innerHTML=b}return $A(d.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function c(h){if(typeof window.Element!="undefined"){var j=window.Element.prototype;if(j){var l="_"+(Math.random()+"").slice(2);var i=document.createElement(h);j[l]="x";var k=(i[l]!=="x");delete j[l];i=null;return k}}return false}function b(i,h){for(var k in h){var j=h[k];if(Object.isFunction(j)&&!(k in i)){i[k]=j.methodize()}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(i){if(i&&typeof i._extendedByPrototype=="undefined"){var h=i.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(i,Element.Methods);b(i,Element.Methods.Simulated);b(i,Element.Methods.ByTag[h.toUpperCase()])}}return i}}return Prototype.K}var a={},f=Element.Methods.ByTag;var g=Object.extend(function(j){if(!j||typeof j._extendedByPrototype!="undefined"||j.nodeType!=1||j==window){return j}var h=Object.clone(a),i=j.tagName.toUpperCase();if(f[i]){Object.extend(h,f[i])}b(j,h);j._extendedByPrototype=Prototype.emptyFunction;return j},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});g.refresh();return g})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var j=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(h)}else{h(b)}}function h(l){l=l.toUpperCase();if(!Element.Methods.ByTag[l]){Element.Methods.ByTag[l]={}}Object.extend(Element.Methods.ByTag[l],c)}function a(n,m,l){l=l||false;for(var p in n){var o=n[p];if(!Object.isFunction(o)){continue}if(!l||!(p in m)){m[p]=o.methodize()}}}function f(o){var l;var n={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(n[o]){l="HTML"+n[o]+"Element"}if(window[l]){return window[l]}l="HTML"+o+"Element";if(window[l]){return window[l]}l="HTML"+o.capitalize()+"Element";if(window[l]){return window[l]}var m=document.createElement(o);var p=m.__proto__||m.constructor.prototype;m=null;return p}var i=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(j.ElementExtensions){a(Element.Methods,i);a(Element.Methods.Simulated,i,true)}if(j.SpecificElementExtensions){for(var k in Element.Methods.ByTag){var g=f(k);if(Object.isUndefined(g)){continue}a(d[k],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(b){var h=Prototype.Browser,f=document,c,d={};function a(){if(h.WebKit&&!f.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(i){if(!c){c=a()}d[i]="client"+i;b["get"+i]=function(){return c[d[i]]};return b["get"+i]()}b.getWidth=g.curry("Width");b.getHeight=g.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=[Element.Storage.UID++]}a=b._prototypeUID[0]}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,c){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,c)}return b},retrieve:function(c,b,a){if(!(c=$(c))){return}var f=Element.getStorage(c),d=f.get(b);if(Object.isUndefined(d)){f.set(b,a);d=a}return d},clone:function(c,a){if(!(c=$(c))){return}var f=c.cloneNode(a);f._prototypeUID=void 0;if(a){var d=Element.select(f,"*"),b=d.length;while(b--){d[b]._prototypeUID=void 0}}return Element.extend(f)}});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 f=false;if(document.evaluate&&window.XPathResult){var d=document.createElement("div");d.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var c=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var b=document.evaluate(c,d,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);f=(b.snapshotLength!==2);d=null}return f})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var b=this.expression;if(Prototype.Browser.WebKit&&(b.include("-of-type")||b.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(b)){return false}if(a){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(a){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var h=this.expression,j=Selector.patterns,c=Selector.xpath,g,b,a=j.length,d;if(Selector._cache[h]){this.xpath=Selector._cache[h];return}this.matcher=[".//*"];while(h&&g!=h&&(/\S/).test(h)){g=h;for(var f=0;f<a;f++){d=j[f].name;if(b=h.match(j[f].re)){this.matcher.push(Object.isFunction(c[d])?c[d](b):new Template(c[d]).evaluate(b));h=h.replace(b[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;var c=this.expression,b;switch(this.mode){case"selectorsAPI":if(a!==document){var d=a.id,f=$(a).identify();f=f.replace(/([\.:])/g,"\\$1");c="#"+f+" "+c}b=$A(a.querySelectorAll(c)).map(Element.extend);a.id=d;return b;case"xpath":return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(k){this.tokens=[];var q=this.expression,a=Selector.patterns,f=Selector.assertions;var b,d,g,o=a.length,c;while(q&&b!==q&&(/\S/).test(q)){b=q;for(var j=0;j<o;j++){d=a[j].re;c=a[j].name;if(g=q.match(d)){if(f[c]){this.tokens.push([c,Object.clone(g)]);q=q.replace(g[0],"")}else{return this.findElements(document).include(k)}}}}var n=true,c,l;for(var j=0,h;h=this.tokens[j];j++){c=h[0],l=h[1];if(!Selector.assertions[c](k,l)){n=false;break}}return n},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var c=document.createElement("div"),a=document.createElement("span");c.id="prototype_test_id";a.className="Test";c.appendChild(a);var b=(c.querySelector("#prototype_test_id .test")!==null);c=a=null;return b})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return""}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();return new Template("[@#{1}]").evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return""}if(Object.isFunction(b)){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(f){var j=f[6],c=Selector.patterns,k=Selector.xpath,a,l,h=c.length,b;var d=[];while(j&&a!=j&&(/\S/).test(j)){a=j;for(var g=0;g<h;g++){b=c[g].name;if(f=j.match(c[g].re)){l=Object.isFunction(k[b])?k[b](f):new Template(k[b]).evaluate(f);d.push("("+l.substring(1,l.length-1)+")");j=j.replace(f[0],"");break}}}return"[not("+d.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(h,f){var i,j=f[6],d;if(j=="even"){j="2n+0"}if(j=="odd"){j="2n+1"}if(i=j.match(/^(\d+)$/)){return"["+h+"= "+i[1]+"]"}if(i=j.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(i[1]=="-"){i[1]=-1}var g=i[1]?Number(i[1]):1;var c=i[2]?Number(i[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:h,a:g,b:c})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(b,c){var a=Element.readAttribute(b,c[1]);return a&&Selector.operators[c[2]](a,c[5]||c[6])}},handlers:{concat:function(d,c){for(var f=0,g;g=c[f];f++){d.push(g)}return d},mark:function(a){var d=Prototype.emptyFunction;for(var b=0,c;c=a[b];b++){c._countedByPrototype=d}return a},unmark:(function(){var a=(function(){var b=document.createElement("div"),f=false,d="_countedByPrototype",c="x";b[d]=c;f=(b.getAttribute(d)===c);b=null;return f})();return a?function(b){for(var c=0,d;d=b[c];c++){d.removeAttribute("_countedByPrototype")}return b}:function(b){for(var c=0,d;d=b[c];c++){d._countedByPrototype=void 0}return b}})(),index:function(a,d,h){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,f=b.length-1,c=1;f>=0;f--){var g=b[f];if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=c++}}}else{for(var f=0,c=1,b=a.childNodes;g=b[f];f++){if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],f;for(var c=0,a=b.length;c<a;c++){if(typeof(f=b[c])._countedByPrototype=="undefined"){f._countedByPrototype=Prototype.emptyFunction;d.push(Element.extend(f))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],f;f=a[c];c++){d.concat(b,f.getElementsByTagName("*"))}return b},child:function(a){var f=Selector.handlers;for(var d=0,c=[],g;g=a[d];d++){for(var b=0,k;k=g.childNodes[b];b++){if(k.nodeType==1&&k.tagName!="!"){c.push(k)}}}return c},adjacent:function(a){for(var c=0,b=[],f;f=a[c];c++){var d=this.nextElementSibling(f);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],f;f=a[c];c++){d.concat(b,Element.nextSiblings(f))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(a,k,c,b){var l=c.toUpperCase();var f=[],j=Selector.handlers;if(a){if(b){if(b=="descendant"){for(var g=0,d;d=a[g];g++){j.concat(f,d.getElementsByTagName(c))}return f}else{a=this[b](a)}if(c=="*"){return a}}for(var g=0,d;d=a[g];g++){if(d.tagName.toUpperCase()===l){f.push(d)}}return f}else{return k.getElementsByTagName(c)}},id:function(a,m,b,c){var l=$(b),k=Selector.handlers;if(m==document){if(!l){return[]}if(!a){return[l]}}else{if(!m.sourceIndex||m.sourceIndex<1){var a=m.getElementsByTagName("*");for(var f=0,d;d=a[f];f++){if(d.id===b){return[d]}}}}if(a){if(c){if(c=="child"){for(var g=0,d;d=a[g];g++){if(l.parentNode==d){return[l]}}}else{if(c=="descendant"){for(var g=0,d;d=a[g];g++){if(Element.descendantOf(l,d)){return[l]}}}else{if(c=="adjacent"){for(var g=0,d;d=a[g];g++){if(Selector.handlers.previousElementSibling(l)==d){return[l]}}}else{a=k[c](a)}}}}for(var g=0,d;d=a[g];g++){if(d==l){return[l]}}return[]}return(l&&Element.descendantOf(l,m))?[l]:[]},className:function(b,a,c,d){if(b&&d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,g){if(!c){c=Selector.handlers.descendant([b])}var j=" "+g+" ";for(var f=0,d=[],h,a;h=c[f];f++){a=h.className;if(a.length==0){continue}if(a==g||(" "+a+" ").include(j)){d.push(h)}}return d},attrPresence:function(c,b,a,h){if(!c){c=b.getElementsByTagName("*")}if(c&&h){c=this[h](c)}var f=[];for(var d=0,g;g=c[d];d++){if(Element.hasAttribute(g,a)){f.push(g)}}return f},attr:function(a,k,j,l,c,b){if(!a){a=k.getElementsByTagName("*")}if(a&&b){a=this[b](a)}var m=Selector.operators[c],g=[];for(var f=0,d;d=a[f];f++){var h=Element.readAttribute(d,j);if(h===null){continue}if(m(h,l)){g.push(d)}}return g},pseudo:function(b,c,f,a,d){if(b&&d){b=this[d](b)}if(!b){b=a.getElementsByTagName("*")}return Selector.pseudos[c](b,f,a)}},pseudos:{"first-child":function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(Selector.handlers.previousElementSibling(f)){continue}c.push(f)}return c},"last-child":function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(Selector.handlers.nextElementSibling(f)){continue}c.push(f)}return c},"only-child":function(b,j,a){var f=Selector.handlers;for(var d=0,c=[],g;g=b[d];d++){if(!f.previousElementSibling(g)&&!f.nextElementSibling(g)){c.push(g)}}return c},"nth-child":function(b,c,a){return Selector.pseudos.nth(b,c,a)},"nth-last-child":function(b,c,a){return Selector.pseudos.nth(b,c,a,true)},"nth-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)},"nth-last-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)},"first-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,false,true)},"last-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,true,true)},"only-of-type":function(b,d,a){var c=Selector.pseudos;return c["last-of-type"](c["first-of-type"](b,d,a),d,a)},getIndices:function(d,c,f){if(d==0){return c>0?[c]:[]}return $R(1,f).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)}return a})},nth:function(c,u,w,t,f){if(c.length==0){return[]}if(u=="even"){u="2n+0"}if(u=="odd"){u="2n+1"}var r=Selector.handlers,q=[],d=[],k;r.mark(c);for(var p=0,g;g=c[p];p++){if(!g.parentNode._countedByPrototype){r.index(g.parentNode,t,f);d.push(g.parentNode)}}if(u.match(/^\d+$/)){u=Number(u);for(var p=0,g;g=c[p];p++){if(g.nodeIndex==u){q.push(g)}}}else{if(k=u.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(k[1]=="-"){k[1]=-1}var x=k[1]?Number(k[1]):1;var v=k[2]?Number(k[2]):0;var y=Selector.pseudos.getIndices(x,v,c.length);for(var p=0,g,n=y.length;g=c[p];p++){for(var o=0;o<n;o++){if(g.nodeIndex==y[o]){q.push(g)}}}}}r.unmark(c);r.unmark(d);return q},empty:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(f.tagName=="!"||f.firstChild){continue}c.push(f)}return c},not:function(a,d,l){var j=Selector.handlers,n,c;var k=new Selector(d).findElements(l);j.mark(k);for(var g=0,f=[],b;b=a[g];g++){if(!b._countedByPrototype){f.push(b)}}j.unmark(k);return f},enabled:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(!f.disabled&&(!f.type||f.type!=="hidden")){c.push(f)}}return c},disabled:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(f.disabled){c.push(f)}}return c},checked:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(f.checked){c.push(f)}}return c}},operators:{"=":function(b,a){return b==a},"!=":function(b,a){return b!=a},"^=":function(b,a){return b==a||b&&b.startsWith(a)},"$=":function(b,a){return b==a||b&&b.endsWith(a)},"*=":function(b,a){return b==a||b&&b.include(a)},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ")},"|=":function(b,a){return("-"+(b||"").toUpperCase()+"-").include("-"+(a||"").toUpperCase()+"-")}},split:function(b){var a=[];b.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){a.push(c[1].strip())});return a},matchElements:function(g,j){var f=$$(j),d=Selector.handlers;d.mark(f);for(var c=0,b=[],a;a=g[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(f);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(f,j){j=Selector.split(j.join(","));var d=[],g=Selector.handlers;for(var c=0,b=j.length,a;c<b;c++){a=new Selector(j[c].strip());g.concat(d,a.findElements(f))}return(b>1)?g.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var f=0,g;g=c[f];f++){if(g.tagName!=="!"){d.push(g)}}return d}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(h,b){if(typeof b!="object"){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,g,a=false,f=b.submit;var d=h.inject({},function(i,j){if(!j.disabled&&j.name){c=j.name;g=$(j).getValue();if(g!=null&&j.type!="file"&&(j.type!="submit"||(!a&&f!==false&&(!f||c==f)&&(a=true)))){if(c in i){if(!Object.isArray(i[c])){i[c]=[i[c]]}i[c].push(g)}else{i[c]=g}}}return i});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var g=$(f).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;for(var b=0;d=g[b];b++){a.push(d)}return a.inject([],function(h,i){if(c[i.tagName.toLowerCase()]){h.push(Element.extend(i))}return h})},getInputs:function(h,c,d){h=$(h);var a=h.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var f=0,j=[],g=a.length;f<g;f++){var b=a[f];if((c&&b.type!=c)||(d&&b.name!=d)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null}else{a.checked=!!b}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value}else{a.value=b}},select:function(c,g){if(Object.isUndefined(g)){return this[c.type=="select-one"?"selectOne":"selectMany"](c)}else{var b,d,h=!Object.isArray(g);for(var a=0,f=c.length;a<f;a++){b=c.options[a];d=this.optionValue(b);if(h){if(d==g){b.selected=true;return}}else{b.selected=g.include(d)}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,f=d.length;if(!f){return null}for(var c=0,a=[];c<f;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var x={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var f=document.documentElement;var y="onmouseenter" in f&&"onmouseleave" in f;var p;if(Prototype.Browser.IE){var i={0:1,1:4,2:2};p=function(A,z){return A.button===i[z]}}else{if(Prototype.Browser.WebKit){p=function(A,z){switch(z){case 0:return A.which==1&&!A.metaKey;case 1:return A.which==1&&A.metaKey;default:return false}}}else{p=function(A,z){return A.which?(A.which===z+1):(A.button===z)}}}function t(z){return p(z,0)}function r(z){return p(z,1)}function l(z){return p(z,2)}function c(B){B=x.extend(B);var A=B.target,z=B.type,C=B.currentTarget;if(C&&C.tagName){if(z==="load"||z==="error"||(z==="click"&&C.tagName.toLowerCase()==="input"&&C.type==="radio")){A=C}}if(A.nodeType==Node.TEXT_NODE){A=A.parentNode}return Element.extend(A)}function n(A,C){var z=x.element(A);if(!C){return z}var B=[z].concat(z.ancestors());return Selector.findElement(B,C,0)}function q(z){return{x:b(z),y:a(z)}}function b(B){var A=document.documentElement,z=document.body||{scrollLeft:0};return B.pageX||(B.clientX+(A.scrollLeft||z.scrollLeft)-(A.clientLeft||0))}function a(B){var A=document.documentElement,z=document.body||{scrollTop:0};return B.pageY||(B.clientY+(A.scrollTop||z.scrollTop)-(A.clientTop||0))}function o(z){x.extend(z);z.preventDefault();z.stopPropagation();z.stopped=true}x.Methods={isLeftClick:t,isMiddleClick:r,isRightClick:l,element:c,findElement:n,pointer:q,pointerX:b,pointerY:a,stop:o};var v=Object.keys(x.Methods).inject({},function(z,A){z[A]=x.Methods[A].methodize();return z});if(Prototype.Browser.IE){function h(A){var z;switch(A.type){case"mouseover":z=A.fromElement;break;case"mouseout":z=A.toElement;break;default:return null}return Element.extend(z)}Object.extend(v,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});x.extend=function(A,z){if(!A){return false}if(A._extendedByPrototype){return A}A._extendedByPrototype=Prototype.emptyFunction;var B=x.pointer(A);Object.extend(A,{target:A.srcElement||z,relatedTarget:h(A),pageX:B.x,pageY:B.y});return Object.extend(A,v)}}else{x.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(x.prototype,v);x.extend=Prototype.K}function m(D,C,E){var B=Element.retrieve(D,"prototype_event_registry");if(Object.isUndefined(B)){d.push(D);B=Element.retrieve(D,"prototype_event_registry",$H())}var z=B.get(C);if(Object.isUndefined(z)){z=[];B.set(C,z)}if(z.pluck("handler").include(E)){return false}var A;if(C.include(":")){A=function(F){if(Object.isUndefined(F.eventName)){return false}if(F.eventName!==C){return false}x.extend(F,D);E.call(D,F)}}else{if(!y&&(C==="mouseenter"||C==="mouseleave")){if(C==="mouseenter"||C==="mouseleave"){A=function(G){x.extend(G,D);var F=G.relatedTarget;while(F&&F!==D){try{F=F.parentNode}catch(H){F=D}}if(F===D){return}E.call(D,G)}}}else{A=function(F){x.extend(F,D);E.call(D,F)}}}A.handler=E;z.push(A);return A}function g(){for(var z=0,A=d.length;z<A;z++){x.stopObserving(d[z]);d[z]=null}}var d=[];if(Prototype.Browser.IE){window.attachEvent("onunload",g)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var k=Prototype.K;if(!y){k=function(A){var z={mouseenter:"mouseover",mouseleave:"mouseout"};return A in z?z[A]:A}}function u(C,B,D){C=$(C);var A=m(C,B,D);if(!A){return C}if(B.include(":")){if(C.addEventListener){C.addEventListener("dataavailable",A,false)}else{C.attachEvent("ondataavailable",A);C.attachEvent("onfilterchange",A)}}else{var z=k(B);if(C.addEventListener){C.addEventListener(z,A,false)}else{C.attachEvent("on"+z,A)}}return C}function j(E,C,F){E=$(E);var B=Element.retrieve(E,"prototype_event_registry");if(Object.isUndefined(B)){return E}if(C&&!F){var D=B.get(C);if(Object.isUndefined(D)){return E}D.each(function(G){Element.stopObserving(E,C,G.handler)});return E}else{if(!C){B.each(function(I){var G=I.key,H=I.value;H.each(function(J){Element.stopObserving(E,G,J.handler)})});return E}}var D=B.get(C);if(!D){return}var A=D.find(function(G){return G.handler===F});if(!A){return E}var z=k(C);if(C.include(":")){if(E.removeEventListener){E.removeEventListener("dataavailable",A,false)}else{E.detachEvent("ondataavailable",A);E.detachEvent("onfilterchange",A)}}else{if(E.removeEventListener){E.removeEventListener(z,A,false)}else{E.detachEvent("on"+z,A)}}B.set(C,D.without(A));return E}function w(C,B,A,z){C=$(C);if(Object.isUndefined(z)){z=true}if(C==document&&document.createEvent&&!C.dispatchEvent){C=document.documentElement}var D;if(document.createEvent){D=document.createEvent("HTMLEvents");D.initEvent("dataavailable",true,true)}else{D=document.createEventObject();D.eventType=z?"ondataavailable":"onfilterchange"}D.eventName=B;D.memo=A||{};if(document.createEvent){C.dispatchEvent(D)}else{C.fireEvent(D.eventType,D)}return x.extend(D)}Object.extend(x,x.Methods);Object.extend(x,{fire:w,observe:u,stopObserving:j});Element.addMethods({fire:w,observe:u,stopObserving:j});Object.extend(document,{fire:w.methodize(),observe:u.methodize(),stopObserving:j.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,x)}else{window.Event=x}})();(function(){var d;function a(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){d=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",c);if(window==top){d=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,f){f=f.toString().strip();var d=/\s/.test(f)?$w(f).map(a).join(""):a(f);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(f,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&&!g){return h}var c=$(f).getElementsByTagName("*");g=" "+g+" ";for(var d=0,l,k;l=c[d];d++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(i){return !i.toString().blank()&&k.include(" "+i+" ")})))){h.push(Element.extend(l))}}return h};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};Array.prototype.call=function(){var a=arguments;this.each(function(b){b.apply(this,a)})};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(a){if(typeof Builder=="undefined"){throw ("Effect.tagifyText requires including script.aculo.us' builder.js library")}var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(Builder.node("span",{style:b},d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var f;if(((typeof b=="object")||(typeof b=="function"))&&(b.length)){f=b}else{f=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(f).each(function(h,g){new c(h,Object.extend(a,{delay:g*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);c=(c||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)}};var Effect2=Effect;Effect.Transitions={linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return(a>1?1:a)},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){a=a||5;return(Math.round((b%(1/a))*a)==0?((b*a*2)-Math.floor(b*a*2)):1-((b*a*2)-Math.floor(b*a*2)))},none:function(a){return 0},full:function(a){return 1}};Effect.ScopedQueue=Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=(typeof b.options.queue=="string")?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(typeof a!="string"){return a}if(!this.instances[a]){this.instances[a]=new Effect.ScopedQueue()}return this.instances[a]}};Effect.Queue=Effect.Queues.get("global");Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"};Effect.Base=function(){};Effect.Base.prototype={position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if(this.state=="idle"){this.state="running";'+codeForEvent(options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(options,"afterSetup")+'};if(this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=Math.round(b*this.totalFrames);if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(typeof this[property]!="function"){a[property]=this[property]}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Event=Class.create();Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var a=Object.extend({duration:0},arguments[0]||{});this.start(a)},update:Prototype.emptyFunction});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:Math.round(this.options.x*a+this.originalLeft)+"px",top:Math.round(this.options.y*a+this.originalTop)+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,f){var g={};if(this.options.scaleX){g.width=Math.round(f)+"px"}if(this.options.scaleY){g.height=Math.round(a)+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-c+"px"}if(this.options.scaleX){g.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){g.top=-c+"px"}if(this.options.scaleX){g.left=-b+"px"}}}this.element.setStyle(g)}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+(Math.round(this._base[d]+(this._delta[d]*a)).toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);this.start(arguments[1]||{})},setup:function(){Position.prepare();var b=Position.cumulativeOffset(this.element);if(this.options.offset){b[1]+=this.options.offset}var a=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(b[1]>a?a:b[1])-this.scrollStart},update:function(a){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(a*this.delta))}});Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left")};return new Effect.Move(b,{x:20,y:0,duration:0.05,afterFinishInternal:function(c){new Effect.Move(c.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(d){new Effect.Move(d.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(g){new Effect.Move(g.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(i){i.element.undoPositioned().setStyle(a)}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(b){b=$(b).cleanWhitespace();var a=b.down().getStyle("bottom");return new Effect.Scale(b,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(c){c.element.makePositioned();c.element.down().makePositioned();if(window.opera){c.element.setStyle({top:""})}c.element.makeClipping().show()},afterUpdateInternal:function(c){c.element.down().setStyle({bottom:(c.dims[0]-c.element.clientHeight)+"px"})},afterFinishInternal:function(c){c.element.hide().undoClipping().undoPositioned().setStyle({bottom:a});c.element.down().undoPositioned()}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var h=c.getDimensions();var i,g;var f,d;switch(b.direction){case"top-left":i=g=f=d=0;break;case"top-right":i=h.width;g=d=0;f=-h.width;break;case"bottom-left":i=f=0;g=h.height;d=-h.height;break;case"bottom-right":i=h.width;g=h.height;f=-h.width;d=-h.height;break;case"center":i=h.width/2;g=h.height/2;f=-h.width/2;d=-h.height/2;break}return new Effect.Move(c,{x:i,y:g,duration:0.01,beforeSetup:function(j){j.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(j){new Effect.Parallel([new Effect.Opacity(j.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(j.element,{x:f,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(j.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(k){k.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(k){k.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var f,d;switch(b.direction){case"top-left":f=d=0;break;case"top-right":f=g.width;d=0;break;case"bottom-left":f=0;d=g.height;break;case"bottom-right":f=g.width;d=g.height;break;case"center":f=g.width/2;d=g.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:f,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(h){h.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(h){h.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{};var a=c.getInlineOpacity();var f=b.transition||Effect.Transitions.sinoidal;var d=function(g){return f(1-Effect.Transitions.pulse(g,b.pulses))};d.bind(f);return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create();Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(typeof b.style=="string"){if(b.style.indexOf(":")==-1){var d="",a="."+b.style;$A(document.styleSheets).reverse().each(function(f){if(f.cssRules){cssRules=f.cssRules}else{if(f.rules){cssRules=f.rules}}$A(cssRules).reverse().each(function(g){if(a==g.selectorText){d=g.style.cssText;throw $break}});if(d){throw $break}});this.style=d.parseStyle();b.afterFinishInternal=function(f){f.element.addClassName(f.options.style);f.transforms.each(function(g){if(g.style!="opacity"){f.element.style[g.style]=""}})}}else{this.style=b.style.parseStyle()}}else{this.style=$H(b.style)}this.start(b)},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(h){var g=h[0],f=h[1],d=null;if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();d="color"}else{if(g=="opacity"){f=parseFloat(f);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(f)){var c=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);f=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(g);return{style:g.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(f):f,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():b.originalValue+Math.round(((b.targetValue-b.originalValue)*a)*1000)/1000+b.unit}this.element.setStyle(d,true)}});Effect.Transform=Class.create();Object.extend(Effect.Transform.prototype,{initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){var c=$H(b).values().first();this.tracks.push($H({ids:$H(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.ids)||$$(a.ids)].flatten();return b.map(function(c){return new a.effect(c,Object.extend({sync:true},a.options))})}).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.prototype.parseStyle=function(){var b=document.createElement("div");b.innerHTML='<div style="'+this+'"></div>';var c=b.childNodes[0].style,a=$H();Element.CSS_PROPERTIES.each(function(d){if(c[d]){a[d]=c[d]}});if(Prototype.Browser.IE&&this.indexOf("opacity")>-1){a.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]}return a};Element.morph=function(a,b){new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a};["getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(a){Element.Methods[a]=Element[a]});Element.Methods.visualEffect=function(b,c,a){s=c.dasherize().camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](b,a);return $(b)};Element.addMethods();var Scriptaculous={Version:"1.8.3",require:function(b){try{document.write('<script type="text/javascript" src="'+b+'"><\/script>')}catch(c){var a=document.createElement("script");a.type="text/javascript";a.src=b;document.getElementsByTagName("head")[0].appendChild(a)}},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function a(c){var d=c.replace(/_.*|\./g,"");d=parseInt(d+"0".times(4-d.length));return c.indexOf("_")>-1?d-1:d}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)}var b=/scriptaculous\.js(\?.*)?$/;$$("head script[src]").findAll(function(c){return c.src.match(b)}).each(function(d){var f=d.src.replace(b,""),c=d.src.match(/\?.*load=([a-z,]*)/);(c?c[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(g){Scriptaculous.require(f+g+".js")})})}};Scriptaculous.load();var fx=new Object();fx.Base=function(){};fx.Base.prototype={setOptions:function(a){this.options={duration:500,onComplete:"",transition:fx.sinoidal};Object.extend(this.options,a||{})},step:function(){var b=(new Date).getTime();if(b>=this.options.duration+this.startTime){this.now=this.to;clearInterval(this.timer);this.timer=null;if(this.options.onComplete){setTimeout(this.options.onComplete.bind(this),10)}}else{var a=(b-this.startTime)/(this.options.duration);this.now=this.options.transition(a)*(this.to-this.from)+this.from}this.increase()},custom:function(b,a){if(this.timer!=null){return}this.from=b;this.to=a;this.startTime=(new Date).getTime();this.timer=setInterval(this.step.bind(this),13)},hide:function(){this.now=0;this.increase()},clearTimer:function(){clearInterval(this.timer);this.timer=null}};fx.Layout=Class.create();fx.Layout.prototype=Object.extend(new fx.Base(),{initialize:function(b,a){this.el=$(b);this.el.style.overflow="hidden";this.iniWidth=this.el.offsetWidth;this.iniHeight=this.el.offsetHeight;this.setOptions(a)}});fx.Height=Class.create();Object.extend(Object.extend(fx.Height.prototype,fx.Layout.prototype),{increase:function(){this.el.style.height=this.now+"px"},toggle:function(){if(this.el.offsetHeight>0){this.custom(this.el.offsetHeight,0)}else{this.custom(0,this.el.scrollHeight)}}});fx.Width=Class.create();Object.extend(Object.extend(fx.Width.prototype,fx.Layout.prototype),{increase:function(){this.el.style.width=this.now+"px"},toggle:function(){if(this.el.offsetWidth>0){this.custom(this.el.offsetWidth,0)}else{this.custom(0,this.iniWidth)}}});fx.Opacity=Class.create();fx.Opacity.prototype=Object.extend(new fx.Base(),{initialize:function(b,a){this.el=$(b);this.now=1;this.increase();this.setOptions(a)},increase:function(){if(this.now==1&&(/Firefox/.test(navigator.userAgent))){this.now=0.9999}this.setOpacity(this.now)},setOpacity:function(a){if(a==0&&this.el.style.visibility!="hidden"){this.el.style.visibility="hidden"}else{if(this.el.style.visibility!="visible"){this.el.style.visibility="visible"}}if(window.ActiveXObject){this.el.style.filter="alpha(opacity="+a*100+")"}this.el.style.opacity=a},toggle:function(){if(this.now>0){this.custom(1,0)}else{this.custom(0,1)}}});fx.sinoidal=function(a){return((-Math.cos(a*Math.PI)/2)+0.5)};fx.linear=function(a){return a};fx.cubic=function(a){return Math.pow(a,3)};fx.circ=function(a){return Math.sqrt(a)};if(typeof Effect=="undefined"){throw ("lightwindow.js requires including script.aculo.us' effects.js library!")}try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var lightwindow=Class.create();lightwindow.prototype={element:null,fileExtension: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},preloadedNextImage:null,preloadedPrevImage:null,galleries:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},activeGallery:false,activeInfo:false,galleryLocation:{current:0,total:0},initialize:function(a){this.options=Object.extend({rootPath:"",loadingTxt:"loading or",cancelTxt:"cancel",playTxt:"",stopTxt:"",slowerTxt:"",fasterTxt:"",infoTabName:"Info",slideshowDuration:5000,showSlideshow:true,circular:false,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","flv","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","wmv"],image:["bmp","gif","jpg","jpeg","png","tif","tiff"]},mimeTypes:{avi:"video/avi",aif:"audio/aiff",aiff:"audio/aiff",gif:"image/gif",bmp:"image/bmp",flv:"video/x-flv",jpg:"image/jpeg",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:"video/x-ms-wmv"},classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",flv:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=7,3,0,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",flv:"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:{duration:300},skin:{main:'<div id="lightwindow_container" ><div id="lightwindow_title_bar" ><div id="lightwindow_title_bar_inner" ><span id="lightwindow_title_bar_title"></span><a id="lightwindow_title_bar_close_link" >&nbsp;X&nbsp;</a></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_info"><div id="lightwindow_info_tab_container" ><a href="#" id="lightwindow_info_tab" ><span id="lightwindow_info_tab_span" class="up" >{infoTabName} </span></a></div><div id="lightwindow_info_content" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_nav_container" ><a id="lightwindow_previous_bottom" href="#" title="">&lt;</a></div><div id="lightwindow_data_gallery_container" ><span id="lightwindow_data_gallery_current"></span> / <span id="lightwindow_data_gallery_total"></span></div><div id="lightwindow_data_nav_container" ><a id="lightwindow_next_bottom"  href="#" title="">&gt;</a></div><div id="lightwindow_data_slideshow_container" ><a id="lightwindow_slideshow_slower" href="#" ><img title="{slowerReplace}" id="lightwindow_slideshow_slower_amount" src="{rootPathReplace1}img/slower.png" alt="" width="16" height="12" /></a><a id="lightwindow_slideshow_play" href="#" ><img title="{playReplace}" src="{rootPathReplace2}img/play.png" alt="" width="16" height="12"  /></a><a id="lightwindow_slideshow_faster" href="#" ><img title="{fasterReplace}" id="lightwindow_slideshow_faster_amount" src="{rootPathReplace3}img/faster.png" alt="" width="16" height="12" /></a></div><div id="lightwindow_data_author_container" ><span id="lightwindow_data_author"></span></div></div><div id="lightwindow_data_caption" ></div></div></div></div>',loading:'<div id="lightwindow_loading" ><img src="{rootPathReplace}img/ajax-loading.gif" alt="loading" /><span>{loadingTxtReplace} <a href="javascript: myLightWindow.deactivate();">{cancelTxtReplace}</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>',playButton:'<img src="{rootPathReplace}img/play.png" alt="" width="16" height="12" title="{playReplace}" />',stopButton:'<img src="{rootPathReplace}img/pause.png" alt="" width="16" height="12" title="{stopReplace}" />'},formMethod:"get",hideFlash:false,hideIframes:false,hideInfoTab: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.slideshowDuration=this.options.slideshowDuration;this.slideshowSlower=0;this.slideshowFaster=0;this._setupLinks();this._getScroll();this._getPageDimensions();this._browserDimensions();this._addLightWindowMarkup(false);this._setupDimensions()},deactivate:function(){this.endSlideshow();this.windowActive=false;this.activeGallery=false;this.activeInfo=false;if(!this.options.hideInfoTab&&!this.infoEmpty){this._handleInfoAnimation(false)}this.animating=false;this.element=null;this._displayLightWindow("none","hidden","hide");this._clearWindowContents(false);var a=Effect.Queues.get("lightwindowAnimation").each(function(b){b.cancel()});this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false);this._monitorMouseWheel(false)},createWindow:function(b,a){this._processLink($(b))},activateWindow:function(a,b){this.element=Object.extend({href:null,title:null,author:null,info:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null,params:null},a||{});this.contentToFetch=this.element.href;this.fileExtension=this._getParameter("lightwindow_fileExtension");this.windowType=this.element.type?this.element.type:this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.fileExtension?"f."+this.fileExtension:this.element.href);if(b){this.galleries=b.galleries}this._clearWindowContents(true);this._addLoadingWindowMarkup();this._buildInfoList();this._getScroll();this._getPageDimensions();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden","show");this._setStatus(true);this._monitorKeyboard(true);this._monitorMouseWheel(true);this._loadWindow()},submitForm:function(a){if(this.options.formHandler){this.options.formHandler(a)}else{this._defaultFormHandler(a)}},openWindow:function(a){var a=$(a);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(a);this._buildInfoList();this._setStatus(true);this._handleTransition()},navigateWindow:function(a){this._handleNavigation(false);if(a=="previous"){this.openWindow(this.navigationObservers.previous)}else{if(a=="next"){this.openWindow(this.navigationObservers.next)}}},_handleSlideshow:function(){if(this.slideshowTimeout){if(this.navigationObservers.next){var a=this.slideshowDuration;var b=function(){if(this.navigationObservers.next){this.navigateWindow("next")}else{this.endSlideshow()}}.bind(this);window.clearTimeout(this.slideshowTimeout);this.slideshowTimeout=window.setTimeout(b,a);if($("lightwindow_slideshow_play")){$("lightwindow_slideshow_play").innerHTML=this.options.skin.stopButton}}else{this.endSlideshow()}}},toggleSlideshow:function(){if(this.slideshowTimeout){this.endSlideshow()}else{if(this.navigationObservers.next){this.navigateWindow("next");this.slideshowTimeout=window.setTimeout(function(){return false},0);this._handleSlideshow()}else{this.endSlideshow()}}},endSlideshow:function(){if(this.slideshowTimeout){window.clearTimeout(this.slideshowTimeout);this.slideshowTimeout=false}if($("lightwindow_slideshow_play")){$("lightwindow_slideshow_play").innerHTML=this.options.skin.playButton}},setSlideshowSlower:function(){this.slideshowDuration+=500;if(this.slideshowTimeout){this.endSlideshow()}if(this.slideshowFaster>0){this.slideshowFaster--}else{this.slideshowSlower++}this.displaySlideshowAmounts()},setSlideshowFaster:function(){if(this.slideshowDuration>=1000){this.slideshowDuration-=500;if(this.slideshowTimeout){this.endSlideshow()}if(this.slideshowSlower>0){this.slideshowSlower--}else{this.slideshowFaster++}this.displaySlideshowAmounts()}},displaySlideshowAmounts:function(){$("lightwindow_slideshow_faster_amount").setStyle({borderLeft:"solid #acacac "+this.slideshowFaster+"px"});$("lightwindow_slideshow_slower_amount").setStyle({borderRight:"solid #acacac "+this.slideshowSlower+"px"})},_buildInfoList:function(){$("lightwindow_info_content").innerHTML="";var b=$("lightwindow_info_content").firstChild;if(b){b.remove()}var a=this.element.info?this.element.info.firstChild:false;if(a){$("lightwindow_info_content").appendChild(a.cloneNode(true));this.infoEmpty=false}else{this.infoEmpty=true;this.activeInfo=false;this._handleInfoAnimation(false)}},_setupLinks:function(){var a=$$("."+this.options.classNames.standard);a.each(function(b){this._processLink(b)}.bind(this))},_processLink:function(d){var c=this._getGenericParameter("lightwindow_fileExtension",d.select(".params").length>0?d.select(".params")[0].innerHTML:"");if(gallery=this._getGalleryInfo(d.rel)){if(!this.galleries[gallery[0]]){this.galleries[gallery[0]]=new Array()}if(!this.galleries[gallery[0]][gallery[1]]){this.galleries[gallery[0]][gallery[1]]=new Array()}this.galleries[gallery[0]][gallery[1]].push(d)}var b=d.getAttribute("href");if(b.indexOf("?")>-1){b=b.substring(0,b.indexOf("?"))}var a=b.substring(b.indexOf("#")+1);if($(a)){$(a).setStyle({display:"none"})}},_setupActions:function(){var a=$$("#lightwindow_container ."+this.options.classNames.action);a.each(function(b){Event.observe(b,"click",this[b.getAttribute("rel")].bindAsEventListener(this,b),false);b.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(b){var c=Element.extend(document.createElement("div"));c.setAttribute("id","lightwindow_overlay");this.overlayEffect=new fx.Opacity(c,{duration:this.options.overlay.duration});this.overlayEffect.hide();this.options.skin.loading=(this.options.skin.loading).replace("{rootPathReplace}",this.options.rootPath);this.options.skin.loading=(this.options.skin.loading).replace("{loadingTxtReplace}",this.options.loadingTxt);this.options.skin.loading=(this.options.skin.loading).replace("{cancelTxtReplace}",this.options.cancelTxt);this.options.skin.playButton=(this.options.skin.playButton).replace("{rootPathReplace}",this.options.rootPath);this.options.skin.stopButton=(this.options.skin.stopButton).replace("{rootPathReplace}",this.options.rootPath);this.options.skin.playButton=(this.options.skin.playButton).replace("{playReplace}",this.options.playTxt);this.options.skin.stopButton=(this.options.skin.stopButton).replace("{stopReplace}",this.options.stopTxt);this.options.skin.main=(this.options.skin.main).replace("{rootPathReplace1}",this.options.rootPath);this.options.skin.main=(this.options.skin.main).replace("{rootPathReplace2}",this.options.rootPath);this.options.skin.main=(this.options.skin.main).replace("{rootPathReplace3}",this.options.rootPath);this.options.skin.main=(this.options.skin.main).replace("{playReplace}",this.options.playTxt);this.options.skin.main=(this.options.skin.main).replace("{slowerReplace}",this.options.slowerTxt);this.options.skin.main=(this.options.skin.main).replace("{fasterReplace}",this.options.fasterTxt);this.options.skin.main=(this.options.skin.main).replace("{infoTabName}",this.options.infoTabName);var d=document.createElement("div");d.setAttribute("id","lightwindow");d.innerHTML=this.options.skin.main;var a=document.getElementsByTagName("body")[0];a.appendChild(c);a.appendChild(d);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};Event.observe($("lightwindow_previous_bottom"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous_bottom").onclick=function(){return false};Event.observe($("lightwindow_next_bottom"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next_bottom").onclick=function(){return false};if(!this.options.hideInfoTab&&!this.infoEmpty){Event.observe($("lightwindow_info_tab"),"click",this._handleInfoAnimation.bind(this,true),false);$("lightwindow_info_tab").onclick=function(){return false}}if($("lightwindow_slideshow_slower")){Event.observe($("lightwindow_slideshow_slower"),"click",this.setSlideshowSlower.bind(this),false);$("lightwindow_slideshow_slower").onclick=function(){return false}}if($("lightwindow_slideshow_play")){Event.observe($("lightwindow_slideshow_play"),"click",this.toggleSlideshow.bind(this),false);$("lightwindow_slideshow_play").onclick=function(){return false}}if($("lightwindow_slideshow_faster")){Event.observe($("lightwindow_slideshow_faster"),"click",this.setSlideshowFaster.bind(this),false);$("lightwindow_slideshow_faster").onclick=function(){return false}}if(Prototype.Browser.IE){Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false)}else{Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false)}Event.observe(c,"click",this.deactivate.bindAsEventListener(this),false);c.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.options.skin.loading},_setupWindowElements:function(a){this.element=a.parentNode;this.element.title=null?"":a.getAttribute("title");this.element.rel=null?"":a.getAttribute("rel");this.element.author=this.element.getChildrenByClassName("author")[0].innerHTML;this.element.caption=this.element.getChildrenByClassName("comment")[0].innerHTML;this.element.params=this.element.getChildrenByClassName("params")[0].innerHTML;this.element.info=this.element.getChildrenByClassName("info")[0];this.contentToFetch=a.href;this.fileExtension=this._getParameter("lightwindow_fileExtension");this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.fileExtension?"f."+this.fileExtension:this.contentToFetch)},_clearWindowContents:function(a){if($("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(b){}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;if(a){Element.show("lightwindow_loading")}if(!(/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{if($("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")})}}},_stopScrolling:function(a){if(this.animating){if(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,d){if(d){var c=$("lightwindow_contents").getElementsByTagName("select")}else{var c=document.getElementsByTagName("select")}for(var b=0;b<c.length;b++){c[b].style.visibility=a}if(!d){if(this.options.hideFlash){var g=document.getElementsByTagName("object");for(b=0;b!=g.length;b++){g[b].style.visibility=a}var f=document.getElementsByTagName("embed");for(b=0;b!=f.length;b++){f[b].style.visibility=a}}if(this.options.hideIframes){var h=document.getElementsByTagName("iframe");for(b=0;b!=h.length;b++){h[b].style.visibility=a}}}},_getPageDimensions:function(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){this.pageDimensions.height=d}else{this.pageDimensions.height=a}if(c<b){this.pageDimensions.width=b}else{this.pageDimensions.width=c}},_displayLightWindow:function(d,a,b){$("lightwindow").style.display=$("lightwindow_container").style.display=d;$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=a;if(b=="show"){window.clearTimeout(this.overlayTimeout);$("lightwindow_overlay").style.height=this.pageDimensions.height+"px";this.overlayEffect.custom(0,0.8)}else{if(b=="hide"){this.overlayEffect.custom(0.8,0);var c=function(){$("lightwindow_overlay").style.height=0}.bind(this);window.clearTimeout(this.overlayTimeout);this.overlayTimeout=window.setTimeout(c,this.options.overlay.duration)}}},_setupDimensions:function(){var c,d;switch(this.windowType){case"page":c=this.options.dimensions.page.height;d=this.options.dimensions.page.width;break;case"image":c=this.options.dimensions.image.height;d=this.options.dimensions.image.width;break;case"media":c=this.options.dimensions.media.height;d=this.options.dimensions.media.width;break;case"external":c=this.options.dimensions.external.height;d=this.options.dimensions.external.width;break;case"inline":c=this.options.dimensions.inline.height;d=this.options.dimensions.inline.width;break;default:c=this.options.dimensions.page.height;d=this.options.dimensions.page.width;break}var a=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;var b=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$("lightwindow").setStyle({top:a+"px",left:b+"px"});$("lightwindow_container").setStyle({height:c+"px",width:d+"px",left:-(d/2)+"px",top:-(c/2)+"px"});$("lightwindow_contents").setStyle({height:c+"px",width:d+"px"})},_fileType:function(a){var f=new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i");if(f.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";var c=new RegExp("[^.].("+this.options.fileTypes.page.join("|")+")s*$","i");var d=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(a)){b="external"}if(d.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(c){if(c.indexOf("?")>-1){c=c.substring(0,c.indexOf("?"))}var b="";for(var a=(c.length-1);a>-1;a--){if(c.charAt(a)=="."){return b}b=c.charAt(a)+b}},_monitorKeyboard:function(a){if(a){document.onkeydown=this._eventKeypress.bind(this)}else{document.onkeydown=""}},_eventKeypress:function(b){if(b==null){var a=event.keyCode}else{var a=b.which}switch(a){case 27:this.deactivate();break;case 13:return;case 37:if(this.navigationObservers.previous){this.navigateWindow("previous")}return;case 39:if(this.navigationObservers.next){this.navigateWindow("next")}return;default:break}if(this.animating){return false}switch(String.fromCharCode(a).toLowerCase()){case"p":if(this.navigationObservers.previous){this.navigateWindow("previous")}break;case"n":if(this.navigationObservers.next){this.navigateWindow("next")}break;default:break}},_monitorMouseWheel:function(a){if(a){this.wheel=this._wheel.bind(this);if(window.addEventListener){window.addEventListener("DOMMouseScroll",this.wheel,false)}window.onmousewheel=document.onmousewheel=this.wheel}else{if(window.removeEventListener){window.removeEventListener("DOMMouseScroll",this.wheel,false)}window.onmousewheel=document.onmousewheel=""}},_wheel:function(a){if(this.animating){return false}if(!a){var a=window.event}var b=0;if(a.wheelDelta){b=a.wheelDelta/120}else{if(a.detail){b=-a.detail/3}}if(b){if(b<0){if(this.navigationObservers.next){this.navigateWindow("next")}}else{if(this.navigationObservers.previous){this.navigateWindow("previous")}}}return Event.stop(a)},_getGalleryInfo:function(a){if(!a){return false}if(a.indexOf("[")>-1){return new Array(escape(a.substring(0,a.indexOf("["))),escape(a.substring(a.indexOf("[")+1,a.indexOf("]"))))}else{return false}},_getDomain:function(f){var h=f.indexOf("//");var b=h+2;var d=f.substring(b,f.length);var a=d.indexOf("/");var g=d.substring(0,a);if(g.indexOf(":")>-1){var c=g.indexOf(":");g=g.substring(0,c)}return g},_getParameter:function(b,a){if(!this.element){return false}if(b=="lightwindow_top"&&this.element.top){return unescape(this.element.top)}else{if(b=="lightwindow_left"&&this.element.left){return unescape(this.element.left)}else{if(b=="lightwindow_type"&&this.element.type){return unescape(this.element.type)}else{if(b=="lightwindow_show_images"&&this.element.showImages){return unescape(this.element.showImages)}else{if(b=="lightwindow_height"&&this.element.height){return unescape(this.element.height)}else{if(b=="lightwindow_width"&&this.element.width){return unescape(this.element.width)}else{if(b=="lightwindow_loading_animation"&&this.element.loadingAnimation){return unescape(this.element.loadingAnimation)}else{if(b=="lightwindow_iframe_embed"&&this.element.iframeEmbed){return unescape(this.element.iframeEmbed)}else{if(b=="lightwindow_form"&&this.element.form){return unescape(this.element.form)}else{if(!a){if(this.element.params){a=this.element.params}else{return}}return this._getGenericParameter(b,a)}}}}}}}}}},_getGenericParameter:function(j,d){var g;var f=d.split(",");var c=j+"=";var h=c.length;for(var b=0;b<f.length;b++){if(f[b].substr(0,h)==c){var a=f[b].split("=");g=a[1];break}}if(!g){return false}else{return unescape(g)}},_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}},_addParamToObject:function(b,c,a,f){var d=document.createElement("param");d.setAttribute("value",c);d.setAttribute("name",b);if(f){d.setAttribute("id",f)}a.appendChild(d);return a},_outerHTML:function(a){if(Prototype.Browser.IE){return a.outerHTML}else{var c=a.cloneNode(true);var b=document.createElement("div");b.appendChild(c);return b.innerHTML}},_convertToMarkup:function(c,b){var a=this._outerHTML(c).replace("</"+b+">","");if(Prototype.Browser.IE){for(var d=0;d<c.childNodes.length;d++){a+=this._outerHTML(c.childNodes[d])}a+="</"+b+">"}return a},_appendObject:function(c,b,a){if(Prototype.Browser.IE){a.innerHTML+=this._convertToMarkup(c,b);if(this.options.EOLASFix.indexOf(this.fileExtension?this.fileExtension:this._fileExtension(this.contentToFetch))>-1){var f=document.getElementsByTagName("object");for(var d=0;d<f.length;d++){if(f[d].getAttribute("data")){f[d].removeAttribute("data")}f[d].outerHTML=f[d].outerHTML;f[d].style.visibility="visible"}}}else{a.appendChild(c)}},_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(b){var a=this.options.skin.iframe;a=a.replace("{body_replace}",b);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(a);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(a);$("lightwindow_iframe").contentDocument.close()}},_loadWindow:function(){switch(this.windowType){case"image":var f=0;var a=[];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(f=0;f<this.galleries[gallery[0]][gallery[1]].length;f++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][f].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][f-this.imageCount]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][f-this.imageCount]}else{if(this.options.circular){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][this.galleries[gallery[0]][gallery[1]].length-1]}else{this.navigationObservers.previous=false}}if(this.galleries[gallery[0]][gallery[1]][f+this.imageCount]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][f+this.imageCount]}else{if(this.options.circular){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][0]}else{this.navigationObservers.next=false}}this.activeGallery=true;this.activeInfo=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false;this.activeInfo=false}for(var c=f;c<(f+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]&&!this.options.circular){$("lightwindow_next").setStyle({display:"none"});$("lightwindow_next_bottom").setStyle({display:"none"});$("lightwindow_data_slideshow_container").setStyle({display:"none"});this.endSlideshow()}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_bottom").setStyle({display:"block"});$("lightwindow_data_slideshow_container").setStyle({display:"block"})}if(!this.galleries[gallery[0]][gallery[1]][c-this.imageCount]&&!this.options.circular){$("lightwindow_previous").setStyle({display:"none"});$("lightwindow_previous_bottom").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_bottom").setStyle({display:"block"})}}a[c]=document.createElement("img");a[c].setAttribute("id","lightwindow_image_"+c);a[c].setAttribute("border","0");a[c].setAttribute("src",this.contentToFetch);$("lightwindow_contents").appendChild(a[c]);this.checkImage[c]=new PeriodicalExecuter(function(j){var h;if(Prototype.Browser.IE||Prototype.Browser.Opera){h=$("lightwindow_image_"+j).complete}else{h=typeof $("lightwindow_image_"+j).naturalWidth!="undefined"&&$("lightwindow_image_"+j).naturalWidth!=0}if(h){this.checkImage[j].stop();var g=$("lightwindow_image_"+j).getHeight();if(g>this.resizeTo.height){this.resizeTo.height=g}this.resizeTo.width+=$("lightwindow_image_"+j).getWidth();this.imageCount--;$("lightwindow_image_"+j).setStyle({height:"100%",width:"100%"});if(this.imageCount==0){this._processWindow()}}}.bind(this,c),0.1)}break;case"media":this._defaultNavigationHandling();this.resizeTo.height=this.resizeTo.width=0;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._defaultNavigationHandling();this._appendIframe("auto");this.resizeTo.height=this._getParameter("lightwindow_height")?this._getParameter("lightwindow_height"):this.dimensions.viewport.height;this.resizeTo.width=this._getParameter("lightwindow_width")?this._getParameter("lightwindow_width"):this.dimensions.viewport.width;this._processWindow();break;case"page":var b=new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(g){$("lightwindow_contents").innerHTML+=g.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":var d=this.contentToFetch;if(d.indexOf("?")>-1){d=d.substring(0,d.indexOf("?"))}d=d.substring(d.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(d).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:window.location=this.contentToFetch;this._defaultNavigationHandling();this.resizeTo.height=this._getParameter("lightwindow_height")?this._getParameter("lightwindow_height"):this.dimensions.viewport.height;this.resizeTo.width=this._getParameter("lightwindow_width")?this._getParameter("lightwindow_width"):this.dimensions.viewport.width;this._processWindow();break}},_defaultNavigationHandling:function(){var a=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}}if(this.galleries[gallery[0]][gallery[1]][a-1]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][a-1]}else{if(this.options.circular){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][this.galleries[gallery[0]][gallery[1]].length-1]}else{this.navigationObservers.previous=false}}if(this.galleries[gallery[0]][gallery[1]][a+1]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][a+1]}else{if(this.options.circular){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][0]}else{this.navigationObservers.next=false}}this.activeGallery=true;this.activeInfo=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false;this.activeInfo=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]&&!this.options.circular){$("lightwindow_next").setStyle({display:"none"});$("lightwindow_next_bottom").setStyle({display:"none"});$("lightwindow_data_slideshow_container").setStyle({display:"none"});this.endSlideshow()}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_bottom").setStyle({display:"block"});$("lightwindow_data_slideshow_container").setStyle({display:"block"})}if(!this.galleries[gallery[0]][gallery[1]][a-1]&&!this.options.circular){$("lightwindow_previous").setStyle({display:"none"});$("lightwindow_previous_bottom").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_bottom").setStyle({display:"block"})}}},_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=Math.round(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=Math.round(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){var b=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=Math.round(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=Math.round(this.resizeTo.width/b);$("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 b={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 a={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.containerChange={height:b.height-a.height,width:b.width-a.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();if(!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"});if(!this.options.showSlideshow){$("lightwindow_data_slideshow_container").setStyle({display:"none"})}this._displayLightWindow("block","visible","");this._animateLightWindow()},_animateLightWindow:function(){if(this.options.animationHandler){this.options.animationHandler().bind(this)}else{this._defaultAnimationHandler()}},_handleNavigation:function(a){if(this.options.navigationHandler){this.options.navigationHandler().bind(this,a)}else{this._defaultDisplayNavigation(a)}},_handleTransition:function(){if(this.options.transitionHandler){this.options.transitionHandler().bind(this)}else{this._defaultTransitionHandler()}},_handleFinalWindowAnimation:function(a){if(this.options.finalAnimationHandler){this.options.finalAnimationHandler().bind(this,a)}else{this._defaultfinalWindowAnimationHandler(a)}},_handleInfoAnimation:function(a){this._defaultInfoAnimationHandler(a)},_defaultDisplayNavigation:function(a){if(a){if(this.windowType=="image"){$("lightwindow_navigation").setStyle({display:"block",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.options.dimensions.titleHeight+"px"})}else{$("lightwindow_navigation").setStyle({display:"none",height:"auto",width:"auto"})}}else{$("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.hideInfoTab&&!this.infoEmpty){this._handleInfoAnimation(false);if($("lightwindow_info_tab_container").getHeight()==0){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_info_tab_container",{sync:true,style:{height:"20px",marginTop:"0px"}}));$("lightwindow_info").setStyle({width:"0px"})}}var a=false;var b=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;if(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.05,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){if(!this.options.hideInfoTab&&!this.infoEmpty){$("lightwindow_info").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}if(!a&&this.dimensions.dataEffects.length>0){new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){if(!this.options.hideInfoTab&&!this.infoEmpty){$("lightwindow_info").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"}})}},_preloadImage:function(){if(this.navigationObservers.next){if(!this.preloadedNextImage||this.preloadedNextImage.src!=this.navigationObservers.next){this.preloadedNextImage=new Image();this.preloadedNextImage.src=this.navigationObservers.next}}if(this.navigationObservers.previous){if(!this.preloadedPrevImage||this.preloadedPrevImage.src!=this.navigationObservers.previous){this.preloadedPrevImage=new Image();this.preloadedPrevImage.src=this.navigationObservers.previous}}},_defaultfinalWindowAnimationHandler:function(a){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._handleNavigation(this.activeGallery);this._defaultInfoAnimationHandler();this._handleSlideshow();this._setStatus(false);this._preloadImage()}else{Effect.Fade("lightwindow_loading",{duration:0.25,delay:0.05,afterFinish:function(){if(this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"){$("lightwindow_contents").setStyle({overflow:"auto"})}this._handleNavigation(this.activeGallery);this._defaultInfoAnimationHandler();this._handleSlideshow();this._setStatus(false);this._preloadImage()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultInfoAnimationHandler:function(a){return false},_defaultTransitionHandler:function(){this.dimensions.dataEffects=[];if($("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.hideInfoTab&&!this.infoEmpty){if($("lightwindow_info").getHeight()!=0&&!this.options.hideInfoTab&&!this.infoEmpty){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_info_tab_container",{sync:true,style:{height:"0px",marginTop:"20px"}}))}if($("lightwindow_info_content").getHeight()!=0){$("lightwindow_info_tab_span").className="up";this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_info_content",{sync:true,style:{height:"0px"},transition:Effect.Transitions.sinoidal,beforeStart:function(){$("lightwindow_info_content").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_info_content").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(d){var b=Event.element(d).parentNode;var c=Form.serialize(this._getParameter("lightwindow_form",b.getAttribute("params")));if(this.options.formMethod=="post"){var a=new Ajax.Request(b.href,{method:"post",postBody:c,onComplete:this.openWindow.bind(this,b)})}else{if(this.options.formMethod=="get"){var a=new Ajax.Request(b.href,{method:"get",parameters:c,onComplete:this.openWindow.bind(this,b)})}}},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.contentToFetch);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var b=document.createElement("object");b.setAttribute("classid",this.options.classids[this.fileExtension?this.fileExtension:this._fileExtension(this.contentToFetch)]);b.setAttribute("codebase",this.options.codebases[this.fileExtension?this.fileExtension:this._fileExtension(this.contentToFetch)]);b.setAttribute("id","lightwindow_media_primary");b.setAttribute("name","lightwindow_media_primary");b.setAttribute("width",this.resizeTo.width);b.setAttribute("height",this.resizeTo.height);b=this._addParamToObject("movie",this.contentToFetch,b);b=this._addParamToObject("src",this.contentToFetch+"?width="+this.resizeTo.width+"&height="+this.resizeTo.height,b);b=this._addParamToObject("controller","true",b);b=this._addParamToObject("wmode","window",b);b=this._addParamToObject("cache","false",b);b=this._addParamToObject("quality","high",b);if(!Prototype.Browser.IE){var a=document.createElement("object");a.setAttribute("type",this.options.mimeTypes[this.fileExtension?this.fileExtension:this._fileExtension(this.contentToFetch)]);a.setAttribute("data",this.contentToFetch+"?width="+this.resizeTo.width+"&height="+this.resizeTo.height);a.setAttribute("id","lightwindow_media_secondary");a.setAttribute("name","lightwindow_media_secondary");a.setAttribute("width",this.resizeTo.width);a.setAttribute("height",this.resizeTo.height);a=this._addParamToObject("controller","true",a);a=this._addParamToObject("wmode","window",a);a=this._addParamToObject("cache","false",a);a=this._addParamToObject("quality","high",a);b.appendChild(a)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(b,"object"))}else{this._appendObject(b,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}else{this._handleFinalWindowAnimation(0)}}this._setupActions()}};lightWindowLoaded=true;

