Function.prototype.extend = function(oExtension){
	for(var sExtensionItem in oExtension){
		if(oExtension.hasOwnProperty(sExtensionItem)){
			this.prototype[sExtensionItem] = oExtension[sExtensionItem];
		}
	}
}

Function.extend({
	
	inheritFrom : function(BaseClass, oOverride){
		var Inheritance = function() {};
		Inheritance.prototype = BaseClass.prototype;
		this.prototype = new Inheritance();
		this.prototype.constructor = this;
		this.baseConstructor = BaseClass;
		this.superClass = BaseClass.prototype;
	
		if(oOverride){
			for(var i in oOverride) {
				this.prototype[i] = oOverride[i];
			}
		}
	}

});

Number.extend({
	
	between : function(a, b){
		return !!(
			this.valueOf() >= Math.min(a, b) &&
			this.valueOf() <= Math.max(a, b)
		);
	}

});


Array.extend({
	
	foreach : function(fFunction){
		for(var i = 0, iLength = this.length; i < iLength; i++){
			var mReturn = fFunction(this[i], i);
			if(mReturn === false){
				break;
			}
		}
	}
	
});
