// augment.js JavaScript 1.8.5 methods for all, version: 0.2.1
// using snippets from Mozilla - https://developer.mozilla.org/en/JavaScript
// (c) 2011 Oliver Nightingale
//
//  Released under MIT license.
//
if(!Array.prototype.every)Array.prototype.every=function(d,c){if(this===void 0||this===null)throw new TypeError;var a=Object(this),b=a.length>>>0;if(typeof d!=="function")throw new TypeError;for(var e=0;e<b;e++)if(e in a&&!d.call(c,a[e],e,a))return false;return true};
if(!Array.prototype.filter)Array.prototype.filter=function(d,c){if(this===void 0||this===null)throw new TypeError;var a=Object(this),b=a.length>>>0;if(typeof d!=="function")throw new TypeError;for(var e=[],f=0;f<b;f++)if(f in a){var g=a[f];d.call(c,g,f,a)&&e.push(g)}return e};
if(!Array.prototype.forEach)Array.prototype.forEach=function(d,c){if(this===void 0||this===null)throw new TypeError;var a=Object(this),b=a.length>>>0;if(typeof d!=="function")throw new TypeError;for(var e=0;e<b;e++)e in a&&d.call(c,a[e],e,a)};
if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d){if(this===void 0||this===null)throw new TypeError;var c=Object(this),a=c.length>>>0;if(a===0)return-1;var b=0;if(arguments.length>0){b=Number(arguments[1]);if(b!==b)b=0;else if(b!==0&&b!==Infinity&&b!==-Infinity)b=(b>0||-1)*Math.floor(Math.abs(b))}if(b>=a)return-1;for(b=b>=0?b:Math.max(a-Math.abs(b),0);b<a;b++)if(b in c&&c[b]===d)return b;return-1};Array.isArray=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"};
if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(d){if(this===void 0||this===null)throw new TypeError;var c=Object(this),a=c.length>>>0;if(a===0)return-1;var b=a;if(arguments.length>1){b=Number(arguments[1]);if(b!==b)b=0;else if(b!==0&&b!==Infinity&&b!==-Infinity)b=(b>0||-1)*Math.floor(Math.abs(b))}for(a=b>=0?Math.min(b,a-1):a-Math.abs(b);a>=0;a--)if(a in c&&c[a]===d)return a;return-1};
if(!Array.prototype.map)Array.prototype.map=function(d,c){if(this===void 0||this===null)throw new TypeError;var a=Object(this),b=a.length>>>0;if(typeof d!=="function")throw new TypeError;for(var e=Array(b),f=0;f<b;f++)if(f in a)e[f]=d.call(c,a[f],f,a);return e};
if(!Array.prototype.reduce)Array.prototype.reduce=function(d){if(this===void 0||this===null)throw new TypeError;var c=Object(this),a=c.length>>>0;if(typeof d!=="function")throw new TypeError;if(a==0&&arguments.length==1)throw new TypeError;var b=0,e;if(arguments.length>=2)e=arguments[1];else{do{if(b in c){e=c[b++];break}if(++b>=a)throw new TypeError;}while(1)}for(;b<a;){if(b in c)e=d.call(undefined,e,c[b],b,c);b++}return e};
if(!Array.prototype.reduceRight)Array.prototype.reduceRight=function(d){if(this===void 0||this===null)throw new TypeError;var c=Object(this),a=c.length>>>0;if(typeof d!=="function")throw new TypeError;if(a===0&&arguments.length===1)throw new TypeError;a-=1;var b;if(arguments.length>=2)b=arguments[1];else{do{if(a in this){b=this[a--];break}if(--a<0)throw new TypeError;}while(1)}for(;a>=0;){if(a in c)b=d.call(undefined,b,c[a],a,c);a--}return b};
if(!Array.prototype.some)Array.prototype.some=function(d,c){if(this===void 0||this===null)throw new TypeError;var a=Object(this),b=a.length>>>0;if(typeof d!=="function")throw new TypeError;for(var e=0;e<b;e++)if(e in a&&d.call(c,a[e],e,a))return true;return false};if(!Date.now)Date.now=function(){return+new Date};if(!Date.prototype.toJSON)Date.prototype.toJSON=Date.prototype.toJSON;
if(!Date.prototype.toUTCString)Date.prototype.toUTCString=function(){var d=function(c){return(c+="",c.length==2)?c:"0"+c};return function(){var c=[this.getUTCFullYear(),d(this.getUTCMonth()+1),d(this.getUTCDate())].join("-"),a=[d(this.getUTCHours()),d(this.getUTCMinutes()),d(this.getUTCSeconds())].join(":")+"."+this.getMilliseconds();return[c,a].join("T")+"Z"}}();
if(!Function.prototype.bind)Function.prototype.bind=function(d){var c=[].slice,a=c.call(arguments,1),b=this,e=function(){},f=function(){return b.apply(this instanceof e?this:d||{},a.concat(c.call(arguments)))};e.prototype=b.prototype;f.prototype=new e;return f};if(!Object.keys)Object.keys=function(d){if(d!==Object(d))throw new TypeError("Object.keys called on non-object");var c=[],a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&c.push(a);return c};
if(!String.prototype.trim)String.prototype.trim=function(){var d=/^\s+/,c=/\s+/;return function(){return this.replace(d,"").replace(c,"")}}();
/**
 * Classy - classy classes for JavaScript
 *
 * :copyright: (c) 2011 by Armin Ronacher. 
 * :license: BSD.
 */
(function(a){function j(a){e=!0;var b=new a;e=!1;return b}function i(b,c){return Object.prototype.hasOwnProperty.call(b,c)?b[c]:a}function h(b,c,d){d===a?delete b[c]:b[c]=d}function g(a){return!f||/\B\$super\b/.test(a.toString())}var b="1.4",c=this,d=c.Class,e=!1,f=function(){$super()}.toString().indexOf("$super")>0,k=function(){};k.$noConflict=function(){try{h(c,"Class",d)}catch(a){c.Class=d}return k},k.$classyVersion=b,k.$extend=function(b){var d=this.prototype,f=j(this);if(b.__include__)for(var l=0,m=b.__include__.length;l!=m;++l){var n=b.__include__[l];for(var o in n){var p=i(n,o);p!==a&&(f[o]=n[o])}}b.__classvars__=b.__classvars__||{};if(f.__classvars__)for(var q in f.__classvars__)if(!b.__classvars__[q]){var p=i(f.__classvars__,q);b.__classvars__[q]=p}for(var o in b){var p=i(b,o);if(o==="__include__"||p===a)continue;f[o]=typeof p=="function"&&g(p)?function(a,b){return function(){var c=i(this,"$super");this.$super=d[b];try{return a.apply(this,arguments)}finally{h(this,"$super",c)}}}(p,o):p}var r=function(){if(!e){var a=c===this?j(arguments.callee):this;a.__init__&&a.__init__.apply(a,arguments),a.$class=r;return a}};for(var q in b.__classvars__){var p=i(b.__classvars__,q);p!==a&&(r[q]=p)}r.prototype=f,r.constructor=r,r.$extend=k.$extend,r.$withData=k.$withData;return r},k.$withData=function(b){var c=j(this);for(var d in b){var e=i(b,d);e!==a&&(c[d]=e)}return c},c.Class=k})()
