var a,viewport={getWinWidth:function(){this.width=0;if(window.innerWidth)this.width=window.innerWidth-18;else if(document.documentElement&&document.documentElement.clientWidth)this.width=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)this.width=document.body.clientWidth},getWinHeight:function(){this.height=0;if(window.innerHeight)this.height=window.innerHeight-18;else if(document.documentElement&&document.documentElement.clientHeight)this.height=document.documentElement.clientHeight; else if(document.body&&document.body.clientHeight)this.height=document.body.clientHeight},getScrollX:function(){this.scrollX=0;if(typeof window.pageXOffset=="number")this.scrollX=window.pageXOffset;else if(document.documentElement&&document.documentElement.scrollLeft)this.scrollX=document.documentElement.scrollLeft;else if(document.body&&document.body.scrollLeft)this.scrollX=document.body.scrollLeft;else if(window.scrollX)this.scrollX=window.scrollX},getScrollY:function(){this.scrollY=0;if(typeof window.pageYOffset== "number")this.scrollY=window.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)this.scrollY=document.documentElement.scrollTop;else if(document.body&&document.body.scrollTop)this.scrollY=document.body.scrollTop;else if(window.scrollY)this.scrollY=window.scrollY},getAll:function(){this.getWinWidth();this.getWinHeight();this.getScrollX();this.getScrollY()}},Prototype={Version:"1.7",Browser:function(){var b=navigator.userAgent,c=Object.prototype.toString.call(window.opera)== "[object Opera]";return{IE:!!window.attachEvent&&!c,Opera:c,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}}(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:function(){var b=window.Element||window.HTMLElement;return!!(b&&b.prototype)}(),SpecificElementExtensions:function(){if(typeof window.HTMLDivElement!=="undefined")return true;var b=document.createElement("div"),c= document.createElement("form"),d=false;if(b.__proto__&&b.__proto__!==c.__proto__)d=true;return d}()},ScriptFragment:"]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(b){return b}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false; var Abstract={},Try={these:function(){for(var b,c=0,d=arguments.length;c0;)if(H=F.match(v)){z+=F.slice(0,H.index);z+=String.interpret(t(H));F=F.slice(H.index+H[0].length)}else{z+=F;F=""}return z}function d(v,t,z){t=b(t);z=Object.isUndefined(z)?1:z;return this.gsub(v, function(F){if(--z<0)return F[0];return t(F)})}function e(v,t){this.gsub(v,t);return String(this)}function f(v,t){v=v||30;t=Object.isUndefined(t)?"...":t;return this.length>v?this.slice(0,v-t.length)+t:String(this)}function h(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function j(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function n(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function p(){var v=new RegExp(Prototype.ScriptFragment,"img"), t=new RegExp(Prototype.ScriptFragment,"im");return(this.match(v)||[]).map(function(z){return(z.match(t)||["",""])[1]})}function w(){return this.extractScripts().map(function(v){return eval(v)})}function y(){return this.replace(/&/g,"&").replace(//g,">")}function A(){return this.stripTags().replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function E(v){var t=this.strip().match(/([^?#]*)(#.*)?$/);if(!t)return{};return t[1].split(v||"&").inject({},function(z, F){if((F=F.split("="))[0]){var H=decodeURIComponent(F.shift());F=F.length>1?F.join("="):F[0];if(F!=undefined)F=decodeURIComponent(F);if(H in z){Object.isArray(z[H])||(z[H]=[z[H]]);z[H].push(F)}else z[H]=F}return z})}function I(){return this.split("")}function J(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function C(v){return v<1?"":(new Array(v+1)).join(this)}function D(){return this.replace(/-+(.)?/g,function(v,t){return t?t.toUpperCase():""})}function k(){return this.charAt(0).toUpperCase()+ this.substring(1).toLowerCase()}function m(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function g(){return this.replace(/_/g,"-")}function l(v){var t=this.replace(/[\x00-\x1f\\]/g,function(z){if(z in String.specialChar)return String.specialChar[z];return"\\u00"+z.charCodeAt().toPaddedString(2,16)});if(v)return'"'+t.replace(/"/g,'\\"')+'"';return"'"+t.replace(/'/g,"\\'")+"'"}function q(v){return this.replace(v|| Prototype.JSONFilter,"$1")}function o(){var v=this;if(v.blank())return false;v=v.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");v=v.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");v=v.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(v)}function s(v){var t=this.unfilterJSON(),z=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(z.test(t))t=t.replace(z,function(H){return"\\u"+("0000"+H.charCodeAt(0).toString(16)).slice(-4)}); try{if(!v||t.isJSON())return eval("("+t+")")}catch(F){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());}function x(){var v=this.unfilterJSON();return JSON.parse(v)}function u(v){return this.indexOf(v)>-1}function G(v){return this.lastIndexOf(v,0)===0}function K(v){var t=this.length-v.length;return t>=0&&this.indexOf(v,t)===t}function M(){return this==""}function N(){return/^\s*$/.test(this)}function r(v,t){return(new Template(this,t)).evaluate(v)}var B=window.JSON&&typeof JSON.parse=== "function"&&JSON.parse('{"test": true}').test;return{gsub:c,sub:d,scan:e,truncate:f,strip:String.prototype.trim||h,stripTags:j,stripScripts:n,extractScripts:p,evalScripts:w,escapeHTML:y,unescapeHTML:A,toQueryParams:E,parseQuery:E,toArray:I,succ:J,times:C,camelize:D,capitalize:k,underscore:m,dasherize:g,inspect:l,unfilterJSON:q,isJSON:o,evalJSON:B?x:s,include:u,startsWith:G,endsWith:K,empty:M,blank:N,interpolate:r}}()); var Template=Class.create({initialize:function(b,c){this.template=b.toString();this.pattern=c||Template.Pattern},evaluate:function(b){if(b&&Object.isFunction(b.toTemplateReplacements))b=b.toTemplateReplacements();return this.template.gsub(this.pattern,function(c){if(b==null)return c[1]+"";var d=c[1]||"";if(d=="\\")return c[2];var e=b,f=c[3],h=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;c=h.exec(f);if(c==null)return d;for(;c!=null;){var j=c[1].startsWith("[")?c[2].replace(/\\\\]/g,"]"):c[1];e=e[j];if(null== e||""==c[3])break;f=f.substring("["==c[3]?c[1].length:c[0].length);c=h.exec(f)}return d+String.interpret(e)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/; var $break={},Enumerable=function(){function b(o,s){var x=0;try{this._each(function(G){o.call(s,G,x++)})}catch(u){if(u!=$break)throw u;}return this}function c(o,s,x){var u=-o,G=[],K=this.toArray();if(o<1)return K;for(;(u+=o)=x)x=u});return x}function I(o, s){o=o||Prototype.K;var x;this.each(function(u,G){u=o.call(s,u,G);if(x==null||uu?1:0}).pluck("value")}function m(){return this.map()}function g(){var o=Prototype.K,s=$A(arguments);if(Object.isFunction(s.last()))o=s.pop();var x=[this].concat(s).map($A);return this.map(function(u,G){return o(x.pluck(G))})}function l(){return this.toArray().length}function q(){return"#"}return{each:b,eachSlice:c,all:d,every:d,any:e,some:e,collect:f,map:f,detect:h,findAll:j,select:j,filter:j,grep:n,include:p,member:p,inGroupsOf:w,inject:y,invoke:A, max:E,min:I,partition:J,pluck:C,reject:D,sortBy:k,toArray:m,entries:m,zip:g,size:l,inspect:q,find:h}}();function $A(b){if(!b)return[];if("toArray"in Object(b))return b.toArray();for(var c=b.length||0,d=new Array(c);c--;)d[c]=b[c];return d}function $w(b){if(!Object.isString(b))return[];return(b=b.strip())?b.split(/\s+/):[]}Array.from=$A; (function(){function b(g,l){for(var q=0,o=this.length>>>0;q"}function J(){return new Hash(this)}return{initialize:b,_each:c,set:d,get:e,unset:f,toObject:h,toTemplateReplacements:h,keys:j,values:n,index:p,merge:w,update:y,toQueryString:E,inspect:I,toJSON:h,clone:J}}());Hash.from=$H; Object.extend(Number.prototype,function(){function b(){return this.toPaddedString(2,16)}function c(){return this+1}function d(p,w){$R(0,this,true).each(p,w);return this}function e(p,w){w=this.toString(w||10);return"0".times(p-w.length)+w}function f(){return Math.abs(this)}function h(){return Math.round(this)}function j(){return Math.ceil(this)}function n(){return Math.floor(this)}return{toColorPart:b,succ:c,times:d,toPaddedString:e,abs:f,round:h,ceil:j,floor:n}}()); function $R(b,c,d){return new ObjectRange(b,c,d)} var ObjectRange=Class.create(Enumerable,function(){function b(e,f,h){this.start=e;this.end=f;this.exclusive=h}function c(e){for(var f=this.start;this.include(f);){e(f);f=f.succ()}}function d(e){if(e1&&!(b==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var b={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){b["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)b.Connection="close"}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push))for(var d=0,e=c.length;d=200&&b<300||b==304},getStatus:function(){try{if(this.transport.status=== 1223)return 204;return this.transport.status||0}catch(b){return 0}},respondToReadyState:function(b){b=Ajax.Request.Events[b];var c=new Ajax.Response(this);if(b=="Complete"){try{this._complete=true;(this.options["on"+c.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(c,c.headerJSON)}catch(d){this.dispatchException(d)}var e=c.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&e&&e.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))this.evalResponse()}try{(this.options["on"+ b]||Prototype.emptyFunction)(c,c.headerJSON);Ajax.Responders.dispatch("on"+b,this,c,c.headerJSON)}catch(f){this.dispatchException(f)}if(b=="Complete")this.transport.onreadystatechange=Prototype.emptyFunction},isSameOrigin:function(){var b=this.url.match(/^\s*https?:\/\/[^\/]*/);return!b||b[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""})},getHeader:function(b){try{return this.transport.getResponseHeader(b)|| null}catch(c){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(b){this.dispatchException(b)}},dispatchException:function(b){(this.options.onException||Prototype.emptyFunction)(this,b);Ajax.Responders.dispatch("onException",this,b)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"]; Ajax.Response=Class.create({initialize:function(b){this.request=b;b=this.transport=b.transport;var c=this.readyState=b.readyState;if(c>2&&!Prototype.Browser.IE||c==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(b.responseText);this.headerJSON=this._getHeaderJSON()}if(c==4){b=b.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus, getStatusText:function(){try{return this.transport.statusText||""}catch(b){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(b){return null}},getResponseHeader:function(b){return this.transport.getResponseHeader(b)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var b=this.getHeader("X-JSON");if(!b)return null;b=decodeURIComponent(escape(b));try{return b.evalJSON(this.request.options.sanitizeJSON|| !this.request.isSameOrigin())}catch(c){this.request.dispatchException(c)}},_getResponseJSON:function(){var b=this.request.options;if(!b.evalJSON||b.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json")||this.responseText.blank())return null;try{return this.responseText.evalJSON(b.sanitizeJSON||!this.request.isSameOrigin())}catch(c){this.request.dispatchException(c)}}}); Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,c,d,e){this.container={success:c.success||c,failure:c.failure||(c.success?null:c)};e=Object.clone(e);var f=e.onComplete;e.onComplete=function(h,j){this.updateContent(h.responseText);Object.isFunction(f)&&f(h,j)}.bind(this);$super(d,e)},updateContent:function(b){var c=this.container[this.success()?"success":"failure"],d=this.options;d.evalScripts||(b=b.stripScripts());if(c=$(c))if(d.insertion)if(Object.isString(d.insertion)){var e= {};e[d.insertion]=b;c.insert(e)}else d.insertion(c,b);else c.update(b)}}); Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,c,d,e){$super(e);this.onComplete=this.options.onComplete;this.frequency=this.options.frequency||2;this.decay=this.options.decay||1;this.updater={};this.container=c;this.url=d;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)}, updateComplete:function(b){if(this.options.decay){this.decay=b.responseText==this.lastText?this.decay*this.options.decay:1;this.lastText=b.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}}); function $(b){if(arguments.length>1){for(var c=0,d=[],e=arguments.length;c');return f.tagName.toLowerCase()==="input"&&f.name==="x"}catch(h){return false}}(),e=b.Element;b.Element=function(f,h){h=h||{};f=f.toLowerCase();var j=Element.cache;if(d&&h.name){f="<"+f+' name="'+h.name+'">';delete h.name;return Element.writeAttribute(document.createElement(f),h)}j[f]||(j[f]=Element.extend(document.createElement(f))); f=c(f,h)?j[f].cloneNode(false):document.createElement(f);return Element.writeAttribute(f,h)};Object.extend(b.Element,e||{});if(e)b.Element.prototype=e.prototype})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var c=b._prototypeUID;if(c){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[c]}}; Element.Methods={visible:function(b){return $(b).style.display!="none"},toggle:function(b){b=$(b);Element[Element.visible(b)?"hide":"show"](b);return b},hide:function(b){b=$(b);b.style.display="none";return b},show:function(b){b=$(b);b.style.display="";return b},remove:function(b){b=$(b);b.parentNode.removeChild(b);return b},update:function(){function b(j,n){j=$(j);for(var p=Element._purgeElement,w=j.getElementsByTagName("*"),y=w.length;y--;)p(w[y]);if(n&&n.toElement)n=n.toElement();if(Object.isElement(n))return j.update().insert(n); n=Object.toHTML(n);p=j.tagName.toUpperCase();if(p==="SCRIPT"&&h){j.text=n;return j}if(f)if(p in Element._insertionTranslations.tags){for(;j.firstChild;)j.removeChild(j.firstChild);Element._getContentFromAnonymousElement(p,n.stripScripts()).each(function(A){j.appendChild(A)})}else if(e&&Object.isString(n)&&n.indexOf("-1){for(;j.firstChild;)j.removeChild(j.firstChild);Element._getContentFromAnonymousElement(p,n.stripScripts(),true).each(function(A){j.appendChild(A)})}else j.innerHTML=n.stripScripts(); else j.innerHTML=n.stripScripts();n.evalScripts.bind(n).defer();return j}var c=function(){var j=document.createElement("select"),n=true;j.innerHTML='';if(j.options&&j.options[0])n=j.options[0].nodeName.toUpperCase()!=="OPTION";return n}(),d=function(){try{var j=document.createElement("table");if(j&&j.tBodies){j.innerHTML="test";return typeof j.tBodies[0]=="undefined"}}catch(n){return true}}(),e=function(){try{var j=document.createElement("div"); j.innerHTML="";return j.childNodes.length===0}catch(n){return true}}(),f=c||d||e,h=function(){var j=document.createElement("script"),n=false;try{j.appendChild(document.createTextNode(""));n=!j.firstChild||j.firstChild&&j.firstChild.nodeType!==3}catch(p){n=true}return n}();return b}(),replace:function(b,c){b=$(b);if(c&&c.toElement)c=c.toElement();else if(!Object.isElement(c)){c=Object.toHTML(c);var d=b.ownerDocument.createRange();d.selectNode(b);c.evalScripts.bind(c).defer();c=d.createContextualFragment(c.stripScripts())}b.parentNode.replaceChild(c, b);return b},insert:function(b,c){b=$(b);if(Object.isString(c)||Object.isNumber(c)||Object.isElement(c)||c&&(c.toElement||c.toHTML))c={bottom:c};var d,e,f;for(var h in c){d=c[h];h=h.toLowerCase();e=Element._insertionTranslations[h];if(d&&d.toElement)d=d.toElement();if(Object.isElement(d))e(b,d);else{d=Object.toHTML(d);f=(h=="before"||h=="after"?b.parentNode:b).tagName.toUpperCase();f=Element._getContentFromAnonymousElement(f,d.stripScripts());if(h=="top"||h=="after")f.reverse();f.each(e.curry(b)); d.evalScripts.bind(d).defer()}}return b},wrap:function(b,c,d){b=$(b);if(Object.isElement(c))$(c).writeAttribute(d||{});else c=Object.isString(c)?new Element(c,d):new Element("div",c);b.parentNode&&b.parentNode.replaceChild(c,b);c.appendChild(b);return c},inspect:function(b){b=$(b);var c="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(d){var e=d.first();d=d.last();if(e=(b[e]||"").toString())c+=" "+d+"="+e.inspect(true)});return c+">"},recursivelyCollect:function(b,c,d){b= $(b);d=d||-1;for(var e=[];b=b[c];){b.nodeType==1&&e.push(Element.extend(b));if(e.length==d)break}return e},ancestors:function(b){return Element.recursivelyCollect(b,"parentNode")},descendants:function(b){return Element.select(b,"*")},firstDescendant:function(b){for(b=$(b).firstChild;b&&b.nodeType!=1;)b=b.nextSibling;return $(b)},immediateDescendants:function(b){var c=[];for(b=$(b).firstChild;b;){b.nodeType===1&&c.push(Element.extend(b));b=b.nextSibling}return c},previousSiblings:function(b){return Element.recursivelyCollect(b, "previousSibling")},nextSiblings:function(b){return Element.recursivelyCollect(b,"nextSibling")},siblings:function(b){b=$(b);return Element.previousSiblings(b).reverse().concat(Element.nextSiblings(b))},match:function(b,c){b=$(b);if(Object.isString(c))return Prototype.Selector.match(b,c);return c.match(b)},up:function(b,c,d){b=$(b);if(arguments.length==1)return $(b.parentNode);var e=Element.ancestors(b);return Object.isNumber(c)?e[c]:Prototype.Selector.find(e,c,d)},down:function(b,c,d){b=$(b);if(arguments.length== 1)return Element.firstDescendant(b);return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[d||0]},previous:function(b,c,d){b=$(b);if(Object.isNumber(c)){d=c;c=false}Object.isNumber(d)||(d=0);return c?Prototype.Selector.find(b.previousSiblings(),c,d):b.recursivelyCollect("previousSibling",d+1)[d]},next:function(b,c,d){b=$(b);if(Object.isNumber(c)){d=c;c=false}Object.isNumber(d)||(d=0);if(c)return Prototype.Selector.find(b.nextSiblings(),c,d);else{Object.isNumber(d);return b.recursivelyCollect("nextSibling", d+1)[d]}},select:function(b){b=$(b);var c=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(c,b)},adjacent:function(b){b=$(b);var c=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(c,b.parentNode).without(b)},identify:function(b){b=$(b);var c=Element.readAttribute(b,"id");if(c)return c;do c="anonymous_element_"+Element.idCounter++;while($(c));Element.writeAttribute(b,"id",c);return c},readAttribute:function(b,c){b=$(b);if(Prototype.Browser.IE){var d= Element._attributeTranslations.read;if(d.values[c])return d.values[c](b,c);if(d.names[c])c=d.names[c];if(c.include(":"))return!b.attributes||!b.attributes[c]?null:b.attributes[c].value}return b.getAttribute(c)},writeAttribute:function(b,c,d){b=$(b);var e={},f=Element._attributeTranslations.write;if(typeof c=="object")e=c;else e[c]=Object.isUndefined(d)?true:d;for(var h in e){c=f.names[h]||h;d=e[h];if(f.values[h])c=f.values[h](b,d);if(d===false||d===null)b.removeAttribute(c);else d===true?b.setAttribute(c, c):b.setAttribute(c,d)}return b},getHeight:function(b){return Element.getDimensions(b).height},getWidth:function(b){return Element.getDimensions(b).width},classNames:function(b){return new Element.ClassNames(b)},hasClassName:function(b,c){if(b=$(b)){b=b.className;return b.length>0&&(b==c||(new RegExp("(^|\\s)"+c+"(\\s|$)")).test(b))}},addClassName:function(b,c){if(b=$(b)){Element.hasClassName(b,c)||(b.className+=(b.className?" ":"")+c);return b}},removeClassName:function(b,c){if(b=$(b)){b.className= b.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)")," ").strip();return b}},toggleClassName:function(b,c){if(b=$(b))return Element[Element.hasClassName(b,c)?"removeClassName":"addClassName"](b,c)},cleanWhitespace:function(b){b=$(b);for(var c=b.firstChild;c;){var d=c.nextSibling;c.nodeType==3&&!/\S/.test(c.nodeValue)&&b.removeChild(c);c=d}return b},empty:function(b){return $(b).innerHTML.blank()},descendantOf:function(b,c){b=$(b);c=$(c);if(b.compareDocumentPosition)return(b.compareDocumentPosition(c)& 8)===8;if(c.contains)return c.contains(b)&&c!==b;for(;b=b.parentNode;)if(b==c)return true;return false},scrollTo:function(b){b=$(b);var c=Element.cumulativeOffset(b);window.scrollTo(c[0],c[1]);return b},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto")d=(b=document.defaultView.getComputedStyle(b,null))?b[c]:null;if(c=="opacity")return d?parseFloat(d):1;return d=="auto"?null:d},getOpacity:function(b){return $(b).getStyle("opacity")},setStyle:function(b, c){b=$(b);var d=b.style;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var e in c)if(e=="opacity")b.setOpacity(c[e]);else d[e=="float"||e=="cssFloat"?Object.isUndefined(d.styleFloat)?"cssFloat":"styleFloat":e]=c[e];return b},setOpacity:function(b,c){b=$(b);b.style.opacity=c==1||c===""?"":c<1.0E-5?0:c;return b},makePositioned:function(b){b=$(b);var c=Element.getStyle(b,"position");if(c=="static"||!c){b._madePositioned= true;b.style.position="relative";if(Prototype.Browser.Opera){b.style.top=0;b.style.left=0}}return b},undoPositioned:function(b){b=$(b);if(b._madePositioned){b._madePositioned=undefined;b.style.position=b.style.top=b.style.left=b.style.bottom=b.style.right=""}return b},makeClipping:function(b){b=$(b);if(b._overflow)return b;b._overflow=Element.getStyle(b,"overflow")||"auto";if(b._overflow!=="hidden")b.style.overflow="hidden";return b},undoClipping:function(b){b=$(b);if(!b._overflow)return b;b.style.overflow= b._overflow=="auto"?"":b._overflow;b._overflow=null;return b},clonePosition:function(b,c,d){d=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},d||{});c=$(c);var e=Element.viewportOffset(c),f=[0,0],h=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){h=Element.getOffsetParent(b);f=Element.viewportOffset(h)}if(h==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(d.setLeft)b.style.left=e[0]-f[0]+d.offsetLeft+"px";if(d.setTop)b.style.top= e[1]-f[1]+d.offsetTop+"px";if(d.setWidth)b.style.width=c.offsetWidth+"px";if(d.setHeight)b.style.height=c.offsetHeight+"px";return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}}; if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(b,c,d){switch(d){case "height":case "width":if(!Element.visible(c))return null;var e=parseInt(b(c,d),10);if(e!==c["offset"+d.capitalize()])return e+"px";return(d==="height"?["border-top-width","padding-top","padding-bottom","border-bottom-width"]:["border-left-width","padding-left","padding-right","border-right-width"]).inject(e,function(f,h){h=b(c,h);return h===null?f:f-parseInt(h,10)})+"px";default:return b(c, d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(b,c,d){if(d==="title")return c.title;return b(c,d)})}else if(Prototype.Browser.IE){Element.Methods.getStyle=function(b,c){b=$(b);c=c=="float"||c=="cssFloat"?"styleFloat":c.camelize();var d=b.style[c];if(!d&&b.currentStyle)d=b.currentStyle[c];if(c=="opacity"){if(d=(b.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/))if(d[1])return parseFloat(d[1])/100;return 1}if(d=="auto"){if((c=="width"||c=="height")&&b.getStyle("display")!= "none")return b["offset"+c.capitalize()]+"px";return null}return d};Element.Methods.setOpacity=function(b,c){function d(h){return h.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var e=b.currentStyle;if(e&&!e.hasLayout||!e&&b.style.zoom=="normal")b.style.zoom=1;e=b.getStyle("filter");var f=b.style;if(c==1||c===""){(e=d(e))?(f.filter=e):f.removeAttribute("filter");return b}else if(c<1.0E-5)c=0;f.filter=d(e)+"alpha(opacity="+c*100+")";return b};Element._attributeTranslations=function(){var b="className",c= "for",d=document.createElement("div");d.setAttribute(b,"x");if(d.className!=="x"){d.setAttribute("class","x");if(d.className==="x")b="class"}d=null;d=document.createElement("label");d.setAttribute(c,"x");if(d.htmlFor!=="x"){d.setAttribute("htmlFor","x");if(d.htmlFor==="x")c="htmlFor"}d=null;return{read:{names:{"class":b,className:b,"for":c,htmlFor:c},values:{_getAttr:function(e,f){return e.getAttribute(f)},_getAttr2:function(e,f){return e.getAttribute(f,2)},_getAttrNode:function(e,f){return(e=e.getAttributeNode(f))? e.value:""},_getEv:function(){var e=document.createElement("div"),f;e.onclick=Prototype.emptyFunction;e=e.getAttribute("onclick");if(String(e).indexOf("{")>-1)f=function(h,j){j=h.getAttribute(j);if(!j)return null;j=j.toString();j=j.split("{")[1];j=j.split("}")[0];return j.strip()};else if(e==="")f=function(h,j){j=h.getAttribute(j);if(!j)return null;return j.strip()};e=null;return f}(),_flag:function(e,f){return $(e).hasAttribute(f)?f:null},style:function(e){return e.style.cssText.toLowerCase()},title:function(e){return e.title}}}}}(); Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(b,c){b.checked=!!c},style:function(b,c){b.style.cssText=c?c:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(b){Element._attributeTranslations.write.names[b.toLowerCase()]=b;Element._attributeTranslations.has[b.toLowerCase()]= b});(function(b){Object.extend(b,{href:b._getAttr2,src:b._getAttr2,type:b._getAttr,action:b._getAttrNode,disabled:b._flag,checked:b._flag,readonly:b._flag,multiple:b._flag,onload:b._getEv,onunload:b._getEv,onclick:b._getEv,ondblclick:b._getEv,onmousedown:b._getEv,onmouseup:b._getEv,onmouseover:b._getEv,onmousemove:b._getEv,onmouseout:b._getEv,onfocus:b._getEv,onblur:b._getEv,onkeypress:b._getEv,onkeydown:b._getEv,onkeyup:b._getEv,onsubmit:b._getEv,onreset:b._getEv,onselect:b._getEv,onchange:b._getEv})})(Element._attributeTranslations.read.values); Prototype.BrowserFeatures.ElementExtensions&&function(){function b(c){c=c.getElementsByTagName("*");for(var d=[],e=0,f;f=c[e];e++)f.tagName!=="!"&&d.push(f);return d}Element.Methods.down=function(c,d,e){c=$(c);if(arguments.length==1)return c.firstDescendant();return Object.isNumber(d)?b(c)[d]:Element.select(c,d)[e||0]}}()}else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent))Element.Methods.setOpacity=function(b,c){b=$(b);b.style.opacity=c==1?0.999999:c===""?"":c<1.0E-5?0:c;return b}; else if(Prototype.Browser.WebKit)Element.Methods.setOpacity=function(b,c){b=$(b);b.style.opacity=c==1||c===""?"":c<1.0E-5?0:c;if(c==1)if(b.tagName.toUpperCase()=="IMG"&&b.width){b.width++;b.width--}else try{var d=document.createTextNode(" ");b.appendChild(d);b.removeChild(d)}catch(e){}return b}; if("outerHTML"in document.documentElement)Element.Methods.replace=function(b,c){b=$(b);if(c&&c.toElement)c=c.toElement();if(Object.isElement(c)){b.parentNode.replaceChild(c,b);return b}c=Object.toHTML(c);var d=b.parentNode,e=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[e]){var f=b.next();e=Element._getContentFromAnonymousElement(e,c.stripScripts());d.removeChild(b);f?e.each(function(h){d.insertBefore(h,f)}):e.each(function(h){d.appendChild(h)})}else b.outerHTML=c.stripScripts(); c.evalScripts.bind(c).defer();return b};Element._returnOffset=function(b,c){var d=[b,c];d.left=b;d.top=c;return d};Element._getContentFromAnonymousElement=function(b,c,d){var e=new Element("div");b=Element._insertionTranslations.tags[b];var f=false;if(b)f=true;else if(d){f=true;b=["","",0]}if(f){e.innerHTML=" "+b[0]+c+b[1];e.removeChild(e.firstChild);for(c=b[2];c--;)e=e.firstChild}else e.innerHTML=c;return $A(e.childNodes)}; Element._insertionTranslations={before:function(b,c){b.parentNode.insertBefore(c,b)},top:function(b,c){b.insertBefore(c,b.firstChild)},bottom:function(b,c){b.appendChild(c)},after:function(b,c){b.parentNode.insertBefore(c,b.nextSibling)},tags:{TABLE:["","
",1],TBODY:["","
",2],TR:["","
",3],TD:["
","
",4],SELECT:["",1]}}; (function(){var b=Element._insertionTranslations.tags;Object.extend(b,{THEAD:b.TBODY,TFOOT:b.TBODY,TH:b.TD})})();Element.Methods.Simulated={hasAttribute:function(b,c){c=Element._attributeTranslations.has[c]||c;b=$(b).getAttributeNode(c);return!!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods); (function(b){if(!Prototype.BrowserFeatures.ElementExtensions&&b.__proto__){window.HTMLElement={};window.HTMLElement.prototype=b.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}})(document.createElement("div")); Element.extend=function(){function b(h){if(typeof window.Element!="undefined"){var j=window.Element.prototype;if(j){var n="_"+(Math.random()+"").slice(2);h=document.createElement(h);j[n]="x";h=h[n]!=="x";delete j[n];return h}}return false}function c(h,j){for(var n in j){var p=j[n];if(Object.isFunction(p)&&!(n in h))h[n]=p.methodize()}}var d=b("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d)return function(h){if(h&&typeof h._extendedByPrototype=="undefined"){var j=h.tagName; if(j&&/^(?:object|applet|embed)$/i.test(j)){c(h,Element.Methods);c(h,Element.Methods.Simulated);c(h,Element.Methods.ByTag[j.toUpperCase()])}}return h};return Prototype.K}var e={},f=Element.Methods.ByTag;d=Object.extend(function(h){if(!h||typeof h._extendedByPrototype!="undefined"||h.nodeType!=1||h==window)return h;var j=Object.clone(e),n=h.tagName.toUpperCase();f[n]&&Object.extend(j,f[n]);c(h,j);h._extendedByPrototype=Prototype.emptyFunction;return h},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(e, Element.Methods);Object.extend(e,Element.Methods.Simulated)}}});d.refresh();return d}();Element.hasAttribute=document.documentElement.hasAttribute?function(b,c){return b.hasAttribute(c)}:Element.Methods.Simulated.hasAttribute; Element.addMethods=function(b){function c(p){p=p.toUpperCase();Element.Methods.ByTag[p]||(Element.Methods.ByTag[p]={});Object.extend(Element.Methods.ByTag[p],b)}function d(p,w,y){y=y||false;for(var A in p){var E=p[A];if(Object.isFunction(E))if(!y||!(A in w))w[A]=E.methodize()}}function e(p){var w,y={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(y[p])w="HTML"+y[p]+"Element";if(window[w])return window[w];w="HTML"+p+"Element";if(window[w])return window[w];w="HTML"+p.capitalize()+"Element";if(window[w])return window[w];p=document.createElement(p);return p.__proto__||p.constructor.prototype} var f=Prototype.BrowserFeatures,h=Element.Methods.ByTag;if(!b){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),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var j=b;b=arguments[1]}if(j)Object.isArray(j)?j.each(c):c(j);else Object.extend(Element.Methods, b||{});j=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(f.ElementExtensions){d(Element.Methods,j);d(Element.Methods.Simulated,j,true)}if(f.SpecificElementExtensions)for(var n in Element.Methods.ByTag){f=e(n);Object.isUndefined(f)||d(h[n],f.prototype)}Object.extend(Element,Element.Methods);delete Element.ByTag;Element.extend.refresh&&Element.extend.refresh();Element.cache={}}; document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}}; (function(b){function c(){if(e.WebKit&&!f.evaluate)return document;if(e.Opera&&window.parseFloat(window.opera.version())<9.5)return document.body;return document.documentElement}function d(n){h||(h=c());j[n]="client"+n;b["get"+n]=function(){return h[j[n]]};return b["get"+n]()}var e=Prototype.Browser,f=document,h,j={};b.getWidth=d.curry("Width");b.getHeight=d.curry("Height")})(document.viewport);Element.Storage={UID:1}; Element.addMethods({getStorage:function(b){if(b=$(b)){if(b===window)b=0;else{if(typeof b._prototypeUID==="undefined")b._prototypeUID=Element.Storage.UID++;b=b._prototypeUID}Element.Storage[b]||(Element.Storage[b]=$H());return Element.Storage[b]}},store:function(b,c,d){if(b=$(b)){arguments.length===2?Element.getStorage(b).update(c):Element.getStorage(b).set(c,d);return b}},retrieve:function(b,c,d){if(b=$(b)){b=Element.getStorage(b);var e=b.get(c);if(Object.isUndefined(e)){b.set(c,d);e=d}return e}}, clone:function(b,c){if(b=$(b)){b=b.cloneNode(c);b._prototypeUID=void 0;if(c){c=Element.select(b,"*");for(var d=c.length;d--;)c[d]._prototypeUID=void 0}return Element.extend(b)}},purge:function(b){if(b=$(b)){var c=Element._purgeElement;c(b);b=b.getElementsByTagName("*");for(var d=b.length;d--;)c(b[d]);return null}}}); (function(){function b(g){g=g.match(/^(\d+)%?$/i);if(!g)return null;return Number(g[1])/100}function c(g,l,q){var o=null;if(Object.isElement(g)){o=g;g=o.getStyle(l)}if(g===null)return null;if(/^(?:-)?\d+(\.\d+)?(px)?$/i.test(g))return window.parseFloat(g);var s=g.include("%"),x=q===document.viewport;if(/\d/.test(g)&&o&&o.runtimeStyle&&!(s&&x)){q=o.style.left;l=o.runtimeStyle.left;o.runtimeStyle.left=o.currentStyle.left;o.style.left=g||0;g=o.style.pixelLeft;o.style.left=q;o.runtimeStyle.left=l;return g}if(o&& s){q=q||o.parentNode;g=b(g);s=null;o.getStyle("position");o=l.include("left")||l.include("right")||l.include("width");l=l.include("top")||l.include("bottom")||l.include("height");if(q===document.viewport)if(o)s=document.viewport.getWidth();else{if(l)s=document.viewport.getHeight()}else if(o)s=$(q).measure("width");else if(l)s=$(q).measure("height");return s===null?0:s*g}return 0}function d(g){for(;g&&g.parentNode;){if(g.getStyle("display")==="none")return false;g=$(g.parentNode)}return true}function e(g){if(g.include("border"))g+= "-width";return g.camelize()}function f(g,l){return new Element.Layout(g,l)}function h(g,l){return $(g).getLayout().get(l)}function j(g){g=$(g);var l=Element.getStyle(g,"display");if(l&&l!=="none")return{width:g.offsetWidth,height:g.offsetHeight};l=g.style;l={visibility:l.visibility,position:l.position,display:l.display};var q={visibility:"hidden",display:"block"};if(l.position!=="fixed")q.position="absolute";Element.setStyle(g,q);q={width:g.offsetWidth,height:g.offsetHeight};Element.setStyle(g,l); return q}function n(g){g=$(g);if(D(g)||k(g)||J(g)||C(g))return $(document.body);if(Element.getStyle(g,"display")!=="inline"&&g.offsetParent)return $(g.offsetParent);for(;(g=g.parentNode)&&g!==document.body;)if(Element.getStyle(g,"position")!=="static")return C(g)?$(document.body):$(g);return $(document.body)}function p(g){g=$(g);var l=0,q=0;if(g.parentNode){do{l+=g.offsetTop||0;q+=g.offsetLeft||0;g=g.offsetParent}while(g)}return new Element.Offset(q,l)}function w(g){g=$(g);var l=g.getLayout(),q=0, o=0;do{q+=g.offsetTop||0;o+=g.offsetLeft||0;if(g=g.offsetParent){if(J(g))break;if(Element.getStyle(g,"position")!=="static")break}}while(g);o-=l.get("margin-top");q-=l.get("margin-left");return new Element.Offset(o,q)}function y(g){var l=0,q=0;do{l+=g.scrollTop||0;q+=g.scrollLeft||0;g=g.parentNode}while(g);return new Element.Offset(q,l)}function A(g){$(s);var l=0,q=0,o=document.body,s=g;do{l+=s.offsetTop||0;q+=s.offsetLeft||0;if(s.offsetParent==o&&Element.getStyle(s,"position")=="absolute")break}while(s= s.offsetParent);s=g;do if(s!=o){l-=s.scrollTop||0;q-=s.scrollLeft||0}while(s=s.parentNode);return new Element.Offset(q,l)}function E(g){g=$(g);if(Element.getStyle(g,"position")==="absolute")return g;var l=n(g),q=g.viewportOffset();l=l.viewportOffset();q=q.relativeTo(l);l=g.getLayout();g.store("prototype_absolutize_original_styles",{left:g.getStyle("left"),top:g.getStyle("top"),width:g.getStyle("width"),height:g.getStyle("height")});g.setStyle({position:"absolute",top:q.top+"px",left:q.left+"px",width:l.get("width")+ "px",height:l.get("height")+"px"});return g}function I(g){g=$(g);if(Element.getStyle(g,"position")==="relative")return g;var l=g.retrieve("prototype_absolutize_original_styles");l&&g.setStyle(l);return g}function J(g){return g.nodeName.toUpperCase()==="BODY"}function C(g){return g.nodeName.toUpperCase()==="HTML"}function D(g){return g.nodeType===Node.DOCUMENT_NODE}function k(g){return g!==document.body&&!Element.descendantOf(g,document.body)}var m=Prototype.K;if("currentStyle"in document.documentElement)m= function(g){if(!g.currentStyle.hasLayout)g.style.zoom=1;return g};Element.Layout=Class.create(Hash,{initialize:function($super,l,q){$super();this.element=$(l);Element.Layout.PROPERTIES.each(function(o){this._set(o,null)},this);if(q){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(g,l){return Hash.prototype.set.call(this,g,l)},set:function(){throw"Properties of Element.Layout are read-only.";},get:function($super, l){var q=$super(l);return q===null?this._compute(l):q},_begin:function(){if(!this._prepared){var g=this.element;if(!d(g)){g.store("prototype_original_styles",{position:g.style.position||"",width:g.style.width||"",visibility:g.style.visibility||"",display:g.style.display||""});var l=g.getStyle("position"),q=g.getStyle("width");if(q==="0px"||q===null){g.style.display="block";q=g.getStyle("width")}var o=l==="fixed"?document.viewport:g.parentNode;g.setStyle({position:"absolute",visibility:"hidden",display:"block"}); var s=g.getStyle("width");l=q&&s===q?c(g,"width",o):l==="absolute"||l==="fixed"?c(g,"width",o):$(g.parentNode).getLayout().get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right");g.setStyle({width:l+"px"})}this._prepared=true}},_end:function(){var g=this.element,l=g.retrieve("prototype_original_styles");g.store("prototype_original_styles",null);g.setStyle(l);this._prepared=false},_compute:function(g){var l= Element.Layout.COMPUTATIONS;if(!(g in l))throw"Property not found.";return this._set(g,l[g].call(this,this.element))},toObject:function(){var g=$A(arguments),l={};(g.length===0?Element.Layout.PROPERTIES:g.join(" ").split(" ")).each(function(q){if(Element.Layout.PROPERTIES.include(q)){var o=this.get(q);if(o!=null)l[q]=o}},this);return l},toHash:function(){var g=this.toObject.apply(this,arguments);return new Hash(g)},toCSS:function(){var g=$A(arguments),l={};(g.length===0?Element.Layout.PROPERTIES: g.join(" ").split(" ")).each(function(q){if(Element.Layout.PROPERTIES.include(q))if(!Element.Layout.COMPOSITE_PROPERTIES.include(q)){var o=this.get(q);if(o!=null)l[e(q)]=o+"px"}},this);return l},inspect:function(){return"#"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"), COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(){this._preComputing||this._begin();var g=this.get("border-box-height");if(g<=0){this._preComputing||this._end();return 0}var l=this.get("border-top"),q=this.get("border-bottom"),o=this.get("padding-top"),s=this.get("padding-bottom");this._preComputing||this._end();return g-l-q-o-s},width:function(){this._preComputing||this._begin();var g= this.get("border-box-width");if(g<=0){this._preComputing||this._end();return 0}var l=this.get("border-left"),q=this.get("border-right"),o=this.get("padding-left"),s=this.get("padding-right");this._preComputing||this._end();return g-l-q-o-s},"padding-box-height":function(){var g=this.get("height"),l=this.get("padding-top"),q=this.get("padding-bottom");return g+l+q},"padding-box-width":function(){var g=this.get("width"),l=this.get("padding-left"),q=this.get("padding-right");return g+l+q},"border-box-height":function(g){this._preComputing|| this._begin();g=g.offsetHeight;this._preComputing||this._end();return g},"border-box-width":function(g){this._preComputing||this._begin();g=g.offsetWidth;this._preComputing||this._end();return g},"margin-box-height":function(){var g=this.get("border-box-height"),l=this.get("margin-top"),q=this.get("margin-bottom");if(g<=0)return 0;return g+l+q},"margin-box-width":function(){var g=this.get("border-box-width"),l=this.get("margin-left"),q=this.get("margin-right");if(g<=0)return 0;return g+l+q},top:function(g){return g.positionedOffset().top}, bottom:function(g){var l=g.positionedOffset();g=g.getOffsetParent().measure("height");var q=this.get("border-box-height");return g-q-l.top},left:function(g){return g.positionedOffset().left},right:function(g){var l=g.positionedOffset();g=g.getOffsetParent().measure("width");var q=this.get("border-box-width");return g-q-l.left},"padding-top":function(g){return c(g,"paddingTop")},"padding-bottom":function(g){return c(g,"paddingBottom")},"padding-left":function(g){return c(g,"paddingLeft")},"padding-right":function(g){return c(g, "paddingRight")},"border-top":function(g){return c(g,"borderTopWidth")},"border-bottom":function(g){return c(g,"borderBottomWidth")},"border-left":function(g){return c(g,"borderLeftWidth")},"border-right":function(g){return c(g,"borderRightWidth")},"margin-top":function(g){return c(g,"marginTop")},"margin-bottom":function(g){return c(g,"marginBottom")},"margin-left":function(g){return c(g,"marginLeft")},"margin-right":function(g){return c(g,"marginRight")}}});"getBoundingClientRect"in document.documentElement&& Object.extend(Element.Layout.COMPUTATIONS,{right:function(g){var l=m(g.getOffsetParent());g=g.getBoundingClientRect();return(l.getBoundingClientRect().right-g.right).round()},bottom:function(g){var l=m(g.getOffsetParent());g=g.getBoundingClientRect();return(l.getBoundingClientRect().bottom-g.bottom).round()}});Element.Offset=Class.create({initialize:function(g,l){this.left=g.round();this.top=l.round();this[0]=this.left;this[1]=this.top},relativeTo:function(g){return new Element.Offset(this.left-g.left, this.top-g.top)},inspect:function(){return"#".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});if(Prototype.Browser.IE){n=n.wrap(function(g,l){l=$(l);if(D(l)||k(l)||J(l)||C(l))return $(document.body);var q=l.getStyle("position");if(q!=="static")return g(l);l.setStyle({position:"relative"});g=g(l);l.setStyle({position:q});return g});w=w.wrap(function(g,l){l=$(l);if(!l.parentNode)return new Element.Offset(0, 0);var q=l.getStyle("position");if(q!=="static")return g(l);var o=l.getOffsetParent();o&&o.getStyle("position")==="fixed"&&m(o);l.setStyle({position:"relative"});g=g(l);l.setStyle({position:q});return g})}else if(Prototype.Browser.Webkit)p=function(g){g=$(g);var l=0,q=0;do{l+=g.offsetTop||0;q+=g.offsetLeft||0;if(g.offsetParent==document.body)if(Element.getStyle(g,"position")=="absolute")break;g=g.offsetParent}while(g);return new Element.Offset(q,l)};Element.addMethods({getLayout:f,measure:h,getDimensions:j, getOffsetParent:n,cumulativeOffset:p,positionedOffset:w,cumulativeScrollOffset:y,viewportOffset:A,absolutize:E,relativize:I});"getBoundingClientRect"in document.documentElement&&Element.addMethods({viewportOffset:function(g){g=$(g);if(k(g))return new Element.Offset(0,0);g=g.getBoundingClientRect();var l=document.documentElement;return new Element.Offset(g.left-l.clientLeft,g.top-l.clientTop)}})})();window.$$=function(){var b=$A(arguments).join(", ");return Prototype.Selector.select(b,document)}; Prototype.Selector=function(){function b(){throw new Error('Method "Prototype.Selector.select" must be defined.');}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.');}function d(h,j,n){n=n||0;var p=Prototype.Selector.match,w=h.length,y=0,A;for(A=0;A0){G=u;break}}u=u[k]}l[s]=G}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,j=true;[0,0].sort(function(){j=false;return 0});var n=function(k,m,g,l){g=g||[];var q=m=m||document;if(m.nodeType!==1&&m.nodeType!==9)return[]; if(!k||typeof k!=="string")return g;for(var o=[],s,x,u,G,K=true,M=C(m),N=k;(d.exec(""),s=d.exec(N))!==null;){N=s[3];o.push(s[1]);if(s[2]){G=s[3];break}}if(o.length>1&&w.exec(k))if(o.length===2&&p.relative[o[0]])x=D(o[0]+o[1],m);else for(x=p.relative[o[0]]?[m]:n(o.shift(),m);o.length;){k=o.shift();if(p.relative[k])k+=o.shift();x=D(k,x)}else{if(!l&&o.length>1&&m.nodeType===9&&!M&&p.match.ID.test(o[0])&&!p.match.ID.test(o[o.length-1])){s=n.find(o.shift(),m,M);m=s.expr?n.filter(s.expr,s.set)[0]:s.set[0]}if(m){s= l?{expr:o.pop(),set:A(l)}:n.find(o.pop(),o.length===1&&(o[0]==="~"||o[0]==="+")&&m.parentNode?m.parentNode:m,M);x=s.expr?n.filter(s.expr,s.set):s.set;if(o.length>0)u=A(x);else K=false;for(;o.length;){var r=o.pop();s=r;if(p.relative[r])s=o.pop();else r="";if(s==null)s=m;p.relative[r](u,s,M)}}else u=[]}u||(u=x);if(!u)throw"Syntax error, unrecognized expression: "+(r||k);if(f.call(u)==="[object Array]")if(K)if(m&&m.nodeType===1)for(k=0;u[k]!=null;k++){if(u[k]&&(u[k]===true||u[k].nodeType===1&&J(m,u[k])))g.push(x[k])}else for(k= 0;u[k]!=null;k++)u[k]&&u[k].nodeType===1&&g.push(x[k]);else g.push.apply(g,u);else A(u,g);if(G){n(G,q,g,l);n.uniqueSort(g)}return g};n.uniqueSort=function(k){if(I){h=j;k.sort(I);if(h)for(var m=1;m":function(k,m,g){var l=typeof m==="string";if(l&&!/\W/.test(m)){m=g?m:m.toUpperCase();g=0;for(var q=k.length;g=0))g||l.push(s);else if(g)m[o]=false;return false},ID:function(k){return k[1].replace(/\\/g,"")},TAG:function(k,m){for(var g=0;m[g]===false;g++);return m[g]&&C(m[g])?k[1]:k[1].toUpperCase()},CHILD:function(k){if(k[1]=="nth"){var m=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(k[2]=="even"&&"2n"||k[2]=="odd"&&"2n+1"||!/\D/.test(k[2])&&"0n+"+k[2]||k[2]);k[2]=m[1]+(m[2]|| 1)-0;k[3]=m[3]-0}k[0]=e++;return k},ATTR:function(k,m,g,l,q,o){m=k[1].replace(/\\/g,"");if(!o&&p.attrMap[m])k[1]=p.attrMap[m];if(k[2]==="~=")k[4]=" "+k[4]+" ";return k},PSEUDO:function(k,m,g,l,q){if(k[1]==="not")if((d.exec(k[3])||"").length>1||/^\w/.test(k[3]))k[3]=n(k[3],null,null,m);else{k=n.filter(k[3],m,g,true^q);g||l.push.apply(l,k);return false}else if(p.match.POS.test(k[0])||p.match.CHILD.test(k[0]))return true;return k},POS:function(k){k.unshift(true);return k}},filters:{enabled:function(k){return k.disabled=== false&&k.type!=="hidden"},disabled:function(k){return k.disabled===true},checked:function(k){return k.checked===true},selected:function(k){return k.selected===true},parent:function(k){return!!k.firstChild},empty:function(k){return!k.firstChild},has:function(k,m,g){return!!n(g[3],k).length},header:function(k){return/h\d/i.test(k.nodeName)},text:function(k){return"text"===k.type},radio:function(k){return"radio"===k.type},checkbox:function(k){return"checkbox"===k.type},file:function(k){return"file"=== k.type},password:function(k){return"password"===k.type},submit:function(k){return"submit"===k.type},image:function(k){return"image"===k.type},reset:function(k){return"reset"===k.type},button:function(k){return"button"===k.type||k.nodeName.toUpperCase()==="BUTTON"},input:function(k){return/input|select|textarea|button/i.test(k.nodeName)}},setFilters:{first:function(k,m){return m===0},last:function(k,m,g,l){return m===l.length-1},even:function(k,m){return m%2===0},odd:function(k,m){return m%2===1}, lt:function(k,m,g){return mg[3]-0},nth:function(k,m,g){return g[3]-0==m},eq:function(k,m,g){return g[3]-0==m}},filter:{PSEUDO:function(k,m,g,l){var q=m[1],o=p.filters[q];if(o)return o(k,g,m,l);else if(q==="contains")return(k.textContent||k.innerText||"").indexOf(m[3])>=0;else if(q==="not"){m=m[3];g=0;for(l=m.length;g=0}},ID:function(k,m){return k.nodeType===1&&k.getAttribute("id")===m},TAG:function(k,m){return m==="*"&&k.nodeType===1||k.nodeName=== m},CLASS:function(k,m){return(" "+(k.className||k.getAttribute("class"))+" ").indexOf(m)>-1},ATTR:function(k,m){var g=m[1];k=p.attrHandle[g]?p.attrHandle[g](k):k[g]!=null?k[g]:k.getAttribute(g);g=k+"";var l=m[2];m=m[4];return k==null?l==="!=":l==="="?g===m:l==="*="?g.indexOf(m)>=0:l==="~="?(" "+g+" ").indexOf(m)>=0:!m?g&&k!==false:l==="!="?g!=m:l==="^="?g.indexOf(m)===0:l==="$="?g.substr(g.length-m.length)===m:l==="|="?g===m||g.substr(0,m.length+1)===m+"-":false},POS:function(k,m,g,l){var q=p.setFilters[m[2]]; if(q)return q(k,g,m,l)}}},w=p.match.POS;for(var y in p.match){p.match[y]=new RegExp(p.match[y].source+/(?![^\[]*\])(?![^\(]*\))/.source);p.leftMatch[y]=new RegExp(/(^(?:.|\r|\n)*?)/.source+p.match[y].source)}var A=function(k,m){k=Array.prototype.slice.call(k,0);if(m){m.push.apply(m,k);return m}return k};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(E){A=function(k,m){m=m||[];if(f.call(k)==="[object Array]")Array.prototype.push.apply(m,k);else if(typeof k.length==="number")for(var g= 0,l=k.length;g";var g=document.documentElement;g.insertBefore(k,g.firstChild);if(document.getElementById(m)){p.find.ID=function(l, q,o){if(typeof q.getElementById!=="undefined"&&!o)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:undefined:[]};p.filter.ID=function(l,q){var o=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id");return l.nodeType===1&&o&&o.nodeValue===q}}g.removeChild(k);g=k=null})();(function(){var k=document.createElement("div");k.appendChild(document.createComment(""));if(k.getElementsByTagName("*").length>0)p.find.TAG= function(m,g){g=g.getElementsByTagName(m[1]);if(m[1]==="*"){m=[];for(var l=0;g[l];l++)g[l].nodeType===1&&m.push(g[l]);g=m}return g};k.innerHTML="";if(k.firstChild&&typeof k.firstChild.getAttribute!=="undefined"&&k.firstChild.getAttribute("href")!=="#")p.attrHandle.href=function(m){return m.getAttribute("href",2)};k=null})();document.querySelectorAll&&function(){var k=n,m=document.createElement("div");m.innerHTML="

";if(!(m.querySelectorAll&&m.querySelectorAll(".TEST").length=== 0)){n=function(l,q,o,s){q=q||document;if(!s&&q.nodeType===9&&!C(q))try{return A(q.querySelectorAll(l),o)}catch(x){}return k(l,q,o,s)};for(var g in k)n[g]=k[g];m=null}}();document.getElementsByClassName&&document.documentElement.getElementsByClassName&&function(){var k=document.createElement("div");k.innerHTML="
";if(k.getElementsByClassName("e").length!==0){k.lastChild.className="e";if(k.getElementsByClassName("e").length!==1){p.order.splice(1,0,"CLASS"); p.find.CLASS=function(m,g,l){if(typeof g.getElementsByClassName!=="undefined"&&!l)return g.getElementsByClassName(m[1])};k=null}}}();var J=document.compareDocumentPosition?function(k,m){return k.compareDocumentPosition(m)&16}:function(k,m){return k!==m&&(k.contains?k.contains(m):true)},C=function(k){return k.nodeType===9&&k.documentElement.nodeName!=="HTML"||!!k.ownerDocument&&k.ownerDocument.documentElement.nodeName!=="HTML"},D=function(k,m){var g=[],l="",q;for(m=m.nodeType?[m]:m;q=p.match.PSEUDO.exec(k);){l+= q[0];k=k.replace(p.match.PSEUDO,"")}k=p.relative[k]?k+"*":k;q=0;for(var o=m.length;q=0}).sortBy(function(d){return d.tabIndex}).first();return c?c:b.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})}, focusFirstElement:function(b){b=$(b);var c=b.findFirstElement();c&&c.activate();return b},request:function(b,c){b=$(b);c=Object.clone(c||{});var d=c.parameters,e=b.readAttribute("action")||"";if(e.blank())e=window.location.href;c.parameters=b.serialize(true);if(d){if(Object.isString(d))d=d.toQueryParams();Object.extend(c.parameters,d)}if(b.hasAttribute("method")&&!c.method)c.method=b.method;return new Ajax.Request(e,c)}}; Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}}; Form.Element.Methods={serialize:function(b){b=$(b);if(!b.disabled&&b.name){var c=b.getValue();if(c!=undefined){var d={};d[b.name]=c;return Object.toQueryString(d)}}return""},getValue:function(b){b=$(b);var c=b.tagName.toLowerCase();return Form.Element.Serializers[c](b)},setValue:function(b,c){b=$(b);var d=b.tagName.toLowerCase();Form.Element.Serializers[d](b,c);return b},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);try{b.focus(); if(b.select&&(b.tagName.toLowerCase()!="input"||!/^(?:button|reset|submit)$/i.test(b.type)))b.select()}catch(c){}return b},disable:function(b){b=$(b);b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element,$F=Form.Element.Methods.getValue; Form.Element.Serializers=function(){function b(n,p){switch(n.type.toLowerCase()){case "checkbox":case "radio":return c(n,p);default:return d(n,p)}}function c(n,p){if(Object.isUndefined(p))return n.checked?n.value:null;else n.checked=!!p}function d(n,p){if(Object.isUndefined(p))return n.value;else n.value=p}function e(n,p){if(Object.isUndefined(p))return(n.type==="select-one"?f:h)(n);for(var w,y,A=!Object.isArray(p),E=0,I=n.length;E=0?j(n.options[p]):null}function h(n){var p,w=n.length;if(!w)return null;var y=0;for(p=[];y=this.offset[1]&&d=this.offset[0]&&c=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(b)},set:function(b){this.element.className=b},add:function(b){this.include(b)||this.set($A(this).concat(b).join(" "))},remove:function(b){this.include(b)&&this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable); (function(){window.Selector=Class.create({initialize:function(b){this.expression=b.strip()},findElements:function(b){return Prototype.Selector.select(this.expression,b)},match:function(b){return Prototype.Selector.match(b,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(b,c){for(var d=Prototype.Selector.match,e=[],f=0,h=b.length;f<\/script>')}catch(c){var d=document.createElement("script");d.type="text/javascript";d.src=b;document.getElementsByTagName("head")[0].appendChild(d)}},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function b(d){var e=d.replace(/_.*|\./g,"");e=parseInt(e+"0".times(4-e.length));return d.indexOf("_")>-1?e-1:e}if(typeof Prototype=="undefined"||typeof Element=="undefined"||typeof Element.Methods== "undefined"||b(Prototype.Version)= "+Scriptaculous.REQUIRED_PROTOTYPE;var c=/scriptaculous\.js(\?.*)?$/;$$("head script[src]").findAll(function(d){return d.src.match(c)}).each(function(d){var e=d.src.replace(c,"");d=d.src.match(/\?.*load=([a-z,]*)/);(d?d[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(f){Scriptaculous.require(e+f+".js")})})}};Scriptaculous.load(); var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(b,c,d){b=b.toUpperCase();var e=document.createElement(this.NODEMAP[b]||"div");try{e.innerHTML="<"+b+">"}catch(f){}var h=e.firstChild||null;if(h&&h.tagName.toUpperCase()!=b)h=h.getElementsByTagName(b)[0];h||(h=document.createElement(b));if(h){if(c)if(this._isStringOrNumber(c)|| c instanceof Array||c.tagName)this._children(h,c);else{var j=this._attributes(c);if(j.length){try{e.innerHTML="<"+b+" "+j+">"}catch(n){}h=e.firstChild||null;if(!h){h=document.createElement(b);for(attr in c)h[attr=="class"?"className":attr]=c[attr]}if(h.tagName.toUpperCase()!=b)h=e.getElementsByTagName(b)[0]}}d&&this._children(h,d);return $(h)}},_text:function(b){return document.createTextNode(b)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(b){var c=[];for(attribute in b)c.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+b[attribute].toString().escapeHTML().gsub(/"/,""")+'"');return c.join(" ")},_children:function(b,c){if(c.tagName)b.appendChild(c);else if(typeof c=="object")c.flatten().each(function(d){if(typeof d=="object")b.appendChild(d);else Builder._isStringOrNumber(d)&&b.appendChild(Builder._text(d))});else Builder._isStringOrNumber(c)&&b.appendChild(Builder._text(c))},_isStringOrNumber:function(b){return typeof b=="string"||typeof b=="number"},build:function(b){var c= this.node("div");$(c).update(b.strip());return c.down()},dump:function(b){if(typeof b!="object"&&typeof b!="function")b=window;"A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR".split(/\s+/).each(function(c){b[c]= function(){return Builder.node.apply(Builder,[c].concat($A(arguments)))}})}};String.prototype.parseColor=function(b){var c="#";if(this.slice(0,4)=="rgb("){var d=this.slice(4,this.length-1).split(","),e=0;do c+=parseInt(d[e]).toColorPart();while(++e<3)}else if(this.slice(0,1)=="#"){if(this.length==4)for(e=1;e<4;e++)c+=(this.charAt(e)+this.charAt(e)).toLowerCase();if(this.length==7)c=this.toLowerCase()}return c.length==7?c:b||this}; Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(c){return c.nodeType==3?c.nodeValue:c.hasChildNodes()?Element.collectTextNodes(c):""}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,c){return $A($(b).childNodes).collect(function(d){return d.nodeType==3?d.nodeValue:d.hasChildNodes()&&!Element.hasClassName(d,c)?Element.collectTextNodesIgnoreClass(d,c):""}).flatten().join("")}; Element.setContentZoom=function(b,c){b=$(b);b.setStyle({fontSize:c/100+"em"});Prototype.Browser.WebKit&&window.scrollBy(0,0);return b};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var c=document.createTextNode(" ");b.appendChild(c);b.removeChild(c)}catch(d){}}; var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(b){return-Math.cos(b*Math.PI)/2+0.5},reverse:function(b){return 1-b},flicker:function(b){b=-Math.cos(b*Math.PI)/4+0.75+Math.random()/4;return b>1?1:b},wobble:function(b){return-Math.cos(b*Math.PI*9*b)/2+0.5},pulse:function(b,c){return-Math.cos(b*((c||5)-0.5)*2*Math.PI)/2+0.5},spring:function(b){return 1- Math.cos(b*4.5*Math.PI)*Math.exp(-b*6)},none:function(){return 0},full:function(){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var c="position:relative";if(Prototype.Browser.IE)c+=";zoom:1";b=$(b);$A(b.childNodes).each(function(d){if(d.nodeType==3){d.nodeValue.toArray().each(function(e){b.insertBefore((new Element("span",{style:c})).update(e==" "?String.fromCharCode(160):e),d)});Element.remove(d)}})},multiple:function(b,c,d){b= (typeof b=="object"||Object.isFunction(b))&&b.length?b:$(b).childNodes;var e=Object.extend({speed:0.1,delay:0},d||{}),f=e.delay;$A(b).each(function(h,j){new c(h,Object.extend(e,{delay:j*e.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c,d){b=$(b);c=(c||"appear").toLowerCase();return Effect[Effect.PAIRS[c][b.visible()?1:0]](b,Object.extend({queue:{position:"end",scope:b.id||"global",limit:1}},d||{}))}}; Effect.DefaultOptions.transition=Effect.Transitions.sinoidal; Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(b){var c=(new Date).getTime();switch(Object.isString(b.options.queue)?b.options.queue:b.options.queue.position){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=this.startOn)if(b>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");this.finish&&this.finish();this.event("afterFinish")}else{b=(b-this.startOn)/this.totalTime;var c=(b*this.totalFrames).round();if(c>this.currentFrame){this.render(b);this.currentFrame=c}}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);this.state="finished"}, event:function(b){this.options[b+"Internal"]&&this.options[b+"Internal"](this);this.options[b]&&this.options[b](this)},inspect:function(){var b=$H();for(property in this)Object.isFunction(this[property])||b.set(property,this[property]);return"#"}}); Effect.Parallel=Class.create(Effect.Base,{initialize:function(b,c){this.effects=b||[];this.start(c)},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(c){c.render(1);c.cancel();c.event("beforeFinish");c.finish&&c.finish(b);c.event("afterFinish")})}}); Effect.Tween=Class.create(Effect.Base,{initialize:function(b,c,d){b=Object.isString(b)?$(b):b;var e=$A(arguments),f=e.last();e=e.length==5?e[3]:null;this.method=Object.isFunction(f)?f.bind(b):Object.isFunction(b[f])?b[f].bind(b):function(h){b[f]=h};this.start(Object.extend({from:c,to:d},e||{}))},update:function(b){this.method(b)}});Effect.Event=Class.create(Effect.Base,{initialize:function(b){this.start(Object.extend({duration:0},b||{}))},update:Prototype.emptyFunction}); Effect.Opacity=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});this.start(Object.extend({from:this.element.getOpacity()||0,to:1},c||{}))},update:function(b){this.element.setOpacity(b)}}); Effect.Move=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({x:0,y:0,mode:"relative"},c||{}))},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x-=this.originalLeft;this.options.y-=this.originalTop}},update:function(b){this.element.setStyle({left:(this.options.x* b+this.originalLeft).round()+"px",top:(this.options.y*b+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,c,d,e){return new Effect.Move(b,Object.extend({x:d,y:c},e||{}))}; Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c,d){this.element=$(b);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},d||{}))},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(c){this.originalStyle[c]= this.element.style[c]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(c){if(b.indexOf(c)>0){this.fontSize=parseFloat(b);this.fontSizeType=c}}.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(b){b=this.options.scaleFrom/100+this.factor*b;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(){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(b,c){var d={}; if(this.options.scaleX)d.width=c.round()+"px";if(this.options.scaleY)d.height=b.round()+"px";if(this.options.scaleFromCenter){b=(b-this.dims[0])/2;c=(c-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY)d.top=this.originalTop-b+"px";if(this.options.scaleX)d.left=this.originalLeft-c+"px"}else{if(this.options.scaleY)d.top=-b+"px";if(this.options.scaleX)d.left=-c+"px"}}this.element.setStyle(d)}}); Effect.Highlight=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({startcolor:"#ffff99"},c||{}))},setup:function(){if(this.element.getStyle("display")=="none")this.cancel();else{this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor)this.options.endcolor= this.element.getStyle("background-color").parseColor("#ffffff");if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle("background-color");this._base=$R(0,2).map(function(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))}},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(c,d,e){return c+ (this._base[e]+this._delta[e]*b).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(b,c){c=c||{};var d=document.viewport.getScrollOffsets();b=$(b).cumulativeOffset();if(c.offset)b[1]+=c.offset;return new Effect.Tween(null,d.top,b[1],c,function(e){scrollTo(d.left,e.round())})}; Effect.Fade=function(b,c){b=$(b);var d=b.getInlineOpacity();c=Object.extend({from:b.getOpacity()||1,to:0,afterFinishInternal:function(e){e.options.to==0&&e.element.hide().setStyle({opacity:d})}},c||{});return new Effect.Opacity(b,c)}; Effect.Appear=function(b,c){b=$(b);c=Object.extend({from:b.getStyle("display")=="none"?0:b.getOpacity()||0,to:1,afterFinishInternal:function(d){d.element.forceRerendering()},beforeSetup:function(d){d.element.setOpacity(d.options.from).show()}},c||{});return new Effect.Opacity(b,c)}; Effect.Puff=function(b,c){b=$(b);var d={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(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(d)}}, c||{}))};Effect.BlindUp=function(b,c){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){d.element.hide().undoClipping()}},c||{}))}; Effect.BlindDown=function(b,c){b=$(b);var d=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},c||{}))}; Effect.SwitchOff=function(b,c){b=$(b);var d=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:d})}})}},c||{}))}; Effect.DropOut=function(b,c){b=$(b);var d={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(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(d)}},c||{}))}; Effect.Shake=function(b,c){b=$(b);c=Object.extend({distance:20,duration:0.5},c||{});var d=parseFloat(c.distance),e=parseFloat(c.duration)/10,f={top:b.getStyle("top"),left:b.getStyle("left")};return new Effect.Move(b,{x:d,y:0,duration:e,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-d*2,y:0,duration:e*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:d*2,y:0,duration:e*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:-d*2,y:0,duration:e*2,afterFinishInternal:function(p){new Effect.Move(p.element, {x:d*2,y:0,duration:e*2,afterFinishInternal:function(w){new Effect.Move(w.element,{x:-d,y:0,duration:e,afterFinishInternal:function(y){y.element.undoPositioned().setStyle(f)}})}})}})}})}})}})}; Effect.SlideDown=function(b,c){b=$(b).cleanWhitespace();var d=b.down().getStyle("bottom"),e=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:e.height,originalWidth:e.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();window.opera&&f.element.setStyle({top:""});f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:f.dims[0]- f.element.clientHeight+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:d})}},c||{}))}; Effect.SlideUp=function(b,c){b=$(b).cleanWhitespace();var d=b.down().getStyle("bottom"),e=b.getDimensions();return new Effect.Scale(b,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:e.height,originalWidth:e.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();window.opera&&f.element.setStyle({top:""});f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:f.dims[0]- f.element.clientHeight+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:d})}},c||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(c){c.element.makeClipping()},afterFinishInternal:function(c){c.element.hide().undoClipping()}})}; Effect.Grow=function(b,c){b=$(b);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},c||{}),e={top:b.style.top,left:b.style.left,height:b.style.height,width:b.style.width,opacity:b.getInlineOpacity()},f=b.getDimensions(),h,j,n,p;switch(d.direction){case "top-left":h=j=n=p=0;break;case "top-right":h=f.width;j=p=0;n=-f.width;break;case "bottom-left":h=n=0;j=f.height;p=-f.height;break; case "bottom-right":h=f.width;j=f.height;n=-f.width;p=-f.height;break;case "center":h=f.width/2;j=f.height/2;n=-f.width/2;p=-f.height/2;break}return new Effect.Move(b,{x:h,y:j,duration:0.01,beforeSetup:function(w){w.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(w){new Effect.Parallel([new Effect.Opacity(w.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(w.element,{x:n,y:p,sync:true,transition:d.moveTransition}),new Effect.Scale(w.element, 100,{scaleMode:{originalHeight:f.height,originalWidth:f.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(y){y.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(y){y.effects[0].element.undoClipping().undoPositioned().setStyle(e)}},d))}})}; Effect.Shrink=function(b,c){b=$(b);c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},c||{});var d={top:b.style.top,left:b.style.left,height:b.style.height,width:b.style.width,opacity:b.getInlineOpacity()},e=b.getDimensions(),f,h;switch(c.direction){case "top-left":f=h=0;break;case "top-right":f=e.width;h=0;break;case "bottom-left":f=0;h=e.height;break;case "bottom-right":f=e.width;h= e.height;break;case "center":f=e.width/2;h=e.height/2;break}return new Effect.Parallel([new Effect.Opacity(b,{sync:true,to:0,from:1,transition:c.opacityTransition}),new Effect.Scale(b,window.opera?1:0,{sync:true,transition:c.scaleTransition,restoreAfterFinish:true}),new Effect.Move(b,{x:f,y:h,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(j){j.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(j){j.effects[0].element.hide().undoClipping().undoPositioned().setStyle(d)}}, c))};Effect.Pulsate=function(b,c){b=$(b);var d=c||{},e=b.getInlineOpacity(),f=d.transition||Effect.Transitions.linear;return new Effect.Opacity(b,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:e})}},d),{transition:function(h){return 1-f(-Math.cos(h*(d.pulses||5)*2*Math.PI)/2+0.5)}}))}; Effect.Fold=function(b,c){b=$(b);var d={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(){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(e){e.element.hide().undoClipping().setStyle(d)}})}},c||{}))}; Effect.Morph=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element)throw Effect._elementDoesNotExistError;b=Object.extend({style:{}},c||{});if(Object.isString(b.style))if(b.style.include(":"))this.style=b.style.parseStyle();else{this.element.addClassName(b.style);this.style=$H(this.element.getStyles());this.element.removeClassName(b.style);var d=this.element.getStyles();this.style=this.style.reject(function(e){return e.value==d[e.key]});b.afterFinishInternal=function(e){e.element.addClassName(e.options.style); e.transforms.each(function(f){e.element.style[f.style]=""})}}else this.style=$H(b.style);this.start(b)},setup:function(){function b(c){if(!c||["rgba(0, 0, 0, 0)","transparent"].include(c))c="#ffffff";c=c.parseColor();return $R(0,2).map(function(d){return parseInt(c.slice(d*2+1,d*2+3),16)})}this.transforms=this.style.map(function(c){var d=c[0];c=c[1];var e=null;if(c.parseColor("#zzzzzz")!="#zzzzzz"){c=c.parseColor();e="color"}else if(d=="opacity"){c=parseFloat(c);Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&& this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(c)){e=c.match(/^([\+\-]?[0-9\.]+)(.*)$/);c=parseFloat(e[1]);e=e.length==3?e[2]:null}var f=this.element.getStyle(d);return{style:d.camelize(),originalValue:e=="color"?b(f):parseFloat(f||0),targetValue:e=="color"?b(c):c,unit:e}}.bind(this)).reject(function(c){return c.originalValue==c.targetValue||c.unit!="color"&&(isNaN(c.originalValue)||isNaN(c.targetValue))})},update:function(b){for(var c={},d,e=this.transforms.length;e--;)c[(d=this.transforms[e]).style]= d.unit=="color"?"#"+Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*b).toColorPart()+Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*b).toColorPart()+Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*b).toColorPart():(d.originalValue+(d.targetValue-d.originalValue)*b).toFixed(3)+(d.unit===null?"":d.unit);this.element.setStyle(c,true)}}); Effect.Transform=Class.create({initialize:function(b,c){this.tracks=[];this.options=c||{};this.addTracks(b)},addTracks:function(b){b.each(function(c){c=$H(c);var d=c.values().first();this.tracks.push($H({ids:c.keys().first(),effect:Effect.Morph,options:{style:d}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var c=b.get("ids"),d=b.get("effect"),e=b.get("options");return[$(c)||$$(c)].flatten().map(function(f){return new d(f,Object.extend({sync:true}, e))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex"); Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div"); String.prototype.parseStyle=function(){var b,c=$H();if(Prototype.Browser.WebKit)b=(new Element("div",{style:this})).style;else{String.__parseStyleElement.innerHTML='
';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(d){b[d]&&c.set(d,b[d])});Prototype.Browser.IE&&this.include("opacity")&&c.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return c}; Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(b){var c=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=c[e];return d})}:function(b){b=$(b);var c=b.currentStyle,d;d=Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=c[f];return e});if(!d.opacity)d.opacity=b.getOpacity();return d}; Effect.Methods={morph:function(b,c,d){b=$(b);new Effect.Morph(b,Object.extend({style:c},d||{}));return b},visualEffect:function(b,c,d){b=$(b);c=c.dasherize().camelize();c=c.charAt(0).toUpperCase()+c.substring(1);new Effect[c](b,d);return b},highlight:function(b,c){b=$(b);new Effect.Highlight(b,c);return b}}; $w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(b){Effect.Methods[b]=function(c,d){c=$(c);Effect[b.charAt(0).toUpperCase()+b.substring(1)](c,d);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(b){Effect.Methods[b]=Element[b]});Element.addMethods(Effect.Methods); if(Object.isUndefined(Effect))throw"dragdrop.js requires including script.aculo.us' effects.js library"; var Droppables={drops:[],remove:function(b){this.drops=this.drops.reject(function(c){return c.element==$(b)})},add:function(b,c){b=$(b);var d=Object.extend({greedy:true,hoverclass:null,tree:false},c||{});if(d.containment){d._containers=[];c=d.containment;Object.isArray(c)?c.each(function(e){d._containers.push($(e))}):d._containers.push($(c))}if(d.accept)d.accept=[d.accept].flatten();Element.makePositioned(b);d.element=b;this.drops.push(d)},findDeepestChild:function(b){deepest=b[0];for(i=1;i0)d=Droppables.findDeepestChild(e);this.last_active&&this.last_active!=d&&this.deactivate(this.last_active);if(d){Position.within(d.element,b[0],b[1]);d.onHover&&d.onHover(c,d.element,Position.overlap(d.overlap,d.element));d!=this.last_active&&Droppables.activate(d)}}},fire:function(b,c){if(this.last_active){Position.prepare(); if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],c,this.last_active))if(this.last_active.onDrop){this.last_active.onDrop(c,this.last_active.element,b);return true}}},reset:function(){this.last_active&&this.deactivate(this.last_active)}},Draggables={drags:[],observers:[],register:function(b){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this); Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(b)},unregister:function(b){this.drags=this.drags.reject(function(c){return c==b});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(b){if(b.options.delay)this._timeout= setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=b}.bind(this),b.options.delay);else{window.focus();this.activeDraggable=b}},deactivate:function(){this.activeDraggable=null},updateDrag:function(b){if(this.activeDraggable){var c=[Event.pointerX(b),Event.pointerY(b)];if(!(this._lastPointer&&this._lastPointer.inspect()==c.inspect())){this._lastPointer=c;this.activeDraggable.updateDrag(b,c)}}},endDrag:function(b){if(this._timeout){clearTimeout(this._timeout);this._timeout= null}if(this.activeDraggable){this._lastPointer=null;this.activeDraggable.endDrag(b);this.activeDraggable=null}},keyPress:function(b){this.activeDraggable&&this.activeDraggable.keyPress(b)},addObserver:function(b){this.observers.push(b);this._cacheObserverCallbacks()},removeObserver:function(b){this.observers=this.observers.reject(function(c){return c.element==b});this._cacheObserverCallbacks()},notify:function(b,c,d){this[b+"Count"]>0&&this.observers.each(function(e){e[b]&&e[b](b,c,d)});c.options[b]&& c.options[b](c,d)},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(b){Draggables[b+"Count"]=Draggables.observers.select(function(c){return c[b]}).length})}},Draggable=Class.create({initialize:function(b,c){var d={handle:false,reverteffect:function(e,f,h){var j=Math.sqrt(Math.abs(f^2)+Math.abs(h^2))*0.02;new Effect.Move(e,{x:-h,y:-f,duration:j,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var f=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e, {duration:0.2,from:0.7,to:f,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=false}})},zindex:1E3,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!c||Object.isUndefined(c.endeffect))Object.extend(d,{starteffect:function(e){e._opacity=Element.getOpacity(e);Draggable._dragging[e]=true;new Effect.Opacity(e,{duration:0.2,from:e._opacity,to:0.7})}});c=Object.extend(d,c||{});this.element=$(b);if(c.handle&&Object.isString(c.handle))this.handle= this.element.down("."+c.handle,0);if(!this.handle)this.handle=$(c.handle);if(!this.handle)this.handle=this.element;if(c.scroll&&!c.scroll.scrollTo&&!c.scroll.outerHTML){c.scroll=$(c.scroll);this._isScrollChild=Element.childOf(this.element,c.scroll)}Element.makePositioned(this.element);this.options=c;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle, "mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return[parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]},initDrag:function(b){if(!(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]))if(Event.isLeftClick(b))if(!((tag_name=Event.element(b).tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA"))){var c= [Event.pointerX(b),Event.pointerY(b)],d=this.element.cumulativeOffset();this.offset=[0,1].map(function(e){return c[e]-d[e]});Draggables.activate(this);Event.stop(b)}},startDrag:function(b){this.dragging=true;if(!this.delta)this.delta=this.currentDelta();if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);(this._originallyAbsolute=this.element.getStyle("position")== "absolute")||Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll)if(this.options.scroll==window){var c=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=c.left;this.originalScrollTop=c.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}Draggables.notify("onStart",this,b);this.options.starteffect&&this.options.starteffect(this.element)},updateDrag:function(b, c){this.dragging||this.startDrag(b);if(!this.options.quiet){Position.prepare();Droppables.show(c,this.element)}Draggables.notify("onDrag",this,b);this.draw(c);this.options.change&&this.options.change(this);if(this.options.scroll){this.stopScrolling();var d;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll))d=[left,top,left+width,top+height];else{d=Position.page(this.options.scroll);d[0]+=this.options.scroll.scrollLeft+Position.deltaX;d[1]+=this.options.scroll.scrollTop+ Position.deltaY;d.push(d[0]+this.options.scroll.offsetWidth);d.push(d[1]+this.options.scroll.offsetHeight)}var e=[0,0];if(c[0]d[2]-this.options.scrollSensitivity)e[0]=c[0]-(d[2]-this.options.scrollSensitivity);if(c[1]>d[3]-this.options.scrollSensitivity)e[1]=c[1]-(d[3]-this.options.scrollSensitivity);this.startScrolling(e)}Prototype.Browser.WebKit&& window.scrollBy(0,0);Event.stop(b)},finishDrag:function(b,c){this.dragging=false;if(this.options.quiet){Position.prepare();var d=[Event.pointerX(b),Event.pointerY(b)];Droppables.show(d,this.element)}if(this.options.ghosting){this._originallyAbsolute||Position.relativize(this.element);delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}d=false;if(c)(d=Droppables.fire(b,this.element))||(d=false);d&&this.options.onDropped&&this.options.onDropped(this.element);Draggables.notify("onEnd", this,b);if((b=this.options.revert)&&Object.isFunction(b))b=b(this.element);c=this.currentDelta();if(b&&this.options.reverteffect){if(d==0||b!="failure")this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])}else this.delta=c;if(this.options.zindex)this.element.style.zIndex=this.originalZ;this.options.endeffect&&this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset()},keyPress:function(b){if(b.keyCode==Event.KEY_ESC){this.finishDrag(b,false);Event.stop(b)}}, endDrag:function(b){if(this.dragging){this.stopScrolling();this.finishDrag(b,true);Event.stop(b)}},draw:function(b){var c=this.element.cumulativeOffset();if(this.options.ghosting){var d=Position.realOffset(this.element);c[0]+=d[0]-Position.deltaX;c[1]+=d[1]-Position.deltaY}d=this.currentDelta();c[0]-=d[0];c[1]-=d[1];if(this.options.scroll&&this.options.scroll!=window&&this._isScrollChild){c[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;c[1]-=this.options.scroll.scrollTop-this.originalScrollTop}d= [0,1].map(function(f){return b[f]-c[f]-this.offset[f]}.bind(this));if(this.options.snap)d=Object.isFunction(this.options.snap)?this.options.snap(d[0],d[1],this):Object.isArray(this.options.snap)?d.map(function(f,h){return(f/this.options.snap[h]).round()*this.options.snap[h]}.bind(this)):d.map(function(f){return(f/this.options.snap).round()*this.options.snap}.bind(this));var e=this.element.style;if(!this.options.constraint||this.options.constraint=="horizontal")e.left=d[0]+"px";if(!this.options.constraint|| this.options.constraint=="vertical")e.top=d[1]+"px";if(e.visibility=="hidden")e.visibility=""},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(b){if(b[0]||b[1]){this.scrollSpeed=[b[0]*this.options.scrollSpeed,b[1]*this.options.scrollSpeed];this.lastScrolled=new Date;this.scrollInterval=setInterval(this.scroll.bind(this),10)}},scroll:function(){var b=new Date,c=b-this.lastScrolled; this.lastScrolled=b;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){b=c/1E3;this.options.scroll.scrollTo(left+b*this.scrollSpeed[0],top+b*this.scrollSpeed[1])}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*c/1E3;this.options.scroll.scrollTop+=this.scrollSpeed[1]*c/1E3}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer= Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*c/1E3;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*c/1E3;if(Draggables._lastScrollPointer[0]<0)Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer)}this.options.change&&this.options.change(this)},_getWindowScroll:function(b){var c,d,e;with(b.document){if(b.document.documentElement&& documentElement.scrollTop){c=documentElement.scrollTop;d=documentElement.scrollLeft}else if(b.document.body){c=body.scrollTop;d=body.scrollLeft}if(b.innerWidth){e=b.innerWidth;b=b.innerHeight}else if(b.document.documentElement&&documentElement.clientWidth){e=documentElement.clientWidth;b=documentElement.clientHeight}else{e=body.offsetWidth;b=body.offsetHeight}}return{top:c,left:d,width:e,height:b}}});Draggable._dragging={}; var SortableObserver=Class.create({initialize:function(b,c){this.element=$(b);this.observer=c;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();this.lastValue!=Sortable.serialize(this.element)&&this.observer(this.element)}}),Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(b){for(;b.tagName.toUpperCase()!="BODY";){if(b.id&&Sortable.sortables[b.id])return b; b=b.parentNode}},options:function(b){if(b=Sortable._findRootElement($(b)))return Sortable.sortables[b.id]},destroy:function(b){b=$(b);if(b=Sortable.sortables[b.id]){Draggables.removeObserver(b.element);b.droppables.each(function(c){Droppables.remove(c)});b.draggables.invoke("destroy");delete Sortable.sortables[b.element.id]}},create:function(b,c){b=$(b);var d=Object.extend({element:b,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:b,handle:false, only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},c||{});this.destroy(b);var e={revert:true,quiet:d.quiet,scroll:d.scroll,scrollSpeed:d.scrollSpeed,scrollSensitivity:d.scrollSensitivity,delay:d.delay,ghosting:d.ghosting,constraint:d.constraint,handle:d.handle};if(d.starteffect)e.starteffect=d.starteffect;if(d.reverteffect)e.reverteffect= d.reverteffect;else if(d.ghosting)e.reverteffect=function(j){j.style.top=0;j.style.left=0};if(d.endeffect)e.endeffect=d.endeffect;if(d.zindex)e.zindex=d.zindex;var f={overlap:d.overlap,containment:d.containment,tree:d.tree,hoverclass:d.hoverclass,onHover:Sortable.onHover},h={onHover:Sortable.onEmptyHover,overlap:d.overlap,containment:d.containment,hoverclass:d.hoverclass};Element.cleanWhitespace(b);d.draggables=[];d.droppables=[];if(d.dropOnEmpty||d.tree){Droppables.add(b,h);d.droppables.push(b)}(d.elements|| this.findElements(b,d)||[]).each(function(j,n){n=d.handles?$(d.handles[n]):d.handle?$(j).select("."+d.handle)[0]:j;d.draggables.push(new Draggable(j,Object.extend(e,{handle:n})));Droppables.add(j,f);if(d.tree)j.treeNode=b;d.droppables.push(j)});if(d.tree)(Sortable.findTreeElements(b,d)||[]).each(function(j){Droppables.add(j,h);j.treeNode=b;d.droppables.push(j)});this.sortables[b.identify()]=d;Draggables.addObserver(new SortableObserver(b,d.onUpdate))},findElements:function(b,c){return Element.findChildren(b, c.only,c.tree?true:false,c.tag)},findTreeElements:function(b,c){return Element.findChildren(b,c.only,c.tree?true:false,c.treeTag)},onHover:function(b,c,d){if(!Element.isParent(c,b))if(!(d>0.33&&d<0.66&&Sortable.options(c).tree))if(d>0.5){Sortable.mark(c,"before");if(c.previousSibling!=b){d=b.parentNode;b.style.visibility="hidden";c.parentNode.insertBefore(b,c);c.parentNode!=d&&Sortable.options(d).onChange(b);Sortable.options(c.parentNode).onChange(b)}}else{Sortable.mark(c,"after");var e=c.nextSibling|| null;if(e!=b){d=b.parentNode;b.style.visibility="hidden";c.parentNode.insertBefore(b,e);c.parentNode!=d&&Sortable.options(d).onChange(b);Sortable.options(c.parentNode).onChange(b)}}},onEmptyHover:function(b,c,d){var e=b.parentNode,f=Sortable.options(c);if(!Element.isParent(c,b)){var h=Sortable.findElements(c,{tag:f.tag,only:f.only}),j=null;if(h){var n=Element.offsetSize(c,f.overlap)*(1-d);for(d=0;d=0)n-=Element.offsetSize(h[d],f.overlap);else{j= n-Element.offsetSize(h[d],f.overlap)/2>=0?d+10?f.flatten():[]};Element.offsetSize=function(b,c){return b["offset"+(c=="vertical"||c=="height"?"Height":"Width")]}; if(typeof Effect=="undefined")throw"controls.js requires including script.aculo.us' effects.js library";var Autocompleter={}; Autocompleter.Base=Class.create({baseInitialize:function(b,c,d){this.element=b=$(b);this.update=$(c);this.active=this.changed=this.hasFocus=false;this.index=-1;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions)this.setOptions(d);else this.options=d||{};this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow= this.options.onShow||function(e,f){if(!f.style.position||f.style.position=="absolute"){f.style.position="absolute";Position.clone(e,f,{setHeight:false,offsetTop:e.offsetHeight})}Effect.Appear(f,{duration:0.15})};this.options.onHide=this.options.onHide||function(e,f){new Effect.Fade(f,{duration:0.15})};if(typeof this.options.tokens=="string")this.options.tokens=new Array(this.options.tokens);this.options.tokens.include("\n")||this.options.tokens.push("\n");this.observer=null;this.element.setAttribute("autocomplete", "off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){Element.getStyle(this.update,"display")=="none"&&this.options.onShow(this.element,this.update);if(!this.iefix&&Prototype.Browser.IE&&Element.getStyle(this.update,"position")=="absolute"){new Insertion.After(this.update,''); this.iefix=$(this.update.id+"_iefix")}this.iefix&&setTimeout(this.fixIEOverlapping.bind(this),50)},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:!this.update.style.height});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();Element.getStyle(this.update,"display")!="none"&&this.options.onHide(this.element,this.update);this.iefix&&Element.hide(this.iefix)},startIndicator:function(){this.options.indicator&&Element.show(this.options.indicator)}, stopIndicator:function(){this.options.indicator&&Element.hide(this.options.indicator)},onKeyPress:function(b){if(this.active)switch(b.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:if(this.index<0){this.hide();this.active=false;return}this.selectEntry(b.keyCode==Event.KEY_RETURN);Event.stop(b);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(b);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(b);return;case Event.KEY_DOWN:this.markNext(); this.render();Event.stop(b);return}else if(b.keyCode==Event.KEY_TAB||b.keyCode==Event.KEY_RETURN||Prototype.Browser.WebKit>0&&b.keyCode==0)return;this.hasFocus=this.changed=true;this.observer&&clearTimeout(this.observer);this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1E3)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(b){var c=Event.findElement(b,"LI");if(this.index!=c.autocompleteIndex){this.index=c.autocompleteIndex; this.render()}Event.stop(b)},onClick:function(b){this.index=Event.findElement(b,"LI").autocompleteIndex;this.selectEntry(true);this.hide()},onBlur:function(){setTimeout(this.hide.bind(this),250);this.active=this.hasFocus=false},render:function(){if(this.entryCount>0){for(var b=0;b0)this.index--;else this.index=this.entryCount-1},markNext:function(){if(this.index=0?this.update.firstChild.childNodes[b]:""},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(b){if(this.options.updateElement)this.options.updateElement(b);else{var c="";if(this.options.select){var d= $(b).select("."+this.options.select)||[];if(d.length>0)c=Element.collectTextNodes(d[0],this.options.select)}else c=Element.collectTextNodesIgnoreClass(b,"informal");d=this.getTokenBounds();if(d[0]!=-1){var e=this.element.value.substr(0,d[0]),f=this.element.value.substr(d[0]).match(/^\s+/);if(f)e+=f[0];this.element.value=e+c+this.element.value.substr(d[1])}else this.element.value=c;this.oldElementValue=this.element.value;this.element.focus();this.options.afterUpdateElement&&this.options.afterUpdateElement(this.element, b)}},updateChoices:function(b){if(!this.changed&&this.hasFocus){this.update.innerHTML=b;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(b=0;b=this.options.minChars)this.getUpdatedChoices();else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var b=this.getTokenBounds();return this.element.value.substring(b[0],b[1]).strip()}, getTokenBounds:function(){if(null!=this.tokenBounds)return this.tokenBounds;var b=this.element.value;if(b.strip().empty())return[-1,0];for(var c=arguments.callee.getFirstDifferencePos(b,this.oldElementValue),d=c==this.oldElementValue.length?1:0,e=-1,f=b.length,h,j=0,n=this.options.tokens.length;je)e=h;h=b.indexOf(this.options.tokens[j],c+d);if(-1!=h&&h"+j.substr(0,f.length)+""+j.substr(f.length)+"");break}else if(f.length>=c.options.partialChars&&c.options.partialSearch&&n!=-1)if(c.options.fullSearch||/\s/.test(j.substr(n-1,1))){e.push("
  • "+j.substr(0,n)+""+j.substr(n,f.length)+""+j.substr(n+f.length)+"
  • ");break}n=c.options.ignoreCase?j.toLowerCase().indexOf(f.toLowerCase(),n+1):j.indexOf(f,n+1)}if(e.length)d= d.concat(e.slice(0,c.options.choices-d.length));return"
      "+d.join("")+"
    "}},b||{})}});Field.scrollFreeActivate=function(b){setTimeout(function(){Field.activate(b)},1)}; Ajax.InPlaceEditor=Class.create({initialize:function(b,c,d){this.url=c;this.element=b=$(b);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(d);Object.extend(this.options,d||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId))this.options.formId=""}if(this.options.externalControl)this.options.externalControl=$(this.options.externalControl);if(!this.options.externalControl)this.options.externalControlOnly= false;this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(b){if(!(!this._editing|| b.ctrlKey||b.altKey||b.shiftKey))if(Event.KEY_ESC==b.keyCode)this.handleFormCancellation(b);else Event.KEY_RETURN==b.keyCode&&this.handleFormSubmission(b)},createControl:function(b,c,d){var e=this.options[b+"Control"];c=this.options[b+"Text"];if("button"==e){d=document.createElement("input");d.type="submit";d.value=c;d.className="editor_"+b+"_button";if("cancel"==b)d.onclick=this._boundCancelHandler;this._form.appendChild(d);this._controls[b]=d}else if("link"==e){e=document.createElement("a");e.href= "#";e.appendChild(document.createTextNode(c));e.onclick="cancel"==b?this._boundCancelHandler:this._boundSubmitHandler;e.className="editor_"+b+"_link";if(d)e.className+=" "+d;this._form.appendChild(e);this._controls[b]=e}},createEditField:function(){var b=this.options.loadTextURL?this.options.loadingText:this.getText(),c;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){c=document.createElement("input");c.type="text";var d=this.options.size||this.options.cols||0;if(0=this.options.rows?this.options.autoRows:this.options.rows;c.cols=this.options.cols||40}c.name=this.options.paramName;c.value=b;c.className="editor_field";if(this.options.submitOnBlur)c.onblur=this._boundSubmitHandler;this._controls.editor=c;this.options.loadTextURL&&this.loadExternalText();this._form.appendChild(this._controls.editor)},createForm:function(){function b(d,e){d=c.options["text"+d+"Controls"];!d||e===false||c._form.appendChild(document.createTextNode(d))}var c=this;this._form= $(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();"textarea"==this._controls.editor.tagName.toLowerCase()&&this._form.appendChild(document.createElement("br"));this.options.onFormCustomization&&this.options.onFormCustomization(this,this._form);b("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);b("Between", this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");b("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML)this.element.innerHTML=this._oldInnerHTML;this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(b){if(!(this._saving||this._editing)){this._editing=true;this.triggerCallback("onEnterEditMode");this.options.externalControl&&this.options.externalControl.hide(); this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);this.options.loadTextURL||this.postProcessEditField();b&&Event.stop(b)}},enterHover:function(){this.options.hoverClassName&&this.element.addClassName(this.options.hoverClassName);this._saving||this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(b){this.triggerCallback("onFailure",b);if(this._oldInnerHTML){this.element.innerHTML= this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(b){this.wrapUp();b&&Event.stop(b)},handleFormSubmission:function(b){var c=this._form,d=$F(this._controls.editor);this.prepareSubmission();c=this.options.callback(c,d)||"";if(Object.isString(c))c=c.toQueryParams();c.editorId=this.element.id;if(this.options.htmlResponse){d=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(d,{parameters:c,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler}); new Ajax.Updater({success:this.element},this.url,d)}else{d=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(d,{parameters:c,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,d)}b&&Event.stop(b)},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();this.options.externalControl&&this.options.externalControl.show(); this._editing=this._saving=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(){this.options.hoverClassName&&this.element.removeClassName(this.options.hoverClassName);this._saving||this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var b=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(b,{parameters:"editorId="+encodeURIComponent(this.element.id), onComplete:Prototype.emptyFunction,onSuccess:function(c){this._form.removeClassName(this.options.loadingClassName);c=c.responseText;if(this.options.stripLoadedTextTags)c=c.stripTags();this._controls.editor.value=c;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,b)},postProcessEditField:function(){var b=this.options.fieldPostCreation;if(b)$(this._controls.editor)["focus"==b?"focus":"activate"]()}, prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(b){Object.extend(this.options,b)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var b;$H(Ajax.InPlaceEditor.Listeners).each(function(c){b=this[c.value].bind(this);this._listeners[c.key]= b;this.options.externalControlOnly||this.element.observe(c.key,b);this.options.externalControl&&this.options.externalControl.observe(c.key,b)}.bind(this))},removeForm:function(){if(this._form){this._form.remove();this._form=null;this._controls={}}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(b, c){"function"==typeof this.options[b]&&this.options[b](this,c)},unregisterListeners:function(){$H(this._listeners).each(function(b){this.options.externalControlOnly||this.element.stopObserving(b.key,b.value);this.options.externalControl&&this.options.externalControl.stopObserving(b.key,b.value)}.bind(this))},wrapUp:function(b){this.leaveEditMode();this._boundComplete(b,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy}); Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,c,d,e){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(c,d,e)},createEditField:function(){var b=document.createElement("select");b.name=this.options.paramName;b.size=1;this._controls.editor=b;this._collection=this.options.collection||[];this.options.loadCollectionURL?this.loadCollection():this.checkForExternalText();this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName); this.showLoadingText(this.options.loadingCollectionText);var b=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(b,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){c=c.responseText.strip();if(!/^\[.*\]$/.test(c))throw"Server returned an invalid collection representation.";this._collection=eval(c);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,b)}, showLoadingText:function(b){this._controls.editor.disabled=true;var c=this._controls.editor.firstChild;if(!c){c=document.createElement("option");c.value="";this._controls.editor.appendChild(c);c.selected=true}c.update((b||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();this.options.loadTextURL?this.loadExternalText():this.buildOptionList()},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var b=Object.extend({method:"get"},this.options.ajaxOptions); Object.extend(b,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){this._text=c.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,b)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(e){return 2===e.length?e:[e,e].flatten()});var b="value"in this.options?this.options.value:this._text, c=this._collection.any(function(e){return e[0]==b}.bind(this));this._controls.editor.update("");var d;this._collection.each(function(e,f){d=document.createElement("option");d.value=e[0];d.selected=c?e[0]==b:0==f;d.appendChild(document.createTextNode(e[1]));this._controls.editor.appendChild(d)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}}); Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(b){function c(d,e){d in b||e===undefined||(b[d]=e)}if(b){c("cancelControl",b.cancelLink?"link":b.cancelButton?"button":b.cancelLink==b.cancelButton==false?false:undefined);c("okControl",b.okLink?"link":b.okButton?"button":b.okLink==b.okButton==false?false:undefined);c("highlightColor",b.highlightcolor);c("highlightEndColor",b.highlightendcolor)}}; Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving", savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(b){return Form.serialize(b)},onComplete:function(b,c){new Effect.Highlight(c,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(b){b.element.style.backgroundColor=b.options.highlightColor;b._effect&&b._effect.cancel()},onFailure:function(b){alert("Error communication with the server: "+ b.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(b){b._effect=new Effect.Highlight(b.element,{startcolor:b.options.highlightColor,endcolor:b.options.highlightEndColor,restorecolor:b._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."}; Form.Element.DelayedObserver=Class.create({initialize:function(b,c,d){this.delay=c||0.5;this.element=$(b);this.callback=d;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(){if(this.lastValue!=$F(this.element)){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1E3);this.lastValue=$F(this.element)}},onTimerEvent:function(){this.timer=null;this.callback(this.element, $F(this.element))}});if(!Control)var Control={}; Control.Slider=Class.create({initialize:function(b,c,d){var e=this;this.handles=Object.isArray(b)?b.collect(function(f){return $(f)}):[$(b)];this.track=$(c);this.options=d||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(f){return $(f)}):false;this.options.startSpan= $(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/, ""):this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,"");this.disabled=this.dragging=this.active=false;this.options.disabled&&this.setDisabled();if(this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this); this.handles.each(function(f,h){h=e.handles.length-1-h;e.setValue(parseFloat((Object.isArray(e.options.sliderValue)?e.options.sliderValue[h]:e.options.sliderValue)||e.range.start),h);f.makePositioned().observe("mousedown",e.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var b=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown); Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(c){Event.stopObserving(c,"mousedown",b.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(b){if(this.allowedValues){if(b>=this.allowedValues.max())return this.allowedValues.max();if(b<=this.allowedValues.min())return this.allowedValues.min();var c=Math.abs(this.allowedValues[0]- b),d=this.allowedValues[0];this.allowedValues.each(function(e){var f=Math.abs(e-b);if(f<=c){d=e;c=f}});return d}if(b>this.range.end)return this.range.end;if(b0&&bthis.values[c+ 1])b=this.values[c+1]}b=this.getNearestValue(b);this.values[c]=b;this.value=this.values[0];this.handles[c].style[this.isVertical()?"top":"left"]=this.translateToPx(b);this.drawSpans();if(!this.dragging||!this.event)this.updateFinished()},setValueBy:function(b,c){this.setValue(this.values[c||this.activeHandleIdx||0]+b,c||this.activeHandleIdx||0)},translateToPx:function(b){return Math.round((this.trackLength-this.handleLength)/(this.range.end-this.range.start)*(b-this.range.start))+"px"},translateToValue:function(b){return b/ (this.trackLength-this.handleLength)*(this.range.end-this.range.start)+this.range.start},getRange:function(b){var c=this.values.sortBy(Prototype.K);b=b||0;return $R(c[b],c[b+1])},minimumOffset:function(){return this.isVertical()?this.alignY:this.alignX},maximumOffset:function(){return this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))- this.alignX},isVertical:function(){return this.axis=="vertical"},drawSpans:function(){var b=this;this.spans&&$R(0,this.spans.length-1).each(function(c){b.setSpan(b.spans[c],b.getRange(c))});if(this.options.startSpan)this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));if(this.options.endSpan)this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))},setSpan:function(b,c){if(this.isVertical()){b.style.top= this.translateToPx(c.start);b.style.height=this.translateToPx(c.end-c.start+this.range.start)}else{b.style.left=this.translateToPx(c.start);b.style.width=this.translateToPx(c.end-c.start+this.range.start)}},updateStyles:function(){this.handles.each(function(b){Element.removeClassName(b,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(b){if(Event.isLeftClick(b)){if(!this.disabled){this.active=true;var c=Event.element(b),d=[Event.pointerX(b),Event.pointerY(b)];if(c== this.track){c=this.track.cumulativeOffset();this.event=b;this.setValue(this.translateToValue((this.isVertical()?d[1]-c[1]:d[0]-c[0])-this.handleLength/2));c=this.activeHandle.cumulativeOffset();this.offsetX=d[0]-c[0];this.offsetY=d[1]-c[1]}else{for(;this.handles.indexOf(c)==-1&&c.parentNode;)c=c.parentNode;if(this.handles.indexOf(c)!=-1){this.activeHandle=c;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();c=this.activeHandle.cumulativeOffset();this.offsetX=d[0]-c[0]; this.offsetY=d[1]-c[1]}}}Event.stop(b)}},update:function(b){if(this.active){if(!this.dragging)this.dragging=true;this.draw(b);Prototype.Browser.WebKit&&window.scrollBy(0,0);Event.stop(b)}},draw:function(b){var c=[Event.pointerX(b),Event.pointerY(b)],d=this.track.cumulativeOffset();c[0]-=this.offsetX+d[0];c[1]-=this.offsetY+d[1];this.event=b;this.setValue(this.translateToValue(this.isVertical()?c[1]:c[0]));if(this.initialized&&this.options.onSlide)this.options.onSlide(this.values.length>1?this.values: this.value,this)},endDrag:function(b){if(this.active&&this.dragging){this.finishDrag(b,true);Event.stop(b)}this.dragging=this.active=false},finishDrag:function(){this.dragging=this.active=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange)this.options.onChange(this.values.length>1?this.values:this.value,this);this.event=null}}); Sound={tracks:{},_enabled:true,template:new Template(''),enable:function(){Sound._enabled=true},disable:function(){Sound._enabled=false},play:function(b,c){if(Sound._enabled){var d=Object.extend({track:"global",url:b,replace:false},c||{});if(d.replace&&this.tracks[d.track]){$R(0,this.tracks[d.track].id).each(function(e){e=$("sound_"+d.track+"_"+e);e.Stop&&e.Stop();e.remove()});this.tracks[d.track]= null}if(this.tracks[d.track])this.tracks[d.track].id++;else this.tracks[d.track]={id:0};d.id=this.tracks[d.track].id;$$("body")[0].insert(Prototype.Browser.IE?new Element("bgsound",{id:"sound_"+d.track+"_"+d.id,src:d.url,loop:1,autostart:true}):Sound.template.evaluate(d))}}}; if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0)if(navigator.plugins&&$A(navigator.plugins).detect(function(b){return b.name.indexOf("QuickTime")!=-1}))Sound.template=new Template('');else if(navigator.plugins&&$A(navigator.plugins).detect(function(b){return b.name.indexOf("Windows Media")!=-1}))Sound.template=new Template(''); else if(navigator.plugins&&$A(navigator.plugins).detect(function(b){return b.name.indexOf("RealPlayer")!=-1}))Sound.template=new Template('');else Sound.play=function(){};Effect.Scroll=Class.create(); Object.extend(Object.extend(Effect.Scroll.prototype,Effect.Base.prototype),{initialize:function(b,c){this.element=$(b);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({x:0,y:0},c||{}))},setup:function(){var b=this.element==window?document.viewport.getScrollOffsets():Element._returnOffset(this.element.scrollLeft,this.element.scrollTop);this.originalScrollLeft=b.left;this.originalScrollTop=b.top;if(this.options.mode=="absolute"){this.options.x-=this.originalScrollLeft; this.options.y-=this.originalScrollTop}},update:function(b){this.element.scrollTo(Math.round(this.options.x*b+this.originalScrollLeft),Math.round(this.options.y*b+this.originalScrollTop))}}); var BEHAVIOUR_WIDGET=null,BehaviourLog=$A(),Behaviour={debug:window.location.search.indexOf("debug")>=0,RUN_EVERY_TIME:$A(),_ruleIndex:{},_ruleCount:0,_startTime:null,_documentLoaded:false,_windowLoaded:false,_running:false,_currentRule:null,_currentFunc:null,_currentRunEveryTime:false,domloaded_list:$H(),onload_list:$H(),setDomLoaded:function(){this._documentLoaded=true;this.log("dom loaded");this.apply()},setWindowLoaded:function(){this._windowLoaded=true;this.log("window loaded");this._running= true;this.onload_list.each(this._runThisOnRuleset.bind(this));this._running=false},_getCurrentTime:function(){return(new Date).getTime()},log:function(b,c){if(this.debug){c||(c=this._getCurrentTime());var d=Math.round(c-this._startTime);c=Math.round(this._getCurrentTime()-c);BehaviourLog.push({start:d,duration:c,rule:this._currentRule,element:b})}},_cssRuleHash:function(b){this._ruleIndex[b]||(this._ruleIndex[b]=++this._ruleCount);return"bhvr_"+window.BEHAVIOUR_WIDGET+"_"+this._ruleIndex[b]},_functionWrapper:function(b){if(this._currentRule&& this._currentFunc){var c=0;if(this.debug)c=this._getCurrentTime();var d=(b.id?"#"+b.id:"")+(b.className?"."+b.className:"");this.debug?this._currentFunc(b):this._currentFunc.defer(b);this.debug&&this.log(d,c);this._currentRunEveryTime||b.addClassName(this._cssRuleHash(this._currentRule))}},_runThisOnIndividualRules:function(b){this._currentRule=b.key;this._currentFunc=b.value;this._currentRunEveryTime=this.RUN_EVERY_TIME.include(this._currentRule);b=this._currentRule.strip();this._currentRunEveryTime|| (b+=":not(."+this._cssRuleHash(this._currentRule)+")");$$(b).each(this._functionWrapper.bind(this));this._currentFunc=this._currentRule=null},_runThisOnRuleset:function(b){window.BEHAVIOUR_WIDGET=b.key;b.value.each(this._runThisOnIndividualRules.bind(this));window.BEHAVIOUR_WIDGET=null},apply:function(b){if(!b&&!this._documentLoaded)return false;if(this._running)return false;this.log("apply: "+b);this._running=true;if(b){var c;if(c=this.domloaded_list.get(b))this._runThisOnRuleset({key:b,value:c}); if(this._windowLoaded&&(c=this.onload_list.get(b)))this._runThisOnRuleset({key:b,value:c})}else{this.domloaded_list.each(this._runThisOnRuleset.bind(this));this._windowLoaded&&this.onload_list.each(this._runThisOnRuleset.bind(this));this.RUN_EVERY_TIME=this.RUN_EVERY_TIME.uniq()}this._running=false},register:function(b,c,d){d||(d=window.BEHAVIOUR_WIDGET?window.BEHAVIOUR_WIDGET:"behaviour_ruleset_"+Math.random());c=c?this.onload_list:this.domloaded_list;var e=c.get(d);e?c.set(d,e.merge(b)):c.set(d, $H(b))}};Behaviour._startTime=Behaviour._getCurrentTime();Event.observe(document,"dom:loaded",Behaviour.setDomLoaded.bind(Behaviour));Event.observe(window,"load",Behaviour.setWindowLoaded.bind(Behaviour)); if(Prototype.Browser.IE){var ieVersion=null,ieBadPNG=null,IE7=null;ieVersion=parseFloat(/MSIE ([\d\.]+)/.exec(navigator.appVersion)[1]);ieBadPNG=ieVersion>=5.5&&ieVersion<7;IE7=ieVersion>=7;var ieBehaviour={"div.autobox-with-tabs div.autobox":function(b){b.style.marginTop=ieVersion<7?"1px":"6px";Event.observe(window,"load",function(){autobox_assign_dimensions(b)})}};Behaviour.register(ieBehaviour);var ieFixZindex=function(b,c){if(b&&b.childElements){var d=b.childElements();if(d.length)return d.each(function(e){ieFixZindex(e, c)});if(b.getStyle("position")!="absolute"&&(!b.getStyle("z-index")||b.getStyle("z-index")=0)return;var c=b.getDimensions();b.style.width=(c.width||1200)+"px";b.style.height=(c.height||1200)+"px";b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"', sizingMethod='crop')";b.src="/s/images/layout/spacer.gif"}else{c=b.getStyle("background-image"); if(!c||c.search(/\.png/i)<0||c.indexOf("/s/images/layout/spacer.gif")<0)return;c=c.substring(5,c.length-2);var d=b.getStyle("background-position");b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"', sizingMethod='crop')";b.setStyle({"background-image":"url(/s/images/layout/spacer.gif)"});b.setStyle({"background-position":d})}Event.observe(b,"propertychange",iePNGPropChange.bindAsEventListener(b))},iePNGPropChange=function(b){switch(b.propertyName){case "src":case "style.backgroundImage":return iePNGFix(this)}}, transparentPNGBehaviour={};for(i=0;i