forked from ender-js/Ender
/
ender.min.js
7 lines (7 loc) · 22.6 KB
/
ender.min.js
1
2
3
4
5
6
7
/*!
* Ender.js: a small yet powerful JavaScript library composed of application agnostic submodules
* License MIT
* copyright Dustin Diaz 2011
* https://github.com/ded/Ender.js
*/
!function(a,b){function j(a,c){d[e]=this[e];var g=this,h=new d,j=typeof a==b,k=j?a:this,l=j?{}:a,m=function(){c||f(a)&&g.apply(this,arguments),k.apply(this,arguments),this.initialize&&this.initialize.apply(this,arguments)};m.methods=function(a){i(h,a,g),m[e]=h;return this},m.methods.call(m,l).prototype.constructor=m,m.extend=arguments.callee,m[e].implement=m.statics=function(a,b){a=typeof a=="string"?function(){var c={};c[a]=b;return c}():a,i(this,a,g);return this};return m}function i(a,d,f){for(var g in d)d.hasOwnProperty(g)&&(a[g]=typeof d[g]==b&&typeof f[e][g]==b&&c.test(d[g])?h(g,d[g],f):d[g])}function h(a,b,c){return function(){var d=this.supr;this.supr=c[e][a];var f=b.apply(this,arguments);this.supr=d;return f}}function g(a){return j.call(typeof a==b?a:d,a,1)}var c=/xyz/.test(function(){xyz})?/\bsupr\b/:/.*/,d=function(){},e="prototype",f=function(a){return typeof a===b};if(typeof module!="undefined"&&module.exports)module.exports=g;else{var k=a.klass;g.noConflict=function(){a.klass=k;return this},a.klass=g}}(this,"function"),!function(a,b){function V(a){var b=[],c,d;label:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue label;b[b.length]=a[c]}return b}function U(a,c){c=typeof c=="string"?U(c)[0]:c||b;if(!c)return[];if(h=T(a,c))return h;if(b.getElementsByClassName&&(h=a.match(y)))return G(c.getElementsByClassName(h[1]));return G(c.querySelectorAll(a))}function T(a,c){if(h=a.match(x))return(m=b.getElementById(h[1]))?[m]:[];if(h=a.match(z))return G(c.getElementsByTagName(h[1]));return!1}function R(a){var b=[],c=[],d,g=L.g(a)||L.s(a,a.split(C));g=g.slice(0);if(!g.length)return b;b=O(g);if(!g.length)return b;for(e=b.length,f=0;e--;){n=b[e],j=n;for(d=g.length;d--;)z:while(j!==B&&(j=j.parentNode))if(p=N.apply(j,M(g[d])))break z;p&&(c[f++]=n)}return c}function Q(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(K.g("^="+c)||K.s("^="+c,new RegExp("^"+P(c))));case"$=":return b.match(K.g("$="+c)||K.s("$="+c,new RegExp(P(c)+"$")));case"*=":return b.match(K.g(c)||K.s(c,new RegExp(P(c))));case"~=":return b.match(K.g("~="+c)||K.s("~="+c,new RegExp("(?:^|\\s+)"+P(c)+"(?:\\s+|$)")));case"|=":return b.match(K.g("|="+c)||K.s("|="+c,new RegExp("^"+P(c)+"(-|$)")))}return!1}function P(a){return J.g(a)||J.s(a,a.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"))}function O(a){var c=[],d=a.pop(),e=M(d),f=e[1]||"*",g,i,j,k=a.length&&(h=a[0].match(x))?b.getElementById(h[1]):b;if(!k)return c;j=k.getElementsByTagName(f);for(g=0,i=j.length;g<i;g++)m=j[g],(r=N.apply(m,e))&&c.push(r);return c}function N(a,b,c,e,f,g,h){var j,k,l;if(b&&this.tagName.toLowerCase()!==b)return!1;if(c&&(j=c.match(v))&&j[1]!==this.id)return!1;if(c&&(q=c.match(w)))for(d=q.length;d--;){k=q[d].slice(1);if(!(I.g(k)||I.s(k,new RegExp("(^|\\s+)"+k+"(\\s+|$)"))).test(this.className))return!1}if(e&&!h){i=this.attributes;for(l in i)if(Object.prototype.hasOwnProperty.call(i,l)&&(i[l].name||l)==f)return this}if(e&&!Q(g,this.getAttribute(f)||"",h))return!1;return this}function M(a){return a.match(F)}function G(a){k=[];for(d=0,o=a.length;d<o;d++)k[d]=a[d];return k}var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=/#([\w\-]+)/,w=/\.[\w\-]+/g,x=/^#([\w\-]+$)/,y=/^\.([\w\-]+)$/,z=/^([\w\-]+)$/,A=/^([\w]+)?\.([\w\-]+)$/,B=b.documentElement,C=/\s(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\])/,D=/^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,E=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,F=new RegExp(D.source+"("+E.source+")?"),H=function(){this.c={}};H.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b){this.c[a]=b;return b}};var I=new H,J=new H,K=new H,L=new H,S="compareDocumentPosition"in B?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in B?function(a,b){return b!==a&&b.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},W=function(){if(b.querySelector&&b.querySelectorAll)return U;return function(a,c){c=typeof c=="string"?W(c)[0]:c||b;if(!c)return[];var d,f=[],g=[],i;if(h=T(a,c))return h;if(h=a.match(A)){s=c.getElementsByTagName(h[1]||"*"),k=I.g(h[2])||I.s(h[2],new RegExp("(^|\\s+)"+h[2]+"(\\s+|$)"));for(d=s.length,e=0;d--;)k.test(s[d].className)&&(f[e++]=s[d]);return f}for(s=a.split(","),d=s.length;d--;)g[d]=R(s[d]);for(d=g.length;u=g[--d];){var j=u;if(c!==b){j=[];for(e=u.length;i=u[--e];)S(i,c)&&j.push(i)}f=f.concat(j)}return V(f)}}(),X=a.qwery;W.noConflict=function(){a.qwery=X;return this},a.qwery=W}(this,document),!function(a){function t(a,b,e){var f={duration:b.duration,easing:b.easing,after:b.after};delete b.duration,delete b.easing,delete b.after;var g=l(b,function(a,b){a=m(a);return k(a)in d&&c.test(b)?[a,b+"px"]:[a,b]});s(a,g,f,e)}function s(a,b,c,d){a=typeof a=="string"?document.getElementById(a):a,c=c||{};var e=r(b),f=a.currentStyle?a.currentStyle:getComputedStyle(a,null),g={},h=+(new Date),i,j=c.duration||200,k=h+j,l,m=c.easing||function(a){return-Math.cos(a*Math.PI)/2+.5};for(i in e)g[i]=q(f[i]);l=setInterval(function(){var b=+(new Date),f,i=b>k?1:(b-h)/j;for(f in e)a.style[f]=e[f].f(g[f].v,e[f].v,m(i))+e[f].u;b>k&&(clearInterval(l),c.after&&c.after(),d&&setTimeout(d,1))},10)}function r(a){var c,d={},e=g.length,f;b.innerHTML='<div style="'+a+'"></div>',c=b.childNodes[0].style;while(e--)(f=c[g[e]])&&(d[g[e]]=q(f));return d}function q(a){var b=parseFloat(a),c=a.replace(/^[\-\d\.]+/,"");return isNaN(b)?{v:c,f:p,u:""}:{v:b,f:n,u:c}}function p(a,b,c){var d=2,e,f,g,h=[],i=[];while((e=3)&&(f=arguments[d-1])&&d--)if(o(f,0)=="r"){f=f.match(/\d+/g);while(e--)h.push(~~f[e])}else{f.length==4&&(f="#"+o(f,1)+o(f,1)+o(f,2)+o(f,2)+o(f,3)+o(f,3));while(e--)h.push(parseInt(o(f,1+e*2,2),16))}while(e--)g=~~(h[e+3]+(h[e]-h[e+3])*c),i.push(g<0?0:g>255?255:g);return"rgb("+i.join(",")+")"}function o(a,b,c){return a.substr(b,c||1)}function n(a,b,c){return(a+(b-a)*c).toFixed(3)}function m(a){if(a.toUpperCase()===a)return a;return a.replace(/([a-zA-Z0-9])([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()}function l(a,b){return j(a,function(a,c){var d=b?b(c,a):[c,a];return d[0]+":"+d[1]+";"}).join("")}function k(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function j(a,b,c){var d=[],e;for(e in a)d.push(b.call(c,a[e],e,a));return d}var b=document.createElement("div"),c=/\d+$/,d={},e="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color fontWeight lineHeight opacity outlineColor zIndex",f="top bottom left right borderWidth borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderSpacing borderRadius marginBottom marginLeft marginRight marginTop width height maxHeight maxWidth minHeight minWidth paddingBottom paddingLeft paddingRight paddingTop fontSize wordSpacing textIndent letterSpacing outlineWidth outlineOffset",g=(e+" "+f).split(" ");for(var h=f.split(" "),i=h.length;i--;)d[h[i]]=1;var u=a.emile;t.noConflict=function(){a.emile=u;return this},a.emile=t}(this),!function(context){function reqwest(a,b){return new Reqwest(a,b)}function Reqwest(o,fn){function success(resp){var r=resp.responseText,val=/json$/i.test(type)?JSON.parse(r):r;/^js$/i.test(type)&&eval(r),fn&&typeof fn=="function"?fn(o):o.success(val)}var type=o.type||"js";this.request=getRequest(o,success),this.retries=o.retries||0}function getRequest(a,b){var c=xhr();c.open(a.method||"GET",typeof a=="string"?a:a.url,!0),c.onreadystatechange=readyState(c,b||a),c.send(a.data||null);return c}function readyState(a,b){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b&&typeof b=="function"?b(a):b.success(a):b&&b.error&&b.error(a),b&&b.complete&&b.complete(a))}}var twoHundo=/^20\d$/,xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){this.request.send(this.o.data||null)}};var oldJax=context.reqwest;reqwest.noConflict=function(){context.reqwest=oldJax;return this},context.reqwest=reqwest}(this),!function(a,b,c){function w(a){h.test(b[p])?c(function(){w(a)},50):a()}function t(a,b){s(a,function(a){return!b(a)})}var d=b.getElementsByTagName("script")[0],e={},f={},g={},h=/in/,i={},k="string",l=!1,m,n="push",o="DOMContentLoaded",p="readyState",q="addEventListener",r="onreadystatechange",s=Array.every||function(a,b){for(m=0,j=a.length;m<j;++m)if(!b(a[m]))return 0;return 1};!b[p]&&b[q]&&(b[q](o,function u(){b.removeEventListener(o,u,l),b[p]="complete"},l),b[p]="loading");var v=function(a,j,k){function w(){if(!--q){e[o]=1,m&&m();for(var a in g)s(a.split("|"),u)&&!t(g[a],u)&&(g[a]=[])}}function u(a){return a.call?a():e[a]}a=a[n]?a:[a];var l=j&&j.call,m=l?j:k,o=l?a.join(""):j,q=a.length;if(!o||!f[o]){c(function(){t(a,function(a){if(!i[a]){i[a]=1,o&&(f[o]=1);var c=b.createElement("script"),e=0;c.onload=c[r]=function(){c[p]&&!!h.test(c[p])||e||(c.onload=c[r]=null,e=1,w())},c.async=1,c.src=a,d.parentNode.insertBefore(c,d)}})},0);return v}};v.ready=function(a,b,c){a=a[n]?a:[a];var d=[];!t(a,function(a){e[a]||d[n](a)})&&s(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][n](b),c&&c(d)}(a.join("|"));return v},v.domReady=w;var x=a.$script;v.noConflict=function(){a.$script=x;return this},a.$script=v}(this,document,setTimeout),function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.slice,h=d.unshift,i=e.toString,j=e.hasOwnProperty,k=d.forEach,l=d.map,m=d.reduce,n=d.reduceRight,o=d.filter,p=d.every,q=d.some,r=d.indexOf,s=d.lastIndexOf,t=Array.isArray,u=Object.keys,v=f.bind,w=function(a){return new B(a)};typeof module!="undefined"&&module.exports?(module.exports=w,w._=w):a._=w,w.VERSION="1.1.5";var x=w.each=w.forEach=function(a,b,d){if(a!=null)if(k&&a.forEach===k)a.forEach(b,d);else if(w.isNumber(a.length)){for(var e=0,f=a.length;e<f;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g in a)if(j.call(a,g)&&b.call(d,a[g],g,a)===c)return};w.map=function(a,b,c){var d=[];if(a==null)return d;if(l&&a.map===l)return a.map(b,c);x(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)});return d},w.reduce=w.foldl=w.inject=function(a,b,c,d){var e=c!==void 0;a==null&&(a=[]);if(m&&a.reduce===m){d&&(b=w.bind(b,d));return e?a.reduce(b,c):a.reduce(b)}x(a,function(a,f,g){!e&&f===0?(c=a,e=!0):c=b.call(d,c,a,f,g)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},w.reduceRight=w.foldr=function(a,b,c,d){a==null&&(a=[]);if(n&&a.reduceRight===n){d&&(b=w.bind(b,d));return c!==void 0?a.reduceRight(b,c):a.reduceRight(b)}var e=(w.isArray(a)?a.slice():w.toArray(a)).reverse();return w.reduce(e,b,c,d)},w.find=w.detect=function(a,b,c){var d;y(a,function(a,e,f){if(b.call(c,a,e,f)){d=a;return!0}});return d},w.filter=w.select=function(a,b,c){var d=[];if(a==null)return d;if(o&&a.filter===o)return a.filter(b,c);x(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)});return d},w.reject=function(a,b,c){var d=[];if(a==null)return d;x(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)});return d},w.every=w.all=function(a,b,d){b=b||w.identity;var e=!0;if(a==null)return e;if(p&&a.every===p)return a.every(b,d);x(a,function(a,f,g){if(!(e=e&&b.call(d,a,f,g)))return c});return e};var y=w.some=w.any=function(a,b,d){b=b||w.identity;var e=!1;if(a==null)return e;if(q&&a.some===q)return a.some(b,d);x(a,function(a,f,g){if(e=b.call(d,a,f,g))return c});return e};w.include=w.contains=function(a,b){var c=!1;if(a==null)return c;if(r&&a.indexOf===r)return a.indexOf(b)!=-1;y(a,function(a){if(c=a===b)return!0});return c},w.invoke=function(a,b){var c=g.call(arguments,2);return w.map(a,function(a){return(b?a[b]:a).apply(a,c)})},w.pluck=function(a,b){return w.map(a,function(a){return a[b]})},w.max=function(a,b,c){if(!b&&w.isArray(a))return Math.max.apply(Math,a);var d={computed:-Infinity};x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})});return d.value},w.min=function(a,b,c){if(!b&&w.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})});return d.value},w.sortBy=function(a,b,c){return w.pluck(w.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},w.sortedIndex=function(a,b,c){c=c||w.identity;var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},w.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(w.isArray(a))return a;if(w.isArguments(a))return g.call(a);return w.values(a)},w.size=function(a){return w.toArray(a).length},w.first=w.head=function(a,b,c){return b!=null&&!c?g.call(a,0,b):a[0]},w.rest=w.tail=function(a,b,c){return g.call(a,b==null||c?1:b)},w.last=function(a){return a[a.length-1]},w.compact=function(a){return w.filter(a,function(a){return!!a})},w.flatten=function(a){return w.reduce(a,function(a,b){if(w.isArray(b))return a.concat(w.flatten(b));a[a.length]=b;return a},[])},w.without=function(a){var b=g.call(arguments,1);return w.filter(a,function(a){return!w.include(b,a)})},w.uniq=w.unique=function(a,b){return w.reduce(a,function(a,c,d){if(0==d||(b===!0?w.last(a)!=c:!w.include(a,c)))a[a.length]=c;return a},[])},w.intersect=function(a){var b=g.call(arguments,1);return w.filter(w.uniq(a),function(a){return w.every(b,function(b){return w.indexOf(b,a)>=0})})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=Array(b);for(var d=0;d<b;d++)c[d]=w.pluck(a,""+d);return c},w.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c){d=w.sortedIndex(a,b);return a[d]===b?d:-1}if(r&&a.indexOf===r)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},w.lastIndexOf=function(a,b){if(a==null)return-1;if(s&&a.lastIndexOf===s)return a.lastIndexOf(b);var c=a.length;while(c--)if(a[c]===b)return c;return-1},w.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=Array(d);while(e<d)f[e++]=a,a+=c;return f},w.bind=function(a,b){if(a.bind===v&&v)return v.apply(a,g.call(arguments,1));var c=g.call(arguments,2);return function(){return a.apply(b,c.concat(g.call(arguments)))}},w.bindAll=function(a){var b=g.call(arguments,1);b.length==0&&(b=w.functions(a)),x(b,function(b){a[b]=w.bind(a[b],a)});return a},w.memoize=function(a,b){var c={};b=b||w.identity;return function(){var d=b.apply(this,arguments);return j.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},w.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},w.defer=function(a){return w.delay.apply(w,[a,1].concat(g.call(arguments,1)))};var z=function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}};w.throttle=function(a,b){return z(a,b,!1)},w.debounce=function(a,b){return z(a,b,!0)},w.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}},w.wrap=function(a,b){return function(){var c=[a].concat(g.call(arguments));return b.apply(this,c)}},w.compose=function(){var a=g.call(arguments);return function(){var b=g.call(arguments);for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.keys=u||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)j.call(a,c)&&(b[b.length]=c);return b},w.values=function(a){return w.map(a,w.identity)},w.functions=w.methods=function(a){return w.filter(w.keys(a),function(b){return w.isFunction(a[b])}).sort()},w.extend=function(a){x(g.call(arguments,1),function(b){for(var c in b)a[c]=b[c]});return a},w.defaults=function(a){x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])});return a},w.clone=function(a){return w.isArray(a)?a.slice():w.extend({},a)},w.tap=function(a,b){b(a);return a},w.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(w.isDate(a)&&w.isDate(b))return a.getTime()===b.getTime();if(w.isNaN(a)&&w.isNaN(b))return!1;if(w.isRegExp(a)&&w.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=w.keys(a),f=w.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!w.isEqual(a[g],b[g]))return!1;return!0},w.isEmpty=function(a){if(w.isArray(a)||w.isString(a))return a.length===0;for(var b in a)if(j.call(a,b))return!1;return!0},w.isElement=function(a){return!!a&&a.nodeType==1},w.isArray=t||function(a){return i.call(a)==="[object Array]"},w.isArguments=function(a){return!!a&&!!j.call(a,"callee")},w.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},w.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},w.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1},w.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},w.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.noConflict=function(){a._=b;return this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},w.mixin=function(a){x(w.functions(a),function(b){D(b,w[b]=a[b])})};var A=0;w.uniqueId=function(a){var b=A++;return a?a+b:b},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},w.template=function(a,b){var c=w.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var B=function(a){this._wrapped=a};w.prototype=B.prototype;var C=function(a,b){return b?w(a).chain():a},D=function(a,b){B.prototype[a]=function(){var a=g.call(arguments);h.call(a,this._wrapped);return C(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];B.prototype[a]=function(){b.apply(this._wrapped,arguments);return C(this._wrapped,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];B.prototype[a]=function(){return C(b.apply(this._wrapped,arguments),this._chain)}}),B.prototype.chain=function(){this._chain=!0;return this},B.prototype.value=function(){return this._wrapped}}(),!function(a){function o(a){return new n(a)}function n(a){this.elements=Object.prototype.hasOwnProperty.call(a,"length")?a:[a]}function m(a,b,c){for(var d=0,e=a.length;d<e;++d)if(b.call(c,a[d],d,a))return!0;return!1}function l(a){return a&&a.nodeName&&a.nodeType==1}function k(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function j(a){return a.replace(/(^\s*|\s*$)/g,"")}function h(a,b){for(i=0,len=a.length;i<len;i++)b(a[i])}function g(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}var b=document,c=b.compatMode=="CSS1Compat"?b.documentElement:b.body,d=/^checked|value|selected$/,e=/^checked|selected$/,f=/msie/.test(navigator.userAgent);n.prototype={each:function(a){for(var b=0;b<this.elements.length;b++)a.call(this,this.elements[b]);return this},map:function(a){var b=[];for(var c=0;c<this.elements.length;c++)b.push(a.call(this,this.elements[c]));return b},html:function(a){return typeof a=="string"?this.each(function(b){b.innerHTML=a}):this.elements[0].innerHTML},addClass:function(a){return this.each(function(b){this.hasClass(b,a)||(b.className=j(b.className+" "+a))})},removeClass:function(a){return this.each(function(b){this.hasClass(b,a)&&(b.className=j(b.className.replace(g(a)," ")))})},hasClass:function(a,b){return typeof b=="undefined"?m(this.elements,function(b){return g(a).test(b.className)}):g(b).test(a.className)},show:function(a){return this.each(function(a){a.style.display=""})},hide:function(a){return this.each(function(a){a.style.display="none"})},create:function(a){return typeof a=="string"?function(){var c=b.createElement("div"),d=[];c.innerHTML=a;var e=c.childNodes;c=c.firstChild,d.push(c);while(c=c.nextSibling)c.nodeType==1&&d.push(c);return d}():l(a)?[a.cloneNode(!0)]:[]},append:function(a){return this.each(function(b){h(this.create(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;h(this.create(a),function(a){b.insertBefore(a,c)})})},before:function(a){return this.each(function(b){h(this.create(a),function(a){b.parentNode.insertBefore(a,b)})})},after:function(a){return this.each(function(b){h(this.create(a),function(a){b.parentNode.insertBefore(a,b.nextSibling)})})},css:function(a,b){var c=typeof a=="string"?function(c){c.style[k(a)]=b}:function(b){for(var c in a)a.hasOwnProperty(c)&&(b.style[k(c)]=a[c])};return this.each(c)},offset:function(){var a=this.elements[0],b=a.offsetWidth,c=a.offsetHeight,d=a.offsetTop,e=a.offsetLeft;while(a=a.offsetParent)d=d+a.offsetTop,e=e+a.offsetLeft;return{top:d,left:e,height:c,width:b}},attr:function(a,b){var c=this.elements[0];return typeof b=="undefined"?d.test(a)?e.test(a)&&typeof c[a]=="string"?!0:c[a]:c.getAttribute(a):this.each(function(c){c.setAttribute(a,b)})},remove:function(){this.each(function(a){a.parentNode.removeChild(a)})},empty:function(){return this.each(function(a){while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a.parentNode.removeChild(a)})}},o.augment=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||n.prototype)[c]=a[c])},o.doc=function(){var a=c.scrollWidth,b=c.scrollHeight,d=this.viewport();return{width:Math.max(a,d.width),height:Math.max(b,d.height)}},o.viewport=function(){var a=self.innerHeight,b=self.innerWidth;f&&(a=c.clientHeight)&&(b=c.clientWidth);return{width:b,height:a}},o.contains="compareDocumentPosition"in c?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in c?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1};var p=a.bonzo;o.noConflict=function(){a.bonzo=p;return this},a.bonzo=o}(this),!function(a){function k(a,c){return b(f(a,c))}function j(a){return a.replace(/(^\s*|\s*$)/g,"")}function i(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}var b=bonzo.noConflict(),c=_.noConflict(),d=klass.noConflict(),e=emile.noConflict(),f=qwery.noConflict(),g=reqwest.noConflict(),h=$script.noConflict();i(k,c),i(k,b),i(k,{trim:function(a){return j(a)},klass:d,ajax:g,script:h,fn:b.augment}),k.fn({animate:function(a,b){this.each(function(c){e(c,a,b)});return this}});var l=a.$;k.noConflict=function(){a.$=l;return this},a.$=k}(this)