function addEvent(el,type,listener,useCapture) {
	if(typeof el == "string") {el = document.getElementById(el);}
	if(!el) {return false;}
	
	if(document.addEventListener) {
		// W3C DOM Level 2 Events - used by Mozilla, Opera and Safari
		if(!useCapture) {useCapture = false;} else {useCapture = true;}
		if(type == "onload") {type = "load";}
		el.addEventListener(type,listener,useCapture);
	} else {
		// MS implementation - used by Internet Explorer
		if(type == "load") {type = "onload";}
		var eProp = type + listener;
		el["e" + eProp] = listener;
		el[eProp] = function() { el["e" + eProp]( window.event ); }
		el.attachEvent(type, el[eProp]);
		//el.attachEvent(type, listener);
	}
}

function removeEvent(el,type,listener,useCapture) {
	if(typeof el == "string") {el = document.getElementById(el);}
	if(!el){return false;}
	if(document.removeEventListener) {
		// W3C DOM Level 2 Events - used by Mozilla, Opera and Safari
		if(!useCapture) {useCapture = false;} else {useCapture = true;}
		if(type == "onload") {type = "load";}
		el.removeEventListener(type,listener,useCapture);
	} else {
		// MS implementation - used by Internet Explorer
		if(type == "load") {type = "onload";}
		var eProp = type + listener;
		el.detachEvent(type, listener);
		//el.detachEvent(type, el[eProp]);
		el[eProp] = null;
		el["e" + eProp] = null;
	}
}
