var Prototype={Version:"1.5.1.1",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:(document.createElement("div").__proto__!==document.createElement("form").__proto__)},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(b){return b}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(f,g){for(var d in g){f[d]=g[d]}return f};Object.extend(Object,{inspect:function(d){try{if(d===undefined){return"undefined"}if(d===null){return"null"}return d.inspect?d.inspect():d.toString()}catch(c){if(c instanceof RangeError){return"..."}throw c}},toJSON:function(h){var k=typeof h;switch(k){case"undefined":case"function":case"unknown":return;case"boolean":return h.toString()}if(h===null){return"null"}if(h.toJSON){return h.toJSON()}if(h.ownerDocument===document){return}var g=[];for(var i in h){var j=Object.toJSON(h[i]);if(j!==undefined){g.push(i.toJSON()+": "+j)}}return"{"+g.join(", ")+"}"},keys:function(f){var d=[];for(var g in f){d.push(g)}return d},values:function(d){var f=[];for(var g in d){f.push(d[g])}return f},clone:function(b){return Object.extend({},b)}});Function.prototype.bind=function(){var f=this,g=$A(arguments),d=g.shift();return function(){return f.apply(d,g.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(g){var f=this,d=$A(arguments),g=d.shift();return function(a){return f.apply(g,[a||window.event].concat(d))}};Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(b){$R(0,this,true).each(b);return this},toPaddedString:function(g,d){var f=this.toString(d||10);return"0".times(g-f.length)+f},toJSON:function(){return isFinite(this)?this.toString():"null"}});Date.prototype.toJSON=function(){return'"'+this.getFullYear()+"-"+(this.getMonth()+1).toPaddedString(2)+"-"+this.getDate().toPaddedString(2)+"T"+this.getHours().toPaddedString(2)+":"+this.getMinutes().toPaddedString(2)+":"+this.getSeconds().toPaddedString(2)+'"'};var Try={these:function(){var k;for(var g=0,j=arguments.length;g<j;g++){var h=arguments[g];try{k=h();break}catch(i){}}return k}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(c,d){this.callback=c;this.frequency=d;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}};Object.extend(String,{interpret:function(b){return b==null?"":String(b)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(i,k){var h="",j=this,g;k=arguments.callee.prepareReplacement(k);while(j.length>0){if(g=j.match(i)){h+=j.slice(0,g.index);h+=String.interpret(k(g));j=j.slice(g.index+g[0].length)}else{h+=j,j=""}}return h},sub:function(g,f,d){f=this.gsub.prepareReplacement(f);d=d===undefined?1:d;return this.gsub(g,function(a){if(--d<0){return a[0]}return f(a)})},scan:function(c,d){this.gsub(c,d);return this},truncate:function(c,d){c=c||30;d=d===undefined?"...":d;return this.length>c?this.slice(0,c-d.length)+d:this},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var c=new RegExp(Prototype.ScriptFragment,"img");var d=new RegExp(Prototype.ScriptFragment,"im");return(this.match(c)||[]).map(function(a){return(a.match(d)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var b=arguments.callee;b.text.data=this;return b.div.innerHTML},unescapeHTML:function(){var b=document.createElement("div");b.innerHTML=this.stripTags();return b.childNodes[0]?(b.childNodes.length>1?$A(b.childNodes).inject("",function(a,d){return a+d.nodeValue}):b.childNodes[0].nodeValue):""},toQueryParams:function(c){var d=this.strip().match(/([^?#]*)(#.*)?$/);if(!d){return{}}return d[1].split(c||"&").inject({},function(b,a){if((a=a.split("="))[0]){var i=decodeURIComponent(a.shift());var h=a.length>1?a.join("="):a[0];if(h!=undefined){h=decodeURIComponent(h)}if(i in b){if(b[i].constructor!=Array){b[i]=[b[i]]}b[i].push(h)}else{b[i]=h}}return b})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(g){var f="";for(var d=0;d<g;d++){f+=this}return f},camelize:function(){var h=this.split("-"),g=h.length;if(g==1){return h[0]}var i=this.charAt(0)=="-"?h[0].charAt(0).toUpperCase()+h[0].substring(1):h[0];for(var f=1;f<g;f++){i+=h[f].charAt(0).toUpperCase()+h[f].substring(1)}return i},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(c){var d=this.gsub(/[\x00-\x1f\\]/,function(b){var a=String.specialChar[b[0]];return a?a:"\\u00"+b[0].charCodeAt().toPaddedString(2,16)});if(c){return'"'+d.replace(/"/g,'\\"')+'"'}return"'"+d.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(b){return this.sub(b||Prototype.JSONFilter,"#{1}")},isJSON:function(){var b=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(b)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(b){return this.indexOf(b)>-1},startsWith:function(b){return this.indexOf(b)===0},endsWith:function(d){var c=this.length-d.length;return c>=0&&this.lastIndexOf(d)===c},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},unescapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}})}String.prototype.gsub.prepareReplacement=function(c){if(typeof c=="function"){return c}var d=new Template(c);return function(a){return d.evaluate(a)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text)}var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(d,c){this.template=d.toString();this.pattern=c||Template.Pattern},evaluate:function(b){return this.template.gsub(this.pattern,function(a){var d=a[1];if(d=="\\"){return a[2]}return d+String.interpret(b[a[3]])})}};var $break={},$continue=new Error('"throw $continue" is deprecated, use "return" instead');var Enumerable={each:function(d){var f=0;try{this._each(function(a){d(a,f++)})}catch(g){if(g!=$break){throw g}}return this},eachSlice:function(k,g){var h=-k,j=[],i=this.toArray();while((h+=k)<i.length){j.push(i.slice(h,h+k))}return j.map(g)},all:function(c){var d=true;this.each(function(a,b){d=d&&!!(c||Prototype.K)(a,b);if(!d){throw $break}});return d},any:function(c){var d=false;this.each(function(a,b){if(d=!!(c||Prototype.K)(a,b)){throw $break}});return d},collect:function(c){var d=[];this.each(function(a,b){d.push((c||Prototype.K)(a,b))});return d},detect:function(c){var d;this.each(function(a,b){if(c(a,b)){d=a;throw $break}});return d},findAll:function(c){var d=[];this.each(function(a,b){if(c(a,b)){d.push(a)}});return d},grep:function(g,d){var f=[];this.each(function(a,b){var c=a.toString();if(c.match(g)){f.push((d||Prototype.K)(a,b))}});return f},include:function(d){var c=false;this.each(function(a){if(a==d){c=true;throw $break}});return c},inGroupsOf:function(c,d){d=d===undefined?null:d;return this.eachSlice(c,function(a){while(a.length<c){a.push(d)}return a})},inject:function(d,c){this.each(function(a,b){d=c(d,a,b)});return d},invoke:function(c){var d=$A(arguments).slice(1);return this.map(function(a){return a[c].apply(a,d)})},max:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a>=d){d=a}});return d},min:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a<d){d=a}});return d},partition:function(g){var d=[],f=[];this.each(function(a,b){((g||Prototype.K)(a,b)?d:f).push(a)});return[d,f]},pluck:function(c){var d=[];this.each(function(a,b){d.push(a[c])});return d},reject:function(c){var d=[];this.each(function(a,b){if(!c(a,b)){d.push(a)}});return d},sortBy:function(b){return this.map(function(d,a){return{value:d,criteria:b(d,a)}}).sort(function(a,h){var i=a.criteria,j=h.criteria;return i<j?-1:i>j?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var d=Prototype.K,f=$A(arguments);if(typeof f.last()=="function"){d=f.pop()}var g=[this].concat(f).map($A);return this.map(function(a,b){return d(g.pluck(b))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(h){if(!h){return[]}if(h.toArray){return h.toArray()}else{var f=[];for(var g=0,i=h.length;g<i;g++){f.push(h[g])}return f}};if(Prototype.Browser.WebKit){$A=Array.from=function(h){if(!h){return[]}if(!(typeof h=="function"&&h=="[object NodeList]")&&h.toArray){return h.toArray()}else{var f=[];for(var g=0,i=h.length;g<i;g++){f.push(h[g])}return f}}}Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(d){for(var f=0,g=this.length;f<g;f++){d(this[f])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(b){return b!=null})},flatten:function(){return this.inject([],function(c,d){return c.concat(d&&d.constructor==Array?d.flatten():[d])})},without:function(){var b=$A(arguments);return this.select(function(a){return !b.include(a)})},indexOf:function(f){for(var d=0,g=this.length;d<g;d++){if(this[d]==f){return d}}return -1},reverse:function(b){return(b!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(b){return this.inject([],function(f,g,a){if(0==a||(b?f.last()!=g:!f.include(g))){f.push(g)}return f})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var b=[];this.each(function(a){var d=Object.toJSON(a);if(d!==undefined){b.push(d)}});return"["+b.join(", ")+"]"}});Array.prototype.toArray=Array.prototype.clone;function $w(b){b=b.strip();return b?b.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var i=[];for(var g=0,k=this.length;g<k;g++){i.push(this[g])}for(var g=0,k=arguments.length;g<k;g++){if(arguments[g].constructor==Array){for(var h=0,j=arguments[g].length;h<j;h++){i.push(arguments[g][h])}}else{i.push(arguments[g])}}return i}}var Hash=function(b){if(b instanceof Hash){this.merge(b)}else{Object.extend(this,b||{})}};Object.extend(Hash,{toQueryString:function(c){var d=[];d.add=arguments.callee.addPair;this.prototype._each.call(c,function(a){if(!a.key){return}var b=a.value;if(b&&typeof b=="object"){if(b.constructor==Array){b.each(function(g){d.add(a.key,g)})}return}d.add(a.key,b)});return d.join("&")},toJSON:function(d){var c=[];this.prototype._each.call(d,function(a){var b=Object.toJSON(a.value);if(b!==undefined){c.push(a.key.toJSON()+": "+b)}});return"{"+c.join(", ")+"}"}});Hash.toQueryString.addPair=function(f,g,d){f=encodeURIComponent(f);if(g===undefined){this.push(f)}else{this.push(f+"="+(g==null?"":encodeURIComponent(g)))}};Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(f){for(var g in this){var i=this[g];if(i&&i==Hash.prototype[g]){continue}var h=[g,i];h.key=g;h.value=i;f(h)}},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},merge:function(b){return $H(b).inject(this,function(a,d){a[d.key]=d.value;return a})},remove:function(){var g;for(var f=0,i=arguments.length;f<i;f++){var h=this[arguments[f]];if(h!==undefined){if(g===undefined){g=h}else{if(g.constructor!=Array){g=[g]}g.push(h)}}delete this[arguments[f]]}return g},toQueryString:function(){return Hash.toQueryString(this)},inspect:function(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Hash.toJSON(this)}});function $H(b){if(b instanceof Hash){return b}return new Hash(b)}if(function(){var f=0,g=function(a){this.key=a};g.prototype.key="foo";for(var d in new g("bar")){f++}return f>1}()){Hash.prototype._each=function(k){var h=[];for(var g in this){var j=this[g];if((j&&j==Hash.prototype[g])||h.include(g)){continue}h.push(g);var i=[g,j];i.key=g;i.value=j;k(i)}}}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(g,f,d){this.start=g;this.end=f;this.exclusive=d},_each:function(d){var c=this.start;while(this.include(c)){d(c);c=c.succ()}},include:function(b){if(b<this.start){return false}if(this.exclusive){return b<this.end}return b<=this.end}});var $R=function(g,f,d){return new ObjectRange(g,f,d)};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(b){this.responders._each(b)},register:function(b){if(!this.include(b)){this.responders.push(b)}},unregister:function(b){this.responders=this.responders.without(b)},dispatch:function(h,f,i,g){this.each(function(b){if(typeof b[h]=="function"){try{b[h].apply(b,[f,i,g])}catch(a){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(b){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};Object.extend(this.options,b||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=this.options.parameters.toQueryParams()}}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(c,d){this.transport=Ajax.getTransport();this.setOptions(d);this.request(c)},request:function(f){this.url=f;this.method=this.options.method;var g=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){g._method=this.method;this.method="post"}this.parameters=g;if(g=Hash.toQueryString(g)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+g}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){g+="&_="}}}try{if(this.options.onCreate){this.options.onCreate(this.transport)}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1)}.bind(this),10)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||g):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var b=this.transport.readyState;if(b>1&&!((b==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var i={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){i["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){i.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var k=this.options.requestHeaders;if(typeof k.push=="function"){for(var g=0,j=k.length;g<j;g+=2){i[k[g]]=k[g+1]}}else{$H(k).each(function(a){i[a.key]=a.value})}}for(var h in i){this.transport.setRequestHeader(h,i[h])}},success:function(){return !this.transport.status||(this.transport.status>=200&&this.transport.status<300)},respondToReadyState:function(i){var m=Ajax.Request.Events[i];var j=this.transport,h=this.evalJSON();if(m=="Complete"){try{this._complete=true;(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(j,h)}catch(l){this.dispatchException(l)}var k=this.getHeader("Content-type");if(k&&k.strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){this.evalResponse()}}try{(this.options["on"+m]||Prototype.emptyFunction)(j,h);Ajax.Responders.dispatch("on"+m,this,j,h)}catch(l){this.dispatchException(l)}if(m=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},getHeader:function(d){try{return this.transport.getResponseHeader(d)}catch(c){return null}},evalJSON:function(){try{var d=this.getHeader("X-JSON");return d?d.evalJSON():null}catch(c){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(b){(this.options.onException||Prototype.emptyFunction)(this,b);Ajax.Responders.dispatch("onException",this,b)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(g,i,f){this.container={success:(g.success||g),failure:(g.failure||(g.success?null:g))};this.transport=Ajax.getTransport();this.setOptions(f);var h=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(a,b){this.updateContent();h(a,b)}).bind(this);this.request(i)},updateContent:function(){var c=this.container[this.success()?"success":"failure"];var d=this.transport.responseText;if(!this.options.evalScripts){d=d.stripScripts()}if(c=$(c)){if(this.options.insertion){new this.options.insertion(c,d)}else{c.update(d)}}if(this.success()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10)}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(f,g,d){this.setOptions(d);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=f;this.url=g;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(b){if(this.options.decay){this.decay=(b.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=b.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(f){if(arguments.length>1){for(var g=0,h=[],i=arguments.length;g<i;g++){h.push($(arguments[g]))}return h}if(typeof f=="string"){f=document.getElementById(f)}return Element.extend(f)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(j,i){var m=[];var k=document.evaluate(j,$(i)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var h=0,l=k.snapshotLength;h<l;h++){m.push(k.snapshotItem(h))}return m};document.getElementsByClassName=function(d,f){var g=".//*[contains(concat(' ', @class, ' '), ' "+d+" ')]";return document._getElementsByXPath(g,f)}}else{document.getElementsByClassName=function(m,i){var p=($(i)||document.body).getElementsByTagName("*");var t=[],r,n=new RegExp("(^|\\s)"+m+"(\\s|$)");for(var o=0,q=p.length;o<q;o++){r=p[o];var l=r.className;if(l.length==0){continue}if(l==m||l.match(n)){t.push(Element.extend(r))}}return t}}if(!window.Element){var Element={}}Element.extend=function(o){var n=Prototype.BrowserFeatures;if(!o||!o.tagName||o.nodeType==3||o._extended||n.SpecificElementExtensions||o==window){return o}var j={},p=o.tagName,k=Element.extend.cache,q=Element.Methods.ByTag;if(!n.ElementExtensions){Object.extend(j,Element.Methods),Object.extend(j,Element.Methods.Simulated)}if(q[p]){Object.extend(j,q[p])}for(var l in j){var m=j[l];if(typeof m=="function"&&!(l in o)){o[l]=k.findOrStore(m)}}o._extended=Prototype.emptyFunction;return o};Element.extend.cache={findOrStore:function(b){return this[b]=this[b]||function(){return b.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(b){return $(b).style.display!="none"},toggle:function(b){b=$(b);Element[Element.visible(b)?"hide":"show"](b);return b},hide:function(b){$(b).style.display="none";return b},show:function(b){$(b).style.display="";return b},remove:function(b){b=$(b);b.parentNode.removeChild(b);return b},update:function(c,d){d=typeof d=="undefined"?"":d.toString();$(c).innerHTML=d.stripScripts();setTimeout(function(){d.evalScripts()},10);return c},replace:function(g,d){g=$(g);d=typeof d=="undefined"?"":d.toString();if(g.outerHTML){g.outerHTML=d.stripScripts()}else{var f=g.ownerDocument.createRange();f.selectNodeContents(g);g.parentNode.replaceChild(f.createContextualFragment(d.stripScripts()),g)}setTimeout(function(){d.evalScripts()},10);return g},inspect:function(c){c=$(c);var d="<"+c.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(a){var b=a.first(),i=a.last();var h=(c[b]||"").toString();if(h){d+=" "+i+"="+h.inspect(true)}});return d+">"},recursivelyCollect:function(f,g){f=$(f);var d=[];while(f=f[g]){if(f.nodeType==1){d.push(Element.extend(f))}}return d},ancestors:function(b){return $(b).recursivelyCollect("parentNode")},descendants:function(b){return $A($(b).getElementsByTagName("*")).each(Element.extend)},firstDescendant:function(b){b=$(b).firstChild;while(b&&b.nodeType!=1){b=b.nextSibling}return $(b)},immediateDescendants:function(b){if(!(b=$(b).firstChild)){return[]}while(b&&b.nodeType!=1){b=b.nextSibling}if(b){return[b].concat($(b).nextSiblings())}return[]},previousSiblings:function(b){return $(b).recursivelyCollect("previousSibling")},nextSiblings:function(b){return $(b).recursivelyCollect("nextSibling")},siblings:function(b){b=$(b);return b.previousSiblings().reverse().concat(b.nextSiblings())},match:function(c,d){if(typeof d=="string"){d=new Selector(d)}return d.match($(c))},up:function(f,h,g){f=$(f);if(arguments.length==1){return $(f.parentNode)}var i=f.ancestors();return h?Selector.findElement(i,h,g):i[g||0]},down:function(f,i,g){f=$(f);if(arguments.length==1){return f.firstDescendant()}var h=f.descendants();return i?Selector.findElement(h,i,g):h[g||0]},previous:function(f,h,g){f=$(f);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(f))}var i=f.previousSiblings();return h?Selector.findElement(i,h,g):i[g||0]},next:function(i,h,f){i=$(i);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(i))}var g=i.nextSiblings();return h?Selector.findElement(g,h,f):g[f||0]},getElementsBySelector:function(){var d=$A(arguments),c=$(d.shift());return Selector.findChildElements(c,d)},getElementsByClassName:function(d,c){return document.getElementsByClassName(c,d)},readAttribute:function(i,g){i=$(i);if(Prototype.Browser.IE){if(!i.attributes){return null}var f=Element._attributeTranslations;if(f.values[g]){return f.values[g](i,g)}if(f.names[g]){g=f.names[g]}var h=i.attributes[g];return h?h.nodeValue:null}return i.getAttribute(g)},getHeight:function(b){return $(b).getDimensions().height},getWidth:function(b){return $(b).getDimensions().width},classNames:function(b){return new Element.ClassNames(b)},hasClassName:function(f,d){if(!(f=$(f))){return}var g=f.className;if(g.length==0){return false}if(g==d||g.match(new RegExp("(^|\\s)"+d+"(\\s|$)"))){return true}return false},addClassName:function(d,c){if(!(d=$(d))){return}Element.classNames(d).add(c);return d},removeClassName:function(d,c){if(!(d=$(d))){return}Element.classNames(d).remove(c);return d},toggleClassName:function(d,c){if(!(d=$(d))){return}Element.classNames(d)[d.hasClassName(c)?"remove":"add"](c);return d},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(d){d=$(d);var g=d.firstChild;while(g){var f=g.nextSibling;if(g.nodeType==3&&!/\S/.test(g.nodeValue)){d.removeChild(g)}g=f}return d},empty:function(b){return $(b).innerHTML.blank()},descendantOf:function(c,d){c=$(c),d=$(d);while(c=c.parentNode){if(c==d){return true}}return false},scrollTo:function(d){d=$(d);var c=Position.cumulativeOffset(d);window.scrollTo(c[0],c[1]);return d},getStyle:function(f,i){f=$(f);i=i=="float"?"cssFloat":i.camelize();var h=f.style[i];if(!h){var g=document.defaultView.getComputedStyle(f,null);h=g?g[i]:null}if(i=="opacity"){return h?parseFloat(h):1}return h=="auto"?null:h},getOpacity:function(b){return $(b).getStyle("opacity")},setStyle:function(h,k,g){h=$(h);var i=h.style;for(var j in k){if(j=="opacity"){h.setOpacity(k[j])}else{i[(j=="float"||j=="cssFloat")?(i.styleFloat===undefined?"cssFloat":"styleFloat"):(g?j:j.camelize())]=k[j]}}return h},setOpacity:function(d,c){d=$(d);d.style.opacity=(c==1||c==="")?"":(c<0.00001)?0:c;return d},getDimensions:function(q){q=$(q);var m=$(q).getStyle("display");if(m!="none"&&m!=null){return{width:q.offsetWidth,height:q.offsetHeight}}var j=q.style;var n=j.visibility;var p=j.position;var k=j.display;j.visibility="hidden";j.position="absolute";j.display="block";var l=q.clientWidth;var o=q.clientHeight;j.display=k;j.position=p;j.visibility=n;return{width:l,height:o}},makePositioned:function(d){d=$(d);var c=Element.getStyle(d,"position");if(c=="static"||!c){d._madePositioned=true;d.style.position="relative";if(window.opera){d.style.top=0;d.style.left=0}}return d},undoPositioned:function(b){b=$(b);if(b._madePositioned){b._madePositioned=undefined;b.style.position=b.style.top=b.style.left=b.style.bottom=b.style.right=""}return b},makeClipping:function(b){b=$(b);if(b._overflow){return b}b._overflow=b.style.overflow||"auto";if((Element.getStyle(b,"overflow")||"visible")!="hidden"){b.style.overflow="hidden"}return b},undoClipping:function(b){b=$(b);if(!b._overflow){return b}b.style.overflow=b._overflow=="auto"?"":b._overflow;b._overflow=null;return b}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf,childElements:Element.Methods.immediateDescendants});if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle;Element.Methods.getStyle=function(d,c){switch(c){case"left":case"top":case"right":case"bottom":if(Element._getStyle(d,"position")=="static"){return null}default:return Element._getStyle(d,c)}}}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(f,d){f=$(f);d=(d=="float"||d=="cssFloat")?"styleFloat":d.camelize();var g=f.style[d];if(!g&&f.currentStyle){g=f.currentStyle[d]}if(d=="opacity"){if(g=(f.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(g[1]){return parseFloat(g[1])/100}}return 1}if(g=="auto"){if((d=="width"||d=="height")&&(f.getStyle("display")!="none")){return f["offset"+d.capitalize()]+"px"}return null}return g};Element.Methods.setOpacity=function(g,h){g=$(g);var i=g.getStyle("filter"),f=g.style;if(h==1||h===""){f.filter=i.replace(/alpha\([^\)]*\)/gi,"");return g}else{if(h<0.00001){h=0}}f.filter=i.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+(h*100)+")";return g};Element.Methods.update=function(i,f){i=$(i);f=typeof f=="undefined"?"":f.toString();var g=i.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].include(g)){var h=document.createElement("div");switch(g){case"THEAD":case"TBODY":h.innerHTML="<table><tbody>"+f.stripScripts()+"</tbody></table>";depth=2;break;case"TR":h.innerHTML="<table><tbody><tr>"+f.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":h.innerHTML="<table><tbody><tr><td>"+f.stripScripts()+"</td></tr></tbody></table>";depth=4}$A(i.childNodes).each(function(a){i.removeChild(a)});depth.times(function(){h=h.firstChild});$A(h.childNodes).each(function(a){i.appendChild(a)})}else{i.innerHTML=f.stripScripts()}setTimeout(function(){f.evalScripts()},10);return i}}else{if(Prototype.Browser.Gecko){Element.Methods.setOpacity=function(d,c){d=$(d);d.style.opacity=(c==1)?0.999999:(c==="")?"":(c<0.00001)?0:c;return d}}}}Element._attributeTranslations={names:{colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"},values:{_getAttr:function(d,c){return d.getAttribute(c,2)},_flag:function(d,c){return $(d).hasAttribute(c)?c:null},style:function(b){return b.style.cssText.toLowerCase()},title:function(d){var c=d.getAttributeNode("title");return c.specified?c.nodeValue:null}}};(function(){Object.extend(this,{href:this._getAttr,src:this._getAttr,type:this._getAttr,disabled:this._flag,checked:this._flag,readonly:this._flag,multiple:this._flag})}).call(Element._attributeTranslations.values);Element.Methods.Simulated={hasAttribute:function(f,h){var g=Element._attributeTranslations,i;h=g.names[h]||h;i=$(f).getAttributeNode(h);return i&&i.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true}Element.hasAttribute=function(d,c){if(d.hasAttribute){return d.hasAttribute(c)}return Element.Methods.Simulated.hasAttribute(d,c)};Element.addMethods=function(q){var l=Prototype.BrowserFeatures,p=Element.Methods.ByTag;if(!q){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var r=q;q=arguments[1]}if(!r){Object.extend(Element.Methods,q||{})}else{if(r.constructor==Array){r.each(m)}else{m(r)}}function m(a){a=a.toUpperCase();if(!Element.Methods.ByTag[a]){Element.Methods.ByTag[a]={}}Object.extend(Element.Methods.ByTag[a],q)}function t(g,b,c){c=c||false;var a=Element.extend.cache;for(var d in g){var f=g[d];if(!c||!(d in b)){b[d]=a.findOrStore(f)}}}function o(a){var c;var b={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(b[a]){c="HTML"+b[a]+"Element"}if(window[c]){return window[c]}c="HTML"+a+"Element";if(window[c]){return window[c]}c="HTML"+a.capitalize()+"Element";if(window[c]){return window[c]}window[c]={};window[c].prototype=document.createElement(a).__proto__;return window[c]}if(l.ElementExtensions){t(Element.Methods,HTMLElement.prototype);t(Element.Methods.Simulated,HTMLElement.prototype,true)}if(l.SpecificElementExtensions){for(var k in Element.Methods.ByTag){var n=o(k);if(typeof n=="undefined"){continue}t(p[k],n.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag};var Toggle={display:Element.toggle};Abstract.Insertion=function(b){this.adjacency=b};Abstract.Insertion.prototype={initialize:function(f,i){this.element=$(f);this.content=i.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(h){var g=this.element.tagName.toUpperCase();if(["TBODY","TR"].include(g)){this.insertContent(this.contentFromAnonymousTable())}else{throw h}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange()}this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){i.evalScripts()},10)},contentFromAnonymousTable:function(){var b=document.createElement("div");b.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(b.childNodes[0].childNodes[0].childNodes)}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(b){b.reverse(false).each((function(a){this.element.insertBefore(a,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(b){b.each((function(a){this.element.appendChild(a)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(b){this.element=$(b)},_each:function(b){this.element.className.split(/\s+/).select(function(a){return a.length>0})._each(b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set($A(this).concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(b){this.expression=b.strip();this.compileMatcher()},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!(/\[[\w-]*?:/).test(this.expression)){return this.compileXPathMatcher()}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(typeof c[i]=="function"?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var k=this.expression,j=Selector.patterns,h=Selector.xpath,l,i;if(Selector._cache[k]){this.xpath=Selector._cache[k];return}this.matcher=[".//*"];while(k&&l!=k&&(/\S/).test(k)){l=k;for(var m in j){if(i=k.match(j[m])){this.matcher.push(typeof h[m]=="function"?h[m](i):new Template(h[m]).evaluate(i));k=k.replace(i[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(b){b=b||document;if(this.xpath){return document._getElementsByXPath(this.xpath,b)}return this.matcher(b)},match:function(b){return this.findElements(document).include(b)},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}};Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(b){if(b[1]=="*"){return""}return"[local-name()='"+b[1].toLowerCase()+"' or local-name()='"+b[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(b){b[3]=b[5]||b[6];return new Template(Selector.xpath.operators[b[2]]).evaluate(b)},pseudo:function(d){var c=Selector.xpath.pseudos[d[1]];if(!c){return""}if(typeof c==="function"){return c(d)}return new Template(Selector.xpath.pseudos[d[1]]).evaluate(d)},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 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(i){var l=i[6],m=Selector.patterns,k=Selector.xpath,o,i,q;var n=[];while(l&&o!=l&&(/\S/).test(l)){o=l;for(var p in m){if(i=l.match(m[p])){q=typeof k[p]=="function"?k[p](i):new Template(k[p]).evaluate(i);n.push("("+q.substring(1,q.length-1)+")");l=l.replace(i[0],"");break}}}return"[not("+n.join(" and ")+")]"},"nth-child":function(b){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",b)},"nth-last-child":function(b){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",b)},"nth-of-type":function(b){return Selector.xpath.pseudos.nth("position() ",b)},"nth-last-of-type":function(b){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",b)},"first-of-type":function(b){b[6]="1";return Selector.xpath.pseudos["nth-of-type"](b)},"last-of-type":function(b){b[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](b)},"only-of-type":function(d){var c=Selector.xpath.pseudos;return c["first-of-type"](d)+c["last-of-type"](d)},nth:function(k,m){var b,a=m[6],n;if(a=="even"){a="2n+0"}if(a=="odd"){a="2n+1"}if(b=a.match(/^(\d+)$/)){return"["+k+"= "+b[1]+"]"}if(b=a.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(b[1]=="-"){b[1]=-1}var l=b[1]?Number(b[1]):1;var o=b[2]?Number(b[2]):0;n="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(n).evaluate({fragment:k,a:l,b:o})}}}},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 = false;',attr:function(b){b[3]=(b[5]||b[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(b)},pseudo:function(b){if(b[6]){b[6]=b[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(b)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/},handlers:{concat:function(h,i){for(var b=0,a;a=i[b];b++){h.push(a)}return h},mark:function(f){for(var d=0,g;g=f[d];d++){g._counted=true}return f},unmark:function(f){for(var d=0,g;g=f[d];d++){g._counted=undefined}return f},index:function(i,l,j){i._counted=true;if(l){for(var h=i.childNodes,k=h.length-1,m=1;k>=0;k--){node=h[k];if(node.nodeType==1&&(!j||node._counted)){node.nodeIndex=m++}}}else{for(var k=0,m=1,h=i.childNodes;node=h[k];k++){if(node.nodeType==1&&(!j||node._counted)){node.nodeIndex=m++}}}},unique:function(g){if(g.length==0){return g}var j=[],i;for(var k=0,h=g.length;k<h;k++){if(!(i=g[k])._counted){i._counted=true;j.push(Element.extend(i))}}return Selector.handlers.unmark(j)},descendant:function(h){var j=Selector.handlers;for(var k=0,g=[],i;i=h[k];k++){j.concat(g,i.getElementsByTagName("*"))}return g},child:function(j){var n=Selector.handlers;for(var o=0,p=[],m;m=j[o];o++){for(var h=0,q=[],i;i=m.childNodes[h];h++){if(i.nodeType==1&&i.tagName!="!"){p.push(i)}}}return p},adjacent:function(h){for(var k=0,g=[],i;i=h[k];k++){var j=this.nextElementSibling(i);if(j){g.push(j)}}return g},laterSibling:function(h){var j=Selector.handlers;for(var k=0,g=[],i;i=h[k];k++){j.concat(g,Element.nextSiblings(i))}return g},nextElementSibling:function(b){while(b=b.nextSibling){if(b.nodeType==1){return b}}return null},previousElementSibling:function(b){while(b=b.previousSibling){if(b.nodeType==1){return b}}return null},tagName:function(h,i,o,l){o=o.toUpperCase();var p=[],n=Selector.handlers;if(h){if(l){if(l=="descendant"){for(var q=0,m;m=h[q];q++){n.concat(p,m.getElementsByTagName(o))}return p}else{h=this[l](h)}if(o=="*"){return h}}for(var q=0,m;m=h[q];q++){if(m.tagName.toUpperCase()==o){p.push(m)}}return p}else{return i.getElementsByTagName(o)}},id:function(h,i,l,n){var m=$(l),p=Selector.handlers;if(!h&&i==document){return m?[m]:[]}if(h){if(n){if(n=="child"){for(var q=0,o;o=h[q];q++){if(m.parentNode==o){return[m]}}}else{if(n=="descendant"){for(var q=0,o;o=h[q];q++){if(Element.descendantOf(m,o)){return[m]}}}else{if(n=="adjacent"){for(var q=0,o;o=h[q];q++){if(Selector.handlers.previousElementSibling(m)==o){return[m]}}}else{h=p[n](h)}}}}for(var q=0,o;o=h[q];q++){if(o==m){return[m]}}return[]}return(m&&Element.descendantOf(m,i))?[m]:[]},className:function(f,g,i,h){if(f&&h){f=this[h](f)}return Selector.handlers.byClassName(f,g,i)},byClassName:function(q,i,n){if(!q){q=Selector.handlers.descendant([i])}var l=" "+n+" ";for(var o=0,p=[],m,k;m=q[o];o++){k=m.className;if(k.length==0){continue}if(k==n||(" "+k+" ").include(l)){p.push(m)}}return p},attrPresence:function(m,h,i){var k=[];for(var l=0,j;j=m[l];l++){if(Element.hasAttribute(j,i)){k.push(j)}}return k},attr:function(v,n,o,m,u){if(!v){v=n.getElementsByTagName("*")}var i=Selector.operators[u],r=[];for(var q=0,t;t=v[q];q++){var p=Element.readAttribute(t,o);if(p===null){continue}if(i(p,m)){r.push(t)}}return r},pseudo:function(g,k,i,h,j){if(g&&j){g=this[j](g)}if(!g){g=h.getElementsByTagName("*")}return Selector.pseudos[k](g,i,h)}},pseudos:{"first-child":function(h,j,i){for(var l=0,m=[],k;k=h[l];l++){if(Selector.handlers.previousElementSibling(k)){continue}m.push(k)}return m},"last-child":function(h,j,i){for(var l=0,m=[],k;k=h[l];l++){if(Selector.handlers.nextElementSibling(k)){continue}m.push(k)}return m},"only-child":function(h,k,i){var m=Selector.handlers;for(var n=0,o=[],l;l=h[n];n++){if(!m.previousElementSibling(l)&&!m.nextElementSibling(l)){o.push(l)}}return o},"nth-child":function(d,g,f){return Selector.pseudos.nth(d,g,f)},"nth-last-child":function(d,g,f){return Selector.pseudos.nth(d,g,f,true)},"nth-of-type":function(d,g,f){return Selector.pseudos.nth(d,g,f,false,true)},"nth-last-of-type":function(d,g,f){return Selector.pseudos.nth(d,g,f,true,true)},"first-of-type":function(d,g,f){return Selector.pseudos.nth(d,"1",f,false,true)},"last-of-type":function(d,g,f){return Selector.pseudos.nth(d,"1",f,true,true)},"only-of-type":function(f,h,g){var i=Selector.pseudos;return i["last-of-type"](i["first-of-type"](f,h,g),h,g)},getIndices:function(b,g,a){if(b==0){return g>0?[g]:[]}return $R(1,a).inject([],function(d,c){if(0==(c-g)%b&&(c-g)/b>=0){d.push(c)}return d})},nth:function(B,G,E,H,z){if(B.length==0){return[]}if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}var a=Selector.handlers,b=[],A=[],l;a.mark(B);for(var h=0,m;m=B[h];h++){if(!m.parentNode._counted){a.index(m.parentNode,H,z);A.push(m.parentNode)}}if(G.match(/^\d+$/)){G=Number(G);for(var h=0,m;m=B[h];h++){if(m.nodeIndex==G){b.push(m)}}}else{if(l=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(l[1]=="-"){l[1]=-1}var D=l[1]?Number(l[1]):1;var F=l[2]?Number(l[2]):0;var C=Selector.pseudos.getIndices(D,F,B.length);for(var h=0,m,j=C.length;m=B[h];h++){for(var i=0;i<j;i++){if(m.nodeIndex==C[i]){b.push(m)}}}}}a.unmark(B);a.unmark(A);return b},empty:function(h,j,i){for(var l=0,m=[],k;k=h[l];l++){if(k.tagName=="!"||(k.firstChild&&!k.innerHTML.match(/^\s*$/))){continue}m.push(k)}return m},not:function(v,r,i){var o=Selector.handlers,h,t;var m=new Selector(r).findElements(i);o.mark(m);for(var p=0,q=[],u;u=v[p];p++){if(!u._counted){q.push(u)}}o.unmark(m);return q},enabled:function(h,j,i){for(var l=0,m=[],k;k=h[l];l++){if(!k.disabled){m.push(k)}}return m},disabled:function(h,j,i){for(var l=0,m=[],k;k=h[l];l++){if(k.disabled){m.push(k)}}return m},checked:function(h,j,i){for(var l=0,m=[],k;k=h[l];l++){if(k.checked){m.push(k)}}return m}},operators:{"=":function(c,d){return c==d},"!=":function(c,d){return c!=d},"^=":function(c,d){return c.startsWith(d)},"$=":function(c,d){return c.endsWith(d)},"*=":function(c,d){return c.include(d)},"~=":function(c,d){return(" "+c+" ").include(" "+d+" ")},"|=":function(c,d){return("-"+c.toUpperCase()+"-").include("-"+d.toUpperCase()+"-")}},matchElements:function(l,k){var m=new Selector(k).findElements(),n=Selector.handlers;n.mark(m);for(var o=0,h=[],i;i=l[o];o++){if(i._counted){h.push(i)}}n.unmark(m);return h},findElement:function(d,g,f){if(typeof g=="number"){f=g;g=false}return Selector.matchElements(d,g||"*")[f||0]},findChildElements:function(o,m){var l=m.join(","),m=[];l.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(a){m.push(a[1].strip())});var p=[],n=Selector.handlers;for(var q=0,h=m.length,i;q<h;q++){i=new Selector(m[q].strip());n.concat(p,i.findElements(o))}return(h>1)?n.unique(p):p}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(b){$(b).reset();return b},serializeElements:function(g,f){var d=g.inject({},function(i,b){if(!b.disabled&&b.name){var c=b.name,a=$(b).getValue();if(a!=null){if(c in i){if(i[c].constructor!=Array){i[c]=[i[c]]}i[c].push(a)}else{i[c]=a}}}return i});return f?d:Hash.toQueryString(d)}};Form.Methods={serialize:function(c,d){return Form.serializeElements(Form.getElements(c),d)},getElements:function(b){return $A($(b).getElementsByTagName("*")).inject([],function(a,d){if(Form.Element.Serializers[d.tagName.toLowerCase()]){a.push(Element.extend(d))}return a})},getInputs:function(m,q,p){m=$(m);var k=m.getElementsByTagName("input");if(!q&&!p){return $A(k).map(Element.extend)}for(var o=0,l=[],n=k.length;o<n;o++){var i=k[o];if((q&&i.type!=q)||(p&&i.name!=p)){continue}l.push(Element.extend(i))}return l},disable:function(b){b=$(b);Form.getElements(b).invoke("disable");return b},enable:function(b){b=$(b);Form.getElements(b).invoke("enable");return b},findFirstElement:function(b){return $(b).getElements().find(function(a){return a.type!="hidden"&&!a.disabled&&["input","select","textarea"].include(a.tagName.toLowerCase())})},focusFirstElement:function(b){b=$(b);b.findFirstElement().activate();return b},request:function(d,f){d=$(d),f=Object.clone(f||{});var g=f.parameters;f.parameters=d.serialize(true);if(g){if(typeof g=="string"){g=g.toQueryParams()}Object.extend(f.parameters,g)}if(d.hasAttribute("method")&&!f.method){f.method=d.method}return new Ajax.Request(d.readAttribute("action"),f)}};Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(f){f=$(f);if(!f.disabled&&f.name){var d=f.getValue();if(d!=undefined){var g={};g[f.name]=d;return Hash.toQueryString(g)}}return""},getValue:function(d){d=$(d);var c=d.tagName.toLowerCase();return Form.Element.Serializers[c](d)},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(d){d=$(d);try{d.focus();if(d.select&&(d.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(d.type))){d.select()}}catch(c){}return d},disable:function(b){b=$(b);b.blur();b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(b){switch(b.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(b);default:return Form.Element.Serializers.textarea(b)}},inputSelector:function(b){return b.checked?b.value:null},textarea:function(b){return b.value},select:function(b){return this[b.type=="select-one"?"selectOne":"selectMany"](b)},selectOne:function(c){var d=c.selectedIndex;return d>=0?this.optionValue(c.options[d]):null},selectMany:function(j){var h,i=j.length;if(!i){return null}for(var k=0,h=[];k<i;k++){var g=j.options[k];if(g.selected){h.push(this.optionValue(g))}}return h},optionValue:function(b){return Element.extend(b).hasAttribute("value")?b.value:b.text}};Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(f,d,g){this.frequency=d;this.element=$(f);this.callback=g;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var d=this.getValue();var c=("string"==typeof this.lastValue&&"string"==typeof d?this.lastValue!=d:String(this.lastValue)!=String(d));if(c){this.callback(this.element,d);this.lastValue=d}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(d,c){this.element=$(d);this.callback=c;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var b=this.getValue();if(this.lastValue!=b){this.callback(this.element,b);this.lastValue=b}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this))},registerCallback:function(b){if(b.type){switch(b.type.toLowerCase()){case"checkbox":case"radio":Event.observe(b,"click",this.onElementEvent.bind(this));break;default:Event.observe(b,"change",this.onElementEvent.bind(this));break}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(b){return $(b.target||b.srcElement)},isLeftClick:function(b){return(((b.which)&&(b.which==1))||((b.button)&&(b.button==1)))},pointerX:function(b){return b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(b){return b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(b){if(b.preventDefault){b.preventDefault();b.stopPropagation()}else{b.returnValue=false;b.cancelBubble=true}},findElement:function(g,d){var f=Event.element(g);while(f.parentNode&&(!f.tagName||(f.tagName.toUpperCase()!=d.toUpperCase()))){f=f.parentNode}return f},observers:false,_observeAndCache:function(h,i,f,g){if(!this.observers){this.observers=[]}if(h.addEventListener){this.observers.push([h,i,f,g]);h.addEventListener(i,f,g)}else{if(h.attachEvent){this.observers.push([h,i,f,g]);h.attachEvent("on"+i,f)}}},unloadCache:function(){if(!Event.observers){return}for(var d=0,c=Event.observers.length;d<c;d++){Event.stopObserving.apply(this,Event.observers[d]);Event.observers[d][0]=null}Event.observers=false},observe:function(h,i,f,g){h=$(h);g=g||false;if(i=="keypress"&&(Prototype.Browser.WebKit||h.attachEvent)){i="keydown"}Event._observeAndCache(h,i,f,g)},stopObserving:function(j,k,g,h){j=$(j);h=h||false;if(k=="keypress"&&(Prototype.Browser.WebKit||j.attachEvent)){k="keydown"}if(j.removeEventListener){j.removeEventListener(k,g,h)}else{if(j.detachEvent){try{j.detachEvent("on"+k,g)}catch(i){}}}}});if(Prototype.Browser.IE){Event.observe(window,"unload",Event.unloadCache,false)}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},realOffset:function(d){var f=0,g=0;do{f+=d.scrollTop||0;g+=d.scrollLeft||0;d=d.parentNode}while(d);return[g,f]},cumulativeOffset:function(d){var f=0,g=0;do{f+=d.offsetTop||0;g+=d.offsetLeft||0;d=d.offsetParent}while(d);return[g,f]},positionedOffset:function(f){var g=0,h=0;do{g+=f.offsetTop||0;h+=f.offsetLeft||0;f=f.offsetParent;if(f){if(f.tagName=="BODY"){break}var i=Element.getStyle(f,"position");if(i=="relative"||i=="absolute"){break}}}while(f);return[h,g]},offsetParent:function(b){if(b.offsetParent){return b.offsetParent}if(b==document.body){return b}while((b=b.parentNode)&&b!=document.body){if(Element.getStyle(b,"position")!="static"){return b}}return document.body},within:function(d,f,g){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(d,f,g)}this.xcomp=f;this.ycomp=g;this.offset=this.cumulativeOffset(d);return(g>=this.offset[1]&&g<this.offset[1]+d.offsetHeight&&f>=this.offset[0]&&f<this.offset[0]+d.offsetWidth)},withinIncludingScrolloffsets:function(f,g,h){var i=this.realOffset(f);this.xcomp=g+i[0]-this.deltaX;this.ycomp=h+i[1]-this.deltaY;this.offset=this.cumulativeOffset(f);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+f.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+f.offsetWidth)},overlap:function(c,d){if(!c){return 0}if(c=="vertical"){return((this.offset[1]+d.offsetHeight)-this.ycomp)/d.offsetHeight}if(c=="horizontal"){return((this.offset[0]+d.offsetWidth)-this.xcomp)/d.offsetWidth}},page:function(h){var g=0,i=0;var f=h;do{g+=f.offsetTop||0;i+=f.offsetLeft||0;if(f.offsetParent==document.body){if(Element.getStyle(f,"position")=="absolute"){break}}}while(f=f.offsetParent);f=h;do{if(!window.opera||f.tagName=="BODY"){g-=f.scrollTop||0;i-=f.scrollLeft||0}}while(f=f.parentNode);return[i,g]},clone:function(m,k){var i=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});m=$(m);var l=Position.page(m);k=$(k);var j=[0,0];var h=null;if(Element.getStyle(k,"position")=="absolute"){h=Position.offsetParent(k);j=Position.page(h)}if(h==document.body){j[0]-=document.body.offsetLeft;j[1]-=document.body.offsetTop}if(i.setLeft){k.style.left=(l[0]-j[0]+i.offsetLeft)+"px"}if(i.setTop){k.style.top=(l[1]-j[1]+i.offsetTop)+"px"}if(i.setWidth){k.style.width=m.offsetWidth+"px"}if(i.setHeight){k.style.height=m.offsetHeight+"px"}},absolutize:function(h){h=$(h);if(h.style.position=="absolute"){return}Position.prepare();var l=Position.positionedOffset(h);var j=l[1];var k=l[0];var m=h.clientWidth;var i=h.clientHeight;h._originalLeft=k-parseFloat(h.style.left||0);h._originalTop=j-parseFloat(h.style.top||0);h._originalWidth=h.style.width;h._originalHeight=h.style.height;h.style.position="absolute";h.style.top=j+"px";h.style.left=k+"px";h.style.width=m+"px";h.style.height=i+"px"},relativize:function(f){f=$(f);if(f.style.position=="relative"){return}Position.prepare();f.style.position="relative";var g=parseFloat(f.style.top||0)-(f._originalTop||0);var d=parseFloat(f.style.left||0)-(f._originalLeft||0);f.style.top=g+"px";f.style.left=d+"px";f.style.height=f._originalHeight;f.style.width=f._originalWidth}};if(Prototype.Browser.WebKit){Position.cumulativeOffset=function(d){var f=0,g=0;do{f+=d.offsetTop||0;g+=d.offsetLeft||0;if(d.offsetParent==document.body){if(Element.getStyle(d,"position")=="absolute"){break}}d=d.offsetParent}while(d);return[g,f]}}Element.addMethods();String.prototype.parseColor=function(){var f="#";if(this.slice(0,4)=="rgb("){var g=this.slice(4,this.length-1).split(",");var d=0;do{f+=parseInt(g[d]).toColorPart()}while(++d<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var d=1;d<4;d++){f+=(this.charAt(d)+this.charAt(d)).toLowerCase()}}if(this.length==7){f=this.toLowerCase()}}}return(f.length==7?f:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(a){return(a.nodeType==3?a.nodeValue:(a.hasChildNodes()?Element.collectTextNodes(a):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(d,c){return $A($(d).childNodes).collect(function(a){return(a.nodeType==3?a.nodeValue:((a.hasChildNodes()&&!Element.hasClassName(a,c))?Element.collectTextNodesIgnoreClass(a,c):""))}).flatten().join("")};Element.setContentZoom=function(d,c){d=$(d);d.setStyle({fontSize:(c/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return d};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(f){try{f=$(f);var g=document.createTextNode(" ");f.appendChild(g);f.removeChild(g)}catch(d){}};Array.prototype.call=function(){var b=arguments;this.each(function(a){a.apply(this,b)})};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(d){if(typeof Builder=="undefined"){throw ("Effect.tagifyText requires including script.aculo.us' builder.js library")}var c="position:relative";if(Prototype.Browser.IE){c+=";zoom:1"}d=$(d);$A(d.childNodes).each(function(a){if(a.nodeType==3){a.nodeValue.toArray().each(function(b){d.insertBefore(Builder.node("span",{style:c},b==" "?String.fromCharCode(160):b),a)});Element.remove(a)}})},multiple:function(g,k){var i;if(((typeof g=="object")||(typeof g=="function"))&&(g.length)){i=g}else{i=$(g).childNodes}var h=Object.extend({speed:0.1,delay:0},arguments[2]||{});var j=h.delay;$A(i).each(function(a,b){new k(a,Object.extend(h,{delay:b*h.speed+j}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(d,g){d=$(d);g=(g||"appear").toLowerCase();var f=Object.extend({queue:{position:"end",scope:(d.id||"global"),limit:1}},arguments[2]||{});Effect[d.visible()?Effect.PAIRS[g][1]:Effect.PAIRS[g][0]](d,f)}};var Effect2=Effect;Effect.Transitions={linear:Prototype.K,sinoidal:function(b){return(-Math.cos(b*Math.PI)/2)+0.5},reverse:function(b){return 1-b},flicker:function(b){var b=((-Math.cos(b*Math.PI)/4)+0.75)+Math.random()/4;return(b>1?1:b)},wobble:function(b){return(-Math.cos(b*Math.PI*(9*b))/2)+0.5},pulse:function(c,d){d=d||5;return(Math.round((c%(1/d))*d)==0?((c*d*2)-Math.floor(c*d*2)):1-((c*d*2)-Math.floor(c*d*2)))},none:function(b){return 0},full:function(b){return 1}};Effect.ScopedQueue=Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(d){var g=new Date().getTime();var f=(typeof d.options.queue=="string")?d.options.queue:d.options.queue.position;switch(f){case"front":this.effects.findAll(function(a){return a.state=="idle"}).each(function(a){a.startOn+=d.finishOn;a.finishOn+=d.finishOn});break;case"with-last":g=this.effects.pluck("startOn").max()||g;break;case"end":g=this.effects.pluck("finishOn").max()||g;break}d.startOn+=g;d.finishOn+=g;if(!d.options.queue.limit||(this.effects.length<d.options.queue.limit)){this.effects.push(d)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(b){this.effects=this.effects.reject(function(a){return a==b});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var g=new Date().getTime();for(var d=0,f=this.effects.length;d<f;d++){this.effects[d]&&this.effects[d].loop(g)}}});Effect.Queues={instances:$H(),get:function(b){if(typeof b!="string"){return b}if(!this.instances[b]){this.instances[b]=new Effect.ScopedQueue()}return this.instances[b]}};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(g){if(g>=this.startOn){if(g>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var d=(g-this.startOn)/this.totalTime,f=Math.round(d*this.totalFrames);if(f>this.currentFrame){this.render(d);this.currentFrame=f}}},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(b){if(this.options[b+"Internal"]){this.options[b+"Internal"](this)}if(this.options[b]){this.options[b](this)}},inspect:function(){var b=$H();for(property in this){if(typeof this[property]!="function"){b[property]=this[property]}}return"#<Effect:"+b.inspect()+",options:"+$H(this.options).inspect()+">"}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(b){this.effects=b||[];this.start(arguments[1])},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(a){a.render(1);a.cancel();a.event("beforeFinish");if(a.finish){a.finish(b)}a.event("afterFinish")})}});Effect.Event=Class.create();Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var b=Object.extend({duration:0},arguments[0]||{});this.start(b)},update:Prototype.emptyFunction});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var d=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(d)},update:function(b){this.element.setOpacity(b)}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var d=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(d)},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(b){this.element.setStyle({left:Math.round(this.options.x*b+this.originalLeft)+"px",top:Math.round(this.options.y*b+this.originalTop)+"px"})}});Effect.MoveBy=function(d,f,g){return new Effect.Move(d,Object.extend({x:g,y:f},arguments[3]||{}))};Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(d,g){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var f=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:g},arguments[2]||{});this.start(f)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(a){this.originalStyle[a]=this.element.style[a]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(a){if(b.indexOf(a)>0){this.fontSize=parseFloat(b);this.fontSizeType=a}}.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(d){var c=(this.options.scaleFrom/100)+(this.factor*d);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*c+this.fontSizeType})}this.setDimensions(this.dims[0]*c,this.dims[1]*c)},finish:function(b){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(h,j){var i={};if(this.options.scaleX){i.width=Math.round(j)+"px"}if(this.options.scaleY){i.height=Math.round(h)+"px"}if(this.options.scaleFromCenter){var k=(h-this.dims[0])/2;var d=(j-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){i.top=this.originalTop-k+"px"}if(this.options.scaleX){i.left=this.originalLeft-d+"px"}}else{if(this.options.scaleY){i.top=-k+"px"}if(this.options.scaleX){i.left=-d+"px"}}}this.element.setStyle(i)}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var d=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(d)},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(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(a,g,f){return a+(Math.round(this._base[f]+(this._delta[f]*b)).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(b){this.element=$(b);this.start(arguments[1]||{})},setup:function(){Position.prepare();var c=Position.cumulativeOffset(this.element);if(this.options.offset){c[1]+=this.options.offset}var d=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(c[1]>d?d:c[1])-this.scrollStart},update:function(b){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(b*this.delta))}});Effect.Fade=function(g){g=$(g);var f=g.getInlineOpacity();var d=Object.extend({from:g.getOpacity()||1,to:0,afterFinishInternal:function(a){if(a.options.to!=0){return}a.element.hide().setStyle({opacity:f})}},arguments[1]||{});return new Effect.Opacity(g,d)};Effect.Appear=function(c){c=$(c);var d=Object.extend({from:(c.getStyle("display")=="none"?0:c.getOpacity()||0),to:1,afterFinishInternal:function(a){a.element.forceRerendering()},beforeSetup:function(a){a.element.setOpacity(a.options.from).show()}},arguments[1]||{});return new Effect.Opacity(c,d)};Effect.Puff=function(c){c=$(c);var d={opacity:c.getInlineOpacity(),position:c.getStyle("position"),top:c.style.top,left:c.style.left,width:c.style.width,height:c.style.height};return new Effect.Parallel([new Effect.Scale(c,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(c,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(a){Position.absolutize(a.effects[0].element)},afterFinishInternal:function(a){a.effects[0].element.hide().setStyle(d)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(a){a.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(c){c=$(c);var d=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(a){a.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(c){c=$(c);var d=c.getInlineOpacity();return new Effect.Appear(c,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(a){new Effect.Scale(a.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(b){b.element.makePositioned().makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping().undoPositioned().setStyle({opacity:d})}})}},arguments[1]||{}))};Effect.DropOut=function(c){c=$(c);var d={top:c.getStyle("top"),left:c.getStyle("left"),opacity:c.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(c,{x:0,y:100,sync:true}),new Effect.Opacity(c,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(a){a.effects[0].element.makePositioned()},afterFinishInternal:function(a){a.effects[0].element.hide().undoPositioned().setStyle(d)}},arguments[1]||{}))};Effect.Shake=function(c){c=$(c);var d={top:c.getStyle("top"),left:c.getStyle("left")};return new Effect.Move(c,{x:20,y:0,duration:0.05,afterFinishInternal:function(a){new Effect.Move(a.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(b){new Effect.Move(b.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(f){new Effect.Move(f.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(i){new Effect.Move(i.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(h){h.element.undoPositioned().setStyle(d)}})}})}})}})}})}})};Effect.SlideDown=function(g){g=$(g).cleanWhitespace();var f=g.down().getStyle("bottom");var d=g.getDimensions();return new Effect.Scale(g,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makePositioned();a.element.down().makePositioned();if(window.opera){a.element.setStyle({top:""})}a.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:(a.dims[0]-a.element.clientHeight)+"px"})},afterFinishInternal:function(a){a.element.undoClipping().undoPositioned();a.element.down().undoPositioned().setStyle({bottom:f})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();var d=c.down().getStyle("bottom");return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(a){a.element.makePositioned();a.element.down().makePositioned();if(window.opera){a.element.setStyle({top:""})}a.element.makeClipping().show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:(a.dims[0]-a.element.clientHeight)+"px"})},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned().setStyle({bottom:d});a.element.down().undoPositioned()}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(a){a.element.makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping()}})};Effect.Grow=function(q){q=$(q);var j=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var k={top:q.style.top,left:q.style.left,height:q.style.height,width:q.style.width,opacity:q.getInlineOpacity()};var m=q.getDimensions();var l,n;var o,p;switch(j.direction){case"top-left":l=n=o=p=0;break;case"top-right":l=m.width;n=p=0;o=-m.width;break;case"bottom-left":l=o=0;n=m.height;p=-m.height;break;case"bottom-right":l=m.width;n=m.height;o=-m.width;p=-m.height;break;case"center":l=m.width/2;n=m.height/2;o=-m.width/2;p=-m.height/2;break}return new Effect.Move(q,{x:l,y:n,duration:0.01,beforeSetup:function(a){a.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(a){new Effect.Parallel([new Effect.Opacity(a.element,{sync:true,to:1,from:0,transition:j.opacityTransition}),new Effect.Move(a.element,{x:o,y:p,sync:true,transition:j.moveTransition}),new Effect.Scale(a.element,100,{scaleMode:{originalHeight:m.height,originalWidth:m.width},sync:true,scaleFrom:window.opera?1:0,transition:j.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(b){b.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(b){b.effects[0].element.undoClipping().undoPositioned().setStyle(k)}},j))}})};Effect.Shrink=function(m){m=$(m);var h=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var i={top:m.style.top,left:m.style.left,height:m.style.height,width:m.style.width,opacity:m.getInlineOpacity()};var j=m.getDimensions();var k,l;switch(h.direction){case"top-left":k=l=0;break;case"top-right":k=j.width;l=0;break;case"bottom-left":k=0;l=j.height;break;case"bottom-right":k=j.width;l=j.height;break;case"center":k=j.width/2;l=j.height/2;break}return new Effect.Parallel([new Effect.Opacity(m,{sync:true,to:0,from:1,transition:h.opacityTransition}),new Effect.Scale(m,window.opera?1:0,{sync:true,transition:h.scaleTransition,restoreAfterFinish:true}),new Effect.Move(m,{x:k,y:l,sync:true,transition:h.moveTransition})],Object.extend({beforeStartInternal:function(a){a.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.effects[0].element.hide().undoClipping().undoPositioned().setStyle(i)}},h))};Effect.Pulsate=function(k){k=$(k);var g=arguments[1]||{};var h=k.getInlineOpacity();var i=g.transition||Effect.Transitions.sinoidal;var j=function(a){return i(1-Effect.Transitions.pulse(a,g.pulses))};j.bind(i);return new Effect.Opacity(k,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(a){a.element.setStyle({opacity:h})}},g),{transition:j}))};Effect.Fold=function(c){c=$(c);var d={top:c.style.top,left:c.style.left,width:c.style.width,height:c.style.height};c.makeClipping();return new Effect.Scale(c,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(a){new Effect.Scale(c,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(b){b.element.hide().undoClipping().setStyle(d)}})}},arguments[1]||{}))};Effect.Morph=Class.create();Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(i){this.element=$(i);if(!this.element){throw (Effect._elementDoesNotExistError)}var f=Object.extend({style:{}},arguments[1]||{});if(typeof f.style=="string"){if(f.style.indexOf(":")==-1){var h="",g="."+f.style;$A(document.styleSheets).reverse().each(function(a){if(a.cssRules){cssRules=a.cssRules}else{if(a.rules){cssRules=a.rules}}$A(cssRules).reverse().each(function(b){if(g==b.selectorText){h=b.style.cssText;throw $break}});if(h){throw $break}});this.style=h.parseStyle();f.afterFinishInternal=function(a){a.element.addClassName(a.options.style);a.transforms.each(function(b){if(b.style!="opacity"){a.element.style[b.style]=""}})}}else{this.style=f.style.parseStyle()}}else{this.style=$H(f.style)}this.start(f)},setup:function(){function b(a){if(!a||["rgba(0, 0, 0, 0)","transparent"].include(a)){a="#ffffff"}a=a.parseColor();return $R(0,2).map(function(d){return parseInt(a.slice(d*2+1,d*2+3),16)})}this.transforms=this.style.map(function(i){var j=i[0],k=i[1],l=null;if(k.parseColor("#zzzzzz")!="#zzzzzz"){k=k.parseColor();l="color"}else{if(j=="opacity"){k=parseFloat(k);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(k)){var m=k.match(/^([\+\-]?[0-9\.]+)(.*)$/);k=parseFloat(m[1]);l=(m.length==3)?m[2]:null}}}var a=this.element.getStyle(j);return{style:j.camelize(),originalValue:l=="color"?b(a):parseFloat(a||0),targetValue:l=="color"?b(k):k,unit:l}}.bind(this)).reject(function(a){return((a.originalValue==a.targetValue)||(a.unit!="color"&&(isNaN(a.originalValue)||isNaN(a.targetValue))))})},update:function(g){var h={},f,i=this.transforms.length;while(i--){h[(f=this.transforms[i]).style]=f.unit=="color"?"#"+(Math.round(f.originalValue[0]+(f.targetValue[0]-f.originalValue[0])*g)).toColorPart()+(Math.round(f.originalValue[1]+(f.targetValue[1]-f.originalValue[1])*g)).toColorPart()+(Math.round(f.originalValue[2]+(f.targetValue[2]-f.originalValue[2])*g)).toColorPart():f.originalValue+Math.round(((f.targetValue-f.originalValue)*g)*1000)/1000+f.unit}this.element.setStyle(h,true)}});Effect.Transform=Class.create();Object.extend(Effect.Transform.prototype,{initialize:function(b){this.tracks=[];this.options=arguments[1]||{};this.addTracks(b)},addTracks:function(b){b.each(function(a){var d=$H(a).values().first();this.tracks.push($H({ids:$H(a).keys().first(),effect:Effect.Morph,options:{style:d}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(d){var c=[$(d.ids)||$$(d.ids)].flatten();return c.map(function(a){return new d.effect(a,Object.extend({sync:true},d.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 d=document.createElement("div");d.innerHTML='<div style="'+this+'"></div>';var g=d.childNodes[0].style,f=$H();Element.CSS_PROPERTIES.each(function(a){if(g[a]){f[a]=g[a]}});if(Prototype.Browser.IE&&this.indexOf("opacity")>-1){f.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]}return f};Element.morph=function(d,c){new Effect.Morph(d,Object.extend({style:c},arguments[2]||{}));return d};["getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(b){Element.Methods[b]=Element[b]});Element.Methods.visualEffect=function(d,g,f){s=g.dasherize().camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](d,f);return $(d)};Element.addMethods();try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var lightwindow=Class.create();lightwindow.prototype={element:null,contentToFetch:null,windowActive:false,dataEffects:[],dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},pageDimensions:{width:null,height:null},preloadImage:[],preloadedImage:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},scrollbarOffset:18,navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},initialize:function(b){this.a=Object.extend({resizeSpeed:8,contentOffset:{height:20,width:20},dimensions:{image:{height:250,width:250},page:{height:250,width:250},inline:{height:250,width:250},media:{height:250,width:250},external:{height:250,width:250},titleHeight:25},classNames:{standard:"lightwindow",action:"lightwindow_action"},fileTypes:{page:["asp","htm","html"],media:["mov","mp3","swf","wav","wmv"],image:["bmp","gif","jpg","png"]},mimeTypes:{gif:"image/gif",bmp:"image/bmp",jpeg:"image/jpeg",mov:"video/quicktime",movie:"video/x-sgi-movie",mp3:"audio/mpeg3",png:"image/png",swf:"application/x-shockwave-flash",wav:"audio/wav",wmv:"application/x-mplayer2"},classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",wmv:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"},viewportPadding:10,EOLASFix:"swf,wmv,fla,flv",overlay:{opacity:0.7,image:"http://www.freerefill.org/images/page_elements/black.png",presetImage:"http://www.freerefill.org/images/page_elements/black-70.png"},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" >close</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_galleries"><div id="lightwindow_galleries_tab_container" ></div><div id="lightwindow_galleries_list" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_gallery_container" ></div><div id="lightwindow_data_author_container" ></div></div><div id="lightwindow_data_caption" ></div></div></div></div>',loading:'<div id="lightwindow_loading" ><img src="http://www.freerefill.org/images/page_elements/ajax-loading.gif" alt="loading" /><span>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></span><iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div>',iframe:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body>{body_replace}</body></html>'},formMethod:"get",hideFlash:false,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false},b||{});this.duration=((11-this.a.resizeSpeed)*0.15);this._setupLinks();this._getScroll();this._getPageDimensions();this._browserDimensions();this._addLightWindowMarkup(false);this._setupDimensions()},activate:function(c,d){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(d);this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},deactivate:function(){this.windowActive=false;this.animating=false;this.element=null;this._displayLightWindow("none","visible");this._clearWindowContents(false);var b=Effect.Queues.get("lightwindowAnimation").each(function(a){a.cancel()});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false)},createWindow:function(c,d){this._processLink($(c))},activateWindow:function(b){this.element=Object.extend({href:null,title:null,author:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null},b||{});this.contentToFetch=this.element.href;this.windowType=this.element.type?this.element.type:this._fileType(this.element.href);this._clearWindowContents(true);this._addLoadingWindowMarkup();this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},submitForm:function(b){if(this.a.formHandler){this.a.formHandler(b)}else{this._defaultFormHandler(b)}},openWindow:function(b){var b=$(b);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(b);this._setStatus(true);this._handleTransition()},navigateWindow:function(b){this._handleNavigation(false);if(b=="previous"){this.openWindow(this.navigationObservers.previous)}else{if(b=="next"){this.openWindow(this.navigationObservers.next)}}},_setupLinks:function(){var b=$$("."+this.a.classNames.standard);b.each(function(a){this._processLink(a)}.bind(this))},_processLink:function(g){var d=g.getAttribute("href");if(d.indexOf("?")>-1){d=d.substring(0,d.indexOf("?"))}var f=d.substring(d.indexOf("#")+1);if($(f)){$(f).setStyle({display:"none"})}Event.observe(g,"click",this.activate.bindAsEventListener(this,g),false);g.onclick=function(){return false}},_setupActions:function(){var b=$$("#lightwindow_container ."+this.a.classNames.action);b.each(function(a){Event.observe(a,"click",this[a.getAttribute("rel")].bindAsEventListener(this,a),false);a.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(f){var i=Element.extend(document.createElement("div"));i.setAttribute("id","lightwindow_overlay");if(Prototype.Browser.Gecko){i.setStyle({backgroundImage:"url("+this.a.overlay.presetImage+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"})}else{i.setStyle({opacity:this.a.overlay.opacity,backgroundImage:"url("+this.a.overlay.image+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"})}var h=document.createElement("div");h.setAttribute("id","lightwindow");h.innerHTML=this.a.skin.main;var g=document.getElementsByTagName("body")[0];g.appendChild(i);g.appendChild(h);if($("lightwindow_title_bar_close_link")){Event.observe("lightwindow_title_bar_close_link","click",this.deactivate.bindAsEventListener(this));$("lightwindow_title_bar_close_link").onclick=function(){return false}}Event.observe($("lightwindow_previous"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous").onclick=function(){return false};Event.observe($("lightwindow_next"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next").onclick=function(){return false};if(Prototype.Browser.IE){Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false)}else{Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false)}Event.observe(i,"click",this.deactivate.bindAsEventListener(this),false);i.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.a.skin.loading},_setupWindowElements:function(b){this.element=b;this.element.title=null?"":b.getAttribute("title");this.element.author=null?"":b.getAttribute("author");this.element.caption=null?"":b.getAttribute("caption");this.element.rel=null?"":b.getAttribute("rel");this.element.params=null?"":b.getAttribute("params");this.contentToFetch=this.element.href;this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch)},_clearWindowContents:function(d){if($("lightwindow_iframe")){Element.remove($("lightwindow_iframe"))}if($("lightwindow_media_primary")){try{$("lightwindow_media_primary").Stop()}catch(c){}Element.remove($("lightwindow_media_primary"))}if($("lightwindow_media_secondary")){try{$("lightwindow_media_secondary").Stop()}catch(c){}Element.remove($("lightwindow_media_secondary"))}this.activeGallery=false;this._handleNavigation(this.activeGallery);if(d){$("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(b){this.animating=b;if(b){Element.show("lightwindow_loading")}if(!(/MSIE 6./i.test(navigator.userAgent))){this._fixedWindow(b)}},_fixedWindow:function(b){if(b){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")})}}},_prepareIE:function(m){if(Prototype.Browser.IE){var h,k,l;if(m){var h="100%"}else{var h="auto"}var i=document.getElementsByTagName("body")[0];var j=document.getElementsByTagName("html")[0];j.style.height=i.style.height=h}},_stopScrolling:function(b){if(this.animating){if(b.preventDefault){b.preventDefault()}b.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(d,c){document.documentElement.scrollLeft=d;document.documentElement.scrollTop=c},_toggleTroubleElements:function(j,n){if(n){var o=$("lightwindow_contents").getElementsByTagName("select")}else{var o=document.getElementsByTagName("select")}for(var i=0;i<o.length;i++){o[i].style.visibility=j}if(!n){if(this.a.hideFlash){var l=document.getElementsByTagName("object");for(i=0;i!=l.length;i++){l[i].style.visibility=j}var m=document.getElementsByTagName("embed");for(i=0;i!=m.length;i++){m[i].style.visibility=j}}var k=document.getElementsByTagName("iframe");for(i=0;i!=k.length;i++){k[i].style.visibility=j}}},_getPageDimensions:function(){var i,g;if(window.innerHeight&&window.scrollMaxY){i=document.body.scrollWidth;g=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){i=document.body.scrollWidth;g=document.body.scrollHeight}else{i=document.body.offsetWidth;g=document.body.offsetHeight}}var f,h;if(self.innerHeight){f=self.innerWidth;h=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){f=document.documentElement.clientWidth;h=document.documentElement.clientHeight}else{if(document.body){f=document.body.clientWidth;h=document.body.clientHeight}}}if(g<h){this.pageDimensions.height=h}else{this.pageDimensions.height=g}if(i<f){this.pageDimensions.width=f}else{this.pageDimensions.width=i}},_displayLightWindow:function(c,d){$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=c;$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=d},_setupDimensions:function(){var i,h;switch(this.windowType){case"page":i=this.a.dimensions.page.height;h=this.a.dimensions.page.width;break;case"image":i=this.a.dimensions.image.height;h=this.a.dimensions.image.width;break;case"media":i=this.a.dimensions.media.height;h=this.a.dimensions.media.width;break;case"external":i=this.a.dimensions.external.height;h=this.a.dimensions.external.width;break;case"inline":i=this.a.dimensions.inline.height;h=this.a.dimensions.inline.width;break;default:i=this.a.dimensions.page.height;h=this.a.dimensions.page.width;break}var g=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;var f=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$("lightwindow").setStyle({top:g+"px",left:f+"px"});$("lightwindow_container").setStyle({height:i+"px",width:h+"px",left:-(h/2)+"px",top:-(i/2)+"px"});$("lightwindow_contents").setStyle({height:i+"px",width:h+"px"})},_fileType:function(h){var i=new RegExp("[^.].("+this.a.fileTypes.image.join("|")+")s*$","i");if(i.test(h)){return"image"}if(h.indexOf("#")>-1&&(document.domain==this._getDomain(h))){return"inline"}if(h.indexOf("?")>-1){h=h.substring(0,h.indexOf("?"))}var g="unknown";var k=new RegExp("[^.].("+this.a.fileTypes.page.join("|")+")s*$","i");var j=new RegExp("[^.].("+this.a.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(h)){g="external"}if(j.test(h)){g="media"}if(g=="external"||g=="media"){return g}if(k.test(h)||h.substr((h.length-1),h.length)=="/"){g="page"}return g},_fileExtension:function(g){if(g.indexOf("?")>-1){g=g.substring(0,g.indexOf("?"))}var d="";for(var f=(g.length-1);f>-1;f--){if(g.charAt(f)=="."){return d}d=g.charAt(f)+d}},_monitorKeyboard:function(b){if(b){document.onkeydown=this._eventKeypress.bind(this)}else{document.onkeydown=""}},_eventKeypress:function(c){if(c==null){var d=event.keyCode}else{var d=c.which}switch(d){case 27:this.deactivate();break;case 13:return;default:break}if(this.animating){return false}switch(String.fromCharCode(d).toLowerCase()){case"p":if(this.navigationObservers.previous){this.navigateWindow("previous")}break;case"n":if(this.navigationObservers.next){this.navigateWindow("next")}break;default:break}},_getDomain:function(m){var k=m.indexOf("//");var i=k+2;var n=m.substring(i,m.length);var j=n.indexOf("/");var l=n.substring(0,j);if(l.indexOf(":")>-1){var o=l.indexOf(":");l=l.substring(0,o)}return l},_getParameter:function(l,p){if(!this.element){return false}if(l=="lightwindow_top"&&this.element.top){return unescape(this.element.top)}else{if(l=="lightwindow_left"&&this.element.left){return unescape(this.element.left)}else{if(l=="lightwindow_type"&&this.element.type){return unescape(this.element.type)}else{if(l=="lightwindow_show_images"&&this.element.showImages){return unescape(this.element.showImages)}else{if(l=="lightwindow_height"&&this.element.height){return unescape(this.element.height)}else{if(l=="lightwindow_width"&&this.element.width){return unescape(this.element.width)}else{if(l=="lightwindow_loading_animation"&&this.element.loadingAnimation){return unescape(this.element.loadingAnimation)}else{if(l=="lightwindow_iframe_embed"&&this.element.iframeEmbed){return unescape(this.element.iframeEmbed)}else{if(l=="lightwindow_form"&&this.element.form){return unescape(this.element.form)}else{if(!p){if(this.element.params){p=this.element.params}else{return}}var n;var o=p.split(",");var q=l+"=";var m=q.length;for(var i=0;i<o.length;i++){if(o[i].substr(0,m)==q){var k=o[i].split("=");n=k[1];break}}if(!n){return false}else{return unescape(n)}}}}}}}}}}},_browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth}else{this.dimensions.viewport.height=window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth}},_getScrollerWidth:function(){var i=Element.extend(document.createElement("div"));i.setAttribute("id","lightwindow_scroll_div");i.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});var k=Element.extend(document.createElement("div"));k.setAttribute("id","lightwindow_content_scroll_div");k.setStyle({width:"100%",height:"200px"});i.appendChild(k);var g=document.getElementsByTagName("body")[0];g.appendChild(i);var j=$("lightwindow_content_scroll_div").offsetWidth;i.style.overflow="auto";var h=$("lightwindow_content_scroll_div").offsetWidth;Element.remove($("lightwindow_scroll_div"));this.scrollbarOffset=j-h},_addParamToObject:function(g,k,h,i){var j=document.createElement("param");j.setAttribute("value",k);j.setAttribute("name",g);if(i){j.setAttribute("id",i)}h.appendChild(j);return h},_outerHTML:function(f){if(Prototype.Browser.IE){return f.outerHTML}else{var g=f.cloneNode(true);var d=document.createElement("div");d.appendChild(g);return d.innerHTML}},_convertToMarkup:function(i,f){var g=this._outerHTML(i).replace("</"+f+">","");if(Prototype.Browser.IE){for(var h=0;h<i.childNodes.length;h++){g+=this._outerHTML(i.childNodes[h])}g+="</"+f+">"}return g},_appendObject:function(k,g,h){if(Prototype.Browser.IE){h.innerHTML+=this._convertToMarkup(k,g);if(this.a.EOLASFix.indexOf(this._fileType(this.element.href))>-1){var i=document.getElementsByTagName("object");for(var j=0;j<i.length;j++){if(i[j].getAttribute("data")){i[j].removeAttribute("data")}i[j].outerHTML=i[j].outerHTML;i[j].style.visibility="visible"}}}else{h.appendChild(k)}},_appendIframe:function(d){var c=document.createElement("iframe");c.setAttribute("id","lightwindow_iframe");c.setAttribute("name","lightwindow_iframe");c.setAttribute("src","about:blank");c.setAttribute("height","100%");c.setAttribute("width","100%");c.setAttribute("frameborder","0");c.setAttribute("marginwidth","0");c.setAttribute("marginheight","0");c.setAttribute("scrolling",d);this._appendObject(c,"iframe",$("lightwindow_contents"))},_writeToIframe:function(c){var d=this.a.skin.iframe;d=d.replace("{body_replace}",c);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(d);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(d);$("lightwindow_iframe").contentDocument.close()}},_loadWindow:function(){switch(this.windowType){case"image":var i=0;var h=[];this.checkImage=[];this.resizeTo.height=this.resizeTo.width=0;this.imageCount=this._getParameter("lightwindow_show_images")?parseInt(this._getParameter("lightwindow_show_images")):1;for(var k=i;k<(i+this.imageCount);k++){h[k]=document.createElement("img");h[k].setAttribute("id","lightwindow_image_"+k);h[k].setAttribute("border","0");h[k].setAttribute("src",this.contentToFetch);$("lightwindow_contents").appendChild(h[k]);this.checkImage[k]=new PeriodicalExecuter(function(a){if(!(typeof $("lightwindow_image_"+a).naturalWidth!="undefined"&&$("lightwindow_image_"+a).naturalWidth==0)){this.checkImage[a].stop();var b=$("lightwindow_image_"+a).getHeight();if(b>this.resizeTo.height){this.resizeTo.height=b}this.resizeTo.width+=$("lightwindow_image_"+a).getWidth();this.imageCount--;$("lightwindow_image_"+a).setStyle({height:"100%"});if(this.imageCount==0){this._processWindow()}}}.bind(this,k),1)}break;case"media":var i=0;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._appendIframe("auto");this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width;this._processWindow();break;case"page":var g=new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(a){$("lightwindow_contents").innerHTML+=a.responseText;this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.a.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.a.contentOffset.width);this._processWindow()}.bind(this)});break;case"inline":var j=this.contentToFetch;if(j.indexOf("?")>-1){j=j.substring(0,j.indexOf("?"))}j=j.substring(j.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(j).innerHTML);this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.a.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.a.contentOffset.width);this._toggleTroubleElements("hidden",true);this._processWindow();break;default:throw ("Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch);break}},_resizeWindowToFit:function(){if(this.resizeTo.height+this.dimensions.cruft.height>this.dimensions.viewport.height){var d=this.resizeTo.height/this.resizeTo.width;this.resizeTo.height=this.dimensions.viewport.height-this.dimensions.cruft.height-(2*this.a.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.width=this.resizeTo.height/d;$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"})}}if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){var c=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=this.dimensions.viewport.width-2*this.dimensions.cruft.width-(2*this.a.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.height=this.resizeTo.width/c;$("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=[];$("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 c={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};$("lightwindow_container").setStyle({height:"auto",width:$("lightwindow_container").getWidth()+this.a.contentOffset.width-(this.windowActive?this.a.contentOffset.width:0)+"px"});var d={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.containerChange={height:c.height-d.height,width:c.width-d.width};this.dimensions.container={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.dimensions.cruft={height:this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.a.contentOffset.height,width:this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.a.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"});this._displayLightWindow("block","visible");this._animateLightWindow()},_animateLightWindow:function(){if(this.a.animationHandler){this.a.animationHandler().bind(this)}else{this._defaultAnimationHandler()}},_handleNavigation:function(b){if(this.a.navigationHandler){this.a.navigationHandler().bind(this,b)}else{this._defaultDisplayNavigation(b)}},_handleTransition:function(){if(this.a.transitionHandler){this.a.transitionHandler().bind(this)}else{this._defaultTransitionHandler()}},_handleFinalWindowAnimation:function(b){if(this.a.finalAnimationHandler){this.a.finalAnimationHandler().bind(this,b)}else{this._defaultfinalWindowAnimationHandler(b)}},_defaultDisplayNavigation:function(b){if(b){$("lightwindow_navigation").setStyle({display:"block",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.a.dimensions.titleHeight+"px"})}else{$("lightwindow_navigation").setStyle({display:"none",height:"auto",width:"auto"})}},_defaultAnimationHandler:function(){if(this.element.caption||this.element.author){$("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.a.dimensions.titleHeight+"px"});this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:this.a.dimensions.titleHeight+"px",marginTop:"0px"}}),new Effect.Appear("lightwindow_title_bar_inner",{sync:true,from:0,to:1}));var d=false;var c=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.a.contentOffset.width;if(c!=$("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.a.contentOffset.width))),sync:true,scaleY:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(c/(this.dimensions.container.width)),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}})}c=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.a.contentOffset.height;if(c!=$("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.a.contentOffset.height))),sync:true,scaleX:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(c/(this.dimensions.container.height)),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){if(this.dimensions.dataEffects.length>0){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"}});d=true}if(!d&&this.dimensions.dataEffects.length>0){new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){if(this.containerChange.height!=0||this.containerChange.width!=0){new Effect.MoveBy("lightwindow_container",this.containerChange.height,this.containerChange.width,{transition:Effect.Transitions.sinoidal})}}.bind(this),afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultfinalWindowAnimationHandler:function(b){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._setStatus(false)}else{Effect.Fade("lightwindow_loading",{duration:0.75,delay:1,afterFinish:function(){if(this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"){$("lightwindow_contents").setStyle({overflow:"auto"})}this._setStatus(false)}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_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}))}this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:"0px",marginTop:this.a.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(h){var f=Event.element(h).parentNode;var i=Form.serialize(this._getParameter("lightwindow_form",f.getAttribute("params")));if(this.a.formMethod=="post"){var g=new Ajax.Request(f.href,{method:"post",postBody:i,onComplete:this.openWindow.bind(this,f)})}else{if(this.a.formMethod=="get"){var g=new Ajax.Request(f.href,{method:"get",parameters:i,onComplete:this.openWindow.bind(this,f)})}}},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.element.href);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var c=document.createElement("object");c.setAttribute("classid",this.a.classids[this._fileExtension(this.contentToFetch)]);c.setAttribute("codebase",this.a.codebases[this._fileExtension(this.contentToFetch)]);c.setAttribute("id","lightwindow_media_primary");c.setAttribute("name","lightwindow_media_primary");c.setAttribute("width",this.resizeTo.width);c.setAttribute("height",this.resizeTo.height);c=this._addParamToObject("movie",this.contentToFetch,c);c=this._addParamToObject("src",this.contentToFetch,c);c=this._addParamToObject("controller","true",c);c=this._addParamToObject("wmode","transparent",c);c=this._addParamToObject("cache","false",c);c=this._addParamToObject("quality","high",c);if(!Prototype.Browser.IE){var d=document.createElement("object");d.setAttribute("type",this.a.mimeTypes[this._fileExtension(this.contentToFetch)]);d.setAttribute("data",this.contentToFetch);d.setAttribute("id","lightwindow_media_secondary");d.setAttribute("name","lightwindow_media_secondary");d.setAttribute("width",this.resizeTo.width);d.setAttribute("height",this.resizeTo.height);d=this._addParamToObject("controller","true",d);d=this._addParamToObject("wmode","transparent",d);d=this._addParamToObject("cache","false",d);d=this._addParamToObject("quality","high",d);c.appendChild(d)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(c,"object"))}else{this._appendObject(c,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}else{this._handleFinalWindowAnimation(0)}}this._setupActions()}};Event.observe(window,"load",lightwindowInit,false);var myLightWindow=null;function lightwindowInit(){myLightWindow=new lightwindow()}var accordion=Class.create();accordion.prototype={showAccordion:null,currentAccordion:null,duration:null,effects:[],animating:false,initialize:function(d,g){if(!$(d)){throw (d+" doesn't exist!");return false}this.a=Object.extend({resizeSpeed:8,classNames:{toggle:"accordion_toggle",toggleActive:"accordion_toggle_active",content:"accordion_content"},defaultSize:{height:null,width:null},direction:"vertical",onEvent:"click"},g||{});this.duration=((11-this.a.resizeSpeed)*0.15);var f=$$("#"+d+" ."+this.a.classNames.toggle);f.each(function(b){Event.observe(b,this.a.onEvent,this.activate.bind(this,b),false);if(this.a.onEvent=="click"){b.onclick=function(){return false}}if(this.a.direction=="horizontal"){var a=$H({width:"0px"})}else{var a=$H({height:"0px"})}a.merge({display:"none"});this.currentAccordion=$(b.next(0)).setStyle(a)}.bind(this))},activate:function(b){if(this.animating){return false}this.effects=[];this.currentAccordion=$(b.next(0));this.currentAccordion.setStyle({display:"block"});this.currentAccordion.previous(0).addClassName(this.a.classNames.toggleActive);if(this.a.direction=="horizontal"){this.scaling=$H({scaleX:true,scaleY:false})}else{this.scaling=$H({scaleX:false,scaleY:true})}if(this.currentAccordion==this.showAccordion){this.deactivate()}else{this._handleAccordion()}},deactivate:function(){var b=$H({duration:this.duration,scaleContent:false,transition:Effect.Transitions.sinoidal,queue:{position:"end",scope:"accordionAnimation"},scaleMode:{originalHeight:this.a.defaultSize.height?this.a.defaultSize.height:this.currentAccordion.scrollHeight,originalWidth:this.a.defaultSize.width?this.a.defaultSize.width:this.currentAccordion.scrollWidth},afterFinish:function(){this.showAccordion.setStyle({height:"auto",display:"none"});this.showAccordion=null;this.animating=false}.bind(this)});b.merge(this.scaling);this.showAccordion.previous(0).removeClassName(this.a.classNames.toggleActive);new Effect.Scale(this.showAccordion,0,b)},_handleAccordion:function(){var b=$H({sync:true,scaleFrom:0,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleMode:{originalHeight:this.a.defaultSize.height?this.a.defaultSize.height:this.currentAccordion.scrollHeight,originalWidth:this.a.defaultSize.width?this.a.defaultSize.width:this.currentAccordion.scrollWidth}});b.merge(this.scaling);this.effects.push(new Effect.Scale(this.currentAccordion,100,b));if(this.showAccordion){this.showAccordion.previous(0).removeClassName(this.a.classNames.toggleActive);b=$H({sync:true,scaleContent:false,transition:Effect.Transitions.sinoidal});b.merge(this.scaling);this.effects.push(new Effect.Scale(this.showAccordion,0,b))}new Effect.Parallel(this.effects,{duration:this.duration,queue:{position:"end",scope:"accordionAnimation"},beforeStart:function(){this.animating=true}.bind(this),afterFinish:function(){if(this.showAccordion){this.showAccordion.setStyle({display:"none"})}$(this.currentAccordion).setStyle({height:"auto"});this.showAccordion=this.currentAccordion;this.animating=false}.bind(this)})}};
