BX.delegate = function (func, thisObject)
{
if (!func || !thisObject)
return func;
return function() {
var cur = BX.proxy_context;
BX.proxy_context = this;
var res = func.apply(thisObject, arguments);
BX.proxy_context = cur;
return res;
}
};