if(!Function.prototype.bind){Function.prototype.bind=function bind(context){var callback=this;var args=Array.prototype.slice.call(arguments,0);var object=args.shift();return function(){return callback.apply(object,args.concat(Array.prototype.slice.call(arguments,0)))}}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function bindAsEventListener(context){var callback=this;var args=Array.prototype.slice.call(arguments,0);var object=args.shift();return function(event){return callback.apply(object,[event||window.event].concat(args))}}}if(!Function.prototype.inherits){Function.prototype.inherits=function inherits(ParentClass){if(typeof this==='function'){if(this===ParentClass){throw new ReferenceError("A Class can't inherit from itself")}this.prototype=new ParentClass();this.prototype.inherits=Function.prototype.inherits;this.prototype.constructor=this;this.prototype.parent=ParentClass.prototype}else if(typeof this==='object'){if(this.constructor===ParentClass){throw new ReferenceError("A Class can't inherit from itself")}if(arguments.length>1){ParentClass.apply(this,Array.prototype.slice.call(arguments,1))}else{ParentClass.call(this)}}}}
