right-rails 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. data/CHANGELOG +8 -2
  2. data/Rakefile +28 -28
  3. data/lib/right_rails/java_script_generator.rb +59 -51
  4. data/public/images/{colorpicker.png → rightjs-ui/colorpicker.png} +0 -0
  5. data/public/images/{resizable.png → rightjs-ui/resizable.png} +0 -0
  6. data/public/javascripts/right-olds-src.js +47 -46
  7. data/public/javascripts/right-safe-src.js +103 -102
  8. data/public/javascripts/right-safe.js +1 -1
  9. data/public/javascripts/right-src.js +611 -541
  10. data/public/javascripts/right.js +86 -85
  11. data/public/javascripts/right/autocompleter-src.js +81 -77
  12. data/public/javascripts/right/autocompleter.js +1 -1
  13. data/public/javascripts/right/calendar-src.js +209 -197
  14. data/public/javascripts/right/calendar.js +6 -6
  15. data/public/javascripts/right/colorpicker-src.js +127 -117
  16. data/public/javascripts/right/colorpicker.js +6 -6
  17. data/public/javascripts/right/dnd-src.js +63 -63
  18. data/public/javascripts/right/dnd.js +2 -2
  19. data/public/javascripts/right/in-edit-src.js +53 -48
  20. data/public/javascripts/right/in-edit.js +2 -2
  21. data/public/javascripts/right/lightbox-src.js +107 -99
  22. data/public/javascripts/right/lightbox.js +2 -2
  23. data/public/javascripts/right/rater-src.js +48 -46
  24. data/public/javascripts/right/rater.js +3 -3
  25. data/public/javascripts/right/resizable-src.js +53 -61
  26. data/public/javascripts/right/resizable.js +4 -4
  27. data/public/javascripts/right/selectable-src.js +97 -95
  28. data/public/javascripts/right/selectable.js +2 -2
  29. data/public/javascripts/right/slider-src.js +47 -45
  30. data/public/javascripts/right/slider.js +8 -8
  31. data/public/javascripts/right/sortable-src.js +54 -52
  32. data/public/javascripts/right/tabs-src.js +181 -171
  33. data/public/javascripts/right/tooltip-src.js +39 -37
  34. data/public/javascripts/right/uploader-src.js +21 -19
  35. data/spec/lib/right_rails/java_script_generator_spec.rb +61 -56
  36. metadata +9 -7
@@ -5,4 +5,4 @@
5
5
  * Copyright (C) 2008-2010 Nikolay Nemshilov
6
6
  */
7
7
  var RightJS=function(g,e){e=e.replace(",document,",",parent.document,")+"RightJS.$N=function(v){return new Number(v)};RightJS.$S=function(v){return new String(v)}";var c=g.document;if("attachEvent"in g)c.write('<iframe name="__rightjs_condom" style="display:none"></iframe>');else{var b=c.createElement("iframe");b.name="__rightjs_condom";b.style.display="none";c.documentElement.appendChild(b)}b=g.frames.__rightjs_condom;if("execScript"in b)b.execScript(e);else{var f=b.document;f.open();f.write("<html></html>");
8
- f.close();c=c.createElement("script");c.text=e;f.body.appendChild(c)}var a=b.RightJS;a.context=b;a.safe=true;return a.$ext(function(d){switch(typeof d){case "number":return a.$N(d);case "string":return a.$S(d);case "function":return a.$ext(d,a.Function.Methods);case "object":if(a.isArray(d))return a.$A(d)}return d},a)}(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<b?-1:0}function Ga(a,b){["extend","include"].each(function(c){var d=b[c];if(y(d)||X(d)){a[c].apply(a, R(d));delete b[c]}})}function oa(a,b){var c=b.toUpperCase(),d=b.capitalize(),e=a.constructor;return(e=[a,e].concat("ancestors"in e?e.ancestors:[]).first(function(f){return f&&(c in f||d in f)}))?e[c]||e[d]:null}function pa(a,b,c){a=a._;for(var d=[];a=a[b];)if(a.tagName&&(!c||n(a).match(c)))d.push(n(a));return d}function eb(a){if(typeof a==="string"){var b=this.tagName,c=fb,d=Ha[b]||["","",1],e=d[2];for(c.innerHTML=d[0]+"<"+b+">"+a+"</"+b+">"+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<e.length;d++)if(!e[d].length||e[d][0]===z.dc)return true}return false}())})}function ra(a,b){a.stop();this.send(u.merge({spinner:this.first(".spinner")},b))}function ea(a){return a=== "transparent"||a==="rgba(0, 0, 0, 0)"}function Qa(a){var b={},c=/[\\d\\.\\-]+/g,d,e,f;for(e in a){d=a[e].match(c);d=d.map("toFloat");d.t=a[e].split(c);d.r=d.t[0]==="rgb(";d.t.length==1&&d.t.unshift("");for(f=0;f<d.length;f++)d.t.splice(f*2+1,0,d[f]);b[e]=d}return b}var j=function(a){return a};j.version="2.0.0-rc2";j.modules=["core","dom","form","events","xhr","fx","cookie","olds"];var s="prototype",J=E[s],sa=u[s].toString,Da=J.slice,ca=function(){return function(){}},Ra=q.documentElement,ta=1,ka=[], N="_rid"+(new Date).getTime(),I=j.$ext=function(a,b,c){b=b||{};var d;for(d in b)if(!c||!(d in a))a[d]=b[d];return a},Sa=j.$eval=function(a){if(a)"execScript"in Q?n(q).window()._.execScript(a):ua("script",{text:a}).insertTo(Ra)};j.$break=function(){throw new j.Break;};var B=j.$alias=function(a,b){for(var c in b)a[c]=a[b[c]];return a};j.defined=function(a){return typeof a!=="undefined"};var aa=j.isFunction=function(a){return typeof a==="function"},L=j.isString=function(a){return typeof a==="string"}, Ta=j.isNumber=function(a){return typeof a==="number"},y=j.isHash=function(a){return sa.call(a)==="[object Object]"},X=j.isArray=function(a){return sa.call(a)==="[object Array]"},Ua=j.isElement=function(a){return a&&a.tagName};j.isNode=function(a){return a&&a.nodeType};var n=j.$=function(a){if(typeof a==="string")a=q.getElementById(a);if(a)if(N in a&&a[N]in ka)a=ka[a[N]];else if(a.nodeType===1)a=new r(a);else if(Ua(a.target)||Ua(a.srcElement))a=new Ma(a);else if(a.nodeType===9)a=new Z(a);else if(a.window== a)a=new da(a);return a},hb=j.$$=function(a,b){return n(b||q).find(a)},ua=j.$E=function(a,b){return new r(a,b)},T=j.$w=function(a){return a.trim().split(/\\s+/)},o=j.$A=function(a){try{return Da.call(a)}catch(b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=a[d];return c}},va=j.$uid=function(a){return N in a?a[N]:a[N]=ta++};if(y(Ra))y=j.isHash=function(a){return sa.call(a)==="[object Object]"&&a!==null&&typeof a!=="undefined"&&typeof a.hasOwnProperty!=="undefined"};for(var C=0,K="Array Function Number String Date RegExp".split(" "), fa=function(){for(var a=0,b=arguments;a<b.length;a++)if(y(b[a])){I(this[s],b[a]);I(this.Methods,b[a])}};C<K.length;C++)I(j[K[C]]=Q[K[C]],{Methods:{},include:fa});j.Object=u;j.Math=w;I(u,{keys:function(a){var b=[],c;for(c in a)b.push(c);return b},values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},each:function(a,b,c){for(var d in a)b.call(c,d,a[d]);return a},empty:function(a){for(var b in a)return false;return true},without:function(){var a=o(arguments),b=a.shift(),c={},d;for(d in b)a.includes(d)|| (c[d]=b[d]);return c},only:function(){for(var a=o(arguments),b=a.shift(),c={},d=0,e=a.length;d<e;d++)if(a[d]in b)c[a[d]]=b[a[d]];return c},merge:function(){for(var a={},b=0,c=arguments.length;b<c;b++)y(arguments[b])&&I(a,arguments[b]);return a},toQueryString:function(a){var b=[],c,d,e=encodeURIComponent;for(c in a){d=R(a[c]);for(var f=0;f<d.length;f++)b.push(e(c)+"="+e(d[f]))}return b.join("&")}},true);var Va=w.random;w.random=function(a,b){if(arguments.length===0)return Va();else if(arguments.length=== 1){b=a;a=0}return~~(Va()*(b-a+1)+~~a)};var ib=J.sort;C=function(a,b,c){return eval("[function(c,s){for(var "+a+"i=0,l=this.length;i<l;i++){"+b.replace("_","c.call(s,this[i],i,this)")+"}"+c+"}]")[0]};var Wa=J.forEach||C("","_",""),jb=J.filter||C("r=[],j=0,","if(_)r[j++]=this[i]","return r"),kb=C("r=[],j=0,","if(!_)r[j++]=this[i]","return r"),lb=J.map||C("r=[],","r[i]=_","return r"),mb=J.some||C("","if(_)return true","return false"),nb=J.every||C("","if(!_)return false","return true"),ob=C("","if(_)return this[i]", "return [][0]"),pb=function(a,b){for(var c=this.length-1;c>-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<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:J.lastIndexOf||function(a){for(var b=this.length-1;b>-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;c<e;c++){b=arguments[c];b=R(b);for(d=0;d<b.length;d++)a.indexOf(b[d])==-1&&a.push(b[d])}return a},flatten:function(){var a=[];this.forEach(function(b){if(X(b))a=a.concat(b.flatten());else a.push(b)});return a},compact:function(){return this.without(null,undefined)},uniq:function(){return[].merge(this)}, includes:function(){for(var a=0,b=arguments.length;a<b;a++)if(this.indexOf(arguments[a])==-1)return false;return true},without:function(){var a=o(arguments);return this.filter(function(b){return!a.includes(b)})},shuffle:function(){for(var a=this.clone(),b,c,d=a.length;d>0;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<b;c+=this[a++]);return c}});B(J,{include:"includes"});O.include({empty:function(){return this==""},blank:function(){return/^\\s*$/.test(this)},trim:O[s].trim||function(){for(var a=this.replace(/^\\s\\s*/,""),b=a.length;/\\s/.test(a.charAt(--b)););return a.slice(0,b+1)},stripTags:function(){return this.replace(/<\\/?[^>]+>/ig,"")},stripScripts:function(a){var b="", c=this.replace(/<script[^>]*>([\\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<this;c++)a.call(b,c);return this},upto:function(a,b,c){for(var d=this+0;d<=a;d++)b.call(c,d); return this},downto:function(a,b,c){for(var d=this+0;d>=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 this<a?a:this+0},max:function(a){return this>a?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<d.length;c++)this.on.apply(this,[b].concat(R(d[c])).concat(a))}}else for(c in b)this.on.apply(this,[c].concat(R(b[c])).concat(a));return this},observes:function(a,b){if(!L(a)){b=a;a=null}if(L(b))b=this[b];return(this.$listeners||[]).some(function(c){return a&& b?c.e===a&&c.f===b:a?c.e===a:c.f===b})},stopObserving:function(a,b){if(y(a))for(var c in a)this.stopObserving(c,a[c]);else{if(!L(a)){b=a;a=null}if(L(b))b=this[b];this.$listeners=(this.$listeners||[]).filter(function(d){return a&&b?d.e!==a||d.f!==b:a?d.e!==a:d.f!==b},this)}return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(b){return b.f}).uniq()},fire:function(){var a=o(arguments),b=a.shift();(this.$listeners||[]).each(function(c){c.e=== b&&c.f.apply(this,c.a.concat(a))},this);return this}});J=ga.create=function(a,b){I(a,u.without(ga[s],"initialize","setOptions"),true);return ba(a,b||oa(a,"events"))};var ba=ga.createShortcuts=function(a,b){(b||[]).each(function(c){var d="on"+c.replace(/(^|_|:)([a-z])/g,function(e,f,i){return i.toUpperCase()});d in a||(a[d]=function(){return this.on.apply(this,[c].concat(o(arguments)))})});return a};j.Break=new E(Error,{message:"Manual break"});K=navigator.userAgent;C="attachEvent"in Q;fa="opera"in Q;var F=j.Browser={IE:C&&!fa,Opera:fa,WebKit:K.include("AppleWebKit/"),Gecko:K.include("Gecko")&&!K.include("KHTML"),MobileSafari:/Apple.*Mobile.*Safari/.test(K),Konqueror:K.include("Konqueror"),OLD:C&&!fa&&!q.querySelector},U=j.Wrapper=function(a,b){var c=function(d,e){this.initialize(d,e);var f=this,i=f._;if(this.constructor===r&&i.tagName in P){f=new P[i.tagName](i);if("$listeners"in this)f.$listeners=this.$listeners}i=N in i?i[N]:i[N]=ta++;return ka[i]=f};if(!b){b=a;a=null}I(c,Xa).inherit(a|| U);Ga(c,b);return c.include({_:undefined},b)};U.Cache=ka;var Z=j.Document=new U({initialize:function(a){this._=a},window:function(){return n(this._.defaultView||this._.parentWindow)}}),da=j.Window=new U({initialize:function(a){this._=a;this.d=a.document},window:function(){return this},size:function(){var a=this._,b=this.d.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a=this._,b=this.d,c=b.body;b=b.documentElement;return a.pageXOffset|| a.pageYOffset?{x:a.pageXOffset,y:a.pageYOffset}:c.scrollLeft||c.scrollTop?{x:c.scrollLeft,y:c.scrollTop}:{x:b.scrollLeft,y:b.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=n(a);if(f&&f instanceof r)a=f.position();if(y(a)){e=a.y;d=a.x}y(c=c||b)&&j.Fx?(new v.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),Ma=j.Event=new U({type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null,pageX:null,pageY:null,initialize:function(a,b){if(typeof a==="string"){a= u.merge({type:a},b);this.stopped=a.bubbles===false;y(b)&&I(this,b)}this._=a;this.type=a.type;this.which=a.which;this.keyCode=a.keyCode;this.target=n(a.target);this.currentTarget=n(a.currentTarget);this.relatedTarget=n(a.relatedTarget);this.pageX=a.pageX;this.pageY=a.pageY;if(!("target"in a)&&"srcElement"in a){this.which=a.button==2?3:a.button==4?2:1;this.target=n(a.srcElement)||b;this.relatedTarget=this.target._===a.fromElement?n(a.toElement):this.target;this.currentTarget=b;var c=this.target.window().scrolls(); this.pageX=a.clientX+c.x;this.pageY=a.clientY+c.y}else if(a.target&&"nodeType"in a.target&&a.target.nodeType===3)this.target=n(a.target.parentNode)},stopPropagation:function(){if("stopPropagation"in this._)this._.stopPropagation();else this._.cancelBubble=true;this.stopped=true;return this},preventDefault:function(){if("preventDefault"in this._)this._.preventDefault();else this._.returnValue=false;return this},stop:function(){return this.stopPropagation().preventDefault()},position:function(){return{x:this.pageX, y:this.pageY}},find:function(a){if(this.target instanceof r){var b=this.target;b=[b].concat(b.parents());var c=this.currentTarget.find(a);return b.first(function(d){return c.include(d)})}}}),qa=[],Ya={id:"id",html:"innerHTML","class":"className"},Za={style:"setStyle",on:"on"},P={},wa={};K=function(a,b){this._=a=(a in wa?wa[a]:wa[a]=q.createElement(a)).cloneNode(false);if(b!==undefined)for(var c in b)if(c in Ya)a[Ya[c]]=b[c];else c in Za?this[Za[c]](b[c]):this.set(c,b[c])};if(F.IE)K=eval("["+K.toString().replace(/(\\((\\w+),\\s*(\\w+)\\)\\s*\\{)/, \'$1if($2==="input"&&$3)$2="<input name="+$3.name+" type="+$3.type+($3.checked?" checked":"")+"/>";\')+"]")[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:["<TABLE>","</TABLE>",2],TR:["<TABLE><TBODY>","</TBODY></TABLE>",3],TD:["<TABLE><TBODY><TR>","</TR></TBODY></TABLE>",4],COL:["<TABLE><COLGROUP>","</COLGROUP><TBODY></TBODY></TABLE>",2],LEGEND:["<FIELDSET>","</FIELDSET>",2],AREA:["<map>","</map>",2],OPTION:["<SELECT>","</SELECT>",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.x<b.x+c.x&&a.y>b.y&&a.y<b.y+c.y},setWidth:function(a){var b=this._.style;b.width=a+"px";b.width=2*a-this._.offsetWidth+"px";return this},setHeight:function(a){var b=this._.style;b.height=a+"px";b.height=2*a-this._.offsetHeight+"px";return this},resize:function(a,b){if(y(a)){b=a.y;a=a.x}return this.setWidth(a).setHeight(b)},moveTo:function(a,b){if(y(a)){b=a.y;a=a.x}return this.setStyle({left:a+"px",top:b+"px"})},scrollTo:function(a, b){if(y(a)){b=a.y;a=a.x}this._.scrollLeft=a;this._.scrollTop=b;return this},scrollThere:function(a){this.window().scrollTo(this,a);return this}});var Y=J({});ia("on",/(\\$listeners\\.push\\((\\w+?)\\);)/,\'$1$2.e=$2.n=$2.e==="rightclick"?"contextmenu":$2.e;\'+(F.Gecko?\'if($2.n==="mousewheel")$2.n="DOMMouseScroll";\':"")+(F.Konqueror?\'if($2.n==="contextmenu")$2.n="rightclick";\':"")+\'$2.w=function(){var a=$A(arguments);$2.r&&$2.r!=="stopEvent"?a.shift():a[0]=new RightJS.Event(a[0],this);$2.f.apply($2.t,a.concat($2.a))};$2.t=this;\'+ (C?\'$2.w=$2.w.bind(this);this._.attachEvent("on"+$2.n,$2.w);\':"this._.addEventListener($2.n,$2.w,false);"));ia("stopObserving",/(function\\s*\\((\\w+)\\)\\s*\\{\\s*)(return\\s*)([^}]+)/m,"$1var r=$4;if(!r)"+(C?\'this._.detachEvent("on"+$2.n,$2.w);\':"this._.removeEventListener($2.n,$2.w,false);")+"$3 r");ia("fire",/(\\w+)(\\s*=\\s*(\\w+).shift\\(\\))/,"$1$2;$1=$1 instanceof RightJS.Event?$1:new RightJS.Event($1,Object.merge({target:this._},$3[0]));$1.currentTarget=this");ia("fire",/((\\w+)\\.e\\s*===\\s*(\\w+))([^}]+\\2\\.f\\.apply)[^}]+?\\.concat\\(\\w+\\)\\)/, \'$1.type$4(this,(($2.r&&$1.r!=="stopEvent")?[]:[$3]).concat($2.a))\');Y.stopEvent=function(a){a.stop()};r.include(Y);Z.include(Y);da.include(Y);ba(da[s],T("blur focus scroll resize load"));Ka("click rightclick contextmenu mousedown mouseup mouseover mouseout mousemove keypress keydown keyup");[r,Z].each("include",{first:function(a){return n(this._.querySelector(La(a,this)))},find:function(a){return o(this._.querySelectorAll(La(a,this))).map(n)}});r.include({match:function(a){var b=this._.tagName=== "HTML"?this._.ownerDocument:this.parents().last();a=n(b||ua("p").insert(this)).find(a).include(this);b||this.remove();return a}});[da,Z].each(function(a){a=a[s];var b=a.on;a.on=function(c){if(c=="ready"&&!this._wR){var d=this._,e=this.fire.bind(this,"ready");d=d.nodeType==9?d:d.document;"readyState"in d?function(){["loaded","complete"].includes(d.readyState)?e():arguments.callee.delay(50)}():d.addEventListener("DOMContentLoaded",e,false);this._wR=true}return b.apply(this,arguments)};ba(a,["ready"])}); B(r[s],{subNodes:"children",sizes:"size",select:"find"});B(Z[s],{select:"find"});B(da[s],{sizes:"size"});var xa=j.Form=P.FORM=new U(r,{initialize:function(a){a=a||{};var b="remote"in a,c=a;if(y(a)){c="form";a=u.without(a,"remote")}this.$super(c,a);b&&this.remotize()},elements:function(){return this.find("input,button,select,textarea")},inputs:function(){return this.elements().filter(function(a){return!["submit","button","reset","image",null].includes(a._.type)})},input:function(a){return n(this._[a])}, focus:function(){var a=this.inputs().first(function(b){return b._.type!=="hidden"});a&&a.focus();return this},blur:function(){this.elements().each("blur");return this},disable:function(){this.elements().each("disable");return this},enable:function(){this.elements().each("enable");return this},values:function(){var a={},b,c,d;this.inputs().each(function(e){d=e._;c=d.name;if(!d.disabled&&c&&(!["checkbox","radio"].includes(d.type)||d.checked)){b=e.getValue();if(c.endsWith("[]"))b=(a[c]||[]).concat([b]); a[c]=b}});return a},serialize:function(){return u.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});Ka("submit reset focus blur disable enable change");B(xa[s],{getElements:"elements"});var tb=r[s].insert,$a=j.Input=P.INPUT=P.BUTTON=P.SELECT=P.TEXTAREA=P.OPTGROUP=new U(r,{initialize:function(a,b){if(!a||y(a)){b=a||{};if(/textarea|select/.test(b.type||"")){a=b.type;delete b.type}else a="input"}this.$super(a,b)},form:function(){return n(this._.form)}, insert:function(a,b){tb.call(this,a,b);this._.tagName==="SELECT"&&L(a)&&o(this._.getElementsByTagName("option")).each(function(c){c.selected=!!c.getAttribute("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?o(this._.getElementsByTagName("option")).map(function(a){return a.selected?a.value:null}).compact():this._.value},setValue:function(a){if(this._.type=="select-multiple"){a=R(a).map(O);o(this._.getElementsByTagName("option")).each(function(b){b.selected= a.includes(b.value)})}else this._.value=a;return this},value:function(a){return this[a===undefined?"getValue":"setValue"](a)},focus:function(){this._.focus();this.focused=true;F.IE&&this.fire("focus",{bubbles:false});return this},blur:function(){this._.blur();this.focused=false;F.IE&&this.fire("blur",{bubbles:false});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=true;return this.fire("disable")},enable:function(){this._.disabled=false;return this.fire("enable")}}); r[s].fire=eval("["+Y.fire.toString().replace(/(\\w+)(\\s*=\\s*\\w+\\.shift[\\s\\S]+)(return this)/m,"$1$2var p=!$1.stopped&&this.parent&&this.parent();p&&p.fire&&p.fire($1);$3")+"]")[0];if(F.IE){q.attachEvent("onfocusin",ja);q.attachEvent("onfocusout",ja)}else{q.addEventListener("focus",ja,true);q.addEventListener("blur",ja,true)}if(!Na("onsubmit","form")){B=function(a){var b=n(a),c=b.target._,d=c.type;c=c.form;var e;if(c&&(e=n(c).parent())&&(a.keyCode===13&&(d==="text"||d==="password")||a.type==="click"&& (d==="submit"||d==="image"))){b.type="submit";b.target=n(c);e.fire(b)}};q.attachEvent("onclick",B);q.attachEvent("onkeypress",B)}if(!Na("onchange","input")){var ab=function(a){var b=a._,c=b.type;return c==="radio"||c==="checkbox"?b.checked:a.getValue()},bb=function(a,b){var c=b.parent(),d=ab(b);if(c&&""+b._prev_value!==""+d){b._prev_value=d;a.type="change";c.fire(a)}};B=function(a){a=n(a);var b=a.target,c=b._.type,d=b._.tagName,e=c==="radio"||c==="checkbox";if(a.type==="click"&&(e||d==="SELECT")|| a.type==="keydown"&&(a.keyCode==13&&d!=="TEXTAREA"||c==="select-multiple"))bb(a,b)};q.attachEvent("onclick",B);q.attachEvent("onkeydown",B);q.attachEvent("onfocusout",function(a){a=n(a);var b=a.target;b instanceof $a&&bb(a,b)});q.attachEvent("onbeforeactivate",function(a){a=n(a).target;if(a instanceof $a)a._prev_value=ab(a)})}[r,Z].each("include",{delegate:function(a){var b=Oa(arguments),c,d,e;for(c in b){d=0;for(e=b[c];d<e.length;d++){this.on(a,gb(c,e[d],this));I(this.$listeners.last(),{dr:c,dc:e[d][0]})}}return this}, undelegate:function(){Pa(arguments,this).each(function(a){this.stopObserving(a.n,a.f)},this);return this},delegates:function(){return!!Pa(arguments,this).length}});u.each({on:"delegate",stopObserving:"undelegate",observes:"delegates"},function(a,b){O[s][a]=function(){var c=n(q),d=o(arguments);d.splice(1,0,""+this);d=c[b].apply(c,d);return d===c?this:d}});qa.each(function(a){O[s]["on"+a.capitalize()]=function(){return this.on.apply(this,[a].concat(o(arguments)))}});var t=j.Xhr=new E(ga,{extend:{EVENTS:T("success failure complete request cancel create"), Options:{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript,text/html,application/xml,text/xml,*/*"},method:"post",encoding:"utf-8",async:true,evalScripts:false,evalResponse:false,evalJS:true,evalJSON:true,secureJSON:true,urlEncoded:true,spinner:null,spinnerFx:"fade",params:null,iframed:false,jsonp:false},load:function(a,b){return(new this(a,u.merge({method:"get"},b))).send()}},initialize:function(a,b){this.initCallbacks();this.url=a;I(this.$super(b),this.options);if(t.Options.spinner&& n(this.spinner)===n(t.Options.spinner))this.spinner=null},setHeader:function(a,b){this.headers[a]=b;return this},getHeader:function(a){var b;try{b=this.xhr.getResponseHeader(a)}catch(c){}return b},successful:function(){return this.status>=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(\'<i><iframe name="\'+this.id+\'" id="\'+this.id+\'" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>\',"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;e<c.length;e++)for(f=0;f<la.length;f++)b.push("border"+la[f]+c[e]);else if(d=="margin"||d=="padding"){e=b;f=d;for(var i=la,z=0;z<i.length;z++)e.push(f+i[z])}else if(d.startsWith("background")){e=b;f=["Color","Position","PositionX","PositionY"];for(i=0;i<f.length;i++)e.push("background"+f[i])}else d=="opacity"&&F.IE?b.push("filter"): b.push(d);c=this._cloneStyle(this.element,b);a=this._endStyle(a,b);b=this.element;d=[];var k;for(k in a)if((k=="width"||k=="height")&&c[k]=="auto")c[k]=b._["offset"+k.capitalize()]+"px";if(a.filter&&!c.filter)c.filter="alpha(opacity=100)";for(e=0;e<4;e++){z=la[e];f="border"+z+"Style";i="border"+z+"Width";z="border"+z+"Color";if(f in c&&c[f]!=a[f]){var ha=b._.style;if(c[f]=="none")ha[i]="0px";ha[f]=a[f];if(ea(c[z]))ha[z]=b.getStyle("Color")}}for(k in a){if(a[k]!==c[k]&&!d.includes(k)&&/color/i.test(k)){if(F.Opera){a[k]= a[k].replace(/"/g,"");c[k]=c[k].replace(/"/g,"")}ea(a[k])||(a[k]=a[k].toRgb());ea(c[k])||(c[k]=c[k].toRgb());if(!a[k]||!c[k])a[k]=c[k]=""}if(/\\d/.test(a[k])&&!/\\d/.test(c[k]))c[k]=a[k].replace(/[\\d\\.\\-]+/g,"0");if(a[k]===c[k]||d.includes(k)||!/\\d/.test(c[k])||!/\\d/.test(a[k])){delete a[k];delete c[k]}}this.before=Qa(c);this.after=Qa(a)},render:function(a){var b,c,d,e=this.element._.style,f,i,z;for(f in this.after){b=this.before[f];c=this.after[f];i=0;for(z=c.length;i<z;i++){d=b[i]+(c[i]-b[i])*a;if(c.r)d= w.round(d);c.t[i*2+1]=d}e[f]=c.t.join("")}},_endStyle:function(a,b){var c=this.element,d=c.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(c.size().x).setStyle(a);c.parent()&&c.insert(d,"before");c=this._cloneStyle(d,b);d.remove();return c},_cloneStyle:function(a,b){for(var c=0,d=b.length,e=a.computedStyles(),f={},i;c<d;c++){i=b[c];if(i in e)f[i]=""+e[i];if(i==="opacity")f[i]=f[i].replace(",",".")}return f}});v.Highlight=new E(v.Morph,{extend:{Options:u.merge(v.Options, {color:"#FF8",transition:"Exp"})},prepare:function(a,b){var c=this.element,d=c._.style,e=b||c.getStyle("backgroundColor");if(ea(e)){this.onFinish(function(){d.backgroundColor="transparent"});e=[c].concat(c.parents()).map(function(f){return(f=f.getStyle("backgroundColor"))&&!ea(f)?f:null}).compact().first()||"#FFF"}d.backgroundColor=a||this.options.color;return this.$super({backgroundColor:e})}});v.Twin=new E(v.Morph,{finish:function(){this.how=="out"&&cb.call(this.element);return this.$super()},setHow:function(a){this.how= a||"toggle";if(this.how=="toggle")this.how=this.element.visible()?"out":"in"}});v.Slide=new E(v.Twin,{extend:{Options:u.merge(v.Options,{direction:"top"})},prepare:function(a){this.setHow(a);var b=ya.call(this.element);this.size=b.size();this.styles={};T("overflow height width marginTop marginLeft").each(function(c){this.styles[c]=b._.style[c]},this);b._.style.overflow="hidden";this.onFinish("_getBack").onCancel("_getBack");return this.$super(this._getStyle(this.options.direction))},_getBack:function(){this.element.setStyle(this.styles)}, _getStyle:function(a){var b={},c=this.size,d=this.styles.marginLeft.toFloat()||0,e=this.styles.marginTop.toFloat()||0;if(this.how=="out"){b[["top","bottom"].includes(a)?"height":"width"]="0px";if(a=="right")b.marginLeft=d+c.x+"px";else if(a=="bottom")b.marginTop=e+c.y+"px"}else if(this.how=="in"){var f=this.element._.style;if(["top","bottom"].includes(a)){b.height=c.y+"px";f.height="0px"}else{b.width=c.x+"px";f.width="0px"}if(a=="right"){b.marginLeft=d+"px";f.marginLeft=d+c.x+"px"}else if(a=="bottom"){b.marginTop= e+"px";f.marginTop=e+c.y+"px"}}return b}});v.Fade=new E(v.Twin,{prepare:function(a){this.setHow(a);this.how=="in"&&ya.call(this.element.setStyle({opacity:0}));return this.$super({opacity:Ta(a)?a:this.how=="in"?1:0})}});v.Scroll=new E(v,{initialize:function(a,b){a=n(a);this.$super(a instanceof da?a._.document[F.WebKit?"body":"documentElement"]:a,b)},prepare:function(a){var b=this.before={},c=this.element._;this.after=a;if("x"in a)b.x=c.scrollLeft;if("y"in a)b.y=c.scrollTop},render:function(a){var b= this.before,c;for(c in b)this.element._["scroll"+(c=="x"?"Left":"Top")]=b[c]+(this.after[c]-b[c])*a}});j.Cookie=new E({include:W,extend:{set:function(a,b,c){return(new this(a,c)).set(b)},get:function(a){return(new this(a)).get()},remove:function(a){return(new this(a)).remove()},enabled:function(){q.cookie="__t=1";return q.cookie.indexOf("__t=1")!=-1},Options:{secure:false,document:q}},initialize:function(a,b){this.name=a;this.setOptions(b)},set:function(a){a=encodeURIComponent(a);var b=this.options; if(b.domain)a+="; domain="+b.domain;if(b.path)a+="; path="+b.path;if(b.duration){var c=new Date;c.setTime(c.getTime()+b.duration*24*60*60*1E3);a+="; expires="+c.toGMTString()}if(b.secure)a+="; secure";b.document.cookie=this.name+"="+a;return this},get:function(){var a=this.options.document.cookie.match("(?:^|;)\\\\s*"+RegExp.escape(this.name)+"=([^;]*)");return a?decodeURIComponent(a[1]):null},remove:function(){this.options.duration=-1;return this.set("")}});if(j.Browser.OLD)n=j.$=function(a){return function(b){var c= a(b);if(c&&c instanceof j.Element&&j.isString(b)&&c._.id!==b)c=j.$(q).first("#"+b);return c}}(j.$);j.$E("p").getBoundingClientRect||j.Element.include({position:function(){var a=this._,b=a.offsetTop,c=a.offsetLeft;for(a=a.offsetParent;a;){b+=a.offsetTop;c+=a.offsetLeft;a=a.offsetParent}return{x:c,y:b}}});q.querySelector||function(a){function b(g){if(!za[g]){var h,p,l,A,M,D,x={};for(l=g;h=l.match(vb);){A=A||{};A[h[1]]={o:h[2],v:h[5]||h[6]};l=l.replace(h[0],"")}if(h=l.match(ha)){M=h[1];D=h[3]==""?null: h[3];l=l.replace(h[0],"")}h=(l.match(i)||[1,null])[1];p=(l.match(z)||"*").toString().toUpperCase();l=(l.match(k)||[1,""])[1].split(".").without("");x.tag=p;if(h||l.length||A||M){var G="function(y){var e,r=[],z=0,x=y.length;for(;z<x;z++){e=y[z];_f_}return r}",H=function(V){G=G.replace("_f_",V+"_f_")};h&&H("if(e.id!=i)continue;");l.length&&H(\'if(e.className){var n=e.className.split(" ");if(n.length==1&&c.indexOf(n[0])==-1)continue;else{for(var i=0,l=c.length,b=false;i<l;i++)if(n.indexOf(c[i])==-1){b=true;break;}if(b)continue;}}else continue;\'); A&&H(\'var p,o,v,k,b=false;for (k in a){p=e.getAttribute(k)||"";o=a[k].o||"";v=a[k].v||"";if((o===""&&e.getAttributeNode(k)===null)||(o==="="&&p!=v)||(o==="*="&&!p.includes(v))||(o==="^="&&!p.startsWith(v))||(o==="$="&&!p.endsWith(v))||(o==="~="&&!p.split(" ").includes(v))||(o==="|="&&!p.split("-").includes(v))){b=true;break;}}if(b){continue;}\');M in e&&H("if(!S[P].call(e,V,S))continue;");x.filter=eval("[function(i,t,c,a,P,V,S,s){return eval(\'[\'+s+\']\')[0]}]")[0](h,p,l,A,M,D,e,G.replace("_f_","r.push(e)"))}za[g]= x}return za[g]}function c(g){var h=g.join("");if(!Aa[h]){for(var p=0;p<g.length;p++)g[p][1]=b(g[p][1]);var l=va,A=function(D){for(var x=[],G=[],H,V=0,$=D.length;V<$;V++){H=l(D[V]);if(!G[H]){x.push(D[V]);G[H]=true}}return x},M=function(D,x){var G=d[x[0]](D,x[1].tag);return x[1].filter?x[1].filter(G):G};Aa[h]=function(D){for(var x,G,H=0,V=g.length;H<V;H++)if(H===0)x=M(D,g[H]);else{if(H>1)x=A(x);for(var $=0;$<x.length;$++){G=M(x[$],g[H]);G.unshift(1);G.unshift($);x.splice.apply(x,G);$+=G.length-3}}return g.length> 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<A;l++)p=p.concat(g[l](h));return p.map(a.$)}};ma.select=ma.find;a.Element.include(ma);a.Document.include(ma)}(j);I(Q,u.without(j,"version","modules"));return j}(window,document,Object,Array, String,Function,Number,Math);');
8
+ f.close();c=c.createElement("script");c.text=e;f.body.appendChild(c)}var a=b.RightJS;a.context=b;a.safe=true;return a.$ext(function(d){switch(typeof d){case "number":return a.$N(d);case "string":return a.$S(d);case "function":return a.$ext(d,a.Function.Methods);case "object":if(a.isArray(d))return a.$A(d)}return d},a)}(window,'var RightJS=function(P,r,u,E,M,V,ma,w){function Q(a){return W(a)?a:[a]}function Ba(a,b){var c=a[0],d=Ca.call(a,1),e=b,f;if(L(c)){f=c;c=b.length&&$(b[0][f])?function(i){return i[f].apply(i,d)}:function(i){return i[f]}}else e=d[0];return[c,e]}function R(a,b,c){var d;try{d=a.apply(b,Ba(c,b))}catch(e){if(!(e instanceof j.Break))throw e;}return d}function Da(a){return!!a}function Ea(a,b){return a>b?1:a<b?-1:0}function Fa(a,b){["extend","include"].each(function(c){var d=b[c];if(x(d)||W(d)){a[c].apply(a, Q(d));delete b[c]}})}function na(a,b){var c=b.toUpperCase(),d=b.capitalize(),e=a.constructor;return(e=[a,e].concat("ancestors"in e?e.ancestors:[]).first(function(f){return f&&(c in f||d in f)}))?e[c]||e[d]:null}function oa(a,b,c){a=a._;for(var d=[];a=a[b];)if(a.tagName&&(!c||n(a).match(c)))d.push(n(a));return d}function eb(a){if(typeof a==="string"){var b=this.tagName,c=fb,d=Ga[b]||["","",1],e=d[2];for(c.innerHTML=d[0]+"<"+b+">"+a+"</"+b+">"+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];Ha.appendChild(d instanceof s?d._:d)}return Ha}function Ia(a,b){var c,d=b.camelize();switch(d){case "opacity":c=!H.IE?a[d].replace(",","."):(/opacity=(\\d+)/i.exec(a.filter||"")||["","100"])[1].toInt()/100+"";break;case "float":d=H.IE?"styleFloat":"cssFloat";default:c=a[d];if(H.Opera&&/color/i.test(d)&&c)c=c.replace(/"/g,"")}return c||null}function ha(a,b,c){X[a]=eval("["+X[a].toString().replace(b,c)+"]")[0]}function Ja(a){a=S(a);pa=pa.concat(a);aa(s[q],a);aa(Y[q],a)}function Ka(a, b){var c=a||"*",d=b._;d="tagName"in d?d.tagName:null;return d===null?c:c.replace(/(^|,)/g,"$1"+d+" ")}function ia(a){var b=new La(a),c=b.target;c=c.parent&&c.parent();b.type=a.type==="focusin"||a.type==="focus"?"focus":"blur";c&&c.fire(b)}function Ma(a,b){var c=r.createElement(b);c.setAttribute(a,";");return $(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))$(i)?i.apply(e,[d].concat(f)):e[i].apply(e,f)}}function Na(a){a=o(a);var b=a[1]||{},c= {},d;if(L(b)){c[b]=a.slice(2);if(W(c[b][0]))c[b]=c[b][0].map(Q)}else c=b;for(d in c){c[d]=Q(c[d]);c[d]=W(c[d][0])?c[d]:[c[d]]}return c}function Oa(a,b){var c=a[0],d,e,f=Na(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<e.length;d++)if(!e[d].length||e[d][0]===z.dc)return true}return false}())})}function qa(a,b){a.stop();this.send(u.merge({spinner:this.first(".spinner")},b))}function da(a){return a=== "transparent"||a==="rgba(0, 0, 0, 0)"}function Pa(a){var b={},c=/[\\d\\.\\-]+/g,d,e,f;for(e in a){d=a[e].match(c);d=d.map("toFloat");d.t=a[e].split(c);d.r=d.t[0]==="rgb(";d.t.length==1&&d.t.unshift("");for(f=0;f<d.length;f++)d.t.splice(f*2+1,0,d[f]);b[e]=d}return b}var j=function(a){return a};j.version="2.0.0";j.modules=["core","dom","form","events","xhr","fx","cookie","olds"];var q="prototype",J=E[q],ra=u[q].toString,Ca=J.slice,ba=function(){return function(){}},Qa=r.documentElement,sa=1,ja=[],I=j.$ext= function(a,b,c){b=b||{};var d;for(d in b)if(!c||!(d in a))a[d]=b[d];return a},Ra=j.$eval=function(a){if(a)"execScript"in P?n(r).window()._.execScript(a):ta("script",{text:a}).insertTo(Qa)};j.$break=function(){throw new j.Break;};var B=j.$alias=function(a,b){for(var c in b)a[c]=a[b[c]];return a};j.defined=function(a){return typeof a!=="undefined"};var $=j.isFunction=function(a){return typeof a==="function"},L=j.isString=function(a){return typeof a==="string"},Sa=j.isNumber=function(a){return typeof a=== "number"},x=j.isHash=function(a){return ra.call(a)==="[object Object]"},W=j.isArray=function(a){return ra.call(a)==="[object Array]"},Ta=j.isElement=function(a){return a&&a.tagName};j.isNode=function(a){return a&&a.nodeType};var n=j.$=function(a){if(typeof a==="string")a=r.getElementById(a);if(a)if("_rjs_id"in a&&a._rjs_id in ja)a=ja[a._rjs_id];else if(a.nodeType===1)a=new s(a);else if(Ta(a.target)||Ta(a.srcElement))a=new La(a);else if(a.nodeType===9)a=new Y(a);else if(a.window==a)a=new ca(a);return a}, hb=j.$$=function(a,b){return n(b||r).find(a)},ta=j.$E=function(a,b){return new s(a,b)},S=j.$w=function(a){return a.trim().split(/\\s+/)},o=j.$A=function(a){try{return Ca.call(a)}catch(b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=a[d];return c}},ua=j.$uid=function(a){return"_rjs_id"in a?a._rjs_id:a._rjs_id=sa++};if(x(Qa))x=j.isHash=function(a){return ra.call(a)==="[object Object]"&&a!==null&&typeof a!=="undefined"&&typeof a.hasOwnProperty!=="undefined"};for(var C=0,K="Array Function Number String Date RegExp".split(" "), ea=function(){for(var a=0;a<arguments.length;a++)if(x(arguments[a])){I(this[q],arguments[a]);I(this.Methods,arguments[a])}};C<K.length;C++)I(j[K[C]]=P[K[C]],{Methods:{},include:ea});j.Object=u;j.Math=w;I(u,{keys:function(a){var b=[],c;for(c in a)b.push(c);return b},values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},each:function(a,b,c){for(var d in a)b.call(c,d,a[d]);return a},empty:function(a){for(var b in a)return false;return true},without:function(){var a=o(arguments),b=a.shift(), c={},d;for(d in b)a.includes(d)||(c[d]=b[d]);return c},only:function(){for(var a=o(arguments),b=a.shift(),c={},d=0,e=a.length;d<e;d++)if(a[d]in b)c[a[d]]=b[a[d]];return c},merge:function(){for(var a={},b=0,c=arguments.length;b<c;b++)x(arguments[b])&&I(a,arguments[b]);return a},toQueryString:function(a){var b=[],c,d,e=encodeURIComponent;for(c in a){d=Q(a[c]);for(var f=0;f<d.length;f++)b.push(e(c)+"="+e(d[f]))}return b.join("&")}},true);var Ua=w.random;w.random=function(a,b){if(arguments.length===0)return Ua(); else if(arguments.length===1){b=a;a=0}return~~(Ua()*(b-a+1)+~~a)};var ib=J.sort;C=function(a,b,c){return eval("[function(c,s){for(var "+a+"i=0,l=this.length;i<l;i++){"+b.replace("_","c.call(s,this[i],i,this)")+"}"+c+"}]")[0]};var Va=J.forEach||C("","_",""),jb=J.filter||C("r=[],j=0,","if(_)r[j++]=this[i]","return r"),kb=C("r=[],j=0,","if(!_)r[j++]=this[i]","return r"),lb=J.map||C("r=[],","r[i]=_","return r"),mb=J.some||C("","if(_)return true","return false"),nb=J.every||C("","if(!_)return false","return true"), ob=C("","if(_)return this[i]","return [][0]"),pb=function(a,b){for(var c=this.length-1;c>-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<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:J.lastIndexOf||function(a){for(var b=this.length-1;b>-1;b--)if(this[b]===a)return b;return-1},first:function(){return arguments.length?R(ob,this,arguments):this[0]},last:function(){return arguments.length? R(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(){R(Va,this,arguments);return this},forEach:Va,map:function(){return R(lb,this,arguments)},filter:function(){return R(jb,this,arguments)},reject:function(){return R(kb,this,arguments)},some:function(a){return R(mb,this, a?arguments:[Da])},every:function(a){return R(nb,this,a?arguments:[Da])},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;c<e;c++){b=arguments[c];b=Q(b);for(d=0;d<b.length;d++)a.indexOf(b[d])==-1&&a.push(b[d])}return a},flatten:function(){var a=[];this.forEach(function(b){if(W(b))a=a.concat(b.flatten());else a.push(b)});return a},compact:function(){return this.without(null,undefined)}, uniq:function(){return[].merge(this)},includes:function(){for(var a=0,b=arguments.length;a<b;a++)if(this.indexOf(arguments[a])==-1)return false;return true},without:function(){var a=o(arguments);return this.filter(function(b){return!a.includes(b)})},shuffle:function(){for(var a=this.clone(),b,c,d=a.length;d>0;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||!Sa(this[0])?arguments:[Ea])},sortBy:function(){var a=Ba(arguments,this);return this.sort(function(b, c){return Ea(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<b;c+=this[a++]);return c}});B(J,{include:"includes"});M.include({empty:function(){return this==""},blank:function(){return/^\\s*$/.test(this)},trim:M[q].trim||function(){for(var a=this.replace(/^\\s\\s*/,""),b=a.length;/\\s/.test(a.charAt(--b)););return a.slice(0,b+1)},stripTags:function(){return this.replace(/<\\/?[^>]+>/ig, "")},stripScripts:function(a){var b="",c=this.replace(/<script[^>]*>([\\s\\S]*?)<\\/script>/img,function(d,e){b+=e+"\\n";return""});if(a===true)Ra(b);else $(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(M[q],{include:"includes"});V.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 ma(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 ma(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}}});ma.include({times:function(a,b){for(var c=0;c<this;c++)a.call(b, c);return this},upto:function(a,b,c){for(var d=this+0;d<=a;d++)b.call(c,d);return this},downto:function(a,b,c){for(var d=this+0;d>=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 this<a?a:this+0},max:function(a){return this>a?a:this+0}});RegExp.escape=function(a){return(""+a).replace(/([.*+?\\^=!:${}()|\\[\\]\\/\\\\])/g, "\\\\$1")};E=j.Class=function(){function a(){"prebind"in this&&W(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&&!x(c)){d=c;c={}}I(a,Wa).inherit(d);Fa(a,c);return a.include(c)};V=S("selfExtended self_extended selfIncluded self_included");var qb=V.concat(S(q+" parent extend include")),rb=V.concat(["constructor"]),Wa={inherit:function(a){if(a&&a[q]){var b= ba();b[q]=a[q];this[q]=new b;this.parent=a}for(this.ancestors=[];a;){this.ancestors.push(a);a=a.parent}return this[q].constructor=this},extend:function(){o(arguments).filter(x).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(q);o(arguments).filter(x).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&&$(i[d])});this[q][d]=!f?e:function(){this.$super=f[d];return e.apply(this,arguments)}},this);c&&c.call(b,this)},this);return this}};V=j.Options={setOptions:function(a){a=this.options=u.merge(na(this,"options"),a);var b,c;if($(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(x(a.last())?a.pop():{});return a}};var fa=j.Observer=new E({include:V,initialize:function(a){this.setOptions(a); aa(this,na(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(W(d))for(c=0;c<d.length;c++)this.on.apply(this,[b].concat(Q(d[c])).concat(a))}}else for(c in b)this.on.apply(this,[c].concat(Q(b[c])).concat(a));return this},observes:function(a,b){if(!L(a)){b=a;a=null}if(L(b))b= this[b];return(this.$listeners||[]).some(function(c){return a&&b?c.e===a&&c.f===b:a?c.e===a:c.f===b})},stopObserving:function(a,b){if(x(a))for(var c in a)this.stopObserving(c,a[c]);else{if(!L(a)){b=a;a=null}if(L(b))b=this[b];this.$listeners=(this.$listeners||[]).filter(function(d){return a&&b?d.e!==a||d.f!==b:a?d.e!==a:d.f!==b},this)}return this},listeners:function(a){return(this.$listeners||[]).filter(function(b){return!a||b.e===a}).map(function(b){return b.f}).uniq()},fire:function(){var a=o(arguments), b=a.shift();(this.$listeners||[]).each(function(c){c.e===b&&c.f.apply(this,c.a.concat(a))},this);return this}});J=fa.create=function(a,b){I(a,u.without(fa[q],"initialize","setOptions"),true);return aa(a,b||na(a,"events"))};var aa=fa.createShortcuts=function(a,b){(b||[]).each(function(c){var d="on"+c.replace(/(^|_|:)([a-z])/g,function(e,f,i){return i.toUpperCase()});d in a||(a[d]=function(){return this.on.apply(this,[c].concat(o(arguments)))})});return a};j.Break=new E(Error,{message:"Manual break"}); K=navigator.userAgent;C="attachEvent"in P;ea="opera"in P;var H=j.Browser={IE:C&&!ea,Opera:ea,WebKit:K.include("AppleWebKit/"),Gecko:K.include("Gecko")&&!K.include("KHTML"),MobileSafari:/Apple.*Mobile.*Safari/.test(K),Konqueror:K.include("Konqueror"),OLD:C&&!ea&&!r.querySelector},T=j.Wrapper=function(a,b){var c=function(d,e){this.initialize(d,e);var f=this,i=f._;if(this.constructor===s&&i.tagName in O){f=new O[i.tagName](i);if("$listeners"in this)f.$listeners=this.$listeners}i="_rjs_id"in i?i._rjs_id: i._rjs_id=sa++;return ja[i]=f};if(!b){b=a;a=null}I(c,Wa).inherit(a||T);Fa(c,b);return c.include({_:undefined},b)};T.Cache=ja;var Y=j.Document=new T({initialize:function(a){this._=a},window:function(){return n(this._.defaultView||this._.parentWindow)}}),ca=j.Window=new T({initialize:function(a){this._=a;this.d=a.document},window:function(){return this},size:function(){var a=this._,b=this.d.documentElement;return a.innerWidth?{x:a.innerWidth,y:a.innerHeight}:{x:b.clientWidth,y:b.clientHeight}},scrolls:function(){var a= this._,b=this.d,c=b.body;b=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:b.scrollLeft,y:b.scrollTop}},scrollTo:function(a,b,c){var d=a,e=b,f=n(a);if(f&&f instanceof s)a=f.position();if(x(a)){e=a.y;d=a.x}x(c=c||b)&&j.Fx?(new v.Scroll(this,c)).start({x:d,y:e}):this._.scrollTo(d,e);return this}}),La=j.Event=new T({type:null,which:null,keyCode:null,target:null,currentTarget:null,relatedTarget:null, pageX:null,pageY:null,initialize:function(a,b){if(typeof a==="string"){a=u.merge({type:a},b);this.stopped=a.bubbles===false;x(b)&&I(this,b)}this._=a;this.type=a.type;this.which=a.which;this.keyCode=a.keyCode;this.target=n(a.target);this.currentTarget=n(a.currentTarget);this.relatedTarget=n(a.relatedTarget);this.pageX=a.pageX;this.pageY=a.pageY;if(!("target"in a)&&"srcElement"in a){this.which=a.button==2?3:a.button==4?2:1;this.target=n(a.srcElement)||b;this.relatedTarget=this.target._===a.fromElement? n(a.toElement):this.target;this.currentTarget=b;var c=this.target.window().scrolls();this.pageX=a.clientX+c.x;this.pageY=a.clientY+c.y}else if(a.target&&"nodeType"in a.target&&a.target.nodeType===3)this.target=n(a.target.parentNode)},stopPropagation:function(){if("stopPropagation"in this._)this._.stopPropagation();else this._.cancelBubble=true;this.stopped=true;return this},preventDefault:function(){if("preventDefault"in this._)this._.preventDefault();else this._.returnValue=false;return this},stop:function(){return this.stopPropagation().preventDefault()}, position:function(){return{x:this.pageX,y:this.pageY}},find:function(a){if(this.target instanceof s){var b=this.target;b=[b].concat(b.parents());var c=this.currentTarget.find(a);return b.first(function(d){return c.include(d)})}}}),pa=[],Xa={id:"id",html:"innerHTML","class":"className"},Ya={style:"setStyle",on:"on"},O={},va={};K=function(a,b){this._=a=(a in va?va[a]:va[a]=r.createElement(a)).cloneNode(false);if(b!==undefined)for(var c in b)if(c in Xa)a[Xa[c]]=b[c];else c in Ya?this[Ya[c]](b[c]):this.set(c, b[c])};try{r.createElement("<input/>");K=eval("["+K.toString().replace(/(\\((\\w+),\\s*(\\w+)\\)\\s*\\{)/,\'$1if($2==="input"&&$3)$2="<input name="+$3.name+" type="+$3.type+($3.checked?" checked":"")+"/>";\')+"]")[0]}catch(wb){}var s=j.Element=new T({initialize:function(a,b){if(typeof a==="string")this.construct(a,b);else this._=a},construct:K});s.Wrappers=O;s.include({parent:function(a){return a?this.parents(a)[0]:n(this._.parentNode||null)},parents:function(a){return oa(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 oa(this,"nextSibling",a)},prevSiblings:function(a){return oa(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 s)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(a){return this.insert(L(a)?o(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}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._rjs_id=sa++;return new s(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)}},Ga={TBODY:["<TABLE>","</TABLE>",2],TR:["<TABLE><TBODY>","</TBODY></TABLE>",3],TD:["<TABLE><TBODY><TR>","</TR></TBODY></TABLE>",4],COL:["<TABLE><COLGROUP>","</COLGROUP><TBODY></TBODY></TABLE>",2],LEGEND:["<FIELDSET>","</FIELDSET>",2],AREA:["<map>","</map>",2],OPTION:["<SELECT>", "</SELECT>",2]};B(Ga,{OPTGROUP:"OPTION",THEAD:"TBODY",TFOOT:"TBODY",TH:"TD"});var Ha=r.createDocumentFragment(),fb=r.createElement("DIV");s.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(H.IE)f.filter="alpha(opacity="+a[c]*100+")";else f.opacity=a[c];else if(c==="float")d=H.IE?"styleFloat":"cssFloat"; f[d]=a[c]}return this},getStyle:function(a){return Ia(this._.style,a)||Ia(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)}});s.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.visible()?"hide":"show"](a,b)},radio:function(a,b){this.siblings().each("hide", a,b);return this.show()}});s.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.x<b.x+c.x&&a.y>b.y&&a.y<b.y+c.y},setWidth:function(a){var b=this._.style;b.width=a+"px";b.width=2*a-this._.offsetWidth+"px";return this},setHeight:function(a){var b=this._.style;b.height=a+"px";b.height=2*a-this._.offsetHeight+"px";return this},resize:function(a,b){if(x(a)){b=a.y;a=a.x}return this.setWidth(a).setHeight(b)},moveTo:function(a, b){if(x(a)){b=a.y;a=a.x}return this.setStyle({left:a+"px",top:b+"px"})},scrollTo:function(a,b){if(x(a)){b=a.y;a=a.x}this._.scrollLeft=a;this._.scrollTop=b;return this},scrollThere:function(a){this.window().scrollTo(this,a);return this}});var X=J({});ha("on",/(\\$listeners\\.push\\((\\w+?)\\);)/,\'$1$2.e=$2.n=$2.e==="rightclick"?"contextmenu":$2.e;\'+(H.Gecko?\'if($2.n==="mousewheel")$2.n="DOMMouseScroll";\':"")+(H.Konqueror?\'if($2.n==="contextmenu")$2.n="rightclick";\':"")+\'$2.w=function(){var a=$A(arguments),_;$2.r&&$2.r!=="stopEvent"?a.shift():_=a[0]=new RightJS.Event(a[0],this);$2.f.apply($2.t,a.concat($2.a))===false&&_.stop()};$2.t=this;\'+ (C?\'$2.w=$2.w.bind(this);this._.attachEvent("on"+$2.n,$2.w);\':"this._.addEventListener($2.n,$2.w,false);"));ha("stopObserving",/(function\\s*\\((\\w+)\\)\\s*\\{\\s*)(return\\s*)([^}]+)/m,"$1var r=$4;if(!r)"+(C?\'this._.detachEvent("on"+$2.n,$2.w);\':"this._.removeEventListener($2.n,$2.w,false);")+"$3 r");ha("fire",/(\\w+)(\\s*=\\s*(\\w+).shift\\(\\))/,"$1$2;$1=$1 instanceof RightJS.Event?$1:new RightJS.Event($1,Object.merge({target:this._},$3[0]));$1.currentTarget=this");ha("fire",/((\\w+)\\.e\\s*===\\s*(\\w+))([^}]+\\2\\.f\\.apply)[^}]+?\\.concat\\(\\w+\\)\\)/, \'$1.type$4(this,(($2.r&&$1.r!=="stopEvent")?[]:[$3]).concat($2.a))\');X.stopEvent=function(a){a.stop()};s.include(X);Y.include(X);ca.include(X);aa(ca[q],S("blur focus scroll resize load"));Ja("click rightclick contextmenu mousedown mouseup mouseover mouseout mousemove keypress keydown keyup");[s,Y].each("include",{first:function(a){return n(this._.querySelector(Ka(a,this)))},find:function(a){return o(this._.querySelectorAll(Ka(a,this))).map(n)}});s.include({match:function(a){var b=this._.tagName=== "HTML"?this._.ownerDocument:this.parents().last();a=n(b||ta("p").insert(this)).find(a).include(this);b||this.remove();return a}});[ca,Y].each(function(a){a=a[q];var b=a.on;a.on=function(c){if(c=="ready"&&!this._wR){var d=this._,e=this.fire.bind(this,"ready");d=d.nodeType==9?d:d.document;"readyState"in d?function(){["loaded","complete"].includes(d.readyState)?e():arguments.callee.delay(50)}():d.addEventListener("DOMContentLoaded",e,false);this._wR=true}return b.apply(this,arguments)};aa(a,["ready"])}); B(s[q],{subNodes:"children",sizes:"size",select:"find"});B(Y[q],{select:"find"});B(ca[q],{sizes:"size"});var wa=j.Form=O.FORM=new T(s,{initialize:function(a){a=a||{};var b="remote"in a,c=a;if(x(a)){c="form";a=u.without(a,"remote")}this.$super(c,a);b&&this.remotize()},elements:function(){return this.find("input,button,select,textarea")},inputs:function(){return this.elements().filter(function(a){return!["submit","button","reset","image",null].includes(a._.type)})},input:function(a){return n(this._[a])}, focus:function(){var a=this.inputs().first(function(b){return b._.type!=="hidden"});a&&a.focus();return this},blur:function(){this.elements().each("blur");return this},disable:function(){this.elements().each("disable");return this},enable:function(){this.elements().each("enable");return this},values:function(){var a={},b,c,d;this.inputs().each(function(e){d=e._;c=d.name;if(!d.disabled&&c&&(!["checkbox","radio"].includes(d.type)||d.checked)){b=e.getValue();if(c.endsWith("[]"))b=(a[c]||[]).concat([b]); a[c]=b}});return a},serialize:function(){return u.toQueryString(this.values())},submit:function(){this._.submit();return this},reset:function(){this._.reset();return this}});Ja("submit reset focus blur disable enable change");B(wa[q],{getElements:"elements"});var tb=s[q].insert,Za=j.Input=O.INPUT=O.BUTTON=O.SELECT=O.TEXTAREA=O.OPTGROUP=new T(s,{initialize:function(a,b){if(!a||x(a)){b=a||{};if(/textarea|select/.test(b.type||"")){a=b.type;delete b.type}else a="input"}this.$super(a,b)},form:function(){return n(this._.form)}, insert:function(a,b){tb.call(this,a,b);this._.tagName==="SELECT"&&L(a)&&o(this._.getElementsByTagName("option")).each(function(c){c.selected=!!c.getAttribute("selected")});return this},update:function(a){return this.clean().insert(a)},getValue:function(){return this._.type=="select-multiple"?o(this._.getElementsByTagName("option")).map(function(a){return a.selected?a.value:null}).compact():this._.value},setValue:function(a){if(this._.type=="select-multiple"){a=Q(a).map(M);o(this._.getElementsByTagName("option")).each(function(b){b.selected= a.includes(b.value)})}else this._.value=a;return this},value:function(a){return this[a===undefined?"getValue":"setValue"](a)},focus:function(){this._.focus();this.focused=true;H.IE&&this.fire("focus",{bubbles:false});return this},blur:function(){this._.blur();this.focused=false;H.IE&&this.fire("blur",{bubbles:false});return this},select:function(){this._.select();return this.focus()},disable:function(){this._.disabled=true;return this.fire("disable")},enable:function(){this._.disabled=false;return this.fire("enable")}, disabled:function(a){return a===undefined?this._.disabled:this[a?"disable":"enable"]()},checked:function(a){if(a===undefined)a=this._.checked;else{this._.checked=a;a=this}return a}});s[q].fire=eval("["+X.fire.toString().replace(/(\\w+)(\\s*=\\s*\\w+\\.shift[\\s\\S]+)(return this)/m,"$1$2var p=!$1.stopped&&this.parent&&this.parent();p&&p.fire&&p.fire($1);$3")+"]")[0];if(H.IE){r.attachEvent("onfocusin",ia);r.attachEvent("onfocusout",ia)}else{r.addEventListener("focus",ia,true);r.addEventListener("blur",ia, true)}if(!Ma("onsubmit","form")){B=function(a){var b=n(a),c=b.target._,d=c.type;c=c.form;var e;if(c&&(e=n(c).parent())&&(a.keyCode===13&&(d==="text"||d==="password")||a.type==="click"&&(d==="submit"||d==="image"))){b.type="submit";b.target=n(c);e.fire(b)}};r.attachEvent("onclick",B);r.attachEvent("onkeypress",B)}if(!Ma("onchange","input")){var $a=function(a){var b=a._,c=b.type;return c==="radio"||c==="checkbox"?b.checked:a.getValue()},ab=function(a,b){var c=b.parent(),d=$a(b);if(c&&""+b._prev_value!== ""+d){b._prev_value=d;a.type="change";c.fire(a)}};B=function(a){a=n(a);var b=a.target,c=b._.type,d=b._.tagName,e=c==="radio"||c==="checkbox";if(a.type==="click"&&(e||d==="SELECT")||a.type==="keydown"&&(a.keyCode==13&&d!=="TEXTAREA"||c==="select-multiple"))ab(a,b)};r.attachEvent("onclick",B);r.attachEvent("onkeydown",B);r.attachEvent("onfocusout",function(a){a=n(a);var b=a.target;b instanceof Za&&ab(a,b)});r.attachEvent("onbeforeactivate",function(a){a=n(a).target;if(a instanceof Za)a._prev_value= $a(a)})}[s,Y].each("include",{delegate:function(a){var b=Na(arguments),c,d,e;for(c in b){d=0;for(e=b[c];d<e.length;d++){this.on(a,gb(c,e[d],this));I(this.$listeners.last(),{dr:c,dc:e[d][0]})}}return this},undelegate:function(){Oa(arguments,this).each(function(a){this.stopObserving(a.n,a.f)},this);return this},delegates:function(){return!!Oa(arguments,this).length}});u.each({on:"delegate",stopObserving:"undelegate",observes:"delegates"},function(a,b){M[q][a]=function(){var c=n(r),d=o(arguments);d.splice(1, 0,""+this);d=c[b].apply(c,d);return d===c?this:d}});var bb=M[q].on;M[q].on=function(a){if(x(a))for(var b in a)bb.apply(this,[b].concat([a[b]]));else bb.apply(this,arguments);return this};pa.each(function(a){M[q]["on"+a.capitalize()]=function(){return this.on.apply(this,[a].concat(o(arguments)))}});var t=j.Xhr=new E(fa,{extend:{EVENTS:S("success failure complete request cancel create"),Options:{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript,text/html,application/xml,text/xml,*/*"}, method:"post",encoding:"utf-8",async:true,evalScripts:false,evalResponse:false,evalJS:true,evalJSON:true,secureJSON:true,urlEncoded:true,spinner:null,spinnerFx:"fade",params:null,iframed:false,jsonp:false},load:function(a,b){return(new this(a,u.merge({method:"get"},b))).send()}},initialize:function(a,b){this.initCallbacks();this.url=a;I(this.$super(b),this.options);if(t.Options.spinner&&n(this.spinner)===n(t.Options.spinner))this.spinner=null},setHeader:function(a,b){this.headers[a]=b;return this}, getHeader:function(a){var b;try{b=this.xhr.getResponseHeader(a)}catch(c){}return b},successful:function(){return this.status>=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=ba();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 wa){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))Ra(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(P.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"});wa.include({send:function(a){a=a||{};a.method=a.method|| this._.method||"post";(new t(this._.action||r.location.href,a)).onComplete(this.enable.bind(this)).send(this);this.disable.bind(this).delay(1);return this},remotize:function(a){if(!this.observes("submit",qa)){this.on("submit",qa,a);this.remote=true}return this},unremotize:function(){this.stopObserving("submit",qa);this.remote=false;return this}});s.include({load:function(a,b){(new t(a,u.merge({method:"get"},b))).update(this);return this}});t.Dummy={open:ba(),abort:ba(),setRequestHeader:ba(),onreadystatechange:ba()}; t.IFramed=new E({include:t.Dummy,initialize:function(a){this.form=a;this.id="xhr_"+(new Date).getTime();a.insert(\'<i><iframe name="\'+this.id+\'" id="\'+this.id+\'" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>\',"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=P[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=ta("script",{charset:a.encoding,async:a.async})},open:function(a,b){this.url=b;this.method=a},send:function(a){P[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(fa,{extend:{EVENTS:S("start finish cancel"),Durations:{"short":200,normal:400,"long":800},Options:{fps:H.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=ua(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}});M.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"};M.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(""):M.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=s.prototype;var cb=B.hide,xa=B.show,db=B.remove,ub=B.scrollTo;s.include({stop:function(){(v.cr[ua(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.visible()?this.fx(a,["in",b]):xa.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 x(b)?this.scroll(a,b):ub.apply(this,arguments)},fx:function(a,b){var c=o(b).compact(),d=x(c.last())?c.pop():{};d=new (v[a.capitalize()])(this,d);d.start.apply(d,c);return this}});var ka=S("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;e<c.length;e++)for(f=0;f<ka.length;f++)b.push("border"+ka[f]+c[e]);else if(d=="margin"||d=="padding"){e=b;f=d;for(var i=ka,z=0;z<i.length;z++)e.push(f+i[z])}else if(d.startsWith("background")){e=b;f=["Color","Position","PositionX","PositionY"];for(i=0;i<f.length;i++)e.push("background"+f[i])}else d=="opacity"&&H.IE?b.push("filter"):b.push(d);c=this._cloneStyle(this.element,b);a=this._endStyle(a,b);b=this.element;d=[]; var k;for(k in a)if((k=="width"||k=="height")&&c[k]=="auto")c[k]=b._["offset"+k.capitalize()]+"px";if(a.filter&&!c.filter)c.filter="alpha(opacity=100)";for(e=0;e<4;e++){z=ka[e];f="border"+z+"Style";i="border"+z+"Width";z="border"+z+"Color";if(f in c&&c[f]!=a[f]){var ga=b._.style;if(c[f]=="none")ga[i]="0px";ga[f]=a[f];if(da(c[z]))ga[z]=b.getStyle("Color")}}for(k in a){if(a[k]!==c[k]&&!d.includes(k)&&/color/i.test(k)){if(H.Opera){a[k]=a[k].replace(/"/g,"");c[k]=c[k].replace(/"/g,"")}da(a[k])||(a[k]= a[k].toRgb());da(c[k])||(c[k]=c[k].toRgb());if(!a[k]||!c[k])a[k]=c[k]=""}if(/\\d/.test(a[k])&&!/\\d/.test(c[k]))c[k]=a[k].replace(/[\\d\\.\\-]+/g,"0");if(a[k]===c[k]||d.includes(k)||!/\\d/.test(c[k])||!/\\d/.test(a[k])){delete a[k];delete c[k]}}this.before=Pa(c);this.after=Pa(a)},render:function(a){var b,c,d,e=this.element._.style,f,i,z;for(f in this.after){b=this.before[f];c=this.after[f];i=0;for(z=c.length;i<z;i++){d=b[i]+(c[i]-b[i])*a;if(c.r)d=w.round(d);c.t[i*2+1]=d}e[f]=c.t.join("")}},_endStyle:function(a, b){var c=this.element,d=c.clone().setStyle("position:absolute;z-index:-1;visibility:hidden").setWidth(c.size().x).setStyle(a);c.parent()&&c.insert(d,"before");c=this._cloneStyle(d,b);d.remove();return c},_cloneStyle:function(a,b){for(var c=0,d=b.length,e=a.computedStyles(),f={},i;c<d;c++){i=b[c];if(i in e)f[i]=""+e[i];if(i==="opacity")f[i]=f[i].replace(",",".")}return f}});v.Highlight=new E(v.Morph,{extend:{Options:u.merge(v.Options,{color:"#FF8",transition:"Exp"})},prepare:function(a,b){var c=this.element, d=c._.style,e=b||c.getStyle("backgroundColor");if(da(e)){this.onFinish(function(){d.backgroundColor="transparent"});e=[c].concat(c.parents()).map(function(f){return(f=f.getStyle("backgroundColor"))&&!da(f)?f:null}).compact().first()||"#FFF"}d.backgroundColor=a||this.options.color;return this.$super({backgroundColor:e})}});v.Twin=new E(v.Morph,{finish:function(){this.how=="out"&&cb.call(this.element);return this.$super()},setHow:function(a){this.how=a||"toggle";if(this.how=="toggle")this.how=this.element.visible()? "out":"in"}});v.Slide=new E(v.Twin,{extend:{Options:u.merge(v.Options,{direction:"top"})},prepare:function(a){this.setHow(a);var b=xa.call(this.element);this.size=b.size();this.styles={};S("overflow height width marginTop marginLeft").each(function(c){this.styles[c]=b._.style[c]},this);b._.style.overflow="hidden";this.onFinish("_getBack").onCancel("_getBack");return this.$super(this._getStyle(this.options.direction))},_getBack:function(){this.element.setStyle(this.styles)},_getStyle:function(a){var b= {},c=this.size,d=this.styles.marginLeft.toFloat()||0,e=this.styles.marginTop.toFloat()||0;if(this.how=="out"){b[["top","bottom"].includes(a)?"height":"width"]="0px";if(a=="right")b.marginLeft=d+c.x+"px";else if(a=="bottom")b.marginTop=e+c.y+"px"}else if(this.how=="in"){var f=this.element._.style;if(["top","bottom"].includes(a)){b.height=c.y+"px";f.height="0px"}else{b.width=c.x+"px";f.width="0px"}if(a=="right"){b.marginLeft=d+"px";f.marginLeft=d+c.x+"px"}else if(a=="bottom"){b.marginTop=e+"px";f.marginTop= e+c.y+"px"}}return b}});v.Fade=new E(v.Twin,{prepare:function(a){this.setHow(a);this.how=="in"&&xa.call(this.element.setStyle({opacity:0}));return this.$super({opacity:Sa(a)?a:this.how=="in"?1:0})}});v.Scroll=new E(v,{initialize:function(a,b){a=n(a);this.$super(a instanceof ca?a._.document[H.WebKit?"body":"documentElement"]:a,b)},prepare:function(a){var b=this.before={},c=this.element._;this.after=a;if("x"in a)b.x=c.scrollLeft;if("y"in a)b.y=c.scrollTop},render:function(a){var b=this.before,c;for(c in b)this.element._["scroll"+ (c=="x"?"Left":"Top")]=b[c]+(this.after[c]-b[c])*a}});j.Cookie=new E({include:V,extend:{set:function(a,b,c){return(new this(a,c)).set(b)},get:function(a){return(new this(a)).get()},remove:function(a){return(new this(a)).remove()},enabled:function(){r.cookie="__t=1";return r.cookie.indexOf("__t=1")!=-1},Options:{secure:false,document:r}},initialize:function(a,b){this.name=a;this.setOptions(b)},set:function(a){a=encodeURIComponent(a);var b=this.options;if(b.domain)a+="; domain="+b.domain;if(b.path)a+= "; path="+b.path;if(b.duration){var c=new Date;c.setTime(c.getTime()+b.duration*24*60*60*1E3);a+="; expires="+c.toGMTString()}if(b.secure)a+="; secure";b.document.cookie=this.name+"="+a;return this},get:function(){var a=this.options.document.cookie.match("(?:^|;)\\\\s*"+RegExp.escape(this.name)+"=([^;]*)");return a?decodeURIComponent(a[1]):null},remove:function(){this.options.duration=-1;return this.set("")}});if(j.Browser.OLD)n=j.$=function(a){return function(b){var c=a(b);if(c&&c instanceof j.Element&& j.isString(b)&&c._.id!==b)c=j.$(r).first("#"+b);return c}}(j.$);j.$E("p").getBoundingClientRect||j.Element.include({position:function(){var a=this._,b=a.offsetTop,c=a.offsetLeft;for(a=a.offsetParent;a;){b+=a.offsetTop;c+=a.offsetLeft;a=a.offsetParent}return{x:c,y:b}}});r.querySelector||function(a){function b(g){if(!ya[g]){var h,p,l,A,N,D,y={};for(l=g;h=l.match(vb);){A=A||{};A[h[1]]={o:h[2],v:h[5]||h[6]};l=l.replace(h[0],"")}if(h=l.match(ga)){N=h[1];D=h[3]==""?null:h[3];l=l.replace(h[0],"")}h=(l.match(i)|| [1,null])[1];p=(l.match(z)||"*").toString().toUpperCase();l=(l.match(k)||[1,""])[1].split(".").without("");y.tag=p;if(h||l.length||A||N){var F="function(y){var e,r=[],z=0,x=y.length;for(;z<x;z++){e=y[z];_f_}return r}",G=function(U){F=F.replace("_f_",U+"_f_")};h&&G("if(e.id!=i)continue;");l.length&&G(\'if(e.className){var n=e.className.split(" ");if(n.length==1&&c.indexOf(n[0])==-1)continue;else{for(var i=0,l=c.length,b=false;i<l;i++)if(n.indexOf(c[i])==-1){b=true;break;}if(b)continue;}}else continue;\'); A&&G(\'var p,o,v,k,b=false;for (k in a){p=e.getAttribute(k)||"";o=a[k].o||"";v=a[k].v||"";if((o===""&&e.getAttributeNode(k)===null)||(o==="="&&p!=v)||(o==="*="&&!p.includes(v))||(o==="^="&&!p.startsWith(v))||(o==="$="&&!p.endsWith(v))||(o==="~="&&!p.split(" ").includes(v))||(o==="|="&&!p.split("-").includes(v))){b=true;break;}}if(b){continue;}\');N in e&&G("if(!S[P].call(e,V,S))continue;");y.filter=eval("[function(i,t,c,a,P,V,S,s){return eval(\'[\'+s+\']\')[0]}]")[0](h,p,l,A,N,D,e,F.replace("_f_","r.push(e)"))}ya[g]= y}return ya[g]}function c(g){var h=g.join("");if(!za[h]){for(var p=0;p<g.length;p++)g[p][1]=b(g[p][1]);var l=ua,A=function(D){for(var y=[],F=[],G,U=0,Z=D.length;U<Z;U++){G=l(D[U]);if(!F[G]){y.push(D[U]);F[G]=true}}return y},N=function(D,y){var F=d[y[0]](D,y[1].tag);return y[1].filter?y[1].filter(F):F};za[h]=function(D){for(var y,F,G=0,U=g.length;G<U;G++)if(G===0)y=N(D,g[G]);else{if(G>1)y=A(y);for(var Z=0;Z<y.length;Z++){F=N(y[Z],g[G]);F.unshift(1);F.unshift(Z);y.splice.apply(y,F);Z+=F.length-3}}return g.length> 1?A(y):y}}return za[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\\-\\._]+)/,ga=/:([\\w\\-]+)(\\((.+?)\\))*$/,vb=/\\[((?:[\\w\\-]*:)?[\\w\\-]+)\\s*(?:([!\\^$*~|]?=)\\s*(([\'"])([^\\4]*?)\\4|([^\'"][^\\]]*?)))?\\]/,ya= {},za={},Aa={},la={first:function(g){return this.find(g)[0]},find:function(g){var h=this._;g=g||"*";if(!Aa[g]){f.lastIndex=0;for(var p=[],l=[],A=" ",N,D;N=f.exec(g);){D=N[1];if(D=="+"||D==">"||D=="~")A=D;else{l.push([A,D]);A=" "}if(N[2]){p.push(c(l));l=[]}}p.push(c(l));Aa[g]=p}g=Aa[g];p=[];l=0;for(A=g.length;l<A;l++)p=p.concat(g[l](h));return p.map(a.$)}};la.select=la.find;a.Element.include(la);a.Document.include(la)}(j);I(P,u.without(j,"version","modules"));return j}(window,document,Object,Array, String,Function,Number,Math);');
@@ -10,7 +10,7 @@
10
10
  * Copyright (C) 2010 Nikolay Nemshilov
11
11
  */
12
12
  var RightJS = (function(window, document, Object, Array, String, Function, Number, Math) {
13
-
13
+
14
14
  /**
15
15
  * The framework description object
16
16
  *
@@ -20,7 +20,7 @@ var RightJS = function(value) {
20
20
  return value; // <- a dummy method to emulate the safe-mode
21
21
  };
22
22
 
23
- RightJS.version = "2.0.0-rc2";
23
+ RightJS.version = "2.0.0";
24
24
  RightJS.modules =["core", "dom", "form", "events", "xhr", "fx", "cookie"];
25
25
 
26
26
 
@@ -39,13 +39,13 @@ RightJS.modules =["core", "dom", "form", "events", "xhr", "fx", "cookie"];
39
39
  /**
40
40
  * Some top-level variables to shortify the things
41
41
  */
42
- var
42
+ var
43
43
  PROTO = 'prototype', A_proto = Array[PROTO],
44
44
  to_s = Object[PROTO].toString, slice = A_proto.slice,
45
45
  dummy = function() { return function() {}; },
46
46
  HTML = document.documentElement, UID = 1, // !#server
47
- Wrappers_Cache = [], UID_KEY = '_rid'+ new Date().getTime(), // !#server
48
-
47
+ Wrappers_Cache = [], UID_KEY = '_rjs_id', // !#server
48
+
49
49
  /**
50
50
  * extends the first object with the keys and values of the second one
51
51
  *
@@ -57,7 +57,7 @@ Wrappers_Cache = [], UID_KEY = '_rid'+ new Date().getTime(), // !#server
57
57
  * @param Boolean flag if the function should not overwrite intersecting values
58
58
  * @return Object extended destination object
59
59
  */
60
- $ext = RightJS.$ext = function(dest, source, dont_overwrite) {
60
+ $ext = RightJS.$ext = function(dest, source, dont_overwrite) {
61
61
  var src = source || {}, key;
62
62
 
63
63
  for (key in src) {
@@ -212,7 +212,7 @@ $ = RightJS.$ = function(object) {
212
212
  if (typeof object === 'string') {
213
213
  object = document.getElementById(object);
214
214
  }
215
-
215
+
216
216
  if (object) {
217
217
  if (UID_KEY in object && object[UID_KEY] in Wrappers_Cache) {
218
218
  object = Wrappers_Cache[object[UID_KEY]];
@@ -226,7 +226,7 @@ $ = RightJS.$ = function(object) {
226
226
  object = new Window(object);
227
227
  }
228
228
  }
229
-
229
+
230
230
  return object;
231
231
  },
232
232
 
@@ -304,10 +304,10 @@ if (isHash(HTML)) {
304
304
  */
305
305
  var i=0, natives = 'Array Function Number String Date RegExp'.split(' '),
306
306
  include_native = function() {
307
- for (var i=0, args = arguments; i < args.length; i++) {
308
- if (isHash(args[i])) {
309
- $ext(this[PROTO], args[i]);
310
- $ext(this.Methods, args[i]);
307
+ for (var i=0; i < arguments.length; i++) {
308
+ if (isHash(arguments[i])) {
309
+ $ext(this[PROTO], arguments[i]);
310
+ $ext(this.Methods, arguments[i]);
311
311
  }
312
312
  }
313
313
  };
@@ -371,7 +371,7 @@ $ext(Object, {
371
371
  }
372
372
  return keys;
373
373
  },
374
-
374
+
375
375
  /**
376
376
  * extracts the list of the attribute values of the given object
377
377
  *
@@ -385,7 +385,7 @@ $ext(Object, {
385
385
  }
386
386
  return values;
387
387
  },
388
-
388
+
389
389
  /**
390
390
  * Calls the function with every key/value pair on the hash
391
391
  *
@@ -398,10 +398,10 @@ $ext(Object, {
398
398
  for (var key in object) {
399
399
  callback.call(scope, key, object[key]);
400
400
  }
401
-
401
+
402
402
  return object;
403
403
  },
404
-
404
+
405
405
  /**
406
406
  * checks if the object-hash has no keys
407
407
  *
@@ -412,7 +412,7 @@ $ext(Object, {
412
412
  for (var key in object) { return false; }
413
413
  return true;
414
414
  },
415
-
415
+
416
416
  /**
417
417
  * returns a copy of the object which contains
418
418
  * all the same keys/values except the key-names
@@ -425,16 +425,16 @@ $ext(Object, {
425
425
  */
426
426
  without: function() {
427
427
  var filter = $A(arguments), object = filter.shift(), copy = {}, key;
428
-
428
+
429
429
  for (key in object) {
430
430
  if (!filter.includes(key)) {
431
431
  copy[key] = object[key];
432
432
  }
433
433
  }
434
-
434
+
435
435
  return copy;
436
436
  },
437
-
437
+
438
438
  /**
439
439
  * returns a copy of the object which contains all the
440
440
  * key/value pairs from the specified key-names list
@@ -449,21 +449,21 @@ $ext(Object, {
449
449
  only: function() {
450
450
  var filter = $A(arguments), object = filter.shift(), copy = {},
451
451
  i=0, length = filter.length;
452
-
452
+
453
453
  for (; i < length; i++) {
454
454
  if (filter[i] in object) {
455
455
  copy[filter[i]] = object[filter[i]];
456
456
  }
457
457
  }
458
-
458
+
459
459
  return copy;
460
460
  },
461
-
461
+
462
462
  /**
463
463
  * merges the given objects and returns the result
464
464
  *
465
465
  * NOTE this method _DO_NOT_ change the objects, it creates a new object
466
- * which conatins all the given ones.
466
+ * which conatins all the given ones.
467
467
  * if there is some keys introspections, the last object wins.
468
468
  * all non-object arguments will be omitted
469
469
  *
@@ -481,7 +481,7 @@ $ext(Object, {
481
481
  }
482
482
  return object;
483
483
  },
484
-
484
+
485
485
  /**
486
486
  * converts a hash-object into an equivalent url query string
487
487
  *
@@ -500,6 +500,7 @@ $ext(Object, {
500
500
  }
501
501
  }, true);
502
502
 
503
+
503
504
  /**
504
505
  * here are the starndard Math object extends
505
506
  *
@@ -524,17 +525,18 @@ var Math_old_random = Math.random;
524
525
  * @return Float random between 0 and 1 if there's no arguments or an integer in the given range
525
526
  */
526
527
  Math.random = function(min, max) {
527
-
528
+
528
529
  if (arguments.length === 0) {
529
530
  return Math_old_random();
530
531
  } else if (arguments.length === 1) {
531
532
  max = min;
532
533
  min = 0;
533
534
  }
534
-
535
+
535
536
  return ~~(Math_old_random() * (max-min+1) + ~~min);
536
537
  };
537
538
 
539
+
538
540
  /**
539
541
  * The Array class extentions
540
542
  *
@@ -550,12 +552,12 @@ var original_sort = A_proto.sort,
550
552
  build_loop = function(pre, body, ret) {
551
553
  return eval('[function(c,s){'+
552
554
  'for(var '+pre+'i=0,l=this.length;i<l;i++){'+
553
- body.replace('_', 'c.call(s,this[i],i,this)') +
555
+ body.replace('_', 'c.call(s,this[i],i,this)') +
554
556
  '}' +
555
557
  ret +
556
558
  '}]')[0];
557
559
  },
558
-
560
+
559
561
  // JavaScript 1.6 methods recatching up or faking
560
562
  for_each = A_proto.forEach || build_loop('', '_', ''),
561
563
  filter = A_proto.filter || build_loop('r=[],j=0,', 'if(_)r[j++]=this[i]', 'return r'),
@@ -572,8 +574,8 @@ last = function(callback, scope) {
572
574
  }
573
575
  return null;
574
576
  };
575
-
576
-
577
+
578
+
577
579
  //
578
580
  // RightJS callbacks magick preprocessing
579
581
  //
@@ -581,7 +583,7 @@ last = function(callback, scope) {
581
583
  // prepares a correct callback function
582
584
  function guess_callback(argsi, array) {
583
585
  var callback = argsi[0], args = slice.call(argsi, 1), scope = array, attr;
584
-
586
+
585
587
  if (isString(callback)) {
586
588
  attr = callback;
587
589
  if (array.length && isFunction(array[0][attr])) {
@@ -592,18 +594,18 @@ function guess_callback(argsi, array) {
592
594
  } else {
593
595
  scope = args[0];
594
596
  }
595
-
597
+
596
598
  return [callback, scope];
597
599
  }
598
600
 
599
601
  // calls the given method with preprocessing the arguments
600
602
  function call_method(func, scope, args) {
601
603
  var result;
602
-
604
+
603
605
  try {
604
606
  result = func.apply(scope, guess_callback(args, scope));
605
607
  } catch(e) { if (!(e instanceof RightJS.Break)) { throw(e); } }
606
-
608
+
607
609
  return result;
608
610
  }
609
611
 
@@ -616,7 +618,7 @@ function boolean_check(i) {
616
618
  function default_sort(a, b) {
617
619
  return a > b ? 1 : a < b ? -1 : 0;
618
620
  }
619
-
621
+
620
622
  Array.include({
621
623
  /**
622
624
  * IE fix
@@ -634,7 +636,7 @@ Array.include({
634
636
  }
635
637
  return -1;
636
638
  },
637
-
639
+
638
640
  /**
639
641
  * IE fix
640
642
  * returns the last index of the value in the array
@@ -650,7 +652,7 @@ Array.include({
650
652
  }
651
653
  return -1;
652
654
  },
653
-
655
+
654
656
  /**
655
657
  * returns the first element of the array
656
658
  *
@@ -659,7 +661,7 @@ Array.include({
659
661
  first: function() {
660
662
  return arguments.length ? call_method(first, this, arguments) : this[0];
661
663
  },
662
-
664
+
663
665
  /**
664
666
  * returns the last element of the array
665
667
  *
@@ -668,7 +670,7 @@ Array.include({
668
670
  last: function() {
669
671
  return arguments.length ? call_method(last, this, arguments) : this[this.length-1];
670
672
  },
671
-
673
+
672
674
  /**
673
675
  * returns a random item of the array
674
676
  *
@@ -677,7 +679,7 @@ Array.include({
677
679
  random: function() {
678
680
  return this.length ? this[Math.random(this.length-1)] : null;
679
681
  },
680
-
682
+
681
683
  /**
682
684
  * returns the array size
683
685
  *
@@ -686,7 +688,7 @@ Array.include({
686
688
  size: function() {
687
689
  return this.length;
688
690
  },
689
-
691
+
690
692
  /**
691
693
  * cleans the array
692
694
  * @return Array this
@@ -695,7 +697,7 @@ Array.include({
695
697
  this.length = 0;
696
698
  return this;
697
699
  },
698
-
700
+
699
701
  /**
700
702
  * checks if the array has no elements in it
701
703
  *
@@ -704,7 +706,7 @@ Array.include({
704
706
  empty: function() {
705
707
  return !this.length;
706
708
  },
707
-
709
+
708
710
  /**
709
711
  * creates a copy of the given array
710
712
  *
@@ -713,7 +715,7 @@ Array.include({
713
715
  clone: function() {
714
716
  return this.slice(0);
715
717
  },
716
-
718
+
717
719
  /**
718
720
  * calls the given callback function in the given scope for each element of the array
719
721
  *
@@ -726,7 +728,7 @@ Array.include({
726
728
  return this;
727
729
  },
728
730
  forEach: for_each,
729
-
731
+
730
732
  /**
731
733
  * creates a list of the array items converted in the given callback function
732
734
  *
@@ -737,7 +739,7 @@ Array.include({
737
739
  map: function() {
738
740
  return call_method(map, this, arguments);
739
741
  },
740
-
742
+
741
743
  /**
742
744
  * creates a list of the array items which are matched in the given callback function
743
745
  *
@@ -748,7 +750,7 @@ Array.include({
748
750
  filter: function() {
749
751
  return call_method(filter, this, arguments);
750
752
  },
751
-
753
+
752
754
  /**
753
755
  * creates a list of the array items that are not matching the give callback function
754
756
  *
@@ -759,7 +761,7 @@ Array.include({
759
761
  reject: function() {
760
762
  return call_method(reject, this, arguments);
761
763
  },
762
-
764
+
763
765
  /**
764
766
  * checks if any of the array elements is logically true
765
767
  *
@@ -770,7 +772,7 @@ Array.include({
770
772
  some: function(value) {
771
773
  return call_method(some, this, value ? arguments : [boolean_check]);
772
774
  },
773
-
775
+
774
776
  /**
775
777
  * checks if all the array elements are logically true
776
778
  *
@@ -781,7 +783,7 @@ Array.include({
781
783
  every: function(value) {
782
784
  return call_method(every, this, value ? arguments : [boolean_check]);
783
785
  },
784
-
786
+
785
787
  /**
786
788
  * applies the given lambda to each element in the array
787
789
  *
@@ -795,7 +797,7 @@ Array.include({
795
797
  this.map.apply(this, arguments).forEach(function(value, i) { this[i] = value; }, this);
796
798
  return this;
797
799
  },
798
-
800
+
799
801
  /**
800
802
  * similar to the concat function but it adds only the values which are not on the list yet
801
803
  *
@@ -807,7 +809,7 @@ Array.include({
807
809
  for (var copy = this.clone(), arg, i=0, j, length = arguments.length; i < length; i++) {
808
810
  arg = arguments[i];
809
811
  arg = ensure_array(arg);
810
-
812
+
811
813
  for (j=0; j < arg.length; j++) {
812
814
  if (copy.indexOf(arg[j]) == -1) {
813
815
  copy.push(arg[j]);
@@ -816,7 +818,7 @@ Array.include({
816
818
  }
817
819
  return copy;
818
820
  },
819
-
821
+
820
822
  /**
821
823
  * flats out complex array into a single dimension array
822
824
  *
@@ -833,7 +835,7 @@ Array.include({
833
835
  });
834
836
  return copy;
835
837
  },
836
-
838
+
837
839
  /**
838
840
  * returns a copy of the array whithout any null or undefined values
839
841
  *
@@ -842,7 +844,7 @@ Array.include({
842
844
  compact: function() {
843
845
  return this.without(null, undefined);
844
846
  },
845
-
847
+
846
848
  /**
847
849
  * returns a copy of the array which contains only the unique values
848
850
  *
@@ -851,7 +853,7 @@ Array.include({
851
853
  uniq: function() {
852
854
  return [].merge(this);
853
855
  },
854
-
856
+
855
857
  /**
856
858
  * checks if all of the given values
857
859
  * exists in the given array
@@ -868,7 +870,7 @@ Array.include({
868
870
  }
869
871
  return true;
870
872
  },
871
-
873
+
872
874
  /**
873
875
  * returns a copy of the array without the items passed as the arguments
874
876
  *
@@ -882,7 +884,7 @@ Array.include({
882
884
  return !filter.includes(value);
883
885
  });
884
886
  },
885
-
887
+
886
888
  /**
887
889
  * Shuffles the array items in a random order
888
890
  *
@@ -890,12 +892,12 @@ Array.include({
890
892
  */
891
893
  shuffle: function() {
892
894
  var shuff = this.clone(), j, x, i = shuff.length;
893
-
895
+
894
896
  for (; i > 0; j = Math.random(i-1), x = shuff[--i], shuff[i] = shuff[j], shuff[j] = x) {}
895
-
897
+
896
898
  return shuff;
897
899
  },
898
-
900
+
899
901
  /**
900
902
  * Default sort fix for numeric values
901
903
  *
@@ -905,7 +907,7 @@ Array.include({
905
907
  sort: function(callback) {
906
908
  return original_sort.apply(this, (callback || !isNumber(this[0])) ? arguments : [default_sort]);
907
909
  },
908
-
910
+
909
911
  /**
910
912
  * sorts the array by running its items though a lambda or calling their attributes
911
913
  *
@@ -915,7 +917,7 @@ Array.include({
915
917
  */
916
918
  sortBy: function() {
917
919
  var pair = guess_callback(arguments, this);
918
-
920
+
919
921
  return this.sort(function(a, b) {
920
922
  return default_sort(
921
923
  pair[0].call(pair[1], a),
@@ -923,7 +925,7 @@ Array.include({
923
925
  );
924
926
  });
925
927
  },
926
-
928
+
927
929
  /**
928
930
  * Returns the minimal value on the list
929
931
  *
@@ -932,7 +934,7 @@ Array.include({
932
934
  min: function() {
933
935
  return Math.min.apply(Math, this);
934
936
  },
935
-
937
+
936
938
  /**
937
939
  * Returns the maximal value
938
940
  *
@@ -941,7 +943,7 @@ Array.include({
941
943
  max: function() {
942
944
  return Math.max.apply(Math, this);
943
945
  },
944
-
946
+
945
947
  /**
946
948
  * Returns a summ of all the items on the list
947
949
  *
@@ -978,7 +980,7 @@ String.include({
978
980
  empty: function() {
979
981
  return this == '';
980
982
  },
981
-
983
+
982
984
  /**
983
985
  * checks if the string contains only white-spaces
984
986
  *
@@ -987,9 +989,9 @@ String.include({
987
989
  blank: function() {
988
990
  return (/^\s*$/).test(this);
989
991
  },
990
-
992
+
991
993
  /**
992
- * removes trailing whitespaces
994
+ * removes trailing whitespaces
993
995
  *
994
996
  * @return String trimmed version
995
997
  */
@@ -998,7 +1000,7 @@ String.include({
998
1000
  while ((/\s/).test(str.charAt(--i))) {}
999
1001
  return str.slice(0, i + 1);
1000
1002
  },
1001
-
1003
+
1002
1004
  /**
1003
1005
  * returns a copy of the string with all the tags removed
1004
1006
  * @return String without tags
@@ -1006,10 +1008,10 @@ String.include({
1006
1008
  stripTags: function() {
1007
1009
  return this.replace(/<\/?[^>]+>/ig, '');
1008
1010
  },
1009
-
1011
+
1010
1012
  /**
1011
1013
  * removes all the scripts declarations out of the string
1012
- * @param mixed option. If it equals true the scrips will be executed,
1014
+ * @param mixed option. If it equals true the scrips will be executed,
1013
1015
  * if a function the scripts will be passed in it
1014
1016
  * @return String without scripts
1015
1017
  */
@@ -1018,16 +1020,16 @@ String.include({
1018
1020
  scripts += source + "\n";
1019
1021
  return '';
1020
1022
  });
1021
-
1023
+
1022
1024
  if (option === true) {
1023
1025
  $eval(scripts);
1024
1026
  } else if (isFunction(option)) {
1025
1027
  option(scripts, text);
1026
1028
  }
1027
-
1029
+
1028
1030
  return text;
1029
1031
  },
1030
-
1032
+
1031
1033
  /**
1032
1034
  * extracts all the scripts out of the string
1033
1035
  *
@@ -1038,7 +1040,7 @@ String.include({
1038
1040
  this.stripScripts(function(s) { scripts = s; });
1039
1041
  return scripts;
1040
1042
  },
1041
-
1043
+
1042
1044
  /**
1043
1045
  * evals all the scripts in the string
1044
1046
  *
@@ -1048,7 +1050,7 @@ String.include({
1048
1050
  this.stripScripts(true);
1049
1051
  return this;
1050
1052
  },
1051
-
1053
+
1052
1054
  /**
1053
1055
  * converts underscored or dasherized string to a camelized one
1054
1056
  * @returns String camelized version
@@ -1058,7 +1060,7 @@ String.include({
1058
1060
  return chr ? chr.toUpperCase() : '';
1059
1061
  });
1060
1062
  },
1061
-
1063
+
1062
1064
  /**
1063
1065
  * converts a camelized or dasherized string into an underscored one
1064
1066
  * @return String underscored version
@@ -1075,7 +1077,7 @@ String.include({
1075
1077
  capitalize: function() {
1076
1078
  return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
1077
1079
  },
1078
-
1080
+
1079
1081
  /**
1080
1082
  * checks if the string contains the given substring
1081
1083
  *
@@ -1085,7 +1087,7 @@ String.include({
1085
1087
  includes: function(string) {
1086
1088
  return this.indexOf(string) != -1;
1087
1089
  },
1088
-
1090
+
1089
1091
  /**
1090
1092
  * checks if the string starts with the given substring
1091
1093
  *
@@ -1095,10 +1097,10 @@ String.include({
1095
1097
  */
1096
1098
  startsWith: function(string, ignorecase) {
1097
1099
  var start_str = this.substr(0, string.length);
1098
- return ignorecase ? start_str.toLowerCase() === string.toLowerCase() :
1100
+ return ignorecase ? start_str.toLowerCase() === string.toLowerCase() :
1099
1101
  start_str === string;
1100
1102
  },
1101
-
1103
+
1102
1104
  /**
1103
1105
  * checks if the string ends with the given substring
1104
1106
  *
@@ -1111,7 +1113,7 @@ String.include({
1111
1113
  return ignorecase ? end_str.toLowerCase() === string.toLowerCase() :
1112
1114
  end_str === string;
1113
1115
  },
1114
-
1116
+
1115
1117
  /**
1116
1118
  * converts the string to an integer value
1117
1119
  * @param Integer base
@@ -1120,7 +1122,7 @@ String.include({
1120
1122
  toInt: function(base) {
1121
1123
  return parseInt(this, base || 10);
1122
1124
  },
1123
-
1125
+
1124
1126
  /**
1125
1127
  * converts the string to a float value
1126
1128
  * @param boolean flat if the method should not use a flexible matching
@@ -1129,11 +1131,12 @@ String.include({
1129
1131
  toFloat: function(strict) {
1130
1132
  return parseFloat(strict ? this : this.replace(',', '.').replace(/(\d)-(\d)/g, '$1.$2'));
1131
1133
  }
1132
-
1134
+
1133
1135
  });
1134
1136
 
1135
1137
  $alias(String[PROTO], {include: 'includes'});
1136
1138
 
1139
+
1137
1140
  /**
1138
1141
  * The Function class extentions
1139
1142
  *
@@ -1184,7 +1187,7 @@ Function.include({
1184
1187
  curry: function() {
1185
1188
  return this.bind.apply(this, [this].concat($A(arguments)));
1186
1189
  },
1187
-
1190
+
1188
1191
  /**
1189
1192
  * The right side curry feature
1190
1193
  *
@@ -1232,7 +1235,7 @@ Function.include({
1232
1235
 
1233
1236
  return timer;
1234
1237
  },
1235
-
1238
+
1236
1239
  /**
1237
1240
  * Chains the given function after the current one
1238
1241
  *
@@ -1251,6 +1254,7 @@ Function.include({
1251
1254
  }
1252
1255
  });
1253
1256
 
1257
+
1254
1258
  /**
1255
1259
  * The Number class extentions
1256
1260
  *
@@ -1274,46 +1278,47 @@ Number.include({
1274
1278
  }
1275
1279
  return this;
1276
1280
  },
1277
-
1281
+
1278
1282
  upto: function(number, callback, scope) {
1279
1283
  for (var i=this+0; i <= number; i++) {
1280
1284
  callback.call(scope, i);
1281
1285
  }
1282
1286
  return this;
1283
1287
  },
1284
-
1288
+
1285
1289
  downto: function(number, callback, scope) {
1286
1290
  for (var i=this+0; i >= number; i--) {
1287
1291
  callback.call(scope, i);
1288
1292
  }
1289
1293
  return this;
1290
1294
  },
1291
-
1295
+
1292
1296
  abs: function() {
1293
1297
  return Math.abs(this);
1294
1298
  },
1295
-
1299
+
1296
1300
  round: function(size) {
1297
1301
  return size ? parseFloat(this.toFixed(size)) : Math.round(this);
1298
1302
  },
1299
-
1303
+
1300
1304
  ceil: function() {
1301
1305
  return Math.ceil(this);
1302
1306
  },
1303
-
1307
+
1304
1308
  floor: function() {
1305
1309
  return Math.floor(this);
1306
1310
  },
1307
-
1311
+
1308
1312
  min: function(value) {
1309
1313
  return this < value ? value : this + 0;
1310
1314
  },
1311
-
1315
+
1312
1316
  max: function(value) {
1313
1317
  return this > value ? value : this + 0;
1314
1318
  }
1315
1319
  });
1316
1320
 
1321
+
1317
1322
  /**
1318
1323
  * The Regexp class extentions
1319
1324
  *
@@ -1335,6 +1340,7 @@ RegExp.escape = function(string) {
1335
1340
  return (''+string).replace(/([.*+?\^=!:${}()|\[\]\/\\])/g, '\\$1');
1336
1341
  };
1337
1342
 
1343
+
1338
1344
  /**
1339
1345
  * The basic Class unit
1340
1346
  *
@@ -1349,7 +1355,7 @@ RegExp.escape = function(string) {
1349
1355
  var Class = RightJS.Class = function() {
1350
1356
  var args = $A(arguments), properties = args.pop() || {},
1351
1357
  parent = args.pop();
1352
-
1358
+
1353
1359
  // basic class object definition
1354
1360
  function klass() {
1355
1361
  if ('prebind' in this && isArray(this.prebind)) {
@@ -1357,7 +1363,7 @@ var Class = RightJS.Class = function() {
1357
1363
  this[method] = this[method].bind(this);
1358
1364
  }, this);
1359
1365
  }
1360
-
1366
+
1361
1367
  return this.initialize ? this.initialize.apply(this, arguments) : this;
1362
1368
  }
1363
1369
 
@@ -1365,13 +1371,13 @@ var Class = RightJS.Class = function() {
1365
1371
  if (!args.length && !isHash(properties)) {
1366
1372
  parent = properties; properties = {};
1367
1373
  }
1368
-
1374
+
1369
1375
  // attaching main class-level methods
1370
1376
  $ext(klass, Class_Methods).inherit(parent);
1371
-
1377
+
1372
1378
  // catching the injections
1373
1379
  Class_attachInjections(klass, properties);
1374
-
1380
+
1375
1381
  return klass.include(properties);
1376
1382
  },
1377
1383
 
@@ -1430,9 +1436,9 @@ Class_Methods = {
1430
1436
  extend: function() {
1431
1437
  $A(arguments).filter(isHash).each(function(module) {
1432
1438
  var callback = module.selfExtended || module.self_extended;
1433
-
1439
+
1434
1440
  $ext(this, clean_module(module, true));
1435
-
1441
+
1436
1442
  if (callback) {
1437
1443
  callback.call(module, this);
1438
1444
  }
@@ -1455,10 +1461,10 @@ Class_Methods = {
1455
1461
 
1456
1462
  $A(arguments).filter(isHash).each(function(module) {
1457
1463
  var callback = module.selfIncluded || module.self_included;
1458
-
1464
+
1459
1465
  Object.each(clean_module(module, false), function(key, method) {
1460
1466
  var ancestor = ancestors.first(function(proto) { return key in proto && isFunction(proto[key]); });
1461
-
1467
+
1462
1468
  this[PROTO][key] = !ancestor ? method : function() {
1463
1469
  this.$super = ancestor[key];
1464
1470
  return method.apply(this, arguments);
@@ -1508,10 +1514,11 @@ function Class_findSet(object, property) {
1508
1514
  constructor = object.constructor,
1509
1515
  candidates = [object, constructor].concat('ancestors' in constructor ? constructor.ancestors : []),
1510
1516
  holder = candidates.first(function(o) { return o && (upcased in o || capcased in o); });
1511
-
1517
+
1512
1518
  return holder ? holder[upcased] || holder[capcased] : null;
1513
1519
  }
1514
1520
 
1521
+
1515
1522
  /**
1516
1523
  * This is a simple mix-in module to be included in other classes
1517
1524
  *
@@ -1533,7 +1540,7 @@ var Options = RightJS.Options = {
1533
1540
  */
1534
1541
  setOptions: function(opts) {
1535
1542
  var options = this.options = Object.merge(Class_findSet(this, 'options'), opts), match, key;
1536
-
1543
+
1537
1544
  // hooking up the observer options
1538
1545
  if (isFunction(this.on)) {
1539
1546
  for (key in options) {
@@ -1543,10 +1550,10 @@ var Options = RightJS.Options = {
1543
1550
  }
1544
1551
  }
1545
1552
  }
1546
-
1553
+
1547
1554
  return this;
1548
1555
  },
1549
-
1556
+
1550
1557
  /**
1551
1558
  * Cuts of an options hash from the end of the arguments list
1552
1559
  * assigns them using the #setOptions method and then
@@ -1562,8 +1569,9 @@ var Options = RightJS.Options = {
1562
1569
  }
1563
1570
  };
1564
1571
 
1572
+
1565
1573
  /**
1566
- * standard Observer class.
1574
+ * standard Observer class.
1567
1575
  *
1568
1576
  * Might be used as a usual class or as a builder over another objects
1569
1577
  *
@@ -1575,18 +1583,18 @@ var Options = RightJS.Options = {
1575
1583
  */
1576
1584
  var Observer = RightJS.Observer = new Class({
1577
1585
  include: Options,
1578
-
1586
+
1579
1587
  /**
1580
1588
  * general constructor
1581
1589
  *
1582
1590
  * @param Object options
1583
1591
  */
1584
1592
  initialize: function(options) {
1585
- this.setOptions(options);
1593
+ this.setOptions(options);
1586
1594
  Observer_createShortcuts(this, Class_findSet(this, 'events'));
1587
1595
  return this;
1588
1596
  },
1589
-
1597
+
1590
1598
  /**
1591
1599
  * binds an event listener
1592
1600
  *
@@ -1599,7 +1607,7 @@ var Observer = RightJS.Observer = new Class({
1599
1607
  */
1600
1608
  on: function() {
1601
1609
  var args = $A(arguments), event = args.shift(), name;
1602
-
1610
+
1603
1611
  if (isString(event)) {
1604
1612
  if (!('$listeners' in this)) { this.$listeners = []; }
1605
1613
 
@@ -1611,14 +1619,14 @@ var Observer = RightJS.Observer = new Class({
1611
1619
 
1612
1620
  case "function":
1613
1621
  var hash = {};
1614
-
1622
+
1615
1623
  // DON'T move it in the one-line hash variable definition,
1616
1624
  // it causes problems with the Konqueror 3 later on
1617
1625
  hash.e = event;
1618
1626
  hash.f = callback;
1619
1627
  hash.a = args;
1620
1628
  hash.r = name;
1621
-
1629
+
1622
1630
  this.$listeners.push(hash);
1623
1631
  break;
1624
1632
 
@@ -1631,7 +1639,7 @@ var Observer = RightJS.Observer = new Class({
1631
1639
  }
1632
1640
  }
1633
1641
  }
1634
-
1642
+
1635
1643
  } else {
1636
1644
  // assuming it's a hash of key-value pairs
1637
1645
  for (name in event) {
@@ -1640,12 +1648,12 @@ var Observer = RightJS.Observer = new Class({
1640
1648
  ).concat(args));
1641
1649
  }
1642
1650
  }
1643
-
1644
-
1645
-
1651
+
1652
+
1653
+
1646
1654
  return this;
1647
1655
  },
1648
-
1656
+
1649
1657
  /**
1650
1658
  * checks if the observer observes given event and/or callback
1651
1659
  *
@@ -1659,13 +1667,13 @@ var Observer = RightJS.Observer = new Class({
1659
1667
  observes: function(event, callback) {
1660
1668
  if (!isString(event)) { callback = event; event = null; }
1661
1669
  if (isString(callback)) { callback = this[callback]; }
1662
-
1670
+
1663
1671
  return (this.$listeners || []).some(function(i) {
1664
1672
  return (event && callback) ? i.e === event && i.f === callback :
1665
1673
  event ? i.e === event : i.f === callback;
1666
1674
  });
1667
1675
  },
1668
-
1676
+
1669
1677
  /**
1670
1678
  * stops observing an event or/and function
1671
1679
  *
@@ -1684,16 +1692,16 @@ var Observer = RightJS.Observer = new Class({
1684
1692
  } else {
1685
1693
  if (!isString(event)) { callback = event; event = null; }
1686
1694
  if (isString(callback)){ callback = this[callback]; }
1687
-
1695
+
1688
1696
  this.$listeners = (this.$listeners || []).filter(function(i) {
1689
1697
  return (event && callback) ? (i.e !== event || i.f !== callback) :
1690
1698
  (event ? i.e !== event : i.f !== callback);
1691
1699
  }, this);
1692
1700
  }
1693
-
1701
+
1694
1702
  return this;
1695
1703
  },
1696
-
1704
+
1697
1705
  /**
1698
1706
  * returns the listeners list for the event
1699
1707
  *
@@ -1708,7 +1716,7 @@ var Observer = RightJS.Observer = new Class({
1708
1716
  return !event || i.e === event;
1709
1717
  }).map(function(i) { return i.f; }).uniq();
1710
1718
  },
1711
-
1719
+
1712
1720
  /**
1713
1721
  * initiates the event handling
1714
1722
  *
@@ -1719,13 +1727,13 @@ var Observer = RightJS.Observer = new Class({
1719
1727
  */
1720
1728
  fire: function() {
1721
1729
  var args = $A(arguments), event = args.shift();
1722
-
1730
+
1723
1731
  (this.$listeners || []).each(function(i) {
1724
1732
  if (i.e === event) {
1725
1733
  i.f.apply(this, i.a.concat(args));
1726
1734
  }
1727
1735
  }, this);
1728
-
1736
+
1729
1737
  return this;
1730
1738
  }
1731
1739
  }),
@@ -1758,7 +1766,7 @@ Observer_createShortcuts = Observer.createShortcuts = function(object, names) {
1758
1766
  };
1759
1767
  }
1760
1768
  });
1761
-
1769
+
1762
1770
  return object;
1763
1771
  };
1764
1772
 
@@ -1772,6 +1780,7 @@ var Break = RightJS.Break = new Class(Error, {
1772
1780
  message: "Manual break"
1773
1781
  });
1774
1782
 
1783
+
1775
1784
  /**
1776
1785
  * this object will contain info about the current browser
1777
1786
  *
@@ -1791,6 +1800,7 @@ Browser = RightJS.Browser = {
1791
1800
  OLD: looks_like_ie && !looks_like_opera && !document.querySelector
1792
1801
  };
1793
1802
 
1803
+
1794
1804
  /**
1795
1805
  * The dom-wrapper main unit
1796
1806
  *
@@ -1802,13 +1812,13 @@ Browser = RightJS.Browser = {
1802
1812
  */
1803
1813
 
1804
1814
  var Wrapper = RightJS.Wrapper = function(parent, methods) {
1805
-
1815
+
1806
1816
  // creating the actual wrapper class
1807
1817
  var Klass = function(object, options) {
1808
1818
  this.initialize(object, options);
1809
-
1819
+
1810
1820
  var instance = this, unit = instance._, uid;
1811
-
1821
+
1812
1822
  // dynamically typecasting in case if the user is creating
1813
1823
  // an element of a subtype via the basic Element constructor
1814
1824
  if (this.constructor === Element && unit.tagName in Element_wrappers) {
@@ -1817,24 +1827,24 @@ var Wrapper = RightJS.Wrapper = function(parent, methods) {
1817
1827
  instance.$listeners = this.$listeners;
1818
1828
  }
1819
1829
  }
1820
-
1830
+
1821
1831
  uid = UID_KEY in unit ? unit[UID_KEY] : (unit[UID_KEY] = UID++);
1822
-
1832
+
1823
1833
  return (Wrappers_Cache[uid] = instance);
1824
1834
  };
1825
-
1835
+
1826
1836
  // finding the parent
1827
1837
  if (!methods) {
1828
1838
  methods = parent;
1829
1839
  parent = null;
1830
1840
  }
1831
-
1841
+
1832
1842
  // hooking up the extedning tools and methods
1833
1843
  $ext(Klass, Class_Methods).inherit(parent || Wrapper);
1834
-
1844
+
1835
1845
  // checking for the injections
1836
1846
  Class_attachInjections(Klass, methods);
1837
-
1847
+
1838
1848
  // including the basic tools
1839
1849
  return Klass.include({_: undefined}, methods);
1840
1850
  };
@@ -1842,6 +1852,7 @@ var Wrapper = RightJS.Wrapper = function(parent, methods) {
1842
1852
  // exposing the cache so it could be manupulated externally
1843
1853
  Wrapper.Cache = Wrappers_Cache;
1844
1854
 
1855
+
1845
1856
  /**
1846
1857
  * A simple document wrapper
1847
1858
  *
@@ -1851,13 +1862,14 @@ var Document = RightJS.Document = new Wrapper({
1851
1862
  initialize: function(document) {
1852
1863
  this._ = document;
1853
1864
  },
1854
-
1865
+
1855
1866
  // returns the window reference
1856
1867
  window: function() {
1857
1868
  return $(this._.defaultView || this._.parentWindow);
1858
1869
  }
1859
1870
  });
1860
1871
 
1872
+
1861
1873
  /**
1862
1874
  * the window object extensions
1863
1875
  *
@@ -1874,7 +1886,7 @@ var Window = RightJS.Window = new Wrapper({
1874
1886
  this._ = window;
1875
1887
  this.d = window.document;
1876
1888
  },
1877
-
1889
+
1878
1890
  /**
1879
1891
  * Generic API reference
1880
1892
  *
@@ -1883,7 +1895,7 @@ var Window = RightJS.Window = new Wrapper({
1883
1895
  window: function() {
1884
1896
  return this;
1885
1897
  },
1886
-
1898
+
1887
1899
  /**
1888
1900
  * returns the inner-size of the window
1889
1901
  *
@@ -1902,9 +1914,9 @@ var Window = RightJS.Window = new Wrapper({
1902
1914
  */
1903
1915
  scrolls: function() {
1904
1916
  var win = this._, doc = this.d, body = doc.body, html = doc.documentElement;
1905
-
1917
+
1906
1918
  return (win.pageXOffset || win.pageYOffset) ? {x: win.pageXOffset, y: win.pageYOffset} :
1907
- (body.scrollLeft || body.scrollTop) ? {x: body.scrollLeft, y: body.scrollTop} :
1919
+ (body && (body.scrollLeft || body.scrollTop)) ? {x: body.scrollLeft, y: body.scrollTop} :
1908
1920
  {x: html.scrollLeft, y: html.scrollTop};
1909
1921
  },
1910
1922
 
@@ -1918,7 +1930,7 @@ var Window = RightJS.Window = new Wrapper({
1918
1930
  */
1919
1931
  scrollTo: function(left, top, fx_options) {
1920
1932
  var left_pos = left, top_pos = top, element = $(left); // moving the values into new vars so they didn't get screwed later on
1921
-
1933
+
1922
1934
  if(element && element instanceof Element) {
1923
1935
  left = element.position();
1924
1936
  }
@@ -1927,7 +1939,7 @@ var Window = RightJS.Window = new Wrapper({
1927
1939
  top_pos = left.y;
1928
1940
  left_pos = left.x;
1929
1941
  }
1930
-
1942
+
1931
1943
  // checking if a smooth scroll was requested
1932
1944
  if (isHash(fx_options = fx_options || top) && RightJS.Fx) {
1933
1945
  new Fx.Scroll(this, fx_options).start({x: left_pos, y: top_pos});
@@ -1954,17 +1966,17 @@ var Window = RightJS.Window = new Wrapper({
1954
1966
  var Event = RightJS.Event = new Wrapper({
1955
1967
  // predefining the keys to spped up the assignments
1956
1968
  type: null,
1957
-
1969
+
1958
1970
  which: null,
1959
1971
  keyCode: null,
1960
-
1972
+
1961
1973
  target: null,
1962
1974
  currentTarget: null,
1963
1975
  relatedTarget: null,
1964
-
1976
+
1965
1977
  pageX: null,
1966
1978
  pageY: null,
1967
-
1979
+
1968
1980
  /**
1969
1981
  * the class constructor
1970
1982
  *
@@ -1976,39 +1988,39 @@ var Event = RightJS.Event = new Wrapper({
1976
1988
  if (typeof event === 'string') {
1977
1989
  event = Object.merge({type: event}, bound_element);
1978
1990
  this.stopped = event.bubbles === false;
1979
-
1991
+
1980
1992
  if (isHash(bound_element)) {
1981
1993
  $ext(this, bound_element);
1982
1994
  }
1983
1995
  }
1984
-
1996
+
1985
1997
  this._ = event;
1986
1998
  this.type = event.type;
1987
-
1999
+
1988
2000
  this.which = event.which;
1989
2001
  this.keyCode = event.keyCode;
1990
-
2002
+
1991
2003
  this.target = $(event.target);
1992
2004
  this.currentTarget = $(event.currentTarget);
1993
2005
  this.relatedTarget = $(event.relatedTarget);
1994
-
2006
+
1995
2007
  this.pageX = event.pageX;
1996
2008
  this.pageY = event.pageY;
1997
-
2009
+
1998
2010
  if (!('target' in event) && 'srcElement' in event) {
1999
2011
  // grabbin the IE properties
2000
2012
  this.which = event.button == 2 ? 3 : event.button == 4 ? 2 : 1;
2001
-
2002
- // faking the target property
2013
+
2014
+ // faking the target property
2003
2015
  this.target = $(event.srcElement) || bound_element;
2004
-
2016
+
2005
2017
  // faking the relatedTarget, currentTarget and other targets
2006
2018
  this.relatedTarget = this.target._ === event.fromElement ? $(event.toElement) : this.target;
2007
2019
  this.currentTarget = bound_element;
2008
-
2020
+
2009
2021
  // faking the mouse position
2010
2022
  var scrolls = this.target.window().scrolls();
2011
-
2023
+
2012
2024
  this.pageX = event.clientX + scrolls.x;
2013
2025
  this.pageY = event.clientY + scrolls.y;
2014
2026
  } else if (event.target && 'nodeType' in event.target && event.target.nodeType === 3) {
@@ -2016,7 +2028,7 @@ var Event = RightJS.Event = new Wrapper({
2016
2028
  this.target = $(event.target.parentNode);
2017
2029
  }
2018
2030
  },
2019
-
2031
+
2020
2032
  /**
2021
2033
  * Stops the event bubbling process
2022
2034
  *
@@ -2031,7 +2043,7 @@ var Event = RightJS.Event = new Wrapper({
2031
2043
  this.stopped = true;
2032
2044
  return this;
2033
2045
  },
2034
-
2046
+
2035
2047
  /**
2036
2048
  * Prevents the default browser action on the event
2037
2049
  *
@@ -2045,7 +2057,7 @@ var Event = RightJS.Event = new Wrapper({
2045
2057
  }
2046
2058
  return this;
2047
2059
  },
2048
-
2060
+
2049
2061
  /**
2050
2062
  * Fully stops the event
2051
2063
  *
@@ -2054,7 +2066,7 @@ var Event = RightJS.Event = new Wrapper({
2054
2066
  stop: function() {
2055
2067
  return this.stopPropagation().preventDefault();
2056
2068
  },
2057
-
2069
+
2058
2070
  /**
2059
2071
  * Returns the event position
2060
2072
  *
@@ -2063,7 +2075,7 @@ var Event = RightJS.Event = new Wrapper({
2063
2075
  position: function() {
2064
2076
  return {x: this.pageX, y: this.pageY};
2065
2077
  },
2066
-
2078
+
2067
2079
  /**
2068
2080
  * Finds the element between the event target
2069
2081
  * and the boundary element that matches the
@@ -2089,6 +2101,7 @@ var Event = RightJS.Event = new Wrapper({
2089
2101
 
2090
2102
  Event_delegation_shortcuts = [];
2091
2103
 
2104
+
2092
2105
  /**
2093
2106
  * The DOM Element unit handling
2094
2107
  *
@@ -2141,16 +2154,17 @@ element_constructor = function(element, options) {
2141
2154
  }
2142
2155
  };
2143
2156
 
2144
- if (Browser.IE) {
2145
- //
2146
- // IE browsers have a bug with checked input elements
2147
- // and we kinda hacking the Element constructor so that
2148
- // it affected IE browsers only
2149
- //
2157
+ //
2158
+ // IE 6,7,8 (not 9!) browsers have a bug with checkbox and radio input elements
2159
+ // it doesn't place the 'checked' property correctly, so we kinda hacking
2160
+ // the Element constructor a bit for them
2161
+ //
2162
+ try {
2163
+ document.createElement('<input/>'); // <- works for IE < 9 only
2150
2164
  element_constructor = patch_function(element_constructor, /(\((\w+),\s*(\w+)\)\s*\{)/,
2151
2165
  '$1if($2==="input"&&$3)$2="<input name="+$3.name+" type="+$3.type+($3.checked?" checked":"")+"/>";'
2152
2166
  );
2153
- }
2167
+ } catch (e) {}
2154
2168
 
2155
2169
  /**
2156
2170
  * The actual elements wrapper
@@ -2174,9 +2188,9 @@ var Element = RightJS.Element = new Wrapper({
2174
2188
  this._ = element;
2175
2189
  }
2176
2190
  },
2177
-
2191
+
2178
2192
  // protected
2179
-
2193
+
2180
2194
  // constructs the event
2181
2195
  construct: element_constructor
2182
2196
  });
@@ -2206,37 +2220,37 @@ Element.include({
2206
2220
  parent: function(css_rule) {
2207
2221
  return css_rule ? this.parents(css_rule)[0] : $(this._.parentNode || null); // <- IE6 need that || null
2208
2222
  },
2209
-
2223
+
2210
2224
  parents: function(css_rule) {
2211
2225
  return recursively_collect(this, 'parentNode', css_rule);
2212
2226
  },
2213
-
2227
+
2214
2228
  children: function(css_rule) {
2215
2229
  return this.find(css_rule).filter(function(element) {
2216
2230
  return element._.parentNode === this._;
2217
2231
  }, this);
2218
2232
  },
2219
-
2233
+
2220
2234
  siblings: function(css_rule) {
2221
2235
  return this.prevSiblings(css_rule).reverse().concat(this.nextSiblings(css_rule));
2222
2236
  },
2223
-
2237
+
2224
2238
  nextSiblings: function(css_rule) {
2225
2239
  return recursively_collect(this, 'nextSibling', css_rule);
2226
2240
  },
2227
-
2241
+
2228
2242
  prevSiblings: function(css_rule) {
2229
2243
  return recursively_collect(this, 'previousSibling', css_rule);
2230
2244
  },
2231
-
2245
+
2232
2246
  next: function(css_rule) {
2233
2247
  return this.nextSiblings(css_rule)[0];
2234
2248
  },
2235
-
2249
+
2236
2250
  prev: function(css_rule) {
2237
2251
  return this.prevSiblings(css_rule)[0];
2238
2252
  },
2239
-
2253
+
2240
2254
  /**
2241
2255
  * removes the elemnt out of this parent node
2242
2256
  *
@@ -2249,7 +2263,7 @@ Element.include({
2249
2263
  }
2250
2264
  return this;
2251
2265
  },
2252
-
2266
+
2253
2267
  /**
2254
2268
  * handles the elements insertion functionality
2255
2269
  *
@@ -2257,35 +2271,35 @@ Element.include({
2257
2271
  *
2258
2272
  * o) an element instance
2259
2273
  * o) a String, which will be converted into content to insert (all the scripts will be parsed out and executed)
2260
- * o) a list of Elements
2274
+ * o) a list of Elements
2261
2275
  * o) a hash like {position: content}
2262
2276
  *
2263
2277
  * @param mixed data to insert
2264
2278
  * @param String position to insert top/bottom/before/after/instead
2265
2279
  * @return Element self
2266
2280
  */
2267
- insert: function(content, position) {
2281
+ insert: function(content, position) {
2268
2282
  var scripts = null, element = this._;
2269
2283
  position = (position||'bottom').toLowerCase();
2270
-
2284
+
2271
2285
  if (typeof(content) !== 'object') {
2272
2286
  scripts = content = (''+content);
2273
2287
  } else if (content && content instanceof Element) {
2274
2288
  content = content._;
2275
2289
  }
2276
-
2290
+
2277
2291
  Element_insertions[position](element, content.tagName ? content :
2278
2292
  Element_createFragment.call(
2279
2293
  (position === 'bottom' || position === 'top') ?
2280
2294
  element : element.parentNode, content
2281
2295
  )
2282
2296
  );
2283
-
2297
+
2284
2298
  if (scripts !== null) { scripts.evalScripts(); }
2285
-
2299
+
2286
2300
  return this;
2287
2301
  },
2288
-
2302
+
2289
2303
  /**
2290
2304
  * Inserts the element inside the given one at the given position
2291
2305
  *
@@ -2297,7 +2311,7 @@ Element.include({
2297
2311
  $(element).insert(this, position);
2298
2312
  return this;
2299
2313
  },
2300
-
2314
+
2301
2315
  /**
2302
2316
  * A shortcut to uppend several units into the element
2303
2317
  *
@@ -2305,10 +2319,10 @@ Element.include({
2305
2319
  * ..................
2306
2320
  * @return Element this
2307
2321
  */
2308
- append: function() {
2309
- return this.insert(arguments);
2322
+ append: function(first) {
2323
+ return this.insert(isString(first) ? $A(arguments).join('') : arguments);
2310
2324
  },
2311
-
2325
+
2312
2326
  /**
2313
2327
  * updates the content of the element by the given content
2314
2328
  *
@@ -2318,21 +2332,21 @@ Element.include({
2318
2332
  update: function(content) {
2319
2333
  if (typeof(content) !== 'object') {
2320
2334
  content = '' + content;
2321
-
2335
+
2322
2336
  try {
2323
2337
  this._.innerHTML = content;
2324
2338
  } catch(e) {
2325
2339
  return this.clean().insert(content);
2326
2340
  }
2327
-
2341
+
2328
2342
  content.evalScripts();
2329
-
2343
+
2330
2344
  return this;
2331
2345
  } else {
2332
2346
  return this.clean().insert(content);
2333
2347
  }
2334
2348
  },
2335
-
2349
+
2336
2350
  /**
2337
2351
  * Works with the Element's innerHTML property
2338
2352
  * This method works both ways! if a content is provided
@@ -2355,7 +2369,7 @@ Element.include({
2355
2369
  replace: function(content) {
2356
2370
  return this.insert(content, 'instead');
2357
2371
  },
2358
-
2372
+
2359
2373
  /**
2360
2374
  * wraps the element with the given element
2361
2375
  *
@@ -2371,7 +2385,7 @@ Element.include({
2371
2385
  }
2372
2386
  return this;
2373
2387
  },
2374
-
2388
+
2375
2389
  /**
2376
2390
  * removes all the child nodes out of the element
2377
2391
  *
@@ -2381,10 +2395,10 @@ Element.include({
2381
2395
  while (this._.firstChild) {
2382
2396
  this._.removeChild(this._.firstChild);
2383
2397
  }
2384
-
2398
+
2385
2399
  return this;
2386
2400
  },
2387
-
2401
+
2388
2402
  /**
2389
2403
  * checks if the element has no child nodes
2390
2404
  *
@@ -2393,7 +2407,7 @@ Element.include({
2393
2407
  empty: function() {
2394
2408
  return this.html().blank();
2395
2409
  },
2396
-
2410
+
2397
2411
  /**
2398
2412
  * Creates a clean clone of the element without any events attached to it
2399
2413
  *
@@ -2414,7 +2428,7 @@ Element.include({
2414
2428
  * @param name String pointer attribute name
2415
2429
  * @param rule String optional css-atom rule
2416
2430
  * @return Array found elements
2417
- */
2431
+ */
2418
2432
  function recursively_collect(where, attr, css_rule) {
2419
2433
  var node = where._, result = [];
2420
2434
 
@@ -2423,7 +2437,7 @@ function recursively_collect(where, attr, css_rule) {
2423
2437
  result.push($(node));
2424
2438
  }
2425
2439
  }
2426
-
2440
+
2427
2441
  return result;
2428
2442
  }
2429
2443
 
@@ -2433,7 +2447,7 @@ var Element_insertions = {
2433
2447
  bottom: function(target, content) {
2434
2448
  target.appendChild(content);
2435
2449
  },
2436
-
2450
+
2437
2451
  top: function(target, content) {
2438
2452
  if (target.firstChild !== null) {
2439
2453
  target.insertBefore(content, target.firstChild);
@@ -2441,7 +2455,7 @@ var Element_insertions = {
2441
2455
  target.appendChild(content);
2442
2456
  }
2443
2457
  },
2444
-
2458
+
2445
2459
  after: function(target, content) {
2446
2460
  var parent = target.parentNode, sibling = target.nextSibling;
2447
2461
  if (sibling !== null) {
@@ -2450,11 +2464,11 @@ var Element_insertions = {
2450
2464
  parent.appendChild(content);
2451
2465
  }
2452
2466
  },
2453
-
2467
+
2454
2468
  before: function(target, content) {
2455
2469
  target.parentNode.insertBefore(content, target);
2456
2470
  },
2457
-
2471
+
2458
2472
  instead: function(target, content) {
2459
2473
  target.parentNode.replaceChild(content, target);
2460
2474
  }
@@ -2477,27 +2491,27 @@ $alias(Element_wraps, {
2477
2491
  TFOOT: 'TBODY',
2478
2492
  TH: 'TD'
2479
2493
  });
2480
-
2494
+
2481
2495
  // converts any data into a html fragment unit
2482
2496
  var fragment = document.createDocumentFragment(),
2483
2497
  tmp_cont = document.createElement('DIV');
2484
-
2498
+
2485
2499
  function Element_createFragment(content) {
2486
2500
  if (typeof(content) === 'string') {
2487
2501
  var tag = this.tagName,
2488
2502
  tmp = tmp_cont,
2489
2503
  wrap = Element_wraps[tag] || ['', '', 1],
2490
2504
  depth = wrap[2];
2491
-
2505
+
2492
2506
  tmp.innerHTML = wrap[0] + '<'+ tag + '>' + content + '</'+ tag + '>' + wrap[1];
2493
-
2507
+
2494
2508
  while (depth-- > 0) {
2495
2509
  tmp = tmp.firstChild;
2496
2510
  }
2497
-
2511
+
2498
2512
  content = tmp.childNodes;
2499
2513
  }
2500
-
2514
+
2501
2515
  for (var i=0, length = content.length, node; i < length; i++) {
2502
2516
  // in case of NodeList unit, the elements will be removed out of the list during the appends
2503
2517
  // therefore if that's an array we use the 'i' variable, and if it's a collection of nodes
@@ -2505,15 +2519,16 @@ function Element_createFragment(content) {
2505
2519
  node = content[content.length === length ? i : 0];
2506
2520
  fragment.appendChild(node instanceof Element ? node._ : node);
2507
2521
  }
2508
-
2522
+
2509
2523
  return fragment;
2510
2524
  }
2511
2525
 
2526
+
2512
2527
  /**
2513
2528
  * this module contains the element unit styles related methods
2514
2529
  *
2515
2530
  * Credits:
2516
- * Some of the functionality is inspired by
2531
+ * Some of the functionality is inspired by
2517
2532
  * - Prototype (http://prototypejs.org) Copyright (C) Sam Stephenson
2518
2533
  * - MooTools (http://mootools.net) Copyright (C) Valerio Proietti
2519
2534
  * - Dojo (www.dojotoolkit.org) Copyright (C) The Dojo Foundation
@@ -2532,7 +2547,7 @@ Element.include({
2532
2547
  */
2533
2548
  setStyle: function(hash, value) {
2534
2549
  var key, c_key, style = {}, element_style = this._.style;
2535
-
2550
+
2536
2551
  if (value) { style[hash] = value; hash = style; }
2537
2552
  else if(isString(hash)) {
2538
2553
  hash.split(';').each(function(option) {
@@ -2543,11 +2558,11 @@ Element.include({
2543
2558
  });
2544
2559
  hash = style;
2545
2560
  }
2546
-
2547
-
2561
+
2562
+
2548
2563
  for (key in hash) {
2549
2564
  c_key = key.indexOf('-') < 0 ? key : key.camelize();
2550
-
2565
+
2551
2566
  if (key === 'opacity') {
2552
2567
  if (Browser.IE) {
2553
2568
  element_style.filter = 'alpha(opacity='+ hash[key] * 100 +')';
@@ -2557,13 +2572,13 @@ Element.include({
2557
2572
  } else if (key === 'float') {
2558
2573
  c_key = Browser.IE ? 'styleFloat' : 'cssFloat';
2559
2574
  }
2560
-
2575
+
2561
2576
  element_style[c_key] = hash[key];
2562
2577
  }
2563
-
2578
+
2564
2579
  return this;
2565
2580
  },
2566
-
2581
+
2567
2582
  /**
2568
2583
  * returns style of the element
2569
2584
  *
@@ -2575,7 +2590,7 @@ Element.include({
2575
2590
  getStyle: function(key) {
2576
2591
  return clean_style(this._.style, key) || clean_style(this.computedStyles(), key);
2577
2592
  },
2578
-
2593
+
2579
2594
  /**
2580
2595
  * returns the hash of computed styles for the element
2581
2596
  *
@@ -2586,17 +2601,17 @@ Element.include({
2586
2601
  // old IE, IE8, W3C
2587
2602
  return element.currentStyle || element.runtimeStyle || element.ownerDocument.defaultView.getComputedStyle(element, null) || {};
2588
2603
  },
2589
-
2604
+
2590
2605
  /**
2591
2606
  * checks if the element has the given class name
2592
- *
2607
+ *
2593
2608
  * @param String class name
2594
2609
  * @return boolean check result
2595
2610
  */
2596
2611
  hasClass: function(name) {
2597
2612
  return (' '+this._.className+' ').indexOf(' '+name+' ') != -1;
2598
2613
  },
2599
-
2614
+
2600
2615
  /**
2601
2616
  * sets the whole class-name string for the element
2602
2617
  *
@@ -2621,7 +2636,7 @@ Element.include({
2621
2636
  }
2622
2637
  return this;
2623
2638
  },
2624
-
2639
+
2625
2640
  /**
2626
2641
  * removes the given class name
2627
2642
  *
@@ -2632,7 +2647,7 @@ Element.include({
2632
2647
  this._.className = (' '+this._.className+' ').replace(' '+name+' ', ' ').trim();
2633
2648
  return this;
2634
2649
  },
2635
-
2650
+
2636
2651
  /**
2637
2652
  * toggles the given class name on the element
2638
2653
  *
@@ -2642,7 +2657,7 @@ Element.include({
2642
2657
  toggleClass: function(name) {
2643
2658
  return this[this.hasClass(name) ? 'removeClass' : 'addClass'](name);
2644
2659
  },
2645
-
2660
+
2646
2661
  /**
2647
2662
  * adds the given class-name to the element
2648
2663
  * and removes it from all the element siblings
@@ -2665,28 +2680,29 @@ Element.include({
2665
2680
  */
2666
2681
  function clean_style(style, in_key) {
2667
2682
  var value, key = in_key.camelize();
2668
-
2683
+
2669
2684
  switch (key) {
2670
2685
  case 'opacity':
2671
2686
  value = !Browser.IE ? style[key].replace(',', '.') :
2672
2687
  ((/opacity=(\d+)/i.exec(style.filter || '') || ['', '100'])[1].toInt() / 100)+'';
2673
2688
  break;
2674
-
2689
+
2675
2690
  case 'float':
2676
2691
  key = Browser.IE ? 'styleFloat' : 'cssFloat';
2677
-
2692
+
2678
2693
  default:
2679
2694
  value = style[key];
2680
-
2695
+
2681
2696
  // Opera returns named colors with quotes
2682
2697
  if (Browser.Opera && /color/i.test(key) && value) {
2683
2698
  value = value.replace(/"/g, '');
2684
2699
  }
2685
2700
  }
2686
-
2701
+
2687
2702
  return value || null;
2688
2703
  }
2689
2704
 
2705
+
2690
2706
  /**
2691
2707
  * Common DOM Element unit methods
2692
2708
  *
@@ -2706,9 +2722,9 @@ Element.include({
2706
2722
  */
2707
2723
  set: function(hash, value) {
2708
2724
  if (typeof(hash) === 'string') { var val = {}; val[hash] = value; hash = val; }
2709
-
2725
+
2710
2726
  var key, element = this._;
2711
-
2727
+
2712
2728
  for (key in hash) {
2713
2729
  // some attributes are not available as properties
2714
2730
  if (!(key in element)) {
@@ -2716,10 +2732,10 @@ Element.include({
2716
2732
  }
2717
2733
  element[key] = hash[key];
2718
2734
  }
2719
-
2735
+
2720
2736
  return this;
2721
2737
  },
2722
-
2738
+
2723
2739
  /**
2724
2740
  * returns the attribute value for the name
2725
2741
  *
@@ -2730,7 +2746,7 @@ Element.include({
2730
2746
  var element = this._, value = element[name] || element.getAttribute(name);
2731
2747
  return value === '' ? null : value;
2732
2748
  },
2733
-
2749
+
2734
2750
  /**
2735
2751
  * checks if the element has that attribute
2736
2752
  *
@@ -2740,7 +2756,7 @@ Element.include({
2740
2756
  has: function(name) {
2741
2757
  return this.get(name) !== null;
2742
2758
  },
2743
-
2759
+
2744
2760
  /**
2745
2761
  * erases the given attribute of the element
2746
2762
  *
@@ -2751,7 +2767,7 @@ Element.include({
2751
2767
  this._.removeAttribute(name);
2752
2768
  return this;
2753
2769
  },
2754
-
2770
+
2755
2771
  /**
2756
2772
  * checks if the elemnt is hidden
2757
2773
  *
@@ -2762,7 +2778,7 @@ Element.include({
2762
2778
  hidden: function() {
2763
2779
  return this.getStyle('display') === 'none';
2764
2780
  },
2765
-
2781
+
2766
2782
  /**
2767
2783
  * checks if the element is visible
2768
2784
  *
@@ -2771,7 +2787,7 @@ Element.include({
2771
2787
  visible: function() {
2772
2788
  return !this.hidden();
2773
2789
  },
2774
-
2790
+
2775
2791
  /**
2776
2792
  * hides the element
2777
2793
  *
@@ -2784,10 +2800,10 @@ Element.include({
2784
2800
  this._d = this.getStyle('display');
2785
2801
  this._.style.display = 'none';
2786
2802
  }
2787
-
2803
+
2788
2804
  return this;
2789
2805
  },
2790
-
2806
+
2791
2807
  /**
2792
2808
  * shows the element
2793
2809
  *
@@ -2799,13 +2815,13 @@ Element.include({
2799
2815
  if (this.hidden()) {
2800
2816
  // setting 'block' for the divs and 'inline' for the other elements hidden on the css-level
2801
2817
  var element = this._, value = element.tagName == 'DIV' ? 'block' : 'inline';
2802
-
2818
+
2803
2819
  element.style.display = this._d == 'none' ? value : this._d || value;
2804
2820
  }
2805
-
2821
+
2806
2822
  return this;
2807
2823
  },
2808
-
2824
+
2809
2825
  /**
2810
2826
  * toggles the visibility state of the element
2811
2827
  *
@@ -2814,9 +2830,9 @@ Element.include({
2814
2830
  * @return Element self
2815
2831
  */
2816
2832
  toggle: function(effect, options) {
2817
- return this[this.hidden() ? 'show' : 'hide'](effect, options);
2833
+ return this[this.visible() ? 'hide' : 'show'](effect, options);
2818
2834
  },
2819
-
2835
+
2820
2836
  /**
2821
2837
  * shows the element and hides all the sibligns
2822
2838
  *
@@ -2830,8 +2846,9 @@ Element.include({
2830
2846
  }
2831
2847
  });
2832
2848
 
2849
+
2833
2850
  /**
2834
- * this module contains the Element's part of functionality
2851
+ * this module contains the Element's part of functionality
2835
2852
  * responsible for the dimensions and positions getting/setting
2836
2853
  *
2837
2854
  * Copyright (C) 2008-2010 Nikolay Nemshilov
@@ -2845,7 +2862,7 @@ Element.include({
2845
2862
  document: function() {
2846
2863
  return $(this._.ownerDocument);
2847
2864
  },
2848
-
2865
+
2849
2866
  /**
2850
2867
  * Returns the reference to this elements window
2851
2868
  *
@@ -2854,7 +2871,7 @@ Element.include({
2854
2871
  window: function() {
2855
2872
  return this.document().window();
2856
2873
  },
2857
-
2874
+
2858
2875
  /**
2859
2876
  * Returns the element size as a hash
2860
2877
  *
@@ -2863,7 +2880,7 @@ Element.include({
2863
2880
  size: function() {
2864
2881
  return { x: this._.offsetWidth, y: this._.offsetHeight };
2865
2882
  },
2866
-
2883
+
2867
2884
  /**
2868
2885
  * Returns the element absolute position
2869
2886
  *
@@ -2875,13 +2892,13 @@ Element.include({
2875
2892
  var rect = this._.getBoundingClientRect(),
2876
2893
  html = this.document()._.documentElement,
2877
2894
  scrolls = this.window().scrolls();
2878
-
2895
+
2879
2896
  return {
2880
2897
  x: rect.left + scrolls.x - html.clientLeft,
2881
2898
  y: rect.top + scrolls.y - html.clientTop
2882
2899
  };
2883
2900
  },
2884
-
2901
+
2885
2902
  /**
2886
2903
  * Returns the element scrolls
2887
2904
  *
@@ -2890,7 +2907,7 @@ Element.include({
2890
2907
  scrolls: function() {
2891
2908
  return { x: this._.scrollLeft, y: this._.scrollTop };
2892
2909
  },
2893
-
2910
+
2894
2911
  /**
2895
2912
  * returns the element dimensions hash
2896
2913
  *
@@ -2900,7 +2917,7 @@ Element.include({
2900
2917
  var size = this.size(),
2901
2918
  scrolls = this.scrolls(),
2902
2919
  position = this.position();
2903
-
2920
+
2904
2921
  return {
2905
2922
  top: position.y,
2906
2923
  left: position.x,
@@ -2910,7 +2927,7 @@ Element.include({
2910
2927
  scrollTop: scrolls.y
2911
2928
  };
2912
2929
  },
2913
-
2930
+
2914
2931
  /**
2915
2932
  * Checks if the element overlaps the given position
2916
2933
  *
@@ -2919,11 +2936,11 @@ Element.include({
2919
2936
  */
2920
2937
  overlaps: function(target) {
2921
2938
  var pos = this.position(), size = this.size();
2922
-
2939
+
2923
2940
  return target.x > pos.x && target.x < (pos.x + size.x) &&
2924
2941
  target.y > pos.y && target.y < (pos.y + size.y);
2925
2942
  },
2926
-
2943
+
2927
2944
  /**
2928
2945
  * sets the width of the element in pixels
2929
2946
  *
@@ -2939,7 +2956,7 @@ Element.include({
2939
2956
  style.width = (2 * width_px - this._.offsetWidth) + 'px';
2940
2957
  return this;
2941
2958
  },
2942
-
2959
+
2943
2960
  /**
2944
2961
  * sets the width of the element in pixels
2945
2962
  *
@@ -2955,7 +2972,7 @@ Element.include({
2955
2972
  style.height = (2 * height_px - this._.offsetHeight) + 'px';
2956
2973
  return this;
2957
2974
  },
2958
-
2975
+
2959
2976
  /**
2960
2977
  * sets the size of the element in pixels
2961
2978
  *
@@ -2973,7 +2990,7 @@ Element.include({
2973
2990
  }
2974
2991
  return this.setWidth(width).setHeight(height);
2975
2992
  },
2976
-
2993
+
2977
2994
  /**
2978
2995
  * sets the element position (against the window corner)
2979
2996
  *
@@ -2986,13 +3003,13 @@ Element.include({
2986
3003
  top = left.y;
2987
3004
  left = left.x;
2988
3005
  }
2989
-
3006
+
2990
3007
  return this.setStyle({
2991
3008
  left: left + 'px',
2992
3009
  top: top + 'px'
2993
3010
  });
2994
3011
  },
2995
-
3012
+
2996
3013
  /**
2997
3014
  * sets the scroll position
2998
3015
  *
@@ -3005,13 +3022,13 @@ Element.include({
3005
3022
  top = left.y;
3006
3023
  left = left.x;
3007
3024
  }
3008
-
3025
+
3009
3026
  this._.scrollLeft = left;
3010
3027
  this._.scrollTop = top;
3011
-
3028
+
3012
3029
  return this;
3013
3030
  },
3014
-
3031
+
3015
3032
  /**
3016
3033
  * makes the window be scrolled to the element
3017
3034
  *
@@ -3024,10 +3041,11 @@ Element.include({
3024
3041
  }
3025
3042
  });
3026
3043
 
3044
+
3027
3045
  /**
3028
3046
  * DOM Element events handling methods
3029
3047
  *
3030
- * Copyright (C) 2008-2010 Nikolay V. Nemshilov
3048
+ * Copyright (C) 2008-2010 Nikolay Nemshilov
3031
3049
  */
3032
3050
  var Element_observer = Observer_create({});
3033
3051
 
@@ -3041,29 +3059,31 @@ function hack_observer(name, re, text) {
3041
3059
  Element_observer[name] = patch_function(Element_observer[name], re, text);
3042
3060
  }
3043
3061
 
3044
- hack_observer('on',
3062
+ hack_observer('on',
3045
3063
  /(\$listeners\.push\((\w+?)\);)/,
3046
-
3064
+
3047
3065
  // aliasing the 'rightclick' to the 'contextmenu' event
3048
3066
  '$1$2.e=$2.n=$2.e==="rightclick"?"contextmenu":$2.e;'+
3049
-
3067
+
3050
3068
  // swapping a browser related event names
3051
3069
  (Browser.Gecko ? 'if($2.n==="mousewheel")$2.n="DOMMouseScroll";' : '') +
3052
3070
  (Browser.Konqueror ? 'if($2.n==="contextmenu")$2.n="rightclick";' : '') +
3053
-
3071
+
3054
3072
  '$2.w=function(){'+
3055
- 'var a=$A(arguments);$2.r&&$2.r!=="stopEvent"?a.shift():a[0]=new RightJS.Event(a[0],this);'+
3056
- '$2.f.apply($2.t,a.concat($2.a))};$2.t=this;' + (
3057
- looks_like_ie ?
3058
- '$2.w=$2.w.bind(this);this._.attachEvent("on"+$2.n,$2.w);' :
3059
- 'this._.addEventListener($2.n,$2.w,false);'
3060
- )
3073
+ 'var a=$A(arguments),_;'+
3074
+ '$2.r&&$2.r!=="stopEvent"?a.shift():_=a[0]=new RightJS.Event(a[0],this);'+
3075
+ '$2.f.apply($2.t,a.concat($2.a))===false&&_.stop()'+
3076
+ '};$2.t=this;' + (
3077
+ looks_like_ie ?
3078
+ '$2.w=$2.w.bind(this);this._.attachEvent("on"+$2.n,$2.w);' :
3079
+ 'this._.addEventListener($2.n,$2.w,false);'
3080
+ )
3061
3081
  );
3062
3082
 
3063
3083
  hack_observer('stopObserving',
3064
- /(function\s*\((\w+)\)\s*\{\s*)(return\s*)([^}]+)/m,
3084
+ /(function\s*\((\w+)\)\s*\{\s*)(return\s*)([^}]+)/m,
3065
3085
  '$1var r=$4;'+
3066
- 'if(!r)' + (looks_like_ie ?
3086
+ 'if(!r)' + (looks_like_ie ?
3067
3087
  'this._.detachEvent("on"+$2.n,$2.w);' :
3068
3088
  'this._.removeEventListener($2.n,$2.w,false);'
3069
3089
  )+'$3 r'
@@ -3105,7 +3125,7 @@ Observer_createShortcuts(Window[PROTO], $w('blur focus scroll resize load'));
3105
3125
  function Element_add_event_shortcuts(tokens) {
3106
3126
  tokens = $w(tokens);
3107
3127
  Event_delegation_shortcuts = Event_delegation_shortcuts.concat(tokens);
3108
-
3128
+
3109
3129
  Observer_createShortcuts(Element[PROTO], tokens);
3110
3130
  Observer_createShortcuts(Document[PROTO], tokens);
3111
3131
  }
@@ -3147,7 +3167,7 @@ function stub_rule(css_rule, tag) {
3147
3167
  first: function(css_rule) {
3148
3168
  return $(this._.querySelector(stub_rule(css_rule, this)));
3149
3169
  },
3150
-
3170
+
3151
3171
  /**
3152
3172
  * Finds a list of matching nodes, or all the descendant nodes if no css-rule provided
3153
3173
  *
@@ -3158,7 +3178,7 @@ function stub_rule(css_rule, tag) {
3158
3178
  return $A(this._.querySelectorAll(stub_rule(css_rule, this))).map($);
3159
3179
  }
3160
3180
  });
3161
-
3181
+
3162
3182
  Element.include({
3163
3183
  /**
3164
3184
  * checks if the element matches this css-rule
@@ -3170,12 +3190,12 @@ Element.include({
3170
3190
  */
3171
3191
  match: function(css_rule) {
3172
3192
  var result, parent = this._.tagName === 'HTML' ? this._.ownerDocument : this.parents().last();
3173
-
3193
+
3174
3194
  // if it's a single node putting it into the context
3175
3195
  result = $(parent || $E('p').insert(this)).find(css_rule).include(this);
3176
-
3196
+
3177
3197
  if (!parent) { this.remove(); }
3178
-
3198
+
3179
3199
  return result;
3180
3200
  }
3181
3201
  });
@@ -3192,17 +3212,17 @@ Element.include({
3192
3212
  */
3193
3213
  [Window, Document].each(function(object) {
3194
3214
  var proto = object[PROTO], old_on = proto.on;
3195
-
3215
+
3196
3216
  // redefining the observer method to catch up
3197
3217
  proto.on = function(name) {
3198
3218
  if (name == 'ready' && !this._wR) {
3199
3219
  var document = this._, ready = this.fire.bind(this, 'ready');
3200
3220
  document = document.nodeType == 9 ? document : document.document;
3201
-
3221
+
3202
3222
  // IE and Konqueror browsers
3203
3223
  if ('readyState' in document) {
3204
3224
  (function() {
3205
- if (['loaded','complete'].includes(document.readyState)) {
3225
+ if (['loaded','complete'].includes(document.readyState)) {
3206
3226
  ready();
3207
3227
  } else {
3208
3228
  arguments.callee.delay(50);
@@ -3211,12 +3231,12 @@ Element.include({
3211
3231
  } else {
3212
3232
  document.addEventListener('DOMContentLoaded', ready, false);
3213
3233
  }
3214
-
3234
+
3215
3235
  this._wR = true;
3216
3236
  }
3217
3237
  return old_on.apply(this, arguments);
3218
3238
  };
3219
-
3239
+
3220
3240
  Observer_createShortcuts(proto, ['ready']);
3221
3241
  });
3222
3242
 
@@ -3242,6 +3262,7 @@ $alias(Window[PROTO], {
3242
3262
  sizes: 'size'
3243
3263
  });
3244
3264
 
3265
+
3245
3266
  /**
3246
3267
  * The form unit class and extensions
3247
3268
  *
@@ -3267,19 +3288,19 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3267
3288
  */
3268
3289
  initialize: function(in_options) {
3269
3290
  var options = in_options || {}, remote = 'remote' in options, element = options;
3270
-
3291
+
3271
3292
  if (isHash(options)) {
3272
3293
  element = 'form';
3273
3294
  options = Object.without(options, 'remote');
3274
3295
  }
3275
-
3296
+
3276
3297
  this.$super(element, options);
3277
-
3298
+
3278
3299
  if (remote) {
3279
3300
  this.remotize();
3280
3301
  }
3281
3302
  },
3282
-
3303
+
3283
3304
  /**
3284
3305
  * returns the form elements as an array of extended units
3285
3306
  *
@@ -3288,7 +3309,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3288
3309
  elements: function() {
3289
3310
  return this.find('input,button,select,textarea');
3290
3311
  },
3291
-
3312
+
3292
3313
  /**
3293
3314
  * returns the list of all the input elements on the form
3294
3315
  *
@@ -3299,7 +3320,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3299
3320
  return !['submit', 'button', 'reset', 'image', null].includes(input._.type);
3300
3321
  });
3301
3322
  },
3302
-
3323
+
3303
3324
  /**
3304
3325
  * Accessing an input by name
3305
3326
  *
@@ -3309,7 +3330,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3309
3330
  input: function(name) {
3310
3331
  return $(this._[name]);
3311
3332
  },
3312
-
3333
+
3313
3334
  /**
3314
3335
  * focuses on the first input element on the form
3315
3336
  *
@@ -3319,12 +3340,12 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3319
3340
  var element = this.inputs().first(function(input) {
3320
3341
  return input._.type !== 'hidden';
3321
3342
  });
3322
-
3343
+
3323
3344
  if (element) { element.focus(); }
3324
-
3345
+
3325
3346
  return this;
3326
3347
  },
3327
-
3348
+
3328
3349
  /**
3329
3350
  * removes focus out of all the form elements
3330
3351
  *
@@ -3334,7 +3355,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3334
3355
  this.elements().each('blur');
3335
3356
  return this;
3336
3357
  },
3337
-
3358
+
3338
3359
  /**
3339
3360
  * disables all the elements on the form
3340
3361
  *
@@ -3344,7 +3365,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3344
3365
  this.elements().each('disable');
3345
3366
  return this;
3346
3367
  },
3347
-
3368
+
3348
3369
  /**
3349
3370
  * enables all the elements on the form
3350
3371
  *
@@ -3354,7 +3375,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3354
3375
  this.elements().each('enable');
3355
3376
  return this;
3356
3377
  },
3357
-
3378
+
3358
3379
  /**
3359
3380
  * returns the list of the form values
3360
3381
  *
@@ -3362,7 +3383,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3362
3383
  */
3363
3384
  values: function() {
3364
3385
  var values = {}, value, name, element, input;
3365
-
3386
+
3366
3387
  this.inputs().each(function(element) {
3367
3388
  input = element._;
3368
3389
  name = input.name;
@@ -3371,14 +3392,14 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3371
3392
  if (name.endsWith('[]')) {
3372
3393
  value = (values[name] || []).concat([value]);
3373
3394
  }
3374
-
3395
+
3375
3396
  values[name] = value;
3376
3397
  }
3377
3398
  });
3378
-
3399
+
3379
3400
  return values;
3380
3401
  },
3381
-
3402
+
3382
3403
  /**
3383
3404
  * returns the key/values organized ready to be sent via a get request
3384
3405
  *
@@ -3387,7 +3408,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3387
3408
  serialize: function() {
3388
3409
  return Object.toQueryString(this.values());
3389
3410
  },
3390
-
3411
+
3391
3412
  /**
3392
3413
  * Delegating the submit method
3393
3414
  *
@@ -3397,7 +3418,7 @@ var Form = RightJS.Form = Element_wrappers.FORM = new Wrapper(Element, {
3397
3418
  this._.submit();
3398
3419
  return this;
3399
3420
  },
3400
-
3421
+
3401
3422
  /**
3402
3423
  * Delegating the 'reset' method
3403
3424
  *
@@ -3425,13 +3446,13 @@ $alias(Form[PROTO], {
3425
3446
  */
3426
3447
  var old_insert = Element[PROTO].insert,
3427
3448
 
3428
- Input = RightJS.Input =
3449
+ Input = RightJS.Input =
3429
3450
 
3430
3451
  // retgistering the typecasted wrappers
3431
- Element_wrappers.INPUT =
3452
+ Element_wrappers.INPUT =
3432
3453
  Element_wrappers.BUTTON =
3433
3454
  Element_wrappers.SELECT =
3434
- Element_wrappers.TEXTAREA =
3455
+ Element_wrappers.TEXTAREA =
3435
3456
  Element_wrappers.OPTGROUP =
3436
3457
 
3437
3458
  new Wrapper(Element, {
@@ -3455,7 +3476,7 @@ new Wrapper(Element, {
3455
3476
  // type to tag name conversion
3456
3477
  if (!element || isHash(element)) {
3457
3478
  options = element || {};
3458
-
3479
+
3459
3480
  if (/textarea|select/.test(options.type || '')) {
3460
3481
  element = options.type;
3461
3482
  delete(options.type);
@@ -3463,10 +3484,10 @@ new Wrapper(Element, {
3463
3484
  element = 'input';
3464
3485
  }
3465
3486
  }
3466
-
3487
+
3467
3488
  this.$super(element, options);
3468
3489
  },
3469
-
3490
+
3470
3491
  /**
3471
3492
  * Returns a reference to the input's form
3472
3493
  *
@@ -3475,7 +3496,7 @@ new Wrapper(Element, {
3475
3496
  form: function() {
3476
3497
  return $(this._.form);
3477
3498
  },
3478
-
3499
+
3479
3500
  /**
3480
3501
  * SELECT element has a bug in FF that screws the selected options
3481
3502
  *
@@ -3485,17 +3506,17 @@ new Wrapper(Element, {
3485
3506
  */
3486
3507
  insert: function(content, position) {
3487
3508
  old_insert.call(this, content, position);
3488
-
3509
+
3489
3510
  // FF doesn't marks selected options correctly with a textual content
3490
3511
  if (this._.tagName === 'SELECT' && isString(content)) {
3491
3512
  $A(this._.getElementsByTagName('option')).each(function(option) {
3492
3513
  option.selected = !!option.getAttribute('selected');
3493
3514
  });
3494
3515
  }
3495
-
3516
+
3496
3517
  return this;
3497
3518
  },
3498
-
3519
+
3499
3520
  /**
3500
3521
  * Overloading the method so it always called the '#insert' method
3501
3522
  *
@@ -3505,7 +3526,7 @@ new Wrapper(Element, {
3505
3526
  update: function(content) {
3506
3527
  return this.clean().insert(content);
3507
3528
  },
3508
-
3529
+
3509
3530
  /**
3510
3531
  * uniform access to the element values
3511
3532
  *
@@ -3538,7 +3559,7 @@ new Wrapper(Element, {
3538
3559
  }
3539
3560
  return this;
3540
3561
  },
3541
-
3562
+
3542
3563
  /**
3543
3564
  * Both ways getter/setter for the value parameter
3544
3565
  *
@@ -3548,7 +3569,7 @@ new Wrapper(Element, {
3548
3569
  value: function(value) {
3549
3570
  return this[value === undefined ? 'getValue' : 'setValue'](value);
3550
3571
  },
3551
-
3572
+
3552
3573
  /**
3553
3574
  * focuses on the first input element on the form
3554
3575
  *
@@ -3560,7 +3581,7 @@ new Wrapper(Element, {
3560
3581
  if (Browser.IE) { this.fire('focus', {bubbles: false}); }
3561
3582
  return this;
3562
3583
  },
3563
-
3584
+
3564
3585
  /**
3565
3586
  * removes focus out of all the form elements
3566
3587
  *
@@ -3572,7 +3593,7 @@ new Wrapper(Element, {
3572
3593
  if (Browser.IE) { this.fire('blur', {bubbles: false}); }
3573
3594
  return this;
3574
3595
  },
3575
-
3596
+
3576
3597
  /**
3577
3598
  * focuses on the element and selects its content
3578
3599
  *
@@ -3582,7 +3603,7 @@ new Wrapper(Element, {
3582
3603
  this._.select();
3583
3604
  return this.focus();
3584
3605
  },
3585
-
3606
+
3586
3607
  /**
3587
3608
  * disables all the elements on the form
3588
3609
  *
@@ -3592,7 +3613,7 @@ new Wrapper(Element, {
3592
3613
  this._.disabled = true;
3593
3614
  return this.fire('disable');
3594
3615
  },
3595
-
3616
+
3596
3617
  /**
3597
3618
  * enables all the elements on the form
3598
3619
  *
@@ -3601,6 +3622,33 @@ new Wrapper(Element, {
3601
3622
  enable: function() {
3602
3623
  this._.disabled = false;
3603
3624
  return this.fire('enable');
3625
+ },
3626
+
3627
+ /**
3628
+ * A bidirectional method to set/get the disabled status of the input field
3629
+ *
3630
+ * @param boolean optional value
3631
+ * @return Input in setter mode boolean in getter
3632
+ */
3633
+ disabled: function(value) {
3634
+ return value === undefined ? this._.disabled : this[value ? 'disable' : 'enable']();
3635
+ },
3636
+
3637
+ /**
3638
+ * A bidirectional method to set/get the checked status of the input field
3639
+ *
3640
+ * @param boolean optional value
3641
+ * @return Input in setter mode boolean in getter
3642
+ */
3643
+ checked: function(value) {
3644
+ if (value === undefined) {
3645
+ value = this._.checked;
3646
+ } else {
3647
+ this._.checked = value;
3648
+ value = this;
3649
+ }
3650
+
3651
+ return value;
3604
3652
  }
3605
3653
  });
3606
3654
 
@@ -3629,9 +3677,9 @@ function focus_boobler(raw_event) {
3629
3677
  var event = new Event(raw_event),
3630
3678
  target = event.target,
3631
3679
  parent = target.parent && target.parent();
3632
-
3680
+
3633
3681
  event.type = (raw_event.type === 'focusin' || raw_event.type === 'focus') ? 'focus' : 'blur';
3634
-
3682
+
3635
3683
  if (parent) { parent.fire(event); }
3636
3684
  }
3637
3685
 
@@ -3671,7 +3719,7 @@ if (!event_support_for('onsubmit', 'form')) {
3671
3719
  var submit_boobler = function(raw_event) {
3672
3720
  var event = $(raw_event), element = event.target._,
3673
3721
  type = element.type, form = element.form, parent;
3674
-
3722
+
3675
3723
  if (form && (parent = $(form).parent()) && (
3676
3724
  (raw_event.keyCode === 13 && (type === 'text' || type === 'password')) ||
3677
3725
  (raw_event.type === 'click' && (type === 'submit' || type === 'image'))
@@ -3681,21 +3729,21 @@ if (!event_support_for('onsubmit', 'form')) {
3681
3729
  parent.fire(event);
3682
3730
  }
3683
3731
  };
3684
-
3732
+
3685
3733
  document.attachEvent('onclick', submit_boobler);
3686
3734
  document.attachEvent('onkeypress', submit_boobler);
3687
3735
  }
3688
3736
 
3689
3737
  if (!event_support_for('onchange', 'input')) {
3690
-
3738
+
3691
3739
  var get_input_value = function(target) {
3692
3740
  var element = target._,
3693
3741
  type = element.type;
3694
-
3742
+
3695
3743
  return type === 'radio' || type === 'checkbox' ?
3696
3744
  element.checked : target.getValue();
3697
3745
  },
3698
-
3746
+
3699
3747
  /**
3700
3748
  * Emulates the 'change' event bubbling
3701
3749
  *
@@ -3713,7 +3761,7 @@ if (!event_support_for('onchange', 'input')) {
3713
3761
  parent.fire(event);
3714
3762
  }
3715
3763
  },
3716
-
3764
+
3717
3765
  /**
3718
3766
  * Catches the input field changes
3719
3767
  *
@@ -3726,7 +3774,7 @@ if (!event_support_for('onchange', 'input')) {
3726
3774
  type = target._.type,
3727
3775
  tag = target._.tagName,
3728
3776
  input_is_radio = (type === 'radio' || type === 'checkbox');
3729
-
3777
+
3730
3778
  if (
3731
3779
  (event.type === 'click' && (input_is_radio || tag === 'SELECT')) ||
3732
3780
  (event.type === 'keydown' && (
@@ -3737,7 +3785,7 @@ if (!event_support_for('onchange', 'input')) {
3737
3785
  change_boobler(event, target);
3738
3786
  }
3739
3787
  },
3740
-
3788
+
3741
3789
  /**
3742
3790
  * Catch inputs blur
3743
3791
  *
@@ -3747,29 +3795,30 @@ if (!event_support_for('onchange', 'input')) {
3747
3795
  catch_input_left = function(raw_event) {
3748
3796
  var event = $(raw_event),
3749
3797
  target = event.target;
3750
-
3798
+
3751
3799
  if (target instanceof Input) {
3752
3800
  change_boobler(event, target);
3753
3801
  }
3754
3802
  };
3755
-
3803
+
3756
3804
  document.attachEvent('onclick', catch_inputs_access);
3757
3805
  document.attachEvent('onkeydown', catch_inputs_access);
3758
3806
  document.attachEvent('onfocusout', catch_input_left);
3759
-
3807
+
3760
3808
  /**
3761
3809
  * storing the input element previous value, so we could figure out
3762
3810
  * if it was changed later on
3763
3811
  */
3764
3812
  document.attachEvent('onbeforeactivate', function(event) {
3765
3813
  var element = $(event).target;
3766
-
3814
+
3767
3815
  if (element instanceof Input) {
3768
3816
  element._prev_value = get_input_value(element);
3769
3817
  }
3770
3818
  });
3771
3819
  }
3772
3820
 
3821
+
3773
3822
  /**
3774
3823
  * This module the standard events delegation interface
3775
3824
  *
@@ -3803,15 +3852,15 @@ if (!event_support_for('onchange', 'input')) {
3803
3852
  for (i=0, list = rules[css_rule]; i < list.length; i++) {
3804
3853
  // registering the delegative listener
3805
3854
  this.on(event, build_delegative_listener(css_rule, list[i], this));
3806
-
3855
+
3807
3856
  // adding the css-rule and callback references to the store
3808
3857
  $ext(this.$listeners.last(), { dr: css_rule, dc: list[i][0] });
3809
3858
  }
3810
3859
  }
3811
-
3860
+
3812
3861
  return this;
3813
3862
  },
3814
-
3863
+
3815
3864
  /**
3816
3865
  * Removes a delegative event listener from the element
3817
3866
  *
@@ -3839,10 +3888,10 @@ if (!event_support_for('onchange', 'input')) {
3839
3888
  delegation_listeners(arguments, this).each(function(h) {
3840
3889
  this.stopObserving(h.n, h.f);
3841
3890
  }, this);
3842
-
3891
+
3843
3892
  return this;
3844
3893
  },
3845
-
3894
+
3846
3895
  /**
3847
3896
  * Checks if there is sucha delegative event listener
3848
3897
  *
@@ -3897,7 +3946,7 @@ function build_delegative_listener(css_rule, entry, scope) {
3897
3946
  */
3898
3947
  function delegation_rules(raw_args) {
3899
3948
  var args = $A(raw_args), rules = args[1] || {}, hash = {}, css_rule;
3900
-
3949
+
3901
3950
  if (isString(rules)) {
3902
3951
  hash[rules] = args.slice(2);
3903
3952
  if (isArray(hash[rules][0])) {
@@ -3906,13 +3955,13 @@ function delegation_rules(raw_args) {
3906
3955
  } else {
3907
3956
  hash = rules;
3908
3957
  }
3909
-
3958
+
3910
3959
  // converting everything into a hash of lists of callbacks
3911
3960
  for (css_rule in hash) {
3912
3961
  hash[css_rule] = ensure_array(hash[css_rule]);
3913
3962
  hash[css_rule] = isArray(hash[css_rule][0]) ? hash[css_rule] : [hash[css_rule]];
3914
3963
  }
3915
-
3964
+
3916
3965
  return hash;
3917
3966
  }
3918
3967
 
@@ -3927,7 +3976,7 @@ function delegation_listeners(args, object) {
3927
3976
  var event = args[0], i, list,
3928
3977
  rules = delegation_rules(args),
3929
3978
  rules_are_empty = !Object.keys(rules).length;
3930
-
3979
+
3931
3980
  return (object.$listeners || []).filter(function(hash) {
3932
3981
  return hash.dr && hash.n === event && (
3933
3982
  rules_are_empty || (function() {
@@ -3940,7 +3989,7 @@ function delegation_listeners(args, object) {
3940
3989
  }
3941
3990
  }
3942
3991
  }
3943
-
3992
+
3944
3993
  return false;
3945
3994
  })()
3946
3995
  );
@@ -3983,19 +4032,30 @@ Object.each({
3983
4032
  }, function(name, method) {
3984
4033
  String[PROTO][name] = function() {
3985
4034
  var doc = $(document), args = $A(arguments), result;
3986
-
4035
+
3987
4036
  args.splice(1,0,''+this);
3988
4037
  result = doc[method].apply(doc, args);
3989
-
4038
+
3990
4039
  return result === doc ? this : result;
3991
4040
  };
3992
4041
  });
4042
+ var old_on = String[PROTO].on;
4043
+ String[PROTO].on = function(hash) {
4044
+ if (isHash(hash)) {
4045
+ for (var key in hash) {
4046
+ old_on.apply(this, [key].concat([hash[key]]));
4047
+ }
4048
+ } else {
4049
+ old_on.apply(this, arguments);
4050
+ }
4051
+ return this;
4052
+ };
3993
4053
 
3994
4054
  /**
3995
4055
  * building the list of String#onEvent shortucts
3996
4056
  *
3997
4057
  * USAGE:
3998
- *
4058
+ *
3999
4059
  * "#css.rule".onClick(function() {...});
4000
4060
  * "#css.rule".onMouseover('method_name');
4001
4061
  */
@@ -4005,6 +4065,7 @@ Event_delegation_shortcuts.each(function(name) {
4005
4065
  };
4006
4066
  });
4007
4067
 
4068
+
4008
4069
  /**
4009
4070
  * XMLHttpRequest wrapper
4010
4071
  *
@@ -4020,7 +4081,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4020
4081
  extend: {
4021
4082
  // supported events list
4022
4083
  EVENTS: $w('success failure complete request cancel create'),
4023
-
4084
+
4024
4085
  // default options
4025
4086
  Options: {
4026
4087
  headers: {
@@ -4042,7 +4103,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4042
4103
  iframed: false,
4043
4104
  jsonp: false
4044
4105
  },
4045
-
4106
+
4046
4107
  /**
4047
4108
  * Shortcut to initiate and send an XHR in a single call
4048
4109
  *
@@ -4054,7 +4115,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4054
4115
  return new this(url, Object.merge({method: 'get'}, options)).send();
4055
4116
  }
4056
4117
  },
4057
-
4118
+
4058
4119
  /**
4059
4120
  * basic constructor
4060
4121
  *
@@ -4063,20 +4124,20 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4063
4124
  */
4064
4125
  initialize: function(url, options) {
4065
4126
  this.initCallbacks(); // system level callbacks should be initialized before the user callbacks
4066
-
4127
+
4067
4128
  this.url = url;
4068
4129
 
4069
4130
  // copying some options to the instance level attributes
4070
4131
  $ext(this.$super(options), this.options);
4071
-
4132
+
4072
4133
  // removing the local spinner if it's the same as the global one
4073
4134
  if (Xhr.Options.spinner && $(this.spinner) === $(Xhr.Options.spinner)) {
4074
4135
  this.spinner = null;
4075
4136
  }
4076
4137
  },
4077
-
4138
+
4078
4139
  /**
4079
- * sets a header
4140
+ * sets a header
4080
4141
  *
4081
4142
  * @param name String header name
4082
4143
  * @param value String header value
@@ -4086,7 +4147,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4086
4147
  this.headers[name] = value;
4087
4148
  return this;
4088
4149
  },
4089
-
4150
+
4090
4151
  /**
4091
4152
  * tries to get a response header
4092
4153
  *
@@ -4099,7 +4160,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4099
4160
  } catch(e) {}
4100
4161
  return value;
4101
4162
  },
4102
-
4163
+
4103
4164
  /**
4104
4165
  * checks if the request was successful
4105
4166
  *
@@ -4108,7 +4169,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4108
4169
  successful: function() {
4109
4170
  return (this.status >= 200) && (this.status < 300);
4110
4171
  },
4111
-
4172
+
4112
4173
  /**
4113
4174
  * performs the actual request sending
4114
4175
  *
@@ -4117,46 +4178,46 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4117
4178
  */
4118
4179
  send: function(params) {
4119
4180
  var add_params = {}, url = this.url, method = this.method.toLowerCase(), headers = this.headers, key, xhr;
4120
-
4181
+
4121
4182
  if (method == 'put' || method == 'delete') {
4122
4183
  add_params._method = method;
4123
4184
  method = 'post';
4124
4185
  }
4125
-
4186
+
4126
4187
  var data = this.prepareData(this.params, this.prepareParams(params), add_params);
4127
-
4188
+
4128
4189
  if (this.urlEncoded && method == 'post' && !headers['Content-type']) {
4129
4190
  this.setHeader('Content-type', 'application/x-www-form-urlencoded;charset='+this.encoding);
4130
4191
  }
4131
-
4192
+
4132
4193
  if (method == 'get') {
4133
4194
  if (data) { url += (url.includes('?') ? '&' : '?') + data; }
4134
4195
  data = null;
4135
4196
  }
4136
-
4197
+
4137
4198
  xhr = this.xhr = this.createXhr();
4138
4199
  this.fire('create');
4139
-
4200
+
4140
4201
  xhr.open(method, url, this.async);
4141
-
4202
+
4142
4203
  xhr.onreadystatechange = this.stateChanged.bind(this);
4143
-
4204
+
4144
4205
  for (key in headers) {
4145
4206
  xhr.setRequestHeader(key, headers[key]);
4146
4207
  }
4147
-
4208
+
4148
4209
  xhr.send(data);
4149
4210
  this.fire('request');
4150
-
4211
+
4151
4212
  if (!this.async) { this.stateChanged(); }
4152
-
4213
+
4153
4214
  return this;
4154
4215
  },
4155
-
4216
+
4156
4217
  /**
4157
- * elements automaticall update method, creates an Xhr request
4218
+ * elements automaticall update method, creates an Xhr request
4158
4219
  * and updates the element innerHTML value onSuccess.
4159
- *
4220
+ *
4160
4221
  * @param Element element
4161
4222
  * @param Object optional request params
4162
4223
  * @return Xhr self
@@ -4164,7 +4225,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4164
4225
  update: function(element, params) {
4165
4226
  return this.onSuccess(function(r) { element.update(r.text); }).send(params);
4166
4227
  },
4167
-
4228
+
4168
4229
  /**
4169
4230
  * stops the request processing
4170
4231
  *
@@ -4172,22 +4233,22 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4172
4233
  */
4173
4234
  cancel: function() {
4174
4235
  var xhr = this.xhr;
4175
-
4236
+
4176
4237
  if (!xhr || xhr.canceled) { return this; }
4177
-
4238
+
4178
4239
  xhr.abort();
4179
4240
  xhr.onreadystatechange = dummy();
4180
4241
  xhr.canceled = true;
4181
-
4242
+
4182
4243
  return this.fire('cancel');
4183
4244
  },
4184
-
4245
+
4185
4246
  // protected
4186
4247
  // wrapping the original method to send references to the xhr objects
4187
4248
  fire: function(name) {
4188
4249
  return this.$super(name, this, this.xhr);
4189
4250
  },
4190
-
4251
+
4191
4252
  // creates new request instance
4192
4253
  createXhr: function() {
4193
4254
  if (this.jsonp) {
@@ -4202,7 +4263,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4202
4263
  }
4203
4264
  }
4204
4265
  },
4205
-
4266
+
4206
4267
  // prepares user sending params
4207
4268
  prepareParams: function(params) {
4208
4269
  if (params && params instanceof Form) {
@@ -4211,7 +4272,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4211
4272
  }
4212
4273
  return params;
4213
4274
  },
4214
-
4275
+
4215
4276
  // converts all the params into a url params string
4216
4277
  prepareData: function() {
4217
4278
  return $A(arguments).map(function(param) {
@@ -4225,22 +4286,22 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4225
4286
  // handles the state change
4226
4287
  stateChanged: function() {
4227
4288
  var xhr = this.xhr;
4228
-
4289
+
4229
4290
  if (xhr.readyState != 4 || xhr.canceled) { return; }
4230
-
4291
+
4231
4292
  try { this.status = xhr.status;
4232
4293
  } catch(e) { this.status = 0; }
4233
-
4294
+
4234
4295
  this.text = this.responseText = xhr.responseText;
4235
4296
  this.xml = this.responseXML = xhr.responseXML;
4236
-
4297
+
4237
4298
  this.fire('complete').fire(this.successful() ? 'success' : 'failure');
4238
4299
  },
4239
-
4300
+
4240
4301
  // called on success
4241
4302
  tryScripts: function(response) {
4242
4303
  var content_type = this.getHeader('Content-type');
4243
-
4304
+
4244
4305
  if (this.evalResponse || (this.evalJS && /(ecma|java)script/i.test(content_type))) {
4245
4306
  $eval(this.text);
4246
4307
  } else if (/json/.test(content_type) && this.evalJSON) {
@@ -4249,7 +4310,7 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4249
4310
  this.text.evalScripts();
4250
4311
  }
4251
4312
  },
4252
-
4313
+
4253
4314
  // sanitizes the json-response texts
4254
4315
  sanitizedJSON: function() {
4255
4316
  try {
@@ -4257,17 +4318,17 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4257
4318
  } catch(e) {
4258
4319
  // manual json consistancy check
4259
4320
  if (window.JSON || !(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(this.text.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''))) {
4260
- if (this.secureJSON) {
4321
+ if (this.secureJSON) {
4261
4322
  throw "JSON error: "+this.text;
4262
4323
  }
4263
4324
  return null;
4264
4325
  }
4265
4326
  }
4266
-
4327
+
4267
4328
  // the fallback JSON extraction
4268
4329
  return eval("("+this.text+")");
4269
4330
  },
4270
-
4331
+
4271
4332
  // initializes the request callbacks
4272
4333
  initCallbacks: function() {
4273
4334
  // connecting basic callbacks
@@ -4277,13 +4338,13 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4277
4338
  complete: 'hideSpinner',
4278
4339
  cancel: 'hideSpinner'
4279
4340
  });
4280
-
4341
+
4281
4342
  // wiring the global xhr callbacks
4282
4343
  Xhr.EVENTS.each(function(name) {
4283
4344
  this.on(name, function() { Xhr.fire(name, this, this.xhr); });
4284
4345
  }, this);
4285
4346
  },
4286
-
4347
+
4287
4348
  showSpinner: function() { Xhr.showSpinner.call(this, this); },
4288
4349
  hideSpinner: function() { Xhr.hideSpinner.call(this, this); }
4289
4350
  });
@@ -4291,28 +4352,28 @@ var Xhr = RightJS.Xhr = new Class(Observer, {
4291
4352
  // attaching the common spinner handling
4292
4353
  $ext(Observer_create(Xhr), {
4293
4354
  counter: 0,
4294
-
4355
+
4295
4356
  // shows the spinner
4296
4357
  showSpinner: function(context) {
4297
4358
  Xhr.trySpinner(context, 'show');
4298
4359
  },
4299
-
4360
+
4300
4361
  // hides the spinner
4301
4362
  hideSpinner: function(context) {
4302
4363
  Xhr.trySpinner(context, 'hide');
4303
4364
  },
4304
-
4365
+
4305
4366
  trySpinner: function(context, method) {
4306
4367
  var object = context || Xhr.Options, spinner = $(object.spinner);
4307
4368
  if (spinner) { spinner[method](object.spinnerFx, {duration: 100}); }
4308
4369
  },
4309
-
4370
+
4310
4371
  // counts a request in
4311
4372
  countIn: function() {
4312
4373
  Xhr.counter ++;
4313
4374
  Xhr.showSpinner();
4314
4375
  },
4315
-
4376
+
4316
4377
  // counts a request out
4317
4378
  countOut: function() {
4318
4379
  Xhr.counter --;
@@ -4362,9 +4423,9 @@ Form.include({
4362
4423
  options.method = options.method || this._.method || 'post';
4363
4424
 
4364
4425
  new Xhr(this._.action || document.location.href, options)
4365
- .onRequest((function() {this.disable.bind(this).delay(20);}).bind(this))
4366
4426
  .onComplete(this.enable.bind(this)).send(this);
4367
4427
 
4428
+ this.disable.bind(this).delay(1); // webkit needs this async call with iframed calls
4368
4429
  return this;
4369
4430
  },
4370
4431
 
@@ -4419,6 +4480,7 @@ Element.include({
4419
4480
  }
4420
4481
  });
4421
4482
 
4483
+
4422
4484
  /**
4423
4485
  * A dummy XmlHTTPRequest interface to be used in other
4424
4486
  * fake requests
@@ -4441,7 +4503,7 @@ Xhr.Dummy = {
4441
4503
  */
4442
4504
  Xhr.IFramed = new Class({
4443
4505
  include: Xhr.Dummy,
4444
-
4506
+
4445
4507
  /**
4446
4508
  * constructor
4447
4509
  *
@@ -4451,30 +4513,31 @@ Xhr.IFramed = new Class({
4451
4513
  initialize: function(form) {
4452
4514
  this.form = form;
4453
4515
  this.id = 'xhr_'+ new Date().getTime();
4454
-
4516
+
4455
4517
  form.insert('<i><iframe name="'+this.id+'" id="'+this.id+
4456
4518
  '" width="0" height="0" frameborder="0" src="about:blank"></iframe></i>',
4457
4519
  'after');
4458
-
4520
+
4459
4521
  $(this.id).on('load', this.onLoad.bind(this));
4460
4522
  },
4461
-
4523
+
4462
4524
  send: function() {
4463
4525
  this.form.set('target', this.id).submit();
4464
4526
  },
4465
-
4527
+
4466
4528
  onLoad: function() {
4467
4529
  this.status = 200;
4468
4530
  this.readyState = 4;
4469
-
4531
+
4470
4532
  try {
4471
4533
  this.responseText = window[this.id].document.documentElement.innerHTML;
4472
4534
  } catch(e) { }
4473
-
4535
+
4474
4536
  this.onreadystatechange();
4475
4537
  }
4476
4538
  });
4477
4539
 
4540
+
4478
4541
  /**
4479
4542
  * The JSONP Xhr request tonnel
4480
4543
  *
@@ -4482,9 +4545,9 @@ Xhr.IFramed = new Class({
4482
4545
  */
4483
4546
  Xhr.JSONP = new Class({
4484
4547
  include: Xhr.Dummy,
4485
-
4548
+
4486
4549
  prefix: 'jsonp',
4487
-
4550
+
4488
4551
  /**
4489
4552
  * Constructor
4490
4553
  *
@@ -4496,13 +4559,13 @@ Xhr.JSONP = new Class({
4496
4559
  this.name = this.prefix + new Date().getTime();
4497
4560
  this.param = (isString(xhr.jsonp) ?
4498
4561
  xhr.jsonp : 'callback') + "=" + this.name;
4499
-
4562
+
4500
4563
  this.script = $E('script', {
4501
4564
  charset: xhr.encoding,
4502
4565
  async: xhr.async
4503
4566
  });
4504
4567
  },
4505
-
4568
+
4506
4569
  /**
4507
4570
  * saving the url and method for the further use
4508
4571
  *
@@ -4510,12 +4573,12 @@ Xhr.JSONP = new Class({
4510
4573
  * @param address String request url address
4511
4574
  * @param Boolean async request marker
4512
4575
  * @return void
4513
- */
4576
+ */
4514
4577
  open: function(method, url, async) {
4515
4578
  this.url = url;
4516
4579
  this.method = method;
4517
4580
  },
4518
-
4581
+
4519
4582
  /**
4520
4583
  * Sends the actual request by inserting the script into the document body
4521
4584
  *
@@ -4524,11 +4587,11 @@ Xhr.JSONP = new Class({
4524
4587
  */
4525
4588
  send: function(data) {
4526
4589
  window[this.name] = this.finish.bind(this);
4527
-
4590
+
4528
4591
  this.script.set('src', this.url + (this.url.include('?') ? '&' : '?') + this.param + "&" + data)
4529
4592
  .insertTo($$('script').last(), 'after');
4530
4593
  },
4531
-
4594
+
4532
4595
  /**
4533
4596
  * Receives the actual JSON data from the server
4534
4597
  *
@@ -4538,13 +4601,14 @@ Xhr.JSONP = new Class({
4538
4601
  finish: function(data) {
4539
4602
  this.status = 200;
4540
4603
  this.readyState = 4;
4541
-
4604
+
4542
4605
  this.xhr.json = this.xhr.responseJSON = data;
4543
-
4606
+
4544
4607
  this.onreadystatechange();
4545
4608
  }
4546
4609
  });
4547
4610
 
4611
+
4548
4612
  /**
4549
4613
  * Basic visual effects class
4550
4614
  *
@@ -4557,14 +4621,14 @@ Xhr.JSONP = new Class({
4557
4621
  var Fx = RightJS.Fx = new Class(Observer, {
4558
4622
  extend: {
4559
4623
  EVENTS: $w('start finish cancel'),
4560
-
4624
+
4561
4625
  // named durations
4562
4626
  Durations: {
4563
4627
  'short': 200,
4564
4628
  'normal': 400,
4565
4629
  'long': 800
4566
4630
  },
4567
-
4631
+
4568
4632
  // default options
4569
4633
  Options: {
4570
4634
  fps: Browser.IE ? 40 : 60,
@@ -4578,28 +4642,28 @@ var Fx = RightJS.Fx = new Class(Observer, {
4578
4642
  Sin: function(i) {
4579
4643
  return -(Math.cos(Math.PI * i) - 1) / 2;
4580
4644
  },
4581
-
4645
+
4582
4646
  Cos: function(i) {
4583
4647
  return Math.asin((i-0.5) * 2)/Math.PI + 0.5;
4584
4648
  },
4585
-
4649
+
4586
4650
  Exp: function(i) {
4587
4651
  return Math.pow(2, 8 * (i - 1));
4588
4652
  },
4589
-
4653
+
4590
4654
  Log: function(i) {
4591
4655
  return 1 - Math.pow(2, - 8 * i);
4592
4656
  },
4593
-
4657
+
4594
4658
  Lin: function(i) {
4595
4659
  return i;
4596
4660
  }
4597
4661
  },
4598
-
4662
+
4599
4663
  ch: [], // scheduled effects registries
4600
4664
  cr: [] // currently running effects registries
4601
4665
  },
4602
-
4666
+
4603
4667
  /**
4604
4668
  * Basic constructor
4605
4669
  *
@@ -4607,14 +4671,14 @@ var Fx = RightJS.Fx = new Class(Observer, {
4607
4671
  */
4608
4672
  initialize: function(element, options) {
4609
4673
  this.$super(options);
4610
-
4674
+
4611
4675
  if ((this.element = element = $(element))) {
4612
4676
  var uid = $uid(element);
4613
4677
  this.ch = (Fx.ch[uid] = Fx.ch[uid] || []);
4614
4678
  this.cr = (Fx.cr[uid] = Fx.cr[uid] || []);
4615
4679
  }
4616
4680
  },
4617
-
4681
+
4618
4682
  /**
4619
4683
  * starts the transition
4620
4684
  *
@@ -4623,21 +4687,21 @@ var Fx = RightJS.Fx = new Class(Observer, {
4623
4687
  start: function() {
4624
4688
  if (this.queue(arguments)) { return this; }
4625
4689
  this.prepare.apply(this, arguments);
4626
-
4690
+
4627
4691
  var options = this.options,
4628
4692
  duration = Fx.Durations[options.duration] || options.duration;
4629
4693
  this.transition = Fx.Transitions[options.transition] || options.transition;
4630
-
4694
+
4631
4695
  this.steps = (duration / 1000 * this.options.fps).ceil();
4632
4696
  this.number = 1;
4633
-
4697
+
4634
4698
  if (this.cr) {
4635
4699
  this.cr.push(this); // adding this effect to the list of currently active
4636
4700
  }
4637
-
4701
+
4638
4702
  return this.fire('start', this).startTimer();
4639
4703
  },
4640
-
4704
+
4641
4705
  /**
4642
4706
  * finishes the transition
4643
4707
  *
@@ -4646,7 +4710,7 @@ var Fx = RightJS.Fx = new Class(Observer, {
4646
4710
  finish: function() {
4647
4711
  return this.stopTimer().unreg().fire('finish').next();
4648
4712
  },
4649
-
4713
+
4650
4714
  /**
4651
4715
  * interrupts the transition
4652
4716
  *
@@ -4660,7 +4724,7 @@ var Fx = RightJS.Fx = new Class(Observer, {
4660
4724
  this.ch.clean();
4661
4725
  return this.stopTimer().unreg().fire('cancel');
4662
4726
  },
4663
-
4727
+
4664
4728
  /**
4665
4729
  * pauses the transition
4666
4730
  *
@@ -4669,7 +4733,7 @@ var Fx = RightJS.Fx = new Class(Observer, {
4669
4733
  pause: function() {
4670
4734
  return this.stopTimer();
4671
4735
  },
4672
-
4736
+
4673
4737
  /**
4674
4738
  * resumes a paused transition
4675
4739
  *
@@ -4678,14 +4742,14 @@ var Fx = RightJS.Fx = new Class(Observer, {
4678
4742
  resume: function() {
4679
4743
  return this.startTimer();
4680
4744
  },
4681
-
4745
+
4682
4746
  // protected
4683
4747
  // dummy method, should be implemented in a subclass
4684
4748
  prepare: function(values) {},
4685
4749
 
4686
4750
  // dummy method, processes the element properties
4687
4751
  render: function(delta) {},
4688
-
4752
+
4689
4753
  // the periodically called method
4690
4754
  // NOTE: called outside of the instance scope!
4691
4755
  step: function(that) {
@@ -4700,13 +4764,13 @@ var Fx = RightJS.Fx = new Class(Observer, {
4700
4764
  that.number ++;
4701
4765
  }
4702
4766
  },
4703
-
4767
+
4704
4768
  // starts the effect timer
4705
4769
  startTimer: function() {
4706
4770
  this.timer = this.step.periodical((1000 / this.options.fps).round(), this);
4707
4771
  return this;
4708
4772
  },
4709
-
4773
+
4710
4774
  // stops the effect timer
4711
4775
  stopTimer: function() {
4712
4776
  if (this.timer) {
@@ -4719,7 +4783,7 @@ var Fx = RightJS.Fx = new Class(Observer, {
4719
4783
  // should return false if there's no queue and true if there is a queue
4720
4784
  queue: function(args) {
4721
4785
  var chain = this.ch, queue = this.options.queue;
4722
-
4786
+
4723
4787
  if (!chain || this.$ch) {
4724
4788
  return (this.$ch = false);
4725
4789
  }
@@ -4727,10 +4791,10 @@ var Fx = RightJS.Fx = new Class(Observer, {
4727
4791
  if (queue) {
4728
4792
  chain.push([args, this]);
4729
4793
  }
4730
-
4794
+
4731
4795
  return queue && chain[0][1] !== this;
4732
4796
  },
4733
-
4797
+
4734
4798
  // calls for the next effect in the queue
4735
4799
  next: function() {
4736
4800
  var chain = this.ch, next = chain.shift();
@@ -4740,7 +4804,7 @@ var Fx = RightJS.Fx = new Class(Observer, {
4740
4804
  }
4741
4805
  return this;
4742
4806
  },
4743
-
4807
+
4744
4808
  // unregisters this effect out of the currently running list
4745
4809
  unreg: function() {
4746
4810
  var currents = this.cr;
@@ -4749,9 +4813,10 @@ var Fx = RightJS.Fx = new Class(Observer, {
4749
4813
  }
4750
4814
  return this;
4751
4815
  }
4752
-
4816
+
4753
4817
  });
4754
4818
 
4819
+
4755
4820
  /**
4756
4821
  * There are the String unit extensions for the effects library
4757
4822
  *
@@ -4786,7 +4851,7 @@ String.include({
4786
4851
  */
4787
4852
  toHex: function() {
4788
4853
  var match = /^#(\w)(\w)(\w)$/.exec(this);
4789
-
4854
+
4790
4855
  if (match) {
4791
4856
  match = "#"+ match[1]+match[1]+match[2]+match[2]+match[3]+match[3];
4792
4857
  } else if ((match = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(this))) {
@@ -4797,10 +4862,10 @@ String.include({
4797
4862
  } else {
4798
4863
  match = String.COLORS[this] || this;
4799
4864
  }
4800
-
4865
+
4801
4866
  return match;
4802
4867
  },
4803
-
4868
+
4804
4869
  /**
4805
4870
  * converts a hex string into an rgb array
4806
4871
  *
@@ -4809,21 +4874,22 @@ String.include({
4809
4874
  */
4810
4875
  toRgb: function(array) {
4811
4876
  var match = /#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(this.toHex()||'');
4812
-
4877
+
4813
4878
  if (match) {
4814
4879
  match = match.slice(1).map('toInt', 16);
4815
4880
  match = array ? match : 'rgb('+match+')';
4816
4881
  }
4817
-
4882
+
4818
4883
  return match;
4819
4884
  }
4820
4885
  });
4821
4886
 
4887
+
4822
4888
  /**
4823
4889
  * This block contains additional Element shortcuts for effects easy handling
4824
4890
  *
4825
4891
  * Credits:
4826
- * Some ideas are inspired by
4892
+ * Some ideas are inspired by
4827
4893
  * - MooTools (http://mootools.net) Copyright (C) Valerio Proietti
4828
4894
  *
4829
4895
  * Copyright (C) 2008-2010 Nikolay V. Nemshilov
@@ -4833,7 +4899,7 @@ var methods = Element.prototype,
4833
4899
  old_show = methods.show,
4834
4900
  old_remove = methods.remove,
4835
4901
  old_scroll = methods.scrollTo;
4836
-
4902
+
4837
4903
  Element.include({
4838
4904
  /**
4839
4905
  * Stops all the visual effects on the element
@@ -4855,7 +4921,7 @@ Element.include({
4855
4921
  hide: function(fx, options) {
4856
4922
  return (fx && this.visible()) ? this.fx(fx, ['out', options]) : old_hide.call(this);
4857
4923
  },
4858
-
4924
+
4859
4925
  /**
4860
4926
  * shows the element with the given visual effect
4861
4927
  *
@@ -4864,9 +4930,9 @@ Element.include({
4864
4930
  * @return Element this
4865
4931
  */
4866
4932
  show: function(fx, options) {
4867
- return (fx && this.hidden()) ? this.fx(fx, ['in', options]) : old_show.call(this);
4933
+ return (fx && !this.visible()) ? this.fx(fx, ['in', options]) : old_show.call(this);
4868
4934
  },
4869
-
4935
+
4870
4936
  /**
4871
4937
  * Removes the element out of the DOM structure
4872
4938
  *
@@ -4879,7 +4945,7 @@ Element.include({
4879
4945
  onFinish: old_remove.bind(this)
4880
4946
  })]) : old_remove.call(this);
4881
4947
  },
4882
-
4948
+
4883
4949
  /**
4884
4950
  * runs the Fx.Morth effect to the given style
4885
4951
  *
@@ -4890,7 +4956,7 @@ Element.include({
4890
4956
  morph: function(style, options) {
4891
4957
  return this.fx('morph', [style, options || {}]); // <- don't replace with arguments
4892
4958
  },
4893
-
4959
+
4894
4960
  /**
4895
4961
  * highlights the element
4896
4962
  *
@@ -4902,7 +4968,7 @@ Element.include({
4902
4968
  highlight: function() {
4903
4969
  return this.fx('highlight', arguments);
4904
4970
  },
4905
-
4971
+
4906
4972
  /**
4907
4973
  * runs the Fx.Fade effect on the element
4908
4974
  *
@@ -4912,7 +4978,7 @@ Element.include({
4912
4978
  fade: function() {
4913
4979
  return this.fx('fade', arguments);
4914
4980
  },
4915
-
4981
+
4916
4982
  /**
4917
4983
  * runs the Fx.Slide effect on the element
4918
4984
  *
@@ -4923,7 +4989,7 @@ Element.include({
4923
4989
  slide: function() {
4924
4990
  return this.fx('slide', arguments);
4925
4991
  },
4926
-
4992
+
4927
4993
  /**
4928
4994
  * Starts the smooth scrolling effect
4929
4995
  *
@@ -4934,34 +5000,35 @@ Element.include({
4934
5000
  scroll: function(value, options) {
4935
5001
  return this.fx('scroll', [value, options||{}]);
4936
5002
  },
4937
-
5003
+
4938
5004
  /**
4939
5005
  * wraps the old scroll to be able to run it with fxes
4940
5006
  *
4941
5007
  * If you send two hashes then will start a smooth scrolling
4942
5008
  * otherwise will just jump over with the usual method
4943
- *
5009
+ *
4944
5010
  * @return Element this
4945
5011
  */
4946
5012
  scrollTo: function(value, options) {
4947
5013
  return isHash(options) ? this.scroll(value, options) : old_scroll.apply(this, arguments);
4948
5014
  },
4949
-
4950
-
5015
+
5016
+
4951
5017
  // protected
4952
5018
 
4953
5019
  // runs an Fx on the element
4954
5020
  fx: function(name, params) {
4955
5021
  var args = $A(params).compact(), options = isHash(args.last()) ? args.pop() : {},
4956
5022
  fx = new Fx[name.capitalize()](this, options);
4957
-
5023
+
4958
5024
  fx.start.apply(fx, args);
4959
-
5025
+
4960
5026
  return this;
4961
5027
  }
4962
-
5028
+
4963
5029
  });
4964
5030
 
5031
+
4965
5032
  /**
4966
5033
  * This class provides the basic effect for styles manipulation
4967
5034
  *
@@ -4994,7 +5061,7 @@ function check_border_styles(element, before, after) {
4994
5061
  bd_style = 'border' + direction + 'Style',
4995
5062
  bd_width = 'border' + direction + 'Width',
4996
5063
  bd_color = 'border' + direction + 'Color';
4997
-
5064
+
4998
5065
  if (bd_style in before && before[bd_style] != after[bd_style]) {
4999
5066
  var style = element._.style;
5000
5067
 
@@ -5013,7 +5080,7 @@ function check_border_styles(element, before, after) {
5013
5080
  // parses the style hash into a processable format
5014
5081
  function parse_style(values) {
5015
5082
  var result = {}, re = /[\d\.\-]+/g, m, key, value, i;
5016
-
5083
+
5017
5084
  for (key in values) {
5018
5085
  m = values[key].match(re);
5019
5086
  value = m.map('toFloat');
@@ -5021,35 +5088,35 @@ function parse_style(values) {
5021
5088
  value.r = value.t[0] === 'rgb(';
5022
5089
 
5023
5090
  if (value.t.length == 1) { value.t.unshift(''); }
5024
-
5091
+
5025
5092
  for (i=0; i < value.length; i++) {
5026
5093
  value.t.splice(i*2 + 1, 0, value[i]);
5027
5094
  }
5028
5095
  result[key] = value;
5029
5096
  }
5030
-
5097
+
5031
5098
  return result;
5032
5099
  }
5033
5100
 
5034
5101
  // cleans up and optimizies the styles
5035
5102
  function clean_styles(element, before, after) {
5036
5103
  var remove = [], key;
5037
-
5104
+
5038
5105
  for (key in after) {
5039
5106
  // checking the height/width options
5040
5107
  if ((key == 'width' || key == 'height') && before[key] == 'auto') {
5041
5108
  before[key] = element._['offset'+key.capitalize()] + 'px';
5042
5109
  }
5043
5110
  }
5044
-
5111
+
5045
5112
  // IE opacity filter fix
5046
5113
  if (after.filter && !before.filter) {
5047
5114
  before.filter = 'alpha(opacity=100)';
5048
5115
  }
5049
-
5116
+
5050
5117
  // adjusting the border style
5051
5118
  check_border_styles(element, before, after);
5052
-
5119
+
5053
5120
  // cleaing up the list
5054
5121
  for (key in after) {
5055
5122
  // proprocessing colors
@@ -5064,12 +5131,12 @@ function clean_styles(element, before, after) {
5064
5131
 
5065
5132
  if (!after[key] || !before[key]) { after[key] = before[key] = ''; }
5066
5133
  }
5067
-
5134
+
5068
5135
  // filling up the missing size
5069
5136
  if (/\d/.test(after[key]) && !/\d/.test(before[key])) {
5070
5137
  before[key] = after[key].replace(/[\d\.\-]+/g, '0');
5071
5138
  }
5072
-
5139
+
5073
5140
  // removing unprocessable keys
5074
5141
  if (after[key] === before[key] || remove.includes(key) || !/\d/.test(before[key]) || !/\d/.test(after[key])) {
5075
5142
  delete(after[key]);
@@ -5086,7 +5153,7 @@ function clean_styles(element, before, after) {
5086
5153
  */
5087
5154
  function style_keys(style) {
5088
5155
  var keys = [], border_types = ['Style', 'Color', 'Width'], key, i, j;
5089
-
5156
+
5090
5157
  for (key in style) {
5091
5158
  if (key.startsWith('border')) {
5092
5159
  for (i=0; i < border_types.length; i++) {
@@ -5104,32 +5171,32 @@ function style_keys(style) {
5104
5171
  keys.push(key);
5105
5172
  }
5106
5173
  }
5107
-
5174
+
5108
5175
  return keys;
5109
5176
  }
5110
-
5177
+
5111
5178
  Fx.Morph = new Class(Fx, {
5112
5179
 
5113
- // protected
5180
+ // protected
5114
5181
 
5115
5182
  // parepares the effect
5116
5183
  prepare: function(style) {
5117
5184
  var keys = style_keys(style),
5118
5185
  before = this._cloneStyle(this.element, keys),
5119
5186
  after = this._endStyle(style, keys);
5120
-
5187
+
5121
5188
  clean_styles(this.element, before, after);
5122
-
5189
+
5123
5190
  this.before = parse_style(before);
5124
5191
  this.after = parse_style(after);
5125
5192
  },
5126
-
5193
+
5127
5194
  render: function(delta) {
5128
5195
  var before, after, value, style = this.element._.style, key, i, l;
5129
5196
  for (key in this.after) {
5130
5197
  before = this.before[key];
5131
5198
  after = this.after[key];
5132
-
5199
+
5133
5200
  for (i=0, l = after.length; i < l; i++) {
5134
5201
  value = before[i] + (after[i] - before[i]) * delta;
5135
5202
  if (after.r) {
@@ -5137,11 +5204,11 @@ Fx.Morph = new Class(Fx, {
5137
5204
  }
5138
5205
  after.t[i*2 + 1] = value;
5139
5206
  }
5140
-
5207
+
5141
5208
  style[key] = after.t.join('');
5142
5209
  }
5143
5210
  },
5144
-
5211
+
5145
5212
  /**
5146
5213
  * Returns a hash of the end style
5147
5214
  *
@@ -5154,18 +5221,18 @@ Fx.Morph = new Class(Fx, {
5154
5221
  .setStyle('position:absolute;z-index:-1;visibility:hidden')
5155
5222
  .setWidth(element.size().x)
5156
5223
  .setStyle(style);
5157
-
5224
+
5158
5225
  if (element.parent()) {
5159
5226
  element.insert(dummy, 'before');
5160
5227
  }
5161
-
5228
+
5162
5229
  var after = this._cloneStyle(dummy, keys);
5163
-
5230
+
5164
5231
  dummy.remove();
5165
-
5232
+
5166
5233
  return after;
5167
5234
  },
5168
-
5235
+
5169
5236
  /**
5170
5237
  * Fast styles cloning
5171
5238
  *
@@ -5179,13 +5246,13 @@ Fx.Morph = new Class(Fx, {
5179
5246
  if (key in style) {
5180
5247
  clean[key] = ''+ style[key];
5181
5248
  }
5182
-
5249
+
5183
5250
  // libwebkit bug fix for in case of languages pack applied
5184
5251
  if (key === 'opacity') {
5185
5252
  clean[key] = clean[key].replace(',', '.');
5186
5253
  }
5187
5254
  }
5188
-
5255
+
5189
5256
  return clean;
5190
5257
  }
5191
5258
  });
@@ -5204,9 +5271,9 @@ Fx.Highlight = new Class(Fx.Morph, {
5204
5271
  transition: 'Exp'
5205
5272
  })
5206
5273
  },
5207
-
5274
+
5208
5275
  // protected
5209
-
5276
+
5210
5277
  /**
5211
5278
  * starts the transition
5212
5279
  *
@@ -5216,19 +5283,19 @@ Fx.Highlight = new Class(Fx.Morph, {
5216
5283
  */
5217
5284
  prepare: function(start, end) {
5218
5285
  var element = this.element, style = element._.style, end_color = end || element.getStyle('backgroundColor');
5219
-
5286
+
5220
5287
  if (is_transparent(end_color)) {
5221
5288
  this.onFinish(function() { style.backgroundColor = 'transparent'; });
5222
-
5289
+
5223
5290
  // trying to find the end color
5224
5291
  end_color = [element].concat(element.parents()).map(function(node) {
5225
5292
  var bg = node.getStyle('backgroundColor');
5226
- return (bg && !is_transparent(bg)) ? bg : null;
5293
+ return (bg && !is_transparent(bg)) ? bg : null;
5227
5294
  }).compact().first() || '#FFF';
5228
5295
  }
5229
-
5296
+
5230
5297
  style.backgroundColor = (start || this.options.color);
5231
-
5298
+
5232
5299
  return this.$super({backgroundColor: end_color});
5233
5300
  }
5234
5301
  });
@@ -5240,7 +5307,7 @@ Fx.Highlight = new Class(Fx.Morph, {
5240
5307
  * Copyright (C) 2008-2010 Nikolay V. Nemshilov
5241
5308
  */
5242
5309
  Fx.Twin = new Class(Fx.Morph, {
5243
-
5310
+
5244
5311
  /**
5245
5312
  * hides the element if it meant to be switched off
5246
5313
  *
@@ -5250,12 +5317,12 @@ Fx.Twin = new Class(Fx.Morph, {
5250
5317
  if (this.how == 'out') {
5251
5318
  old_hide.call(this.element);
5252
5319
  }
5253
-
5320
+
5254
5321
  return this.$super();
5255
5322
  },
5256
5323
 
5257
5324
  // protected
5258
-
5325
+
5259
5326
  /**
5260
5327
  * assigns the direction of the effect in or out
5261
5328
  *
@@ -5263,7 +5330,7 @@ Fx.Twin = new Class(Fx.Morph, {
5263
5330
  */
5264
5331
  setHow: function(how) {
5265
5332
  this.how = how || 'toggle';
5266
-
5333
+
5267
5334
  if (this.how == 'toggle') {
5268
5335
  this.how = this.element.visible() ? 'out' : 'in';
5269
5336
  }
@@ -5271,6 +5338,7 @@ Fx.Twin = new Class(Fx.Morph, {
5271
5338
 
5272
5339
  });
5273
5340
 
5341
+
5274
5342
  /**
5275
5343
  * the slide effects wrapper
5276
5344
  *
@@ -5282,14 +5350,14 @@ Fx.Slide = new Class(Fx.Twin, {
5282
5350
  direction: 'top'
5283
5351
  })
5284
5352
  },
5285
-
5286
- // protected
5353
+
5354
+ // protected
5287
5355
  prepare: function(how) {
5288
5356
  this.setHow(how);
5289
-
5357
+
5290
5358
  var element = old_show.call(this.element);
5291
5359
  this.size = element.size();
5292
-
5360
+
5293
5361
  this.styles = {};
5294
5362
  $w('overflow height width marginTop marginLeft').each(function(key) {
5295
5363
  this.styles[key] = element._.style[key];
@@ -5322,7 +5390,7 @@ Fx.Slide = new Class(Fx.Twin, {
5322
5390
 
5323
5391
  } else if (this.how == 'in') {
5324
5392
  var element_style = this.element._.style;
5325
-
5393
+
5326
5394
  if (['top', 'bottom'].includes(direction)) {
5327
5395
  style.height = size.y + 'px';
5328
5396
  element_style.height = '0px';
@@ -5339,12 +5407,13 @@ Fx.Slide = new Class(Fx.Twin, {
5339
5407
  element_style.marginTop = margin_top + size.y + 'px';
5340
5408
  }
5341
5409
  }
5342
-
5410
+
5343
5411
  return style;
5344
5412
  }
5345
5413
 
5346
5414
  });
5347
5415
 
5416
+
5348
5417
  /**
5349
5418
  * The opacity effects wrapper
5350
5419
  *
@@ -5353,37 +5422,38 @@ Fx.Slide = new Class(Fx.Twin, {
5353
5422
  Fx.Fade = new Class(Fx.Twin, {
5354
5423
  prepare: function(how) {
5355
5424
  this.setHow(how);
5356
-
5425
+
5357
5426
  if (this.how == 'in') {
5358
5427
  old_show.call(this.element.setStyle({opacity: 0}));
5359
5428
  }
5360
-
5429
+
5361
5430
  return this.$super({opacity: isNumber(how) ? how : this.how == 'in' ? 1 : 0});
5362
5431
  }
5363
5432
  });
5364
5433
 
5434
+
5365
5435
  /**
5366
5436
  * A smooth scrolling visual effect
5367
5437
  *
5368
5438
  * Copyright (C) 2009-2010 Nikolay V. Nemshilov
5369
5439
  */
5370
5440
  Fx.Scroll = new Class(Fx, {
5371
-
5441
+
5372
5442
  initialize: function(element, options) {
5373
5443
  element = $(element);
5374
5444
  // swapping the actual scrollable when it's the window
5375
5445
  this.$super(element instanceof Window ? element._.document[Browser.WebKit ? 'body' : 'documentElement'] : element, options);
5376
5446
  },
5377
-
5447
+
5378
5448
  prepare: function(value) {
5379
5449
  var before = this.before = {}, element = this.element._;
5380
-
5450
+
5381
5451
  this.after = value;
5382
-
5452
+
5383
5453
  if ('x' in value) { before.x = element.scrollLeft; }
5384
5454
  if ('y' in value) { before.y = element.scrollTop; }
5385
5455
  },
5386
-
5456
+
5387
5457
  render: function(delta) {
5388
5458
  var before = this.before, key;
5389
5459
  for (key in before) {
@@ -5392,6 +5462,7 @@ Fx.Scroll = new Class(Fx, {
5392
5462
  }
5393
5463
  });
5394
5464
 
5465
+
5395
5466
  /**
5396
5467
  * this module handles the work with cookies
5397
5468
  *
@@ -5403,7 +5474,7 @@ Fx.Scroll = new Class(Fx, {
5403
5474
  */
5404
5475
  var Cookie = RightJS.Cookie = new Class({
5405
5476
  include: Options,
5406
-
5477
+
5407
5478
  extend: {
5408
5479
  // sets the cookie
5409
5480
  set: function(name, value, options) {
@@ -5417,20 +5488,20 @@ var Cookie = RightJS.Cookie = new Class({
5417
5488
  remove: function(name) {
5418
5489
  return new this(name).remove();
5419
5490
  },
5420
-
5491
+
5421
5492
  // checks if the cookies are enabled
5422
5493
  enabled: function() {
5423
5494
  document.cookie = "__t=1";
5424
5495
  return document.cookie.indexOf("__t=1")!=-1;
5425
5496
  },
5426
-
5497
+
5427
5498
  // some basic options
5428
5499
  Options: {
5429
5500
  secure: false,
5430
5501
  document: document
5431
5502
  }
5432
5503
  },
5433
-
5504
+
5434
5505
  /**
5435
5506
  * constructor
5436
5507
  * @param String cookie name
@@ -5441,7 +5512,7 @@ var Cookie = RightJS.Cookie = new Class({
5441
5512
  this.name = name;
5442
5513
  this.setOptions(options);
5443
5514
  },
5444
-
5515
+
5445
5516
  /**
5446
5517
  * sets the cookie with the name
5447
5518
  *
@@ -5461,7 +5532,7 @@ var Cookie = RightJS.Cookie = new Class({
5461
5532
  options.document.cookie = this.name + '=' + value;
5462
5533
  return this;
5463
5534
  },
5464
-
5535
+
5465
5536
  /**
5466
5537
  * searches for a cookie with the name
5467
5538
  *
@@ -5471,8 +5542,8 @@ var Cookie = RightJS.Cookie = new Class({
5471
5542
  var value = this.options.document.cookie.match('(?:^|;)\\s*' + RegExp.escape(this.name) + '=([^;]*)');
5472
5543
  return (value) ? decodeURIComponent(value[1]) : null;
5473
5544
  },
5474
-
5475
- /**
5545
+
5546
+ /**
5476
5547
  * removes the cookie
5477
5548
  *
5478
5549
  * @return Cookie this
@@ -5483,6 +5554,12 @@ var Cookie = RightJS.Cookie = new Class({
5483
5554
  }
5484
5555
  });
5485
5556
 
5557
+
5558
+ // globalizing the top-level variables
5559
+ $ext(window, Object.without(RightJS, 'version', 'modules'));
5560
+
5561
+ return RightJS;
5562
+ })(window, document, Object, Array, String, Function, Number, Math);
5486
5563
  /**
5487
5564
  * The old browsers support patch loading script
5488
5565
  * will be included in the core file when it's built
@@ -5500,10 +5577,3 @@ if (!document.querySelector) {
5500
5577
  .src.replace(/(^|\/)(right)([^\/]+)$/, '$1$2-olds$3') +
5501
5578
  '"></script>');
5502
5579
  }
5503
-
5504
-
5505
- // globalizing the top-level variables
5506
- $ext(window, Object.without(RightJS, 'version', 'modules'));
5507
-
5508
- return RightJS;
5509
- })(window, document, Object, Array, String, Function, Number, Math);