/** * RightJS in safe-mode, http://rightjs.org * Released under terms of the MIT license * * Copyright (C) 2008-2010 Nikolay Nemshilov */ /** * The safe-mode layout * * Copyright (C) 2010 Nikolay Nemshilov */ var RightJS = (function(window, src) { // premassaging the source code, swapping the document reference where needed src = src // the default document to the current one .replace(',document,', ',parent.document,') // building the inside types conversion methods + 'RightJS.$N=function(v){return new Number(v)};' + 'RightJS.$S=function(v){return new String(v)}'; // building the frame sandbox var frame_id = '__rightjs_condom', document = window.document; if ('attachEvent' in window) { document.write(''); } else { var frame = document.createElement('iframe'); frame.name = frame_id; frame.style.display = 'none'; document.documentElement.appendChild(frame); } // puttin the code into the frame var win = window.frames[frame_id]; if ('execScript' in win) { win.execScript(src); } else { var doc = win.document; doc.open();doc.write(''); doc.close(); var script = document.createElement('script'); script.text = src; doc.body.appendChild(script); } // transferring the object references from the sandbox into local variable var RightJS = win.RightJS; RightJS.context = win; RightJS.safe = true; // building the access and types conversion proxy var proxy = function(value) { switch (typeof value) { case 'number': return RightJS.$N(value); case 'string': return RightJS.$S(value); case 'function': return RightJS.$ext(value, RightJS.Function.Methods); case 'object': if (RightJS.isArray(value)) return RightJS.$A(value); } return value; }; return RightJS.$ext(proxy, RightJS); })(window, 'var RightJS=function(Q,q,u,E,O,W,na,w){function R(a){return X(a)?a:[a]}function Ca(a,b){var c=a[0],d=Da.call(a,1),e=b,f;if(L(c)){f=c;c=b.length&&aa(b[0][f])?function(i){return i[f].apply(i,d)}:function(i){return i[f]}}else e=d[0];return[c,e]}function S(a,b,c){var d;try{d=a.apply(b,Ca(c,b))}catch(e){if(!(e instanceof j.Break))throw e;}return d}function Ea(a){return!!a}function Fa(a,b){return a>b?1:a"+a+""+d[1];e-- >0;)c=c.firstChild;a=c.childNodes}b=0;for(c=a.length;b< '+ 'c;b++){d=a[a.length===c?b:0];Ia.appendChild(d instanceof r?d._:d)}return Ia}function Ja(a,b){var c,d=b.camelize();switch(d){case "opacity":c=!F.IE?a[d].replace(",","."):(/opacity=(\\d+)/i.exec(a.filter||"")||["","100"])[1].toInt()/100+"";break;case "float":d=F.IE?"styleFloat":"cssFloat";default:c=a[d];if(F.Opera&&/color/i.test(d)&&c)c=c.replace(/"/g,"")}return c||null}function ia(a,b,c){Y[a]=eval("["+Y[a].toString().replace(b,c)+"]")[0]}function Ka(a){a=T(a);qa=qa.concat(a);ba(r[s],a);ba(Z[s],a)}function La(a, '+ 'b){var c=a||"*",d=b._;d="tagName"in d?d.tagName:null;return d===null?c:c.replace(/(^|,)/g,"$1"+d+" ")}function ja(a){var b=new Ma(a),c=b.target;c=c.parent&&c.parent();b.type=a.type==="focusin"||a.type==="focus"?"focus":"blur";c&&c.fire(b)}function Na(a,b){var c=q.createElement(b);c.setAttribute(a,";");return aa(c[a])}function gb(a,b,c){return function(d){var e=d.target,f=o(b),i=f.shift();if(c.find(a).includes(e))aa(i)?i.apply(e,[d].concat(f)):e[i].apply(e,f)}}function Oa(a){a=o(a);var b=a[1]||{}, '+ 'c={},d;if(L(b)){c[b]=a.slice(2);if(X(c[b][0]))c[b]=c[b][0].map(R)}else c=b;for(d in c){c[d]=R(c[d]);c[d]=X(c[d][0])?c[d]:[c[d]]}return c}function Pa(a,b){var c=a[0],d,e,f=Oa(a),i=!u.keys(f).length;return(b.$listeners||[]).filter(function(z){return z.dr&&z.n===c&&(i||function(){for(var k in f)if(z.dr===k){d=0;for(e=f[k];d-1;c--)if(a.call(b,this[c],c,this))return this[c];return null};E.include({indexOf:J.indexOf||function(a,b){for(var c=b<0?w.max(0,this.length+b):b||0,d=this.length;c-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?S(ob,this,arguments):this[0]},last:function(){return arguments.length?S(pb,this,arguments): '+ 'this[this.length-1]},random:function(){return this.length?this[w.random(this.length-1)]:null},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return!this.length},clone:function(){return this.slice(0)},each:function(){S(Wa,this,arguments);return this},forEach:Wa,map:function(){return S(lb,this,arguments)},filter:function(){return S(jb,this,arguments)},reject:function(){return S(kb,this,arguments)},some:function(a){return S(mb,this,a?arguments:[Ea])}, '+ 'every:function(a){return S(nb,this,a?arguments:[Ea])},walk:function(){this.map.apply(this,arguments).forEach(function(a,b){this[b]=a},this);return this},merge:function(){for(var a=this.clone(),b,c=0,d,e=arguments.length;c0;b=w.random(d-1),c=a[--d],a[d]=a[b],a[b]=c);return a},sort:function(a){return ib.apply(this,a||!Ta(this[0])?arguments:[Fa])},sortBy:function(){var a=Ca(arguments,this);return this.sort(function(b,c){return Fa(a[0].call(a[1],b),a[0].call(a[1], '+ 'c))})},min:function(){return w.min.apply(w,this)},max:function(){return w.max.apply(w,this)},sum:function(){for(var a=0,b=this.length,c=0;a]+>/ig,"")},stripScripts:function(a){var b="", '+ 'c=this.replace(/]*>([\\s\\S]*?)<\\/script>/img,function(d,e){b+=e+"\\n";return""});if(a===true)Sa(b);else aa(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(true);return this},camelize:function(){return this.replace(/(\\-|_)+(.)?/g,function(a,b,c){return c?c.toUpperCase():""})},underscored:function(){return this.replace(/([a-z\\d])([A-Z]+)/g,"$1_$2").replace(/\\-/g,"_").toLowerCase()},capitalize:function(){return this.charAt(0).toUpperCase()+ '+ 'this.substring(1).toLowerCase()},includes:function(a){return this.indexOf(a)!=-1},startsWith:function(a,b){var c=this.substr(0,a.length);return b?c.toLowerCase()===a.toLowerCase():c===a},endsWith:function(a,b){var c=this.substring(this.length-a.length);return b?c.toLowerCase()===a.toLowerCase():c===a},toInt:function(a){return parseInt(this,a||10)},toFloat:function(a){return parseFloat(a?this:this.replace(",",".").replace(/(\\d)-(\\d)/g,"$1.$2"))}});B(O[s],{include:"includes"});W.include({bind:function(){var a= '+ 'o(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length||arguments.length?a.concat(o(arguments)):a)}},bindAsEventListener:function(){var a=o(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(o(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(o(arguments)))},rcurry:function(){var a=o(arguments),b=this;return function(){return b.apply(b,o(arguments).concat(a))}},delay:function(){var a=o(arguments),b=a.shift();a=new na(setTimeout(this.bind.apply(this, '+ '[this].concat(a)),b));a.cancel=function(){clearTimeout(this)};return a},periodical:function(){var a=o(arguments),b=a.shift();a=new na(setInterval(this.bind.apply(this,[this].concat(a)),b));a.stop=function(){clearInterval(this)};return a},chain:function(){var a=o(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}});na.include({times:function(a,b){for(var c=0;c=a;d--)b.call(c,d);return this},abs:function(){return w.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):w.round(this)},ceil:function(){return w.ceil(this)},floor:function(){return w.floor(this)},min:function(a){return thisa?a:this+0}});RegExp.escape=function(a){return(""+a).replace(/([.*+?\\^=!:${}()|\\[\\]\\/\\\\])/g,"\\\\$1")};E=j.Class=function(){function a(){"prebind"in this&&X(this.prebind)&& '+ 'this.prebind.each(function(e){this[e]=this[e].bind(this)},this);return this.initialize?this.initialize.apply(this,arguments):this}var b=o(arguments),c=b.pop()||{},d=b.pop();if(!b.length&&!y(c)){d=c;c={}}I(a,Xa).inherit(d);Ga(a,c);return a.include(c)};W=T("selfExtended self_extended selfIncluded self_included");var qb=W.concat(T(s+" parent extend include")),rb=W.concat(["constructor"]),Xa={inherit:function(a){if(a&&a[s]){var b=ca();b[s]=a[s];this[s]=new b;this.parent=a}for(this.ancestors=[];a;){this.ancestors.push(a); '+ 'a=a.parent}return this[s].constructor=this},extend:function(){o(arguments).filter(y).each(function(a){var b=a.selfExtended||a.self_extended;I(this,u.without.apply(u,[a].concat(qb)));b&&b.call(a,this)},this);return this},include:function(){var a=(this.ancestors||[]).map(s);o(arguments).filter(y).each(function(b){var c=b.selfIncluded||b.self_included;u.each(u.without.apply(u,[b].concat(rb)),function(d,e){var f=a.first(function(i){return d in i&&aa(i[d])});this[s][d]=!f?e:function(){this.$super=f[d]; '+ 'return e.apply(this,arguments)}},this);c&&c.call(b,this)},this);return this}};W=j.Options={setOptions:function(a){a=this.options=u.merge(oa(this,"options"),a);var b,c;if(aa(this.on))for(c in a)if(b=c.match(/on([A-Z][A-Za-z]+)/)){this.on(b[1].toLowerCase(),a[c]);delete a[c]}return this},cutOptions:function(a){a=o(a);this.setOptions(y(a.last())?a.pop():{});return a}};var ga=j.Observer=new E({include:W,initialize:function(a){this.setOptions(a);ba(this,oa(this,"events"));return this},on:function(){var a= '+ 'o(arguments),b=a.shift(),c;if(L(b)){if(!("$listeners"in this))this.$listeners=[];var d=a.shift();switch(typeof d){case "string":c=d;d=this[d];case "function":var e={};e.e=b;e.f=d;e.a=a;e.r=c;this.$listeners.push(e);break;default:if(X(d))for(c=0;c";\')+"]")[0];var r=j.Element=new U({initialize:function(a,b){if(typeof a==="string")this.construct(a,b);else this._=a},construct:K});r.Wrappers=P;r.include({parent:function(a){return a?this.parents(a)[0]:n(this._.parentNode||null)},parents:function(a){return pa(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(b){return b._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))}, '+ 'nextSiblings:function(a){return pa(this,"nextSibling",a)},prevSiblings:function(a){return pa(this,"previousSibling",a)},next:function(a){return this.nextSiblings(a)[0]},prev:function(a){return this.prevSiblings(a)[0]},remove:function(){var a=this._,b=a.parentNode;b&&b.removeChild(a);return this},insert:function(a,b){var c=null,d=this._;b=(b||"bottom").toLowerCase();if(typeof a!=="object")c=a=""+a;else if(a&&a instanceof r)a=a._;sb[b](d,a.tagName?a:eb.call(b==="bottom"||b==="top"?d:d.parentNode,a)); '+ 'c!==null&&c.evalScripts();return this},insertTo:function(a,b){n(a).insert(this,b);return this},append:function(){return this.insert(arguments)},update:function(a){if(typeof a!=="object"){a=""+a;try{this._.innerHTML=a}catch(b){return this.clean().insert(a)}a.evalScripts();return this}else return this.clean().insert(a)},html:function(a){return a===undefined?this._.innerHTML:this.update(a)},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;if(c){a=n(a)._; '+ 'c.replaceChild(a,b);a.appendChild(b)}return this},clean:function(){for(;this._.firstChild;)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){var a=this._.cloneNode(true);a[N]=ta++;return new r(a)}});var sb={bottom:function(a,b){a.appendChild(b)},top:function(a,b){a.firstChild!==null?a.insertBefore(b,a.firstChild):a.appendChild(b)},after:function(a,b){var c=a.parentNode,d=a.nextSibling;d!==null?c.insertBefore(b,d):c.appendChild(b)},before:function(a, '+ 'b){a.parentNode.insertBefore(b,a)},instead:function(a,b){a.parentNode.replaceChild(b,a)}},Ha={TBODY:["","
",2],TR:["","
",3],TD:["","
",4],COL:["","
",2],LEGEND:["
","
",2],AREA:["","",2],OPTION:["",2]};B(Ha,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var Ia=q.createDocumentFragment(),fb=q.createElement("DIV"); '+ 'r.include({setStyle:function(a,b){var c,d,e={},f=this._.style;if(b){e[a]=b;a=e}else if(L(a)){a.split(";").each(function(i){i=i.split(":").map("trim");if(i[0]&&i[1])e[i[0]]=i[1]});a=e}for(c in a){d=c.indexOf("-")<0?c:c.camelize();if(c==="opacity")if(F.IE)f.filter="alpha(opacity="+a[c]*100+")";else f.opacity=a[c];else if(c==="float")d=F.IE?"styleFloat":"cssFloat";f[d]=a[c]}return this},getStyle:function(a){return Ja(this._.style,a)||Ja(this.computedStyles(),a)},computedStyles:function(){var a=this._; '+ 'return a.currentStyle||a.runtimeStyle||a.ownerDocument.defaultView.getComputedStyle(a,null)||{}},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},addClass:function(a){var b=" "+this._.className+" ";if(b.indexOf(" "+a+" ")==-1)this._.className+=(b===" "?"":" ")+a;return this},removeClass:function(a){this._.className=(" "+this._.className+" ").replace(" "+a+" "," ").trim();return this},toggleClass:function(a){return this[this.hasClass(a)? '+ '"removeClass":"addClass"](a)},radioClass:function(a){this.siblings().each("removeClass",a);return this.addClass(a)}});r.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b;a=c}var d;c=this._;for(d in a){d in c||c.setAttribute(d,""+a[d]);c[d]=a[d]}return this},get:function(a){var b=this._;a=b[a]||b.getAttribute(a);return a===""?null:a},has:function(a){return this.get(a)!==null},erase:function(a){this._.removeAttribute(a);return this},hidden:function(){return this.getStyle("display")=== '+ '"none"},visible:function(){return!this.hidden()},hide:function(){if(this.visible()){this._d=this.getStyle("display");this._.style.display="none"}return this},show:function(){if(this.hidden()){var a=this._,b=a.tagName=="DIV"?"block":"inline";a.style.display=this._d=="none"?b:this._d||b}return this},toggle:function(a,b){return this[this.hidden()?"show":"hide"](a,b)},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()}});r.include({document:function(){return n(this._.ownerDocument)}, '+ 'window:function(){return this.document().window()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.document()._.documentElement,c=this.window().scrolls();return{x:a.left+c.x-b.clientLeft,y:a.top+c.y-b.clientTop}},scrolls:function(){return{x:this._.scrollLeft,y:this._.scrollTop}},dimensions:function(){var a=this.size(),b=this.scrolls(),c=this.position();return{top:c.y,left:c.x,width:a.x,height:a.y,scrollLeft:b.x,scrollTop:b.y}}, '+ 'overlaps:function(a){var b=this.position(),c=this.size();return a.x>b.x&&a.xb.y&&a.y=200&&this.status<300},send:function(a){var b={},c=this.url,d=this.method.toLowerCase(),e=this.headers,f;if(d=="put"||d=="delete"){b._method=d;d="post"}b=this.prepareData(this.params,this.prepareParams(a),b);this.urlEncoded&&d=="post"&&!e["Content-type"]&&this.setHeader("Content-type", '+ '"application/x-www-form-urlencoded;charset="+this.encoding);if(d=="get"){if(b)c+=(c.includes("?")?"&":"?")+b;b=null}a=this.xhr=this.createXhr();this.fire("create");a.open(d,c,this.async);a.onreadystatechange=this.stateChanged.bind(this);for(f in e)a.setRequestHeader(f,e[f]);a.send(b);this.fire("request");this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(c){a.update(c.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(); '+ 'a.onreadystatechange=ca();a.canceled=true;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){if(this.jsonp)return new t.JSONP(this);else if(this.form&&this.form.first("input[type=file]"))return new t.IFramed(this.form);else try{return new XMLHttpRequest}catch(a){return new ActiveXObject("MSXML2.XMLHTTP")}},prepareParams:function(a){if(a&&a instanceof xa){this.form=a;a=a.values()}return a},prepareData:function(){return o(arguments).map(function(a){L(a)|| '+ '(a=u.toQueryString(a));return a.blank()?null:a}).compact().join("&")},stateChanged:function(){var a=this.xhr;if(!(a.readyState!=4||a.canceled)){try{this.status=a.status}catch(b){this.status=0}this.text=this.responseText=a.responseText;this.xml=this.responseXML=a.responseXML;this.fire("complete").fire(this.successful()?"success":"failure")}},tryScripts:function(){var a=this.getHeader("Content-type");if(this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(a))Sa(this.text);else if(/json/.test(a)&& '+ 'this.evalJSON)this.json=this.responseJSON=this.sanitizedJSON();else this.evalScripts&&this.text.evalScripts()},sanitizedJSON:function(){try{return JSON.parse(this.text)}catch(a){if(Q.JSON||!/^[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]*$/.test(this.text.replace(/\\\\./g,"@").replace(/"[^"\\\\\\n\\r]*"/g,""))){if(this.secureJSON)throw"JSON error: "+this.text;return null}}return eval("("+this.text+")")},initCallbacks:function(){this.on({success:"tryScripts",create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}); '+ 't.EVENTS.each(function(a){this.on(a,function(){t.fire(a,this,this.xhr)})},this)},showSpinner:function(){t.showSpinner.call(this,this)},hideSpinner:function(){t.hideSpinner.call(this,this)}});I(J(t),{counter:0,showSpinner:function(a){t.trySpinner(a,"show")},hideSpinner:function(a){t.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||t.Options,d=n(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){t.counter++;t.showSpinner()},countOut:function(){t.counter--;t.counter<1&&t.hideSpinner()}}).on({create:"countIn", '+ 'complete:"countOut",cancel:"countOut"});xa.include({send:function(a){a=a||{};a.method=a.method||this._.method||"post";(new t(this._.action||q.location.href,a)).onRequest(function(){this.disable.bind(this).delay(20)}.bind(this)).onComplete(this.enable.bind(this)).send(this);return this},remotize:function(a){if(!this.observes("submit",ra)){this.on("submit",ra,a);this.remote=true}return this},unremotize:function(){this.stopObserving("submit",ra);this.remote=false;return this}});r.include({load:function(a, '+ 'b){(new t(a,u.merge({method:"get"},b))).update(this);return this}});t.Dummy={open:ca(),abort:ca(),setRequestHeader:ca(),onreadystatechange:ca()};t.IFramed=new E({include:t.Dummy,initialize:function(a){this.form=a;this.id="xhr_"+(new Date).getTime();a.insert(\'\',"after");n(this.id).on("load",this.onLoad.bind(this))},send:function(){this.form.set("target",this.id).submit()},onLoad:function(){this.status= '+ '200;this.readyState=4;try{this.responseText=Q[this.id].document.documentElement.innerHTML}catch(a){}this.onreadystatechange()}});t.JSONP=new E({include:t.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a;this.name=this.prefix+(new Date).getTime();this.param=(L(a.jsonp)?a.jsonp:"callback")+"="+this.name;this.script=ua("script",{charset:a.encoding,async:a.async})},open:function(a,b){this.url=b;this.method=a},send:function(a){Q[this.name]=this.finish.bind(this);this.script.set("src",this.url+(this.url.include("?")? '+ '"&":"?")+this.param+"&"+a).insertTo(hb("script").last(),"after")},finish:function(a){this.status=200;this.readyState=4;this.xhr.json=this.xhr.responseJSON=a;this.onreadystatechange()}});var v=j.Fx=new E(ga,{extend:{EVENTS:T("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:F.IE?40:60,duration:"normal",transition:"Sin",queue:true},Transitions:{Sin:function(a){return-(w.cos(w.PI*a)-1)/2},Cos:function(a){return w.asin((a-0.5)*2)/w.PI+0.5},Exp:function(a){return w.pow(2, '+ '8*(a-1))},Log:function(a){return 1-w.pow(2,-8*a)},Lin:function(a){return a}},ch:[],cr:[]},initialize:function(a,b){this.$super(b);if(this.element=a=n(a)){var c=va(a);this.ch=v.ch[c]=v.ch[c]||[];this.cr=v.cr[c]=v.cr[c]||[]}},start:function(){if(this.queue(arguments))return this;this.prepare.apply(this,arguments);var a=this.options,b=v.Durations[a.duration]||a.duration;this.transition=v.Transitions[a.transition]||a.transition;this.steps=(b/1E3*this.options.fps).ceil();this.number=1;this.cr&&this.cr.push(this); '+ 'return this.fire("start",this).startTimer()},finish:function(){return this.stopTimer().unreg().fire("finish").next()},cancel:function(){this.ch.clean();return this.stopTimer().unreg().fire("cancel")},pause:function(){return this.stopTimer()},resume:function(){return this.startTimer()},prepare:function(){},render:function(){},step:function(a){if(a.number>a.steps)a.finish();else{if(!a.w){a.w=true;a.render(a.transition(a.number/a.steps));a.w=false}a.number++}},startTimer:function(){this.timer=this.step.periodical((1E3/ '+ 'this.options.fps).round(),this);return this},stopTimer:function(){this.timer&&this.timer.stop();return this},queue:function(a){var b=this.ch,c=this.options.queue;if(!b||this.$ch)return this.$ch=false;c&&b.push([a,this]);return c&&b[0][1]!==this},next:function(){var a=this.ch,b=a.shift();if(b=a[0]){b[1].$ch=true;b[1].start.apply(b[1],b[0])}return this},unreg:function(){var a=this.cr;a&&a.splice(a.indexOf(this),1);return this}});O.COLORS={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00", '+ 'olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",brown:"#a52a2a"};O.include({toHex:function(){var a=/^#(\\w)(\\w)(\\w)$/.exec(this);return a=a?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/.exec(this))?"#"+a.slice(1).map(function(b){b=(b-0).toString(16);return b.length==1?"0"+b:b}).join(""):O.COLORS[this]||this},toRgb:function(a){var b= '+ '/#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/i.exec(this.toHex()||"");if(b){b=b.slice(1).map("toInt",16);b=a?b:"rgb("+b+")"}return b}});B=r.prototype;var cb=B.hide,ya=B.show,db=B.remove,ub=B.scrollTo;r.include({stop:function(){(v.cr[va(this)]||[]).each("cancel");return this},hide:function(a,b){return a&&this.visible()?this.fx(a,["out",b]):cb.call(this)},show:function(a,b){return a&&this.hidden()?this.fx(a,["in",b]):ya.call(this)},remove:function(a,b){return a&&this.visible()?this.fx(a,["out",u.merge(b, '+ '{onFinish:db.bind(this)})]):db.call(this)},morph:function(a,b){return this.fx("morph",[a,b||{}])},highlight:function(){return this.fx("highlight",arguments)},fade:function(){return this.fx("fade",arguments)},slide:function(){return this.fx("slide",arguments)},scroll:function(a,b){return this.fx("scroll",[a,b||{}])},scrollTo:function(a,b){return y(b)?this.scroll(a,b):ub.apply(this,arguments)},fx:function(a,b){var c=o(b).compact(),d=y(c.last())?c.pop():{};d=new (v[a.capitalize()])(this,d);d.start.apply(d, '+ 'c);return this}});var la=T("Top Left Right Bottom");v.Morph=new E(v,{prepare:function(a){var b=[],c=["Style","Color","Width"],d,e,f;for(d in a)if(d.startsWith("border"))for(e=0;e1)x=A(x);for(var $=0;$ '+ '1?A(x):x}}return Aa[h]}var d={" ":function(g,h){return a.$A(g.getElementsByTagName(h))},">":function(g,h){for(var p=[],l=g.firstChild;l;){if(h=="*"||l.tagName==h)p.push(l);l=l.nextSibling}return p},"+":function(g,h){for(;g=g.nextSibling;)if(g.tagName)return h=="*"||g.tagName==h?[g]:[];return[]},"~":function(g,h){for(var p=[];g=g.nextSibling;)if(h=="*"||g.tagName==h)p.push(g);return p}},e={checked:function(){return this.checked},disabled:function(){return this.disabled},empty:function(){return!(this.innerText|| '+ 'this.innerHTML||this.textContent||"").length},"first-child":function(g){for(var h=this;h=h.previousSibling;)if(h.tagName&&(!g||h.tagName==g))return false;return true},"first-of-type":function(g,h){return h["first-child"].call(this,this.tagName)},"last-child":function(g){for(var h=this;h=h.nextSibling;)if(h.tagName&&(!g||h.tagName==g))return false;return true},"last-of-type":function(g,h){return h["last-child"].call(this,this.tagName)},"only-child":function(g,h){return h["first-child"].call(this,g)&& '+ 'h["last-child"].call(this,g)},"only-of-type":function(g,h){return h["only-child"].call(this,this.tagName,h)},"nth-child":function(g,h,p){if(!this.parentNode)return false;g=g.toLowerCase();if(g=="n")return true;if(g.includes("n")){var l=h=0;if(m=g.match(/^([+\\-]?\\d*)?n([+\\-]?\\d*)?$/)){h=m[1]=="-"?-1:parseInt(m[1],10)||1;l=parseInt(m[2],10)||0}g=1;for(var A=this;A=A.previousSibling;)if(A.tagName&&(!p||A.tagName==p))g++;return(g-l)%h===0&&(g-l)/h>=0}else return h.index.call(this,g.toInt()-1,h,p)},"nth-of-type":function(g, '+ 'h){return h["nth-child"].call(this,g,h,this.tagName)},index:function(g,h,p){g=a.isString(g)?g.toInt():g;h=this;for(var l=0;h=h.previousSibling;)if(h.tagName&&(!p||h.tagName==p)&&++l>g)return false;return l==g}},f=/((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^\\[\\]]*\\]|[\'"][^\'"]*[\'"]|[^\\[\\]\'"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?/g,i=/#([\\w\\-_]+)/,z=/^[\\w\\*]+/,k=/\\.([\\w\\-\\._]+)/,ha=/:([\\w\\-]+)(\\((.+?)\\))*$/,vb=/\\[((?:[\\w\\-]*:)?[\\w\\-]+)\\s*(?:([!\\^$*~|]?=)\\s*(([\'"])([^\\4]*?)\\4|([^\'"][^\\]]*?)))?\\]/,za= '+ '{},Aa={},Ba={},ma={first:function(g){return this.find(g)[0]},find:function(g){var h=this._;g=g||"*";if(!Ba[g]){f.lastIndex=0;for(var p=[],l=[],A=" ",M,D;M=f.exec(g);){D=M[1];if(D=="+"||D==">"||D=="~")A=D;else{l.push([A,D]);A=" "}if(M[2]){p.push(c(l));l=[]}}p.push(c(l));Ba[g]=p}g=Ba[g];p=[];l=0;for(A=g.length;l