Just a quick note that checking for window.console works if you need to detect the presence of firebug; if window.console is undefined, firebug is uninstalled or disabled. If firebug is enabled, alerting window.console should return [object Object]
Also, if firebug is enabled, alerting console.firebug will return the version number.