
// This object prevents errors (or even not executed scripts) in IE and browsers w/o Firebug installed.
var FirebugUtils = {

	consoleMethods: ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"],

	available: function() {
		return (window.console) ? (window.console.firebug) : false;
	},
	check: function() {
		if (!this.available()) this.disable();
	},
	disable: function() {
		window.console = {};
		var methods = this.consoleMethods;
		for (var i = methods.length - 1; i > -1; i--) {
			window.console[methods[i]] = function(){};
		}
	}
}
FirebugUtils.check();


// Checks whether a string ends with the given suffix.
if (!String.prototype.endsWith) {
	String.prototype.endsWith = function(suffix) {
		var startPos = this.length - suffix.length;
		if (startPos < 0) {
			return false;
		}
		return (this.lastIndexOf(suffix, startPos) == startPos);
	};
}