/** * RightJS v2.2.2 safe-mode, http://rightjs.org * Released under terms of the MIT license * * Copyright (C) 2008-2011 Nikolay Nemshilov */ /** * The safe-mode layout * * Copyright (C) 2010-2011 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(a,b,c,d,e,f,g,h){function cG(a,c){var d=b.createElement(c);d.setAttribute(a,";");return v(d[a])}function cE(a,b,c,d){var e={},f=a.marginLeft.toFloat()||0,g=a.marginTop.toFloat()||0,h=c==="right",i=c==="bottom",j=c==="top"||i;d==="out"?(e[j?"height":"width"]="0px",h?e.marginLeft=f+b.x+"px":i&&(e.marginTop=g+b.y+"px")):(j?(e.height=b.y+"px",a.height="0px"):(e.width=b.x+"px",a.width="0px"),h?(e.marginLeft=f+"px",a.marginLeft=f+b.x+"px"):i&&(e.marginTop=g+"px",a.marginTop=g+b.y+"px"));return e}function cD(a,b,c){var d=a.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(a.size().x).setStyle(b),e;a.parent()&&a.insert(d,"before"),e=cC(d,c),d.remove();return e}function cC(a,b){var c=0,d=b.length,e=a.computedStyles(),f={},g;for(;cd?a.finish():(a.render(b(e/d)),e++)},c)}function ck(a){var b=G(a._);(ce[b]||[]).each("cancel"),(cd[b]||[]).splice(0)}function cj(a){var b=a.ch,c=b.shift();if(c=b[0])c[1].$ch=!0,c[1].start.apply(c[1],c[0])}function ci(a){var b=a.cr;b&&b.splice(b.indexOf(a),1)}function ch(a){a.cr&&a.cr.push(a)}function cg(a,b){var c=a.ch,d=a.options.queue;if(!c||a.$ch)return a.$ch=!1;d&&c.push([b,a]);return d&&c[0][1]!==a}function cf(a){var b=G((a.element||{})._||{});a.ch=cd[b]=cd[b]||[],a.cr=ce[b]=ce[b]||[]}function cb(a,b){a.stop(),this.send(b)}function b$(a,b){var d=a[0],e,f,g=bZ(a),h=!c.keys(g).length;return(b.$listeners||[]).filter(function(a){return a.dr&&a.n===d&&(h||function(){for(var b in g)if(a.dr===b)for(e=0,f=g[b];e"+b+""+e[1];while(f--!==0)d=d.firstChild;b=d.childNodes;while(b.length!==0)bK.appendChild(b[0])}else for(var g=0,h=b.length,i;gb?1:a-1;c--)if(a.call(b,this[c],c,this))return this[c];return undefined};d.include({indexOf:j.indexOf||function(a,b){for(var c=b<0?h.max(0,this.length+b):b||0;c-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?Y(U,this,arguments):this[0]},last:function(){return arguments.length?Y(V,this,arguments):this[this.length-1]},random:function(){return this.length===0?undefined:this[h.random(this.length-1)]},size:function(){return this.length},clean:function(){this.length=0;return this},empty:function(){return this.length===0},clone:function(){return this.slice(0)},each:function(){Y(O,this,arguments);return this},forEach:O,map:function(){return Y(R,this,arguments)},filter:function(){return Y(P,this,arguments)},reject:function(){return Y(Q,this,arguments)},some:function(a){return Y(S,this,a?arguments:[Z])},every:function(a){return Y(T,this,a?arguments:[Z])},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;c0;b=h.random(d-1),c=a[--d],a[d]=a[b],a[b]=c){}return a},sort:function(a){return N.apply(this,a||!x(this[0])?arguments:[$])},sortBy:function(){var a=W(arguments,this);return this.sort(function(b,c){return $(a[0].call(a[1],b),a[0].call(a[1],c))})},min:function(){return h.min.apply(h,this)},max:function(){return h.max.apply(h,this)},sum:function(){for(var a=0,b=0;b]+>/ig,"")},stripScripts:function(a){var b="",c=this.replace(/]*>([\\s\\S]*?)<\\/script>/img,function(a,c){b+=c+"\\n";return""});a===!0?r(b):v(a)&&a(b,c);return c},extractScripts:function(){var a="";this.stripScripts(function(b){a=b});return a},evalScripts:function(){this.stripScripts(!0);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){return(b!==!0?this.indexOf(a):this.toLowerCase().indexOf(a.toLowerCase()))===0},endsWith:function(a,b){return this.length-(b!==!0?this.lastIndexOf(a):this.toLowerCase().lastIndexOf(a.toLowerCase()))===a.length},toInt:function(a){return parseInt(this,a===undefined?10:a)},toFloat:function(a){return parseFloat(a===!0?this:this.replace(",",".").replace(/(\\d)-(\\d)/,"$1.$2"))}}),e.prototype.include=e.prototype.includes,f.include({bind:function(){var a=H(arguments),b=a.shift(),c=this;return function(){return c.apply(b,a.length!==0||arguments.length!==0?a.concat(H(arguments)):a)}},bindAsEventListener:function(){var a=H(arguments),b=a.shift(),c=this;return function(d){return c.apply(b,[d].concat(a).concat(H(arguments)))}},curry:function(){return this.bind.apply(this,[this].concat(H(arguments)))},rcurry:function(){var a=H(arguments),b=this;return function(){return b.apply(b,H(arguments).concat(a))}},delay:function(){var a=H(arguments),b=a.shift(),c=new g(setTimeout(this.bind.apply(this,[this].concat(a)),b));c.cancel=function(){clearTimeout(this)};return c},periodical:function(){var a=H(arguments),b=a.shift(),c=new g(setInterval(this.bind.apply(this,[this].concat(a)),b));c.stop=function(){clearInterval(this)};return c},chain:function(){var a=H(arguments),b=a.shift(),c=this;return function(){var d=c.apply(c,arguments);b.apply(b,a);return d}}}),g.include({times:function(a,b){for(var c=0;c=a;d--)b.call(c,d);return this},abs:function(){return h.abs(this)},round:function(a){return a?parseFloat(this.toFixed(a)):h.round(this)},ceil:function(){return h.ceil(this)},floor:function(){return h.floor(this)},min:function(a){return thisa?a:this+0}}),RegExp.escape=function(a){return(""+a).replace(/([.*+?\\^=!:${}()|\\[\\]\\/\\\\])/g,"\\\\$1")};var _=i.Class=function(){var a=H(arguments).slice(0,2),b=a.pop()||{},c=a.pop(),d=arguments[2],e=function(){};!a.length&&!y(b)&&(c=b,b={}),!d&&c&&(c===bs||c.ancestors.include(bs))&&(d=bt()),d=q(d||function(){bf(this);return"initialize"in this?this.initialize.apply(this,arguments):this},ba),c=c||_,e.prototype=c.prototype,d.prototype=new e,d.parent=c,d.prototype.constructor=d,d.ancestors=[];while(c)d.ancestors.push(c),c=c.parent;["extend","include"].each(function(a){a in b&&d[a].apply(d,L(b[a]))});return d.include(b)},ba={extend:function(){H(arguments).filter(y).each(function(a){q(this,bc(a,!0)),bd(this,a,!0)},this);return this},include:function(){var a=[this].concat(this.ancestors);H(arguments).filter(y).each(function(b){c.each(bc(b,!1),function(b,c){for(var d,e=0;e"),bp.OLD=bp.IE8L=bq=!0}catch(br){}var bs=i.Wrapper=new _({_:undefined,initialize:function(a){this._=a}});bs.Cache=o,bs.Cast=function(a){return a.tagName in bD?bD[a.tagName]:undefined};var bx=i.Document=new _(bs,{win:function(){return bw(this._.defaultView||this._.parentWindow)}}),by=bw(b),bz=i.Window=new _(bs,{win:function(){return this},size:function(){var a=this._,b=a.document.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=a.document,c=b.body,d=b.documentElement;return a.pageXOffset||a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c&&(c.scrollLeft||c.scrollTop)?{x:c.scrollLeft,y:c.scrollTop}:{x:d.scrollLeft,y:d.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=x(a)?null:C(a);f instanceof bC&&(a=f.position()),y(a)&&(e=a.y,d=a.x),y(c=c||b)&&i.Fx?(new cc.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),bA=i.Event=new _(bs,{type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:bv,stopPropagation:function(){this._.stopPropagation?this._.stopPropagation():this._.cancelBubble=!0,this.stopped=!0;return this},preventDefault:function(){this._.preventDefault?this._.preventDefault():this._.returnValue=!1;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX,y:this.pageY}},offset:function(){if(this.target instanceof bC){var a=this.target.position();return{x:this.pageX-a.x,y:this.pageY-a.y}}return null},find:function(a){if(this.target instanceof bs&&this.currentTarget instanceof bs){var b=this.target._,c=this.currentTarget.find(a,!0);while(b){if(c.indexOf(b)!==-1)return bw(b);b=b.parentNode}}return undefined}},bv),bB=[],bC=i.Element=new _(bs,{initialize:function(a,b){bG(this,a,b)}},bu),bD=bC.Wrappers={},bE={},bF=function(a,c){return(a in bE?bE[a]:bE[a]=b.createElement(a)).cloneNode(!1)};bq&&(bF=function(a,c){a==="input"&&c!==undefined&&(a=\'");return b.createElement(a)}),bC.include({parent:function(a){var b=this._.parentNode,c=b&&b.nodeType;return a?this.parents(a)[0]:c===1||c===9?bw(b):null},parents:function(a){return bH(this,"parentNode",a)},children:function(a){return this.find(a).filter(function(a){return a._.parentNode===this._},this)},siblings:function(a){return this.prevSiblings(a).reverse().concat(this.nextSiblings(a))},nextSiblings:function(a){return bH(this,"nextSibling",a)},prevSiblings:function(a){return bH(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===undefined?"bottom":b,typeof a!=="object"?c=a=""+a:a instanceof bC&&(a=a._),bI[b](d,a.nodeType===undefined?bM(b==="bottom"||b==="top"?d:d.parentNode,a):a),c!==null&&c.evalScripts();return this},insertTo:function(a,b){C(a).insert(this,b);return this},append:function(a){return this.insert(w(a)?H(arguments).join(""):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}return this.clean().insert(a)},html:function(a){return a===undefined?this._.innerHTML:this.update(a)},text:function(a){return a===undefined?this._.textContent||this._.innerText:this.update(this.doc()._.createTextNode(a))},replace:function(a){return this.insert(a,"instead")},wrap:function(a){var b=this._,c=b.parentNode;c&&(a=C(a)._,c.replaceChild(a,b),a.appendChild(b));return this},clean:function(){while(this._.firstChild)this._.removeChild(this._.firstChild);return this},empty:function(){return this.html().blank()},clone:function(){return new bC(this._.cloneNode(!0))},index:function(){var a=this._,b=a.parentNode.firstChild,c=0;while(b!==a)b.nodeType===1&&c++,b=b.nextSibling;return c}});var bI={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)}},bJ={TBODY:["","
",2],TR:["","
",3],TD:["","
",4],COL:["","
",2],LEGEND:["
","
",2],AREA:["","",2],OPTION:["",2]};t(bJ,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var bK=b.createDocumentFragment(),bL=b.createElement("DIV");bC.include({setStyle:function(a,b){var c,d,e={},f=this._.style;b!==undefined?(e[a]=b,a=e):w(a)&&(a.split(";").each(function(a){var b=a.split(":").map("trim");b[0]&&b[1]&&(e[b[0]]=b[1])}),a=e);for(c in a)d=c.indexOf("-")<0?c:c.camelize(),c==="opacity"?bo?f.filter="alpha(opacity="+a[c]*100+")":f.opacity=a[c]:c==="float"&&(d=bo?"styleFloat":"cssFloat"),f[d]=a[c];return this},getStyle:function(a){return bN(this._.style,a)||bN(this.computedStyles(),a)},computedStyles:m.currentStyle?function(){return this._.currentStyle||{}}:m.runtimeStyle?function(){return this._.runtimeStyle||{}}:function(){return this._.ownerDocument.defaultView.getComputedStyle(this._,null)},hasClass:function(a){return(" "+this._.className+" ").indexOf(" "+a+" ")!=-1},setClass:function(a){this._.className=a;return this},getClass:function(){return this._.className},addClass:function(a){var b=" "+this._.className+" ";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)}}),bC.include({set:function(a,b){if(typeof a==="string"){var c={};c[a]=b,a=c}var d,e=this._;for(d in a)d==="style"?this.setStyle(a[d]):(d in e||e.setAttribute(d,""+a[d]),e[d]=a[d]);return this},get:function(a){var b=this._,c=b[a]||b.getAttribute(a);return c===""?null:c},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(a,b){this.visible()&&(this._d=this.getStyle("display"),this._.style.display="none");return this},show:function(){if(this.hidden()){var a=this._,b=this._d,c;if(!b||b==="none")c=E(a.tagName).insertTo(m),b=c.getStyle("display"),c.remove();b==="none"&&(b="block"),a.style.display=b}return this},toggle:function(){return this[this.visible()?"hide":"show"]()},radio:function(a,b){this.siblings().each("hide",a,b);return this.show()}}),bC.include({doc:function(){return bw(this._.ownerDocument)},win:function(){return this.doc().win()},size:function(){return{x:this._.offsetWidth,y:this._.offsetHeight}},position:function(){var a=this._.getBoundingClientRect(),b=this.doc()._.documentElement,c=this.win().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,g;if(d=="put"||d=="delete")b._method=d,d="post";var h=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),d=="get"&&(h&&(c+=(c.include("?")?"&":"?")+h),h=null),g=this.xhr=this.createXhr(),this.fire("create"),g.open(d,c,this.async),g.onreadystatechange=this.stateChanged.bind(this);for(f in e)g.setRequestHeader(f,e[f]);g.send(h),this.fire("request"),this.async||this.stateChanged();return this},update:function(a,b){return this.onSuccess(function(b){a.update(b.text)}).send(b)},cancel:function(){var a=this.xhr;if(!a||a.canceled)return this;a.abort(),a.onreadystatechange=function(){},a.canceled=!0;return this.fire("cancel")},fire:function(a){return this.$super(a,this,this.xhr)},createXhr:function(){return this.jsonp?new ca.JSONP(this):this.form&&this.form.first("input[type=file]")?new ca.IFramed(this.form):"ActiveXObject"in a?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest},prepareParams:function(a){a&&a instanceof bP&&(this.form=a,a=a.values());return a},prepareData:function(){return H(arguments).map(function(a){w(a)||(a=c.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(a){var b=this.getHeader("Content-type");this.evalResponse||this.evalJS&&/(ecma|java)script/i.test(b)?r(this.text):/json/.test(b)&&this.evalJSON?this.json=this.responseJSON=this.sanitizedJSON():this.evalScripts&&this.text.evalScripts()},sanitizedJSON:function(){if(!/^[,:{}\\[\\]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"JSON"in a?JSON.parse(this.text):(new f("return "+this.text))()},initCallbacks:function(){this.on({success:"tryScripts",create:"showSpinner",complete:"hideSpinner",cancel:"hideSpinner"}),ca.EVENTS.each(function(a){this.on(a,function(){ca.fire(a,this,this.xhr)})},this)},showSpinner:function(){ca.showSpinner.call(this,this)},hideSpinner:function(){ca.hideSpinner.call(this,this)}});q(bi(ca),{counter:0,showSpinner:function(a){ca.trySpinner(a,"show")},hideSpinner:function(a){ca.trySpinner(a,"hide")},trySpinner:function(a,b){var c=a||ca.Options,d=C(c.spinner);d&&d[b](c.spinnerFx,{duration:100})},countIn:function(){ca.counter++,ca.showSpinner()},countOut:function(){ca.counter--,ca.counter<1&&ca.hideSpinner()}}).on({create:"countIn",complete:"countOut",cancel:"countOut"}),bP.include({send:function(a){a=a||{},a.method=a.method||this._.method||"post",this.xhr=(new ca(this._.action||b.location.href,q({spinner:this.first(".spinner")},a))).onComplete(this.enable.bind(this)).onCancel(this.enable.bind(this)).send(this),this.disable.bind(this).delay(1);return this},cancelXhr:function(){this.xhr instanceof ca&&this.xhr.cancel();return this},remotize:function(a){this.remote||(this.on("submit",cb,a),this.remote=!0);return this},unremotize:function(){this.stopObserving("submit",cb),this.remote=!1;return this}}),bC.include({load:function(a,b){(new ca(a,q({method:"get"},b))).update(this);return this}}),ca.Dummy={open:function(){},setRequestHeader:function(){},onreadystatechange:function(){}},ca.IFramed=new _({include:ca.Dummy,initialize:function(a){this.form=a,this.id="xhr_"+(new Date).getTime(),this.form.doc().first("body").append(\'\',"after"),C(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,this.form.set("target","");try{this.responseText=a[this.id].document.documentElement.innerHTML}catch(b){}this.onreadystatechange()},abort:function(){C(this.id).set("src","about:blank")}}),ca.JSONP=new _({include:ca.Dummy,prefix:"jsonp",initialize:function(a){this.xhr=a,this.name=this.prefix+(new Date).getTime(),this.param=(w(a.jsonp)?a.jsonp:"callback")+"="+this.name,this.script=E("script",{charset:a.encoding,async:a.async})},open:function(a,b,c){this.url=b,this.method=a},send:function(b){a[this.name]=this.finish.bind(this),this.script.set("src",this.url+(this.url.include("?")?"&":"?")+this.param+"&"+b).insertTo(D("script").last(),"after")},finish:function(a){this.status=200,this.readyState=4,this.xhr.json=this.xhr.responseJSON=a,this.onreadystatechange()},abort:function(){a[this.name]=function(){}}});var cc=i.Fx=new _(bh,{extend:{EVENTS:F("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:bq?40:60,duration:"normal",transition:"Sin",queue:!0},Transitions:{Sin:function(a){return-(h.cos(h.PI*a)-1)/2},Cos:function(a){return h.asin((a-.5)*2)/h.PI+.5},Exp:function(a){return h.pow(2,8*(a-1))},Log:function(a){return 1-h.pow(2,-8*a)},Lin:function(a){return a}}},initialize:function(a,b){this.$super(b),this.element=C(a),cf(this)},start:function(){if(cg(this,arguments))return this;var a=this.options,b=cc.Durations[a.duration]||a.duration,c=cc.Transitions[a.transition]||a.transition,d=(b/1e3*this.options.fps).ceil(),e=(1e3/this.options.fps).round();ch(this),this.prepare.apply(this,arguments),cl(this,c,e,d);return this.fire("start",this)},finish:function(){cm(this),ci(this),this.fire("finish"),cj(this);return this},cancel:function(){cm(this),ci(this);return this.fire("cancel")},prepare:function(){},render:function(){}}),cd=[],ce=[];e.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"},e.include({toHex:function(){var a=/^#(\\w)(\\w)(\\w)$/.exec(this);a?a="#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:(a=/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/.exec(this))?a="#"+a.slice(1).map(function(a){a=(a-0).toString(16);return a.length==1?"0"+a:a}).join(""):a=e.COLORS[this]||this;return a},toRgb:function(a){var b=/#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})/i.exec(this.toHex()||"");b&&(b=b.slice(1).map("toInt",16),b=a?b:"rgb("+b+")");return b}}),bC.include({stop:function(){ck(this);return this},hide:function(a,b){return a&&this.visible()?cn(this,a,["out",b]):this.$super()},show:function(a,b){return a&&!this.visible()?cn(this,a,["in",b]):this.$super()},toggle:function(a,b){return a?cn(this,a,["toggle",b]):this.$super()},remove:function(a,b){return a&&this.visible()?cn(this,a,["out",q(b||{},{onFinish:this.$super.bind(this)})]):this.$super()},morph:function(a,b){return cn(this,"morph",[a,b||{}])},highlight:function(){return cn(this,"highlight",arguments)},fade:function(){return cn(this,"fade",arguments)},slide:function(){return cn(this,"slide",arguments)},scroll:function(a,b){return cn(this,"scroll",[a,b||{}])},scrollTo:function(a,b){return y(b)?this.scroll(a,b):this.$super.apply(this,arguments)}});var co=["WebkitT","OT","MozT","MsT","t"].first(function(a){return a+"ransition"in m.style}),cp=co+"ransition",cq=cp+"Property",cr=cp+"Duration",cs=cp+"TimingFunction",ct={Sin:"cubic-bezier(.3,0,.6,1)",Cos:"cubic-bezier(0,.3,.6,0)",Log:"cubic-bezier(0.6,.3,.8)",Exp:"cubic-bezier(.6,0,.8,.3)",Lin:"cubic-bezier(0,0,1,1)"};cc.Options.engine=co===undefined||bn?"javascript":"native",cc.Morph=new _(cc,{prepare:function(a){if(this.options.engine==="native"&&co!==undefined)this.render=this.transition=function(){},cu.call(this,a);else{var b=cx(a),c=cC(this.element,b),d=cD(this.element,a,b);cB(this.element,c,d),this.before=cA(c),this.after=cA(d)}},render:function(a){var b,c,d,e=this.element._.style,f,g,i;for(f in this.after){b=this.before[f],c=this.after[f];for(g=0,i=c.length;g":function(a,b){var c=[],d=a.firstChild;while(d)(b==="*"||d.tagName===b)&&c.push(d),d=d.nextSibling;return c},"+":function(a,b){while(a=a.nextSibling)if(a.tagName)return b==="*"||a.tagName===b?[a]:[];return[]},"~":function(a,b){var c=[];while(a=a.nextSibling)(b==="*"||a.tagName===b)&&c.push(a);return c}},cP={not:function(a,b){return a.nodeType===1&&!i.$(a).match(b)},checked:function(a){return a.checked===!0},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},selected:function(a){return a.selected===!0},empty:function(a){return!a.firstChild},"first-child":function(a,b){while(a=a.previousSibling)if(a.nodeType===1&&(b===null||a.nodeName===b))return!1;return!0},"first-of-type":function(a){return cP["first-child"](a,a.nodeName)},"last-child":function(a,b){while(a=a.nextSibling)if(a.nodeType===1&&(b===null||a.nodeName===b))return!1;return!0},"last-of-type":function(a){return cP["last-child"](a,a.nodeName)},"only-child":function(a,b){return cP["first-child"](a,b)&&cP["last-child"](a,b)},"only-of-type":function(a){return cP["only-child"](a,a.nodeName)},"nth-child":function(a,b,c,d){var e=1,f=b[0],g=b[1];while(a=d===!0?a.nextSibling:a.previousSibling)a.nodeType===1&&(c===undefined||a.nodeName===c)&&e++;return g===undefined?e===f:(e-g)%f===0&&(e-g)/f>=0},"nth-of-type":function(a,b){return cP["nth-child"](a,b,a.nodeName)},"nth-last-child":function(a,b){return cP["nth-child"](a,b,undefined,!0)},"nth-last-of-type":function(a,b){return cP["nth-child"](a,b,a.nodeName,!0)}},cQ=/((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^\\[\\]]*\\]|[\'"][^\'"]*[\'"]|[^\\[\\]\'"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?/g,cR=/#([\\w\\-_]+)/,cS=/^[\\w\\*]+/,cT=/\\.([\\w\\-\\._]+)/,cU=/:([\\w\\-]+)(\\((.+?)\\))*$/,cV=/\\[((?:[\\w\\-]*:)?[\\w\\-]+)\\s*(?:([!\\^$*~|]?=)\\s*(([\'"])([^\\4]*?)\\4|([^\'"][^\\]]*?)))?\\]/,cW={},cX=function(a){if(!cW[a]){var b,c,d,e,f,g,h,i,j,k={},l=a;while(i=l.match(cV))f=f||{},f[i[1]]={o:i[2]||"",v:i[5]||i[6]||""},l=l.replace(i[0],"");if(i=l.match(cU)){g=i[1],h=i[3]===""?null:i[3];if(g.startsWith("nth")){h=h.toLowerCase();if(h==="n")g=null,h=null;else{h==="odd"&&(h="2n+1"),h==="even"&&(h="2n");var m=/^([+\\-]?\\d*)?n([+\\-]?\\d*)?$/.exec(h);m?h=[m[1]==="-"?-1:parseInt(m[1],10)||1,parseInt(m[2],10)||0]:h=[parseInt(h,10),undefined]}}l=l.replace(i[0],"")}b=(l.match(cR)||[1,null])[1],c=(l.match(cS)||"*").toString().toUpperCase(),d=(l.match(cT)||[1,""])[1].split(".").without(""),e=d.length,k.tag=c;if(b||d.length||f||g)b=b||!1,f=f||!1,g=g in cP?cP[g]:!1,d=e?d:!1,k.filter=function(a){var c,i=[],j=0,k=0,l=a.length,m;for(;j1&&(c=e(c));for(var i=0;i1?e(c):c}}return cY[b]},c$={},c_={},da=function(a){if(!c$[a]){cQ.lastIndex=0;var b=[],c=[],d=" ",e,f;while(e=cQ.exec(a))f=e[1],f==="+"||f===">"||f==="~"?d=f:(c.push([d,f]),d=" "),e[2]&&(b.push(cZ(c)),c=[]);b.push(cZ(c)),c$[a]=b}return c$[a]},db=function(a,b){var c=da(b),d=[];for(var e=0,f=c.length;e