// JavaScript Document


function clsEventManager() {
	this.onLoad 	= new Events
	this.onResize 	= new Events
	this.onResized	= new Events
	this.onUnload	= new Events
	
	this.clsEvent = Events
	
	function Events() {
		var dctEvents = new hexDictionary
		this.add = function (strRef,objEvent,strVars) {
			if (strVars != undefined) {					
				dctEvents.add(strRef,new Array(objEvent,strVars))
			}else{
				dctEvents.add(strRef,objEvent)
			}
		}
		this.remove = function (strRef) {
			dctEvents.remove(strRef)
		}
		this.removeAll = function () {
			dctEvents = new hexDictionary
		}
		this.events = function () {
			var objEvents = ""
			for (objEvents in dctEvents.keys()) {
				if (dctEvents.lookup(objEvents) != null) {
					var strVars = ""
					var objFunc = ""
					if (dctEvents.lookup(objEvents)[0]!= null) {
						objFunc = dctEvents.lookup(objEvents)[0]
						strVars = dctEvents.lookup(objEvents)[1]
						objFunc(strVars)
					}else{
						dctEvents.lookup(objEvents)()
					}
					
				}
			}
		}
	}
}

var objEvents = new clsEventManager
window.onload		= objEvents.onLoad.events
window.onunload 	= objEvents.onUnload.events
window.onresize 	= objEvents.onResize.events
window.onresized 	= objEvents.onResized.events
window.onrefresh 	= objEvents.onUnload.events