function ExecuteFunction(functionName, executionContext /*, args */) { var args = Array.prototype.slice.call(arguments, 2); var namespaces = functionName.split("."); var func = namespaces.pop(); for (var i = 0; i < namespaces.length; i++) { executionContext = executionContext[namespaces[i]]; } return executionContext[func].apply(executionContext, args); }; String.prototype.format = function() { var args = arguments; return this.replace(/{(\d+)}/g, function(match, number) { return typeof args[number] != 'undefined' ? args[number] : match ; }); }; String.prototype.replaceAll = function(find_string, substitute_string) { return this.replace(new RegExp(find_string, 'g'), substitute_string); }; String.prototype.ltrim = function() { return this.replace(/^\s+/, ''); }; String.prototype.rtrim = function() { var str = this, ws = /\s/, i = str.length; while (ws.test(str.charAt(--i))); return str.slice(0, i + 1); }; String.prototype.trim = function() { var str = this.replace(/^\s\s*/, ''), ws = /\s/, i = str.length; while (ws.test(str.charAt(--i))); return str.slice(0, i + 1); }; String.prototype.startsWith = function(prefix) { return this.indexOf(prefix) == 0; }; String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; }; function ajax(url, data, success, e, ka) { $.ajax({ type: "POST", url: url, data: data, contentType: "application/json; charset=utf-8", dataType: "json", success: success, error: e }); if (ka != false) { var keepAlive = $('
'); var dt = new Date(); url = '/BIW/Framework/KeepSessionAlive.aspx?t=' + dt.getTime(); keepAlive.load(url, function() { keepAlive.remove(); }); } }; var ajaxCache = function(urlArg, dataArg, onSuccess, onError, cache) { if (cache == true) { var output = $.data(document, urlArg + dataArg); if (output != null && output.expiry > new Date()) { onSuccess(output); //should we poke the webservice? - keep the session ticking over? return; } else { $.data(document, urlArg + dataArg, null); } } $.ajax({ type: "POST", url: urlArg, data: dataArg, contentType: "application/json; charset=utf-8", dataType: "json", success: function(output) { if (cache) { var expiry = new Date(); expiry.setMinutes(expiry.getMinutes() + 15); output.expiry = expiry; $.data(document, urlArg + dataArg, output); onSuccess(output); } else { onSuccess(output); } }, error: onError }); }; (function($) { $.fn.outerHTML = function() { return $(this).clone().wrap('').parent().html(); } })(jQuery); var block = function(element) { if (element == null || element == undefined) { $.blockUI({ message: '