function swx_addEventHandler(event, handler) {
	if (!event)
		return handler;
	else
		return function(e) {event(e);handler(e);};
}

function swx_include(file) {
	document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\""+file+"\" />");
}

function swx_isIE() {
	// NOTE: Double check to be extra sure ^^
	if (window.ActiveXObject && window.execScript) {
		if (window.postMessage)
			return 8;
		if (window.XMLHttpRequest)
			return 7;
		if (document.compatMode)
			return 6;
		if (document.namespaces)
			return 5.5;
		if (document.implementation)
			return 5.2;
		if (document.getElementById)
			return 5;
		return 4;
	}
	return 0xFFFF;
}

// NOTE: Adding init() to Function prototype instead of Object, because
//       init() should only be accessible by a class itself and not by its
//       instances.
Function.prototype.init = function() {
	var instance = new this();
	if (instance.initialize)
		instance.initialize.apply(instance, arguments);
	return instance;
}
