var ofLoad = new Array();
var bDl    = false;

function addLoadEvent(oFunc)
{
	ofLoad[ofLoad.length] = oFunc;
}

function startLoadEvents ()
{
	if (bDl)
		return false;
	bDl = true;
	for (var i = 0; i < ofLoad.length; i++)
		ofLoad[i]();
}

function createElement (element) {
	if (typeof document.createElementNS != 'undefined') {
		return(document.createElementNS('http://www.w3.org/1999/xhtml', element));
	}
	if (typeof document.createElement != 'undefined') {
		return(document.createElement(element));
	}
	return(false);
}

function cssjs (a, o, c1, c2) {
	switch (a) {
		case 'swap':
			o.className = !cssjs('check', o, c1) ? o.className.replace(c2, c1) : o.className.replace(c1, c2);
			break;
		case 'add':
			if (!o.className)
				o.className = '';
			if (!cssjs('check', o, c1)) {
				o.className += o.className ? ' '+c1 : c1;
			}
			break;
		case 'remove':
			var rep = o.className.match(' '+c1) ? ' '+c1 : c1;
			o.className = o.className.replace(rep, '');
			break;
		case 'check':
			if (!o.className)
				return(false);
			return(new RegExp('\\b'+c1+'\\b').test(o.className));
			break;
	}
	return(true);
}

window.onload = startLoadEvents;

/*******************************************************************************************
 * Firebug
 * Written by Joe Hewitt (http://www.getfirebug.com/)
 * Suppress any calls to console.log, etc.
 *******************************************************************************************/

	if (!window.console || !console.firebug) {

		var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];

		window.console = {};
		for (var i = 0; i < names.length; ++i) {
			window.console[names[i]] = function() {};
		}

	}