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(a){return a}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(a===undefined){return"undefined"}if(a===null){return"null"}return a.inspect?a.inspect():a.toString()}catch(b){if(b instanceof RangeError){return"..."}throw b}},toJSON:function(a){var c=typeof a;switch(c){case"undefined":case"function":case"unknown":return;case"boolean":return a.toString()}if(a===null){return"null"}if(a.toJSON){return a.toJSON()}if(a.ownerDocument===document){return}var b=[];for(var e in a){var d=Object.toJSON(a[e]);if(d!==undefined){b.push(e.toJSON()+": "+d)}}return"{"+b.join(", ")+"}"},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)}});Function.prototype.bind=function(){var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(c){var a=this,b=$A(arguments),c=b.shift();return function(d){return a.apply(c,[d||window.event].concat(b))}};Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this},toPaddedString:function(c,b){var a=this.toString(b||10);return"0".times(c-a.length)+a},toJSON:function(){return isFinite(this)?this.toString():"null"}});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 c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},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(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(e,c){var a="",d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length>0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=String.interpret(c(b));d=d.slice(b.index+b[0].length)}else{a+=d,d=""}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=b===undefined?1:b;return this.gsub(c,function(d){if(--b<0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return this},truncate:function(b,a){b=b||30;a=a===undefined?"...":a;return this.length>b?this.slice(0,b-a.length)+a:this},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,"img");var a=new RegExp(Prototype.ScriptFragment,"im");return(this.match(b)||[]).map(function(c){return(c.match(a)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=document.createElement("div");a.innerHTML=this.stripTags();return a.childNodes[0]?(a.childNodes.length>1?$A(a.childNodes).inject("",function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue):""},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);if(!a){return{}}return a[1].split(b||"&").inject({},function(e,f){if((f=f.split("="))[0]){var c=decodeURIComponent(f.shift());var d=f.length>1?f.join("="):f[0];if(d!=undefined){d=decodeURIComponent(d)}if(c in e){if(e[c].constructor!=Array){e[c]=[e[c]]}e[c].push(d)}else{e[c]=d}}return e})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(c){var a="";for(var b=0;b<c;b++){a+=this}return a},camelize:function(){var d=this.split("-"),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)=="-"?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b<a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:"\\u00"+c[0].charCodeAt().toPaddedString(2,16)});if(b){return'"'+a.replace(/"/g,'\\"')+'"'}return"'"+a.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,"#{1}")},isJSON:function(){var a=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(a){return this.indexOf(a)>-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(b){if(typeof b=="function"){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text)}var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){return this.template.gsub(this.pattern,function(b){var c=b[1];if(c=="\\"){return b[2]}return c+String.interpret(a[b[3]])})}};var $break={},$continue=new Error('"throw $continue" is deprecated, use "return" instead');var Enumerable={each:function(b){var a=0;try{this._each(function(d){b(d,a++)})}catch(c){if(c!=$break){throw c}}return this},eachSlice:function(c,b){var a=-c,d=[],e=this.toArray();while((a+=c)<e.length){d.push(e.slice(a,a+c))}return d.map(b)},all:function(b){var a=true;this.each(function(d,c){a=a&&!!(b||Prototype.K)(d,c);if(!a){throw $break}});return a},any:function(b){var a=false;this.each(function(d,c){if(a=!!(b||Prototype.K)(d,c)){throw $break}});return a},collect:function(b){var a=[];this.each(function(d,c){a.push((b||Prototype.K)(d,c))});return a},detect:function(b){var a;this.each(function(d,c){if(b(d,c)){a=d;throw $break}});return a},findAll:function(b){var a=[];this.each(function(d,c){if(b(d,c)){a.push(d)}});return a},grep:function(c,b){var a=[];this.each(function(f,e){var d=f.toString();if(d.match(c)){a.push((b||Prototype.K)(f,e))}});return a},include:function(a){var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inGroupsOf:function(b,a){a=a===undefined?null:a;return this.eachSlice(b,function(c){while(c.length<b){c.push(a)}return c})},inject:function(a,b){this.each(function(d,c){a=b(a,d,c)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.map(function(c){return c[b].apply(c,a)})},max:function(b){var a;this.each(function(d,c){d=(b||Prototype.K)(d,c);if(a==undefined||d>=a){a=d}});return a},min:function(b){var a;this.each(function(d,c){d=(b||Prototype.K)(d,c);if(a==undefined||d<a){a=d}});return a},partition:function(c){var b=[],a=[];this.each(function(e,d){((c||Prototype.K)(e,d)?b:a).push(e)});return[b,a]},pluck:function(b){var a=[];this.each(function(d,c){a.push(d[b])});return a},reject:function(b){var a=[];this.each(function(d,c){if(!b(d,c)){a.push(d)}});return a},sortBy:function(a){return this.map(function(c,b){return{value:c,criteria:a(c,b)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var b=Prototype.K,a=$A(arguments);if(typeof a.last()=="function"){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(d){if(!d){return[]}if(d.toArray){return d.toArray()}else{var b=[];for(var a=0,c=d.length;a<c;a++){b.push(d[a])}return b}};if(Prototype.Browser.WebKit){$A=Array.from=function(d){if(!d){return[]}if(!(typeof d=="function"&&d=="[object NodeList]")&&d.toArray){return d.toArray()}else{var b=[];for(var a=0,c=d.length;a<c;a++){b.push(d[a])}return b}}}Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;a<c;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(a&&a.constructor==Array?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},indexOf:function(a){for(var b=0,c=this.length;b<c;b++){if(this[b]==a){return b}}return -1},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c)}return d})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var a=[];this.each(function(b){var c=Object.toJSON(b);if(c!==undefined){a.push(c)}});return"["+a.join(", ")+"]"}});Array.prototype.toArray=Array.prototype.clone;function $w(a){a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b<c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b<c;b++){if(arguments[b].constructor==Array){for(var a=0,d=arguments[b].length;a<d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e}}var Hash=function(a){if(a instanceof Hash){this.merge(a)}else{Object.extend(this,a||{})}};Object.extend(Hash,{toQueryString:function(b){var a=[];a.add=arguments.callee.addPair;this.prototype._each.call(b,function(d){if(!d.key){return}var c=d.value;if(c&&typeof c=="object"){if(c.constructor==Array){c.each(function(e){a.add(d.key,e)})}return}a.add(d.key,c)});return a.join("&")},toJSON:function(a){var b=[];this.prototype._each.call(a,function(d){var c=Object.toJSON(d.value);if(c!==undefined){b.push(d.key.toJSON()+": "+c)}});return"{"+b.join(", ")+"}"}});Hash.toQueryString.addPair=function(a,c,b){a=encodeURIComponent(a);if(c===undefined){this.push(a)}else{this.push(a+"="+(c==null?"":encodeURIComponent(c)))}};Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(b){for(var a in this){var c=this[a];if(c&&c==Hash.prototype[a]){continue}var d=[a,c];d.key=a;d.value=c;b(d)}},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},merge:function(a){return $H(a).inject(this,function(b,c){b[c.key]=c.value;return b})},remove:function(){var a;for(var b=0,c=arguments.length;b<c;b++){var d=this[arguments[b]];if(d!==undefined){if(a===undefined){a=d}else{if(a.constructor!=Array){a=[a]}a.push(d)}}delete this[arguments[b]]}return a},toQueryString:function(){return Hash.toQueryString(this)},inspect:function(){return"#<Hash:{"+this.map(function(a){return a.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Hash.toJSON(this)}});function $H(a){if(a instanceof Hash){return a}return new Hash(a)}if(function(){var a=0,c=function(d){this.key=d};c.prototype.key="foo";for(var b in new c("bar")){a++}return a>1}()){Hash.prototype._each=function(c){var a=[];for(var b in this){var d=this[b];if((d&&d==Hash.prototype[b])||a.include(b)){continue}a.push(b);var e=[b,d];e.key=b;e.value=d;c(e)}}}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start){return false}if(this.exclusive){return a<this.end}return a<=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(typeof f[d]=="function"){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};Object.extend(this.options,a||{});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(b,a){this.transport=Ajax.getTransport();this.setOptions(a);this.request(b)},request:function(a){this.url=a;this.method=this.options.method;var c=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){c._method=this.method;this.method="post"}this.parameters=c;if(c=Hash.toQueryString(c)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+c}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){c+="&_="}}}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||c):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(b){this.dispatchException(b)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(typeof c.push=="function"){for(var b=0,d=c.length;b<d;b+=2){e[c[b]]=c[b+1]}}else{$H(c).each(function(f){e[f.key]=f.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},success:function(){return !this.transport.status||(this.transport.status>=200&&this.transport.status<300)},respondToReadyState:function(a){var c=Ajax.Request.Events[a];var g=this.transport,b=this.evalJSON();if(c=="Complete"){try{this._complete=true;(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(g,b)}catch(d){this.dispatchException(d)}var f=this.getHeader("Content-type");if(f&&f.strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(g,b);Ajax.Responders.dispatch("on"+c,this,g,b)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},evalJSON:function(){try{var a=this.getHeader("X-JSON");return a?a.evalJSON():null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};this.transport=Ajax.getTransport();this.setOptions(b);var d=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(f,e){this.updateContent();d(f,e)}).bind(this);this.request(c)},updateContent:function(){var b=this.container[this.success()?"success":"failure"];var a=this.transport.responseText;if(!this.options.evalScripts){a=a.stripScripts()}if(b=$(b)){if(this.options.insertion){new this.options.insertion(b,a)}else{b.update(a)}}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(a,c,b){this.setOptions(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(typeof b=="string"){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,a){var c=[];var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b<d;b++){c.push(e.snapshotItem(b))}return c};document.getElementsByClassName=function(b,a){var c=".//*[contains(concat(' ', @class, ' '), ' "+b+" ')]";return document._getElementsByXPath(c,a)}}else{document.getElementsByClassName=function(g,j){var d=($(j)||document.body).getElementsByTagName("*");var a=[],b,f=new RegExp("(^|\\s)"+g+"(\\s|$)");for(var e=0,c=d.length;e<c;e++){b=d[e];var h=b.className;if(h.length==0){continue}if(h==g||h.match(f)){a.push(Element.extend(b))}}return a}}if(!window.Element){var Element={}}Element.extend=function(e){var f=Prototype.BrowserFeatures;if(!e||!e.tagName||e.nodeType==3||e._extended||f.SpecificElementExtensions||e==window){return e}var b={},d=e.tagName,a=Element.extend.cache,c=Element.Methods.ByTag;if(!f.ElementExtensions){Object.extend(b,Element.Methods),Object.extend(b,Element.Methods.Simulated)}if(c[d]){Object.extend(b,c[d])}for(var h in b){var g=b[h];if(typeof g=="function"&&!(h in e)){e[h]=a.findOrStore(g)}}e._extended=Prototype.emptyFunction;return e};Element.extend.cache={findOrStore:function(a){return this[a]=this[a]||function(){return a.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){$(a).style.display="none";return a},show:function(a){$(a).style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(b,a){a=typeof a=="undefined"?"":a.toString();$(b).innerHTML=a.stripScripts();setTimeout(function(){a.evalScripts()},10);return b},replace:function(c,b){c=$(c);b=typeof b=="undefined"?"":b.toString();if(c.outerHTML){c.outerHTML=b.stripScripts()}else{var a=c.ownerDocument.createRange();a.selectNodeContents(c);c.parentNode.replaceChild(a.createContextualFragment(b.stripScripts()),c)}setTimeout(function(){b.evalScripts()},10);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last();var d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return $(a).recursivelyCollect("parentNode")},descendants:function(a){return $A($(a).getElementsByTagName("*")).each(Element.extend)},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]}while(a&&a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){return $(a).recursivelyCollect("previousSibling")},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling")},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(b,a){if(typeof a=="string"){a=new Selector(a)}return a.match($(b))},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=b.ancestors();return d?Selector.findElement(c,d,a):c[a||0]},down:function(b,c,a){b=$(b);if(arguments.length==1){return b.firstDescendant()}var d=b.descendants();return c?Selector.findElement(d,c,a):d[a||0]},previous:function(b,d,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var c=b.previousSiblings();return d?Selector.findElement(c,d,a):c[a||0]},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=c.nextSiblings();return d?Selector.findElement(a,d,b):a[b||0]},getElementsBySelector:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},getElementsByClassName:function(a,b){return document.getElementsByClassName(b,a)},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){if(!c.attributes){return null}var b=Element._attributeTranslations;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}var d=c.attributes[a];return d?d.nodeValue:null}return c.getAttribute(a)},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;if(c.length==0){return false}if(c==b||c.match(new RegExp("(^|\\s)"+b+"(\\s|$)"))){return true}return false},addClassName:function(a,b){if(!(a=$(a))){return}Element.classNames(a).add(b);return a},removeClassName:function(a,b){if(!(a=$(a))){return}Element.classNames(a).remove(b);return a},toggleClassName:function(a,b){if(!(a=$(a))){return}Element.classNames(a)[a.hasClassName(b)?"remove":"add"](b);return a},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Position.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(a,c,b){a=$(a);var e=a.style;for(var d in c){if(d=="opacity"){a.setOpacity(c[d])}else{e[(d=="float"||d=="cssFloat")?(e.styleFloat===undefined?"cssFloat":"styleFloat"):(b?d:d.camelize())]=c[d]}}return a},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},getDimensions:function(c){c=$(c);var g=$(c).getStyle("display");if(g!="none"&&g!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var f=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var h=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=f;return{width:h,height:e}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=a.style.overflow||"auto";if((Element.getStyle(a,"overflow")||"visible")!="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a}};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(a,b){switch(b){case"left":case"top":case"right":case"bottom":if(Element._getStyle(a,"position")=="static"){return null}default:return Element._getStyle(a,b)}}}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(a,d){a=$(a);var c=a.getStyle("filter"),b=a.style;if(d==1||d===""){b.filter=c.replace(/alpha\([^\)]*\)/gi,"");return a}else{if(d<0.00001){d=0}}b.filter=c.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+(d*100)+")";return a};Element.Methods.update=function(c,b){c=$(c);b=typeof b=="undefined"?"":b.toString();var a=c.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].include(a)){var d=document.createElement("div");switch(a){case"THEAD":case"TBODY":d.innerHTML="<table><tbody>"+b.stripScripts()+"</tbody></table>";depth=2;break;case"TR":d.innerHTML="<table><tbody><tr>"+b.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":d.innerHTML="<table><tbody><tr><td>"+b.stripScripts()+"</td></tr></tbody></table>";depth=4}$A(c.childNodes).each(function(e){c.removeChild(e)});depth.times(function(){d=d.firstChild});$A(d.childNodes).each(function(e){c.appendChild(e)})}else{c.innerHTML=b.stripScripts()}setTimeout(function(){b.evalScripts()},10);return c}}else{if(Prototype.Browser.Gecko){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}}}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(a,b){return a.getAttribute(b,2)},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){var b=a.getAttributeNode("title");return b.specified?b.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(b,d){var a=Element._attributeTranslations,c;d=a.names[d]||d;c=$(b).getAttributeNode(d);return c&&c.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(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var h=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(b.constructor==Array){b.each(g)}else{g(b)}}function g(j){j=j.toUpperCase();if(!Element.Methods.ByTag[j]){Element.Methods.ByTag[j]={}}Object.extend(Element.Methods.ByTag[j],c)}function a(m,k,j){j=j||false;var l=Element.extend.cache;for(var o in m){var n=m[o];if(!j||!(o in k)){k[o]=l.findOrStore(n)}}}function e(l){var j;var k={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(k[l]){j="HTML"+k[l]+"Element"}if(window[j]){return window[j]}j="HTML"+l+"Element";if(window[j]){return window[j]}j="HTML"+l.capitalize()+"Element";if(window[j]){return window[j]}window[j]={};window[j].prototype=document.createElement(l).__proto__;return window[j]}if(h.ElementExtensions){a(Element.Methods,HTMLElement.prototype);a(Element.Methods.Simulated,HTMLElement.prototype,true)}if(h.SpecificElementExtensions){for(var i in Element.Methods.ByTag){var f=e(i);if(typeof f=="undefined"){continue}a(d[i],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag};var Toggle={display:Element.toggle};Abstract.Insertion=function(a){this.adjacency=a};Abstract.Insertion.prototype={initialize:function(b,c){this.element=$(b);this.content=c.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(d){var a=this.element.tagName.toUpperCase();if(["TBODY","TR"].include(a)){this.insertContent(this.contentFromAnonymousTable())}else{throw d}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange()}this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){c.evalScripts()},10)},contentFromAnonymousTable:function(){var a=document.createElement("div");a.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(a.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(a){a.each((function(b){this.element.parentNode.insertBefore(b,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(a){a.reverse(false).each((function(b){this.element.insertBefore(b,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(a){a.each((function(b){this.element.appendChild(b)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(a){a.each((function(b){this.element.parentNode.insertBefore(b,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(a){this.expression=a.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 f=this.expression,g=Selector.patterns,b=Selector.xpath,d,a;if(Selector._cache[f]){this.xpath=Selector._cache[f];return}this.matcher=[".//*"];while(f&&d!=f&&(/\S/).test(f)){d=f;for(var c in g){if(a=f.match(g[c])){this.matcher.push(typeof b[c]=="function"?b[c](a):new Template(b[c]).evaluate(a));f=f.replace(a[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;if(this.xpath){return document._getElementsByXPath(this.xpath,a)}return this.matcher(a)},match:function(a){return this.findElements(document).include(a)},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}};Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return""}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(a){a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return""}if(typeof b==="function"){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(b){var j=b[6],h=Selector.patterns,a=Selector.xpath,f,b,c;var g=[];while(j&&f!=j&&(/\S/).test(j)){f=j;for(var d in h){if(b=j.match(h[d])){c=typeof a[d]=="function"?a[d](b):new Template(a[d]).evaluate(b);g.push("("+c.substring(1,c.length-1)+")");j=j.replace(b[0],"");break}}}return"[not("+g.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(g,e){var h,i=e[6],d;if(i=="even"){i="2n+0"}if(i=="odd"){i="2n+1"}if(h=i.match(/^(\d+)$/)){return"["+g+"= "+h[1]+"]"}if(h=i.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]=="-"){h[1]=-1}var f=h[1]?Number(h[1]):1;var c=h[2]?Number(h[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:g,a:f,b:c})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);   c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c);        c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/},handlers:{concat:function(d,c){for(var e=0,f;f=c[e];e++){d.push(f)}return d},mark:function(a){for(var b=0,c;c=a[b];b++){c._counted=true}return a},unmark:function(a){for(var b=0,c;c=a[b];b++){c._counted=undefined}return a},index:function(a,d,f){a._counted=true;if(d){for(var b=a.childNodes,e=b.length-1,c=1;e>=0;e--){node=b[e];if(node.nodeType==1&&(!f||node._counted)){node.nodeIndex=c++}}}else{for(var e=0,c=1,b=a.childNodes;node=b[e];e++){if(node.nodeType==1&&(!f||node._counted)){node.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],e;for(var c=0,a=b.length;c<a;c++){if(!(e=b[c])._counted){e._counted=true;d.push(Element.extend(e))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,e.getElementsByTagName("*"))}return b},child:function(a){var f=Selector.handlers;for(var e=0,d=[],g;g=a[e];e++){for(var b=0,c=[],k;k=g.childNodes[b];b++){if(k.nodeType==1&&k.tagName!="!"){d.push(k)}}}return d},adjacent:function(a){for(var c=0,b=[],e;e=a[c];c++){var d=this.nextElementSibling(e);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,Element.nextSiblings(e))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(b,a,e,j){e=e.toUpperCase();var d=[],f=Selector.handlers;if(b){if(j){if(j=="descendant"){for(var c=0,g;g=b[c];c++){f.concat(d,g.getElementsByTagName(e))}return d}else{b=this[j](b)}if(e=="*"){return b}}for(var c=0,g;g=b[c];c++){if(g.tagName.toUpperCase()==e){d.push(g)}}return d}else{return a.getElementsByTagName(e)}},id:function(b,a,j,f){var g=$(j),d=Selector.handlers;if(!b&&a==document){return g?[g]:[]}if(b){if(f){if(f=="child"){for(var c=0,e;e=b[c];c++){if(g.parentNode==e){return[g]}}}else{if(f=="descendant"){for(var c=0,e;e=b[c];c++){if(Element.descendantOf(g,e)){return[g]}}}else{if(f=="adjacent"){for(var c=0,e;e=b[c];c++){if(Selector.handlers.previousElementSibling(g)==e){return[g]}}}else{b=d[f](b)}}}}for(var c=0,e;e=b[c];c++){if(e==g){return[g]}}return[]}return(g&&Element.descendantOf(g,a))?[g]:[]},className:function(b,a,c,d){if(b&&d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,f){if(!c){c=Selector.handlers.descendant([b])}var h=" "+f+" ";for(var e=0,d=[],g,a;g=c[e];e++){a=g.className;if(a.length==0){continue}if(a==f||(" "+a+" ").include(h)){d.push(g)}}return d},attrPresence:function(c,b,a){var e=[];for(var d=0,f;f=c[d];d++){if(Element.hasAttribute(f,a)){e.push(f)}}return e},attr:function(a,h,g,j,b){if(!a){a=h.getElementsByTagName("*")}var k=Selector.operators[b],d=[];for(var e=0,c;c=a[e];e++){var f=Element.readAttribute(c,g);if(f===null){continue}if(k(f,j)){d.push(c)}}return d},pseudo:function(b,c,e,a,d){if(b&&d){b=this[d](b)}if(!b){b=a.getElementsByTagName("*")}return Selector.pseudos[c](b,e,a)}},pseudos:{"first-child":function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.previousElementSibling(e)){continue}c.push(e)}return c},"last-child":function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.nextElementSibling(e)){continue}c.push(e)}return c},"only-child":function(b,g,a){var e=Selector.handlers;for(var d=0,c=[],f;f=b[d];d++){if(!e.previousElementSibling(f)&&!e.nextElementSibling(f)){c.push(f)}}return c},"nth-child":function(b,c,a){return Selector.pseudos.nth(b,c,a)},"nth-last-child":function(b,c,a){return Selector.pseudos.nth(b,c,a,true)},"nth-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)},"nth-last-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)},"first-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,false,true)},"last-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,true,true)},"only-of-type":function(b,d,a){var c=Selector.pseudos;return c["last-of-type"](c["first-of-type"](b,d,a),d,a)},getIndices:function(d,c,e){if(d==0){return c>0?[c]:[]}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)}return a})},nth:function(c,s,u,r,e){if(c.length==0){return[]}if(s=="even"){s="2n+0"}if(s=="odd"){s="2n+1"}var q=Selector.handlers,p=[],d=[],g;q.mark(c);for(var o=0,f;f=c[o];o++){if(!f.parentNode._counted){q.index(f.parentNode,r,e);d.push(f.parentNode)}}if(s.match(/^\d+$/)){s=Number(s);for(var o=0,f;f=c[o];o++){if(f.nodeIndex==s){p.push(f)}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1}var v=g[1]?Number(g[1]):1;var t=g[2]?Number(g[2]):0;var w=Selector.pseudos.getIndices(v,t,c.length);for(var o=0,f,k=w.length;f=c[o];o++){for(var n=0;n<k;n++){if(f.nodeIndex==w[n]){p.push(f)}}}}}q.unmark(c);q.unmark(d);return p},empty:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.tagName=="!"||(e.firstChild&&!e.innerHTML.match(/^\s*$/))){continue}c.push(e)}return c},not:function(a,d,k){var g=Selector.handlers,l,c;var j=new Selector(d).findElements(k);g.mark(j);for(var f=0,e=[],b;b=a[f];f++){if(!b._counted){e.push(b)}}g.unmark(j);return e},enabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(!e.disabled){c.push(e)}}return c},disabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.disabled){c.push(e)}}return c},checked:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.checked){c.push(e)}}return c}},operators:{"=":function(b,a){return b==a},"!=":function(b,a){return b!=a},"^=":function(b,a){return b.startsWith(a)},"$=":function(b,a){return b.endsWith(a)},"*=":function(b,a){return b.include(a)},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ")},"|=":function(b,a){return("-"+b.toUpperCase()+"-").include("-"+a.toUpperCase()+"-")}},matchElements:function(f,g){var e=new Selector(g).findElements(),d=Selector.handlers;d.mark(e);for(var c=0,b=[],a;a=f[c];c++){if(a._counted){b.push(a)}}d.unmark(e);return b},findElement:function(b,c,a){if(typeof c=="number"){a=c;c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(e,g){var j=g.join(","),g=[];j.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(h){g.push(h[1].strip())});var d=[],f=Selector.handlers;for(var c=0,b=g.length,a;c<b;c++){a=new Selector(g[c].strip());f.concat(d,a.findElements(e))}return(b>1)?f.unique(d):d}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(c,a){var b=c.inject({},function(d,f){if(!f.disabled&&f.name){var e=f.name,g=$(f).getValue();if(g!=null){if(e in d){if(d[e].constructor!=Array){d[e]=[d[e]]}d[e].push(g)}else{d[e]=g}}}return d});return a?b:Hash.toQueryString(b)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(a){return $A($(a).getElementsByTagName("*")).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c))}return b})},getInputs:function(g,c,d){g=$(g);var a=g.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e<f;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){continue}h.push(Element.extend(b))}return h},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(a){return $(a).getElements().find(function(b){return b.type!="hidden"&&!b.disabled&&["input","select","textarea"].include(b.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var c=a.parameters;a.parameters=b.serialize(true);if(c){if(typeof c=="string"){c=c.toQueryParams()}Object.extend(a.parameters,c)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(b.readAttribute("action"),a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Hash.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(a.type))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.blur();a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a);default:return Form.Element.Serializers.textarea(a)}},inputSelector:function(a){return a.checked?a.value:null},textarea:function(a){return a.value},select:function(a){return this[a.type=="select-one"?"selectOne":"selectMany"](a)},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,e=d.length;if(!e){return null}for(var c=0,a=[];c<e;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(a,b,c){this.frequency=b;this.element=$(a);this.callback=c;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var a=this.getValue();var b=("string"==typeof this.lastValue&&"string"==typeof a?this.lastValue!=a:String(this.lastValue)!=String(a));if(b){this.callback(this.element,a);this.lastValue=a}}};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(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this))},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}};Form.Element.EventObserver=Class.create();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(a){return $(a.target||a.srcElement)},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},pointerX:function(a){return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(a){return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},findElement:function(c,b){var a=Event.element(c);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observers:false,_observeAndCache:function(d,c,b,a){if(!this.observers){this.observers=[]}if(d.addEventListener){this.observers.push([d,c,b,a]);d.addEventListener(c,b,a)}else{if(d.attachEvent){this.observers.push([d,c,b,a]);d.attachEvent("on"+c,b)}}},unloadCache:function(){if(!Event.observers){return}for(var a=0,b=Event.observers.length;a<b;a++){Event.stopObserving.apply(this,Event.observers[a]);Event.observers[a][0]=null}Event.observers=false},observe:function(d,c,b,a){d=$(d);a=a||false;if(c=="keypress"&&(Prototype.Browser.WebKit||d.attachEvent)){c="keydown"}Event._observeAndCache(d,c,b,a)},stopObserving:function(d,c,b,a){d=$(d);a=a||false;if(c=="keypress"&&(Prototype.Browser.WebKit||d.attachEvent)){c="keydown"}if(d.removeEventListener){d.removeEventListener(c,b,a)}else{if(d.detachEvent){try{d.detachEvent("on"+c,b)}catch(f){}}}}});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(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return[c,a]},cumulativeOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return[c,a]},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName=="BODY"){break}var c=Element.getStyle(b,"position");if(c=="relative"||c=="absolute"){break}}}while(b);return[d,a]},offsetParent:function(a){if(a.offsetParent){return a.offsetParent}if(a==document.body){return a}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return a}}return document.body},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=this.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=this.realOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=this.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},page:function(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}}while(b=b.offsetParent);b=d;do{if(!window.opera||b.tagName=="BODY"){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return[c,a]},clone:function(c,e){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});c=$(c);var d=Position.page(c);e=$(e);var f=[0,0];var b=null;if(Element.getStyle(e,"position")=="absolute"){b=Position.offsetParent(e);f=Position.page(b)}if(b==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){e.style.left=(d[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){e.style.top=(d[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){e.style.width=c.offsetWidth+"px"}if(a.setHeight){e.style.height=c.offsetHeight+"px"}},absolutize:function(b){b=$(b);if(b.style.position=="absolute"){return}Position.prepare();var d=Position.positionedOffset(b);var f=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=f-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=f+"px";b.style.left=e+"px";b.style.width=c+"px";b.style.height=a+"px"},relativize:function(a){a=$(a);if(a.style.position=="relative"){return}Position.prepare();a.style.position="relative";var c=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=c+"px";a.style.left=b+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth}};if(Prototype.Browser.WebKit){Position.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}b=b.offsetParent}while(b);return[c,a]}}Element.addMethods();String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};Array.prototype.call=function(){var a=arguments;this.each(function(b){b.apply(this,a)})};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(a){if(typeof Builder=="undefined"){throw ("Effect.tagifyText requires including script.aculo.us' builder.js library")}var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(Builder.node("span",{style:b},d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var e;if(((typeof b=="object")||(typeof b=="function"))&&(b.length)){e=b}else{e=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);c=(c||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)}};var Effect2=Effect;Effect.Transitions={linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return(a>1?1:a)},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){a=a||5;return(Math.round((b%(1/a))*a)==0?((b*a*2)-Math.floor(b*a*2)):1-((b*a*2)-Math.floor(b*a*2)))},none:function(a){return 0},full:function(a){return 1}};Effect.ScopedQueue=Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=(typeof b.options.queue=="string")?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(typeof a!="string"){return a}if(!this.instances[a]){this.instances[a]=new Effect.ScopedQueue()}return this.instances[a]}};Effect.Queue=Effect.Queues.get("global");Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"};Effect.Base=function(){};Effect.Base.prototype={position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if(this.state=="idle"){this.state="running";'+codeForEvent(options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(options,"afterSetup")+'};if(this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=Math.round(b*this.totalFrames);if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(typeof this[property]!="function"){a[property]=this[property]}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Event=Class.create();Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var a=Object.extend({duration:0},arguments[0]||{});this.start(a)},update:Prototype.emptyFunction});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:Math.round(this.options.x*a+this.originalLeft)+"px",top:Math.round(this.options.y*a+this.originalTop)+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=Math.round(e)+"px"}if(this.options.scaleY){f.height=Math.round(a)+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}this.element.setStyle(f)}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+(Math.round(this._base[d]+(this._delta[d]*a)).toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);this.start(arguments[1]||{})},setup:function(){Position.prepare();var b=Position.cumulativeOffset(this.element);if(this.options.offset){b[1]+=this.options.offset}var a=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(b[1]>a?a:b[1])-this.scrollStart},update:function(a){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(a*this.delta))}});Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left")};return new Effect.Move(b,{x:20,y:0,duration:0.05,afterFinishInternal:function(c){new Effect.Move(c.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(d){new Effect.Move(d.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(e){new Effect.Move(e.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(f){new Effect.Move(f.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(h){h.element.undoPositioned().setStyle(a)}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(b){b=$(b).cleanWhitespace();var a=b.down().getStyle("bottom");return new Effect.Scale(b,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(c){c.element.makePositioned();c.element.down().makePositioned();if(window.opera){c.element.setStyle({top:""})}c.element.makeClipping().show()},afterUpdateInternal:function(c){c.element.down().setStyle({bottom:(c.dims[0]-c.element.clientHeight)+"px"})},afterFinishInternal:function(c){c.element.hide().undoClipping().undoPositioned().setStyle({bottom:a});c.element.down().undoPositioned()}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var h,f;var e,d;switch(b.direction){case"top-left":h=f=e=d=0;break;case"top-right":h=g.width;f=d=0;e=-g.width;break;case"bottom-left":h=e=0;f=g.height;d=-g.height;break;case"bottom-right":h=g.width;f=g.height;e=-g.width;d=-g.height;break;case"center":h=g.width/2;f=g.height/2;e=-g.width/2;d=-g.height/2;break}return new Effect.Move(c,{x:h,y:f,duration:0.01,beforeSetup:function(i){i.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(i){new Effect.Parallel([new Effect.Opacity(i.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(i.element,{x:e,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(i.element,100,{scaleMode:{originalHeight:g.height,originalWidth:g.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(j){j.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(j){j.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var f=c.getDimensions();var e,d;switch(b.direction){case"top-left":e=d=0;break;case"top-right":e=f.width;d=0;break;case"bottom-left":e=0;d=f.height;break;case"bottom-right":e=f.width;d=f.height;break;case"center":e=f.width/2;d=f.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:e,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{};var a=c.getInlineOpacity();var e=b.transition||Effect.Transitions.sinoidal;var d=function(f){return e(1-Effect.Transitions.pulse(f,b.pulses))};d.bind(e);return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create();Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(typeof b.style=="string"){if(b.style.indexOf(":")==-1){var d="",a="."+b.style;$A(document.styleSheets).reverse().each(function(e){if(e.cssRules){cssRules=e.cssRules}else{if(e.rules){cssRules=e.rules}}$A(cssRules).reverse().each(function(f){if(a==f.selectorText){d=f.style.cssText;throw $break}});if(d){throw $break}});this.style=d.parseStyle();b.afterFinishInternal=function(e){e.element.addClassName(e.options.style);e.transforms.each(function(f){if(f.style!="opacity"){e.element.style[f.style]=""}})}}else{this.style=b.style.parseStyle()}}else{this.style=$H(b.style)}this.start(b)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(g){var f=g[0],e=g[1],d=null;if(e.parseColor("#zzzzzz")!="#zzzzzz"){e=e.parseColor();d="color"}else{if(f=="opacity"){e=parseFloat(e);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(e)){var c=e.match(/^([\+\-]?[0-9\.]+)(.*)$/);e=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(f);return{style:f.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(e):e,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():b.originalValue+Math.round(((b.targetValue-b.originalValue)*a)*1000)/1000+b.unit}this.element.setStyle(d,true)}});Effect.Transform=Class.create();Object.extend(Effect.Transform.prototype,{initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){var c=$H(b).values().first();this.tracks.push($H({ids:$H(b).keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=[$(a.ids)||$$(a.ids)].flatten();return b.map(function(c){return new a.effect(c,Object.extend({sync:true},a.options))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.prototype.parseStyle=function(){var b=document.createElement("div");b.innerHTML='<div style="'+this+'"></div>';var c=b.childNodes[0].style,a=$H();Element.CSS_PROPERTIES.each(function(d){if(c[d]){a[d]=c[d]}});if(Prototype.Browser.IE&&this.indexOf("opacity")>-1){a.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]}return a};Element.morph=function(a,b){new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a};["getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(a){Element.Methods[a]=Element[a]});Element.Methods.visualEffect=function(b,c,a){s=c.dasherize().camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](b,a);return $(b)};Element.addMethods();if(typeof Effect=="undefined"){throw ("lightwindow.js requires including script.aculo.us' effects.js library!")}try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var lightwindow=Class.create();lightwindow.prototype={element:null,contentToFetch:null,windowActive:false,dataEffects:[],dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},pageDimensions:{width:null,height:null},preloadImage:[],preloadedImage:[],galleries:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},scrollbarOffset:18,navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},activeGallery:false,galleryLocation:{current:0,total:0},initialize:function(a){this.options=Object.extend({resizeSpeed:8,contentOffset:{height:20,width:20},dimensions:{image:{height:250,width:250},page:{height:250,width:250},inline:{height:250,width:250},media:{height:250,width:250},external:{height:250,width:250},titleHeight:25},classNames:{standard:"lightwindow",action:"lightwindow_action"},fileTypes:{page:["asp","aspx","cgi","cfm","htm","html","pl","php4","php3","php","php5","phtml","rhtml","shtml","txt","vbs","rb"],media:["aif","aiff","asf","avi","divx","m1v","m2a","m2v","m3u","mid","midi","mov","moov","movie","mp2","mp3","mpa","mpa","mpe","mpeg","mpg","mpg","mpga","pps","qt","rm","ram","swf","viv","vivo","wav"],image:["bmp","gif","jpg","png","tiff"]},mimeTypes:{avi:"video/avi",aif:"audio/aiff",aiff:"audio/aiff",gif:"image/gif",bmp:"image/bmp",jpeg:"image/jpeg",m1v:"video/mpeg",m2a:"audio/mpeg",m2v:"video/mpeg",m3u:"audio/x-mpequrl",mid:"audio/x-midi",midi:"audio/x-midi",mjpg:"video/x-motion-jpeg",moov:"video/quicktime",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp3:"audio/mpeg3",mpa:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"audio/mpeg",mpg:"video/mpeg",mpga:"audio/mpeg",pdf:"application/pdf",png:"image/png",pps:"application/mspowerpoint",qt:"video/quicktime",ram:"audio/x-pn-realaudio-plugin",rm:"application/vnd.rn-realmedia",swf:"application/x-shockwave-flash",tiff:"image/tiff",viv:"video/vivo",vivo:"video/vivo",wav:"audio/wav",wmv:"application/x-mplayer2"},classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",wmv:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"},viewportPadding:10,EOLASFix:"swf,wmv,fla,flv",overlay:{opacity:0.9,image:lwplugin_path+"images/black.png",presetImage:lwplugin_path+"images/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" ><a href="#" id="lightwindow_galleries_tab" ><span id="lightwindow_galleries_tab_span" class="up" >Galleries</span></a></div><div id="lightwindow_galleries_list" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_gallery_container" ><span id="lightwindow_data_gallery_current"></span> of <span id="lightwindow_data_gallery_total"></span></div><div id="lightwindow_data_author_container" >by <span id="lightwindow_data_author"></span></div></div><div id="lightwindow_data_caption" ></div></div></div></div>',loading:'<div id="lightwindow_loading" ><img src="'+lwplugin_path+'images/ajax-loading.gif" alt="loading" /><span>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></span><iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div>',iframe:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body>{body_replace}</body></html>',gallery:{top:'<div class="lightwindow_galleries_list"><h1>{gallery_title_replace}</h1><ul>',middle:"<li>{gallery_link_replace}</li>",bottom:"</ul></div>"}},formMethod:"get",hideFlash:false,hideGalleryTab:false,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false,galleryAnimationHandler:false,showGalleryCount:true},a||{});this.duration=((11-this.options.resizeSpeed)*0.15);this._setupLinks();this._getScroll();this._getPageDimensions();this._browserDimensions();this._addLightWindowMarkup(false);this._setupDimensions();this.buildGalleryList()},activate:function(b,a){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(a);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.activeGallery=false;if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false)}this.animating=false;this.element=null;this._displayLightWindow("none","visible");this._clearWindowContents(false);var a=Effect.Queues.get("lightwindowAnimation").each(function(b){b.cancel()});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false)},createWindow:function(b,a){this._processLink($(b))},activateWindow:function(a){this.element=Object.extend({href:null,title:null,author:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null},a||{});this.contentToFetch=this.element.href;this.windowType=this.element.type?this.element.type:this._fileType(this.element.href);this._clearWindowContents(true);this._addLoadingWindowMarkup();this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},submitForm:function(a){if(this.options.formHandler){this.options.formHandler(a)}else{this._defaultFormHandler(a)}},openWindow:function(a){var a=$(a);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(a);this._setStatus(true);this._handleTransition()},navigateWindow:function(a){this._handleNavigation(false);if(a=="previous"){this.openWindow(this.navigationObservers.previous)}else{if(a=="next"){this.openWindow(this.navigationObservers.next)}}},buildGalleryList:function(){var a="";var b;for(i in this.galleries){if(typeof this.galleries[i]=="object"){a+=(this.options.skin.gallery.top).replace("{gallery_title_replace}",unescape(i));for(j in this.galleries[i]){if(typeof this.galleries[i][j]=="object"){b='<a href="#" id="lightwindow_gallery_'+i+"_"+j+'" >'+unescape(j)+"</a>";a+=(this.options.skin.gallery.middle).replace("{gallery_link_replace}",b)}}a+=this.options.skin.gallery.bottom}}new Insertion.Top("lightwindow_galleries_list",a);for(i in this.galleries){if(typeof this.galleries[i]=="object"){for(j in this.galleries[i]){if(typeof this.galleries[i][j]=="object"){Event.observe($("lightwindow_gallery_"+i+"_"+j),"click",this.openWindow.bind(this,this.galleries[i][j][0]),false);$("lightwindow_gallery_"+i+"_"+j).onclick=function(){return false}}}}}},_setupLinks:function(){var a=$$("."+this.options.classNames.standard);a.each(function(b){this._processLink(b)}.bind(this))},_processLink:function(c){if((this._fileType(c.getAttribute("href"))=="image"||this._fileType(c.getAttribute("href"))=="media")){if(gallery=this._getGalleryInfo(c.rel)){if(!this.galleries[gallery[0]]){this.galleries[gallery[0]]=new Array()}if(!this.galleries[gallery[0]][gallery[1]]){this.galleries[gallery[0]][gallery[1]]=new Array()}this.galleries[gallery[0]][gallery[1]].push(c)}}var b=c.getAttribute("href");if(b.indexOf("?")>-1){b=b.substring(0,b.indexOf("?"))}var a=b.substring(b.indexOf("#")+1);if($(a)){$(a).setStyle({display:"none"})}Event.observe(c,"click",this.activate.bindAsEventListener(this,c),false);c.onclick=function(){return false}},_setupActions:function(){var a=$$("#lightwindow_container ."+this.options.classNames.action);a.each(function(b){Event.observe(b,"click",this[b.getAttribute("rel")].bindAsEventListener(this,b),false);b.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(b){var c=Element.extend(document.createElement("div"));c.setAttribute("id","lightwindow_overlay");if(Prototype.Browser.Gecko||(window.XMLHttpRequest&&document.all)){c.setStyle({backgroundImage:"url("+this.options.overlay.presetImage+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"})}else{c.setStyle({opacity:this.options.overlay.opacity,backgroundImage:"url("+this.options.overlay.image+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"})}var d=document.createElement("div");d.setAttribute("id","lightwindow");d.innerHTML=this.options.skin.main;var a=document.getElementsByTagName("body")[0];a.appendChild(c);a.appendChild(d);if($("lightwindow_title_bar_close_link")){Event.observe("lightwindow_title_bar_close_link","click",this.deactivate.bindAsEventListener(this));$("lightwindow_title_bar_close_link").onclick=function(){return false}}Event.observe($("lightwindow_previous"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous").onclick=function(){return false};Event.observe($("lightwindow_next"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next").onclick=function(){return false};if(!this.options.hideGalleryTab){Event.observe($("lightwindow_galleries_tab"),"click",this._handleGalleryAnimation.bind(this,true),false);$("lightwindow_galleries_tab").onclick=function(){return false}}if(Prototype.Browser.IE){Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false)}else{Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false)}Event.observe(c,"click",this.deactivate.bindAsEventListener(this),false);c.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.options.skin.loading},_setupWindowElements:function(a){this.element=a;this.element.title=null?"":a.getAttribute("title");this.element.author=null?"":a.getAttribute("author");this.element.caption=null?"":a.getAttribute("caption");this.element.rel=null?"":a.getAttribute("rel");this.element.params=null?"":a.getAttribute("params");this.contentToFetch=this.element.href;this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch)},_clearWindowContents:function(a){if($("lightwindow_iframe")){Element.remove($("lightwindow_iframe"))}if($("lightwindow_media_primary")){try{$("lightwindow_media_primary").Stop()}catch(b){}Element.remove($("lightwindow_media_primary"))}if($("lightwindow_media_secondary")){try{$("lightwindow_media_secondary").Stop()}catch(b){}Element.remove($("lightwindow_media_secondary"))}this.activeGallery=false;this._handleNavigation(this.activeGallery);if(a){$("lightwindow_contents").innerHTML="";$("lightwindow_contents").setStyle({overflow:"hidden"});if(!this.windowActive){$("lightwindow_data_slide_inner").setStyle({display:"none"});$("lightwindow_title_bar_title").innerHTML=""}$("lightwindow_data_slide").setStyle({height:"auto"})}this.resizeTo.height=null;this.resizeTo.width=null},_setStatus:function(a){this.animating=a;if(a){Element.show("lightwindow_loading")}if(!(/MSIE 6./i.test(navigator.userAgent))){this._fixedWindow(a)}},_fixedWindow:function(a){if(a){if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"absolute",top:parseFloat($("lightwindow").getStyle("top"))+this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))+this.pagePosition.x+"px"})}else{$("lightwindow").setStyle({position:"absolute"})}}else{if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"fixed",top:parseFloat($("lightwindow").getStyle("top"))-this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))-this.pagePosition.x+"px"})}else{if($("lightwindow_iframe")){this._browserDimensions()}$("lightwindow").setStyle({position:"fixed",top:(parseFloat(this._getParameter("lightwindow_top"))?parseFloat(this._getParameter("lightwindow_top"))+"px":this.dimensions.viewport.height/2+"px"),left:(parseFloat(this._getParameter("lightwindow_left"))?parseFloat(this._getParameter("lightwindow_left"))+"px":this.dimensions.viewport.width/2+"px")})}}},_prepareIE:function(c){if(Prototype.Browser.IE){var b,f,d;if(c){var b="100%"}else{var b="auto"}var a=document.getElementsByTagName("body")[0];var g=document.getElementsByTagName("html")[0];g.style.height=a.style.height=b}},_stopScrolling:function(a){if(this.animating){if(a.preventDefault){a.preventDefault()}a.returnValue=false}},_getScroll:function(){if(typeof(window.pageYOffset)=="number"){this.pagePosition.x=window.pageXOffset;this.pagePosition.y=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){this.pagePosition.x=document.body.scrollLeft;this.pagePosition.y=document.body.scrollTop}else{if(document.documentElement){this.pagePosition.x=document.documentElement.scrollLeft;this.pagePosition.y=document.documentElement.scrollTop}}}},_setScroll:function(a,b){document.documentElement.scrollLeft=a;document.documentElement.scrollTop=b},_toggleTroubleElements:function(a,d){if(d){var c=$("lightwindow_contents").getElementsByTagName("select")}else{var c=document.getElementsByTagName("select")}for(var b=0;b<c.length;b++){c[b].style.visibility=a}if(!d){if(this.options.hideFlash){var g=document.getElementsByTagName("object");for(b=0;b!=g.length;b++){g[b].style.visibility=a}var f=document.getElementsByTagName("embed");for(b=0;b!=f.length;b++){f[b].style.visibility=a}}var h=document.getElementsByTagName("iframe");for(b=0;b!=h.length;b++){h[b].style.visibility=a}}},_getPageDimensions:function(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){this.pageDimensions.height=d}else{this.pageDimensions.height=a}if(c<b){this.pageDimensions.width=b}else{this.pageDimensions.width=c}},_displayLightWindow:function(b,a){$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=b;$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=a},_setupDimensions:function(){var c,d;switch(this.windowType){case"page":c=this.options.dimensions.page.height;d=this.options.dimensions.page.width;break;case"image":c=this.options.dimensions.image.height;d=this.options.dimensions.image.width;break;case"media":c=this.options.dimensions.media.height;d=this.options.dimensions.media.width;break;case"external":c=this.options.dimensions.external.height;d=this.options.dimensions.external.width;break;case"inline":c=this.options.dimensions.inline.height;d=this.options.dimensions.inline.width;break;default:c=this.options.dimensions.page.height;d=this.options.dimensions.page.width;break}var a=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;var b=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$("lightwindow").setStyle({top:a+"px",left:b+"px"});$("lightwindow_container").setStyle({height:c+"px",width:d+"px",left:-(d/2)+"px",top:-(c/2)+"px"});$("lightwindow_contents").setStyle({height:c+"px",width:d+"px"})},_fileType:function(a){var f=new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i");if(f.test(a)){return"image"}if(a.indexOf("#")>-1&&(document.domain==this._getDomain(a))){return"inline"}if(a.indexOf("?")>-1){a=a.substring(0,a.indexOf("?"))}var b="unknown";var c=new RegExp("[^.].("+this.options.fileTypes.page.join("|")+")s*$","i");var d=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(a)){b="external"}if(d.test(a)){b="media"}if(b=="external"||b=="media"){return b}if(c.test(a)||a.substr((a.length-1),a.length)=="/"){b="page"}return b},_fileExtension:function(c){if(c.indexOf("?")>-1){c=c.substring(0,c.indexOf("?"))}var b="";for(var a=(c.length-1);a>-1;a--){if(c.charAt(a)=="."){return b}b=c.charAt(a)+b}},_monitorKeyboard:function(a){if(a){document.onkeydown=this._eventKeypress.bind(this)}else{document.onkeydown=""}},_eventKeypress:function(b){if(b==null){var a=event.keyCode}else{var a=b.which}switch(a){case 27:this.deactivate();break;case 13:return;default:break}if(this.animating){return false}switch(String.fromCharCode(a).toLowerCase()){case"p":if(this.navigationObservers.previous){this.navigateWindow("previous")}break;case"n":if(this.navigationObservers.next){this.navigateWindow("next")}break;default:break}},_getGalleryInfo:function(a){if(!a){return false}if(a.indexOf("[")>-1){return new Array(escape(a.substring(0,a.indexOf("["))),escape(a.substring(a.indexOf("[")+1,a.indexOf("]"))))}else{return false}},_getDomain:function(f){var h=f.indexOf("//");var b=h+2;var d=f.substring(b,f.length);var a=d.indexOf("/");var g=d.substring(0,a);if(g.indexOf(":")>-1){var c=g.indexOf(":");g=g.substring(0,c)}return g},_getParameter:function(k,d){if(!this.element){return false}if(k=="lightwindow_top"&&this.element.top){return unescape(this.element.top)}else{if(k=="lightwindow_left"&&this.element.left){return unescape(this.element.left)}else{if(k=="lightwindow_type"&&this.element.type){return unescape(this.element.type)}else{if(k=="lightwindow_show_images"&&this.element.showImages){return unescape(this.element.showImages)}else{if(k=="lightwindow_height"&&this.element.height){return unescape(this.element.height)}else{if(k=="lightwindow_width"&&this.element.width){return unescape(this.element.width)}else{if(k=="lightwindow_loading_animation"&&this.element.loadingAnimation){return unescape(this.element.loadingAnimation)}else{if(k=="lightwindow_iframe_embed"&&this.element.iframeEmbed){return unescape(this.element.iframeEmbed)}else{if(k=="lightwindow_form"&&this.element.form){return unescape(this.element.form)}else{if(!d){if(this.element.params){d=this.element.params}else{return}}var g;var f=d.split(",");var c=k+"=";var h=c.length;for(var b=0;b<f.length;b++){if(f[b].substr(0,h)==c){var a=f[b].split("=");g=a[1];break}}if(!g){return false}else{return unescape(g)}}}}}}}}}}},_browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth}else{this.dimensions.viewport.height=window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth}},_getScrollerWidth:function(){var f=Element.extend(document.createElement("div"));f.setAttribute("id","lightwindow_scroll_div");f.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});var c=Element.extend(document.createElement("div"));c.setAttribute("id","lightwindow_content_scroll_div");c.setStyle({width:"100%",height:"200px"});f.appendChild(c);var b=document.getElementsByTagName("body")[0];b.appendChild(f);var d=$("lightwindow_content_scroll_div").offsetWidth;f.style.overflow="auto";var a=$("lightwindow_content_scroll_div").offsetWidth;Element.remove($("lightwindow_scroll_div"));this.scrollbarOffset=d-a},_addParamToObject:function(b,c,a,f){var d=document.createElement("param");d.setAttribute("value",c);d.setAttribute("name",b);if(f){d.setAttribute("id",f)}a.appendChild(d);return a},_outerHTML:function(a){if(Prototype.Browser.IE){return a.outerHTML}else{var c=a.cloneNode(true);var b=document.createElement("div");b.appendChild(c);return b.innerHTML}},_convertToMarkup:function(c,b){var a=this._outerHTML(c).replace("</"+b+">","");if(Prototype.Browser.IE){for(var d=0;d<c.childNodes.length;d++){a+=this._outerHTML(c.childNodes[d])}a+="</"+b+">"}return a},_appendObject:function(c,b,a){if(Prototype.Browser.IE){a.innerHTML+=this._convertToMarkup(c,b);if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){var f=document.getElementsByTagName("object");for(var d=0;d<f.length;d++){if(f[d].getAttribute("data")){f[d].removeAttribute("data")}f[d].outerHTML=f[d].outerHTML;f[d].style.visibility="visible"}}}else{a.appendChild(c)}},_appendIframe:function(a){var b=document.createElement("iframe");b.setAttribute("id","lightwindow_iframe");b.setAttribute("name","lightwindow_iframe");b.setAttribute("src","about:blank");b.setAttribute("height","100%");b.setAttribute("width","100%");b.setAttribute("frameborder","0");b.setAttribute("marginwidth","0");b.setAttribute("marginheight","0");b.setAttribute("scrolling",a);this._appendObject(b,"iframe",$("lightwindow_contents"))},_writeToIframe:function(b){var a=this.options.skin.iframe;a=a.replace("{body_replace}",b);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(a);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(a);$("lightwindow_iframe").contentDocument.close()}},_loadWindow:function(){switch(this.windowType){case"image":var f=0;var a=[];this.checkImage=[];this.resizeTo.height=this.resizeTo.width=0;this.imageCount=this._getParameter("lightwindow_show_images")?parseInt(this._getParameter("lightwindow_show_images")):1;if(gallery=this._getGalleryInfo(this.element.rel)){for(f=0;f<this.galleries[gallery[0]][gallery[1]].length;f++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][f].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][f-this.imageCount]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][f-this.imageCount]}else{this.navigationObservers.previous=false}if(this.galleries[gallery[0]][gallery[1]][f+this.imageCount]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][f+this.imageCount]}else{this.navigationObservers.next=false}this.activeGallery=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false}for(var c=f;c<(f+this.imageCount);c++){if(gallery&&this.galleries[gallery[0]][gallery[1]][c]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][c].href;this.galleryLocation={current:(c+1)/this.imageCount,total:(this.galleries[gallery[0]][gallery[1]].length)/this.imageCount};if(!this.galleries[gallery[0]][gallery[1]][c+this.imageCount]){$("lightwindow_next").setStyle({display:"none"})}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][c+this.imageCount].title}if(!this.galleries[gallery[0]][gallery[1]][c-this.imageCount]){$("lightwindow_previous").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][c-this.imageCount].title}}a[c]=document.createElement("img");a[c].setAttribute("id","lightwindow_image_"+c);a[c].setAttribute("border","0");a[c].setAttribute("src",this.contentToFetch);$("lightwindow_contents").appendChild(a[c]);this.checkImage[c]=new PeriodicalExecuter(function(h){if(!(typeof $("lightwindow_image_"+h).naturalWidth!="undefined"&&$("lightwindow_image_"+h).naturalWidth==0)){this.checkImage[h].stop();var g=$("lightwindow_image_"+h).getHeight();if(g>this.resizeTo.height){this.resizeTo.height=g}this.resizeTo.width+=$("lightwindow_image_"+h).getWidth();this.imageCount--;$("lightwindow_image_"+h).setStyle({height:"100%"});if(this.imageCount==0){this._processWindow()}}}.bind(this,c),1)}break;case"media":var f=0;this.resizeTo.height=this.resizeTo.width=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(f=0;f<this.galleries[gallery[0]][gallery[1]].length;f++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][f].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][f-1]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][f-1]}else{this.navigationObservers.previous=false}if(this.galleries[gallery[0]][gallery[1]][f+1]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][f+1]}else{this.navigationObservers.next=false}this.activeGallery=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false}if(gallery&&this.galleries[gallery[0]][gallery[1]][f]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][f].href;this.galleryLocation={current:f+1,total:this.galleries[gallery[0]][gallery[1]].length};if(!this.galleries[gallery[0]][gallery[1]][f+1]){$("lightwindow_next").setStyle({display:"none"})}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][f+1].title}if(!this.galleries[gallery[0]][gallery[1]][f-1]){$("lightwindow_previous").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][f-1].title}}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 b=new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(g){$("lightwindow_contents").innerHTML+=g.responseText;this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.options.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.options.contentOffset.width);this._processWindow()}.bind(this)});break;case"inline":var d=this.contentToFetch;if(d.indexOf("?")>-1){d=d.substring(0,d.indexOf("?"))}d=d.substring(d.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(d).innerHTML);this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.options.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.options.contentOffset.width);this._toggleTroubleElements("hidden",true);this._processWindow();break;default: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 a=this.resizeTo.height/this.resizeTo.width;this.resizeTo.height=this.dimensions.viewport.height-this.dimensions.cruft.height-(2*this.options.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.width=this.resizeTo.height/a;$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"})}}if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){var b=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=this.dimensions.viewport.width-2*this.dimensions.cruft.width-(2*this.options.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.height=this.resizeTo.width/b;$("lightwindow_data_slide_inner").setStyle({height:this.resizeTo.height+"px"})}}},_presetWindowSize:function(){if(this._getParameter("lightwindow_height")){this.resizeTo.height=parseFloat(this._getParameter("lightwindow_height"))}if(this._getParameter("lightwindow_width")){this.resizeTo.width=parseFloat(this._getParameter("lightwindow_width"))}},_processWindow:function(){this.dimensions.dataEffects=[];if(this.element.caption||this.element.author||(this.activeGallery&&this.options.showGalleryCount)){if(this.element.caption){$("lightwindow_data_caption").innerHTML=this.element.caption;$("lightwindow_data_caption").setStyle({display:"block"})}else{$("lightwindow_data_caption").setStyle({display:"none"})}if(this.element.author){$("lightwindow_data_author").innerHTML=this.element.author;$("lightwindow_data_author_container").setStyle({display:"block"})}else{$("lightwindow_data_author_container").setStyle({display:"none"})}if(this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_gallery_current").innerHTML=this.galleryLocation.current;$("lightwindow_data_gallery_total").innerHTML=this.galleryLocation.total;$("lightwindow_data_gallery_container").setStyle({display:"block"})}else{$("lightwindow_data_gallery_container").setStyle({display:"none"})}$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px",height:"auto",visibility:"visible",display:"block"});$("lightwindow_data_slide").setStyle({height:$("lightwindow_data_slide").getHeight()+"px",width:"1px",overflow:"hidden",display:"block"})}else{$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});$("lightwindow_data_slide_inner").setStyle({display:"none",visibility:"hidden",width:this.resizeTo.width+"px",height:"0px"})}if(this.element.title!="null"){$("lightwindow_title_bar_title").innerHTML=this.element.title}else{$("lightwindow_title_bar_title").innerHTML=""}var b={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};$("lightwindow_container").setStyle({height:"auto",width:$("lightwindow_container").getWidth()+this.options.contentOffset.width-(this.windowActive?this.options.contentOffset.width:0)+"px"});var a={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.containerChange={height:b.height-a.height,width:b.width-a.width};this.dimensions.container={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.dimensions.cruft={height:this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.options.contentOffset.height,width:this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.options.contentOffset.width};this._presetWindowSize();this._resizeWindowToFit();if(!this.windowActive){$("lightwindow_container").setStyle({left:-(this.dimensions.container.width/2)+"px",top:-(this.dimensions.container.height/2)+"px"})}$("lightwindow_container").setStyle({height:this.dimensions.container.height+"px",width:this.dimensions.container.width+"px"});this._displayLightWindow("block","visible");this._animateLightWindow()},_animateLightWindow:function(){if(this.options.animationHandler){this.options.animationHandler().bind(this)}else{this._defaultAnimationHandler()}},_handleNavigation:function(a){if(this.options.navigationHandler){this.options.navigationHandler().bind(this,a)}else{this._defaultDisplayNavigation(a)}},_handleTransition:function(){if(this.options.transitionHandler){this.options.transitionHandler().bind(this)}else{this._defaultTransitionHandler()}},_handleFinalWindowAnimation:function(a){if(this.options.finalAnimationHandler){this.options.finalAnimationHandler().bind(this,a)}else{this._defaultfinalWindowAnimationHandler(a)}},_handleGalleryAnimation:function(a){if(this.options.galleryAnimationHandler){this.options.galleryAnimationHandler().bind(this,a)}else{this._defaultGalleryAnimationHandler(a)}},_defaultDisplayNavigation:function(a){if(a){$("lightwindow_navigation").setStyle({display:"block",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.options.dimensions.titleHeight+"px"})}else{$("lightwindow_navigation").setStyle({display:"none",height:"auto",width:"auto"})}},_defaultAnimationHandler:function(){if(this.element.caption||this.element.author||(this.activeGallery&&this.options.showGalleryCount)){$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});this.dimensions.dataEffects.push(new Effect.SlideDown("lightwindow_data_slide",{sync:true}),new Effect.Appear("lightwindow_data_slide",{sync:true,from:0,to:1}))}$("lightwindow_title_bar_inner").setStyle({height:"0px",marginTop:this.options.dimensions.titleHeight+"px"});this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:this.options.dimensions.titleHeight+"px",marginTop:"0px"}}),new Effect.Appear("lightwindow_title_bar_inner",{sync:true,from:0,to:1}));if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false);if($("lightwindow_galleries_tab_container").getHeight()==0){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"20px",marginTop:"0px"}}));$("lightwindow_galleries").setStyle({width:"0px"})}}var a=false;var b=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;if(b!=$("lightwindow_container").getWidth()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.width/$("lightwindow_contents").getWidth()),{scaleFrom:100*($("lightwindow_contents").getWidth()/($("lightwindow_contents").getWidth()+(this.options.contentOffset.width))),sync:true,scaleY:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(b/(this.dimensions.container.width)),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}})}b=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.options.contentOffset.height;if(b!=$("lightwindow_container").getHeight()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.height/$("lightwindow_contents").getHeight()),{scaleFrom:100*($("lightwindow_contents").getHeight()/($("lightwindow_contents").getHeight()+(this.options.contentOffset.height))),sync:true,scaleX:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(b/(this.dimensions.container.height)),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){if(this.dimensions.dataEffects.length>0){if(!this.options.hideGalleryTab){$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"})}new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}});a=true}if(!a&&this.dimensions.dataEffects.length>0){new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){if(!this.options.hideGalleryTab){$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"})}if(this.containerChange.height!=0||this.containerChange.width!=0){new Effect.MoveBy("lightwindow_container",this.containerChange.height,this.containerChange.width,{transition:Effect.Transitions.sinoidal})}}.bind(this),afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultfinalWindowAnimationHandler:function(a){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._handleNavigation(this.activeGallery);this._setStatus(false)}else{Effect.Fade("lightwindow_loading",{duration:0.75,delay:1,afterFinish:function(){if(this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"){$("lightwindow_contents").setStyle({overflow:"auto"})}this._handleNavigation(this.activeGallery);this._defaultGalleryAnimationHandler();this._setStatus(false)}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultGalleryAnimationHandler:function(b){if(this.activeGallery){$("lightwindow_galleries").setStyle({display:"block",marginBottom:$("lightwindow_data_slide").getHeight()+this.options.contentOffset.height/2+"px"});$("lightwindow_navigation").setStyle({height:$("lightwindow_contents").getHeight()-20+"px"})}else{$("lightwindow_galleries").setStyle({display:"none"});$("lightwindow_galleries_tab_container").setStyle({height:"0px",marginTop:"20px"});$("lightwindow_galleries_list").setStyle({height:"0px"});return false}if(b){if($("lightwindow_galleries_list").getHeight()==0){var a=$("lightwindow_contents").getHeight()*0.8;$("lightwindow_galleries_tab_span").className="down"}else{var a=0;$("lightwindow_galleries_tab_span").className="up"}new Effect.Morph("lightwindow_galleries_list",{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:a+"px"},beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})},queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultTransitionHandler:function(){this.dimensions.dataEffects=[];if($("lightwindow_data_slide").getStyle("display")!="none"){this.dimensions.dataEffects.push(new Effect.SlideUp("lightwindow_data_slide",{sync:true}),new Effect.Fade("lightwindow_data_slide",{sync:true,from:1,to:0}))}if(!this.options.hideGalleryTab){if($("lightwindow_galleries").getHeight()!=0&&!this.options.hideGalleryTab){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"0px",marginTop:"20px"}}))}if($("lightwindow_galleries_list").getHeight()!=0){$("lightwindow_galleries_tab_span").className="up";this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_list",{sync:true,style:{height:"0px"},transition:Effect.Transitions.sinoidal,beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})}}))}}this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:"0px",marginTop:this.options.dimensions.titleHeight+"px"}}),new Effect.Fade("lightwindow_title_bar_inner",{sync:true,from:1,to:0}));new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._loadWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultFormHandler:function(d){var b=Event.element(d).parentNode;var c=Form.serialize(this._getParameter("lightwindow_form",b.getAttribute("params")));if(this.options.formMethod=="post"){var a=new Ajax.Request(b.href,{method:"post",postBody:c,onComplete:this.openWindow.bind(this,b)})}else{if(this.options.formMethod=="get"){var a=new Ajax.Request(b.href,{method:"get",parameters:c,onComplete:this.openWindow.bind(this,b)})}}},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.element.href);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var b=document.createElement("object");b.setAttribute("classid",this.options.classids[this._fileExtension(this.contentToFetch)]);b.setAttribute("codebase",this.options.codebases[this._fileExtension(this.contentToFetch)]);b.setAttribute("id","lightwindow_media_primary");b.setAttribute("name","lightwindow_media_primary");b.setAttribute("width",this.resizeTo.width);b.setAttribute("height",this.resizeTo.height);b=this._addParamToObject("movie",this.contentToFetch,b);b=this._addParamToObject("src",this.contentToFetch,b);b=this._addParamToObject("controller","true",b);b=this._addParamToObject("wmode","transparent",b);b=this._addParamToObject("cache","false",b);b=this._addParamToObject("quality","high",b);b=this._addParamToObject("base",".",b);if(!Prototype.Browser.IE){var a=document.createElement("object");a.setAttribute("type",this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);a.setAttribute("data",this.contentToFetch);a.setAttribute("id","lightwindow_media_secondary");a.setAttribute("name","lightwindow_media_secondary");a.setAttribute("width",this.resizeTo.width);a.setAttribute("height",this.resizeTo.height);a=this._addParamToObject("controller","true",a);a=this._addParamToObject("wmode","transparent",a);a=this._addParamToObject("cache","false",a);a=this._addParamToObject("quality","high",a);a=this._addParamToObject("base",".",a);b.appendChild(a)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(b,"object"))}else{this._appendObject(b,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}else{this._handleFinalWindowAnimation(0)}}this._setupActions()}};Event.observe(window,"load",lightwindowInit,false);var myLightWindow=null;function lightwindowInit(){myLightWindow=new lightwindow()};


