/**
 * The BoundMethod prototype creates a function wrapper to let you run a function in the context
 * of the original object, rather than in the context of the second object, when you pass a
 * function from one object to another. <br/>
 * Inspired in mx.utils.Delegate.
 */
function BoundMethod(){}

/**
 * Creates a functions wrapper for the original function so that it runs in the provided context.
 * @parameter Object obj Context in which to run the function.
 * @paramater Function func Function to run.
 * @return Function
 */
BoundMethod.create = function(obj, func){
	var f = function()
	{
		var target = arguments.callee.target;
		var func = arguments.callee.func;

		return func.apply(target, arguments);
	};

	f.target = obj;
	f.func = func;

	return f;
}
