/**
 *  console
 */
(function(){

if (typeof console === 'undefined') {
	
	var methods = [
		'log',
		'info',
		'log',
		'debug',
		'info',
		'warn',
		'error',
		'assert',
		'dir',
		'dirxml',
		'trace',
		'group',
		'groupEnd',
		'groupCollapsed',
		'time',
		'timeEnd',
		'profile',
		'profileEnd'
	];
	
	window.console = {};
	
	if (window.opera && opera.postError) {
		for (var i=0; i<methods.length; i++) {
			if (!console[methods[i]]) {
				console[methods[i]] = opera.postError;
			}
		}
	} else if (document.body) {
		var firebug=document.createElement('script');
		firebug.setAttribute('src', 'http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');
		document.body.appendChild(firebug); 
		(function(){
			if (window.pi && window.firebug) {
				firebug.init();
			} else {
				setTimeout(arguments.callee);
			}
		})()
	} else if (alert) {
		for (var i=0; i<methods.length; i++) {
			if (!console[methods[i]]) {
				console[methods[i]] = alert;
			}
		}
	}
}


/**
 * Fireunit
 */
if (typeof fireunit === 'undefined') {
	window.fireunit	= {};
	if (!fireunit.ok) {
		fireunit.ok = function(boolean, msg) {
			if (!msg) return
			if (boolean) {
				console.info('PASS: '+ msg);
			} else {
				console.warn('FAIL: '+ msg);
			}
		}
	}
}


})();
