Function.prototype.bind=function(scope, args){ args=args || []; scope=scope || window; var fn=this; return function() { return fn.apply(scope, args); };};Function.prototype.bindAsEventListener=function(object){ var _function=this; return function(event) { return _function.apply(object, [(event || window.event)]); }};