/*
===== Reference Sites =====
http://msdn2.microsoft.com/en-us/library/ms535863.aspx#
http://developer.mozilla.org/en/docs/DOM:event
*/

Utilities.Event = function(evt){
	
	var evt = (evt) ? evt : event;
	
	//Event Object
	this.Event = evt;
	this.cancelled = false;
	
	//Event Properties
	this.altKey = evt.altKey;
	this.button = evt.button;
	this.charCode = (evt.charCode) ? evt.charCode : evt.keyCode;
	this.clientX = evt.clientX;
	this.clientY = evt.clientY;
	this.ctrlKey = evt.ctrlKey;
//	this.currentTarget = (evt.currentTarget) ? evt.currentTarget : null;
	this.keyCode = evt.keyCode
	this.layerX = (evt.layerX) ? evt.layerX : evt.offsetX;
	this.layerY = (evt.layerY) ? evt.layerY : evt.offsetY;
	this.pageX = (evt.pageX) ? evt.pageX : evt.x;
	this.pageY = (evt.pageY) ? evt.pageY : evt.y;
	if(evt.relatedTarget){
		this.relatedTarget = evt.relatedTarget;
		}
	else{
		if(evt.type.toLowerCase() == 'mouseover'){
			this.relatedTarget = evt.fromElement;
			}
		else if(evt.type.toLowerCase() == 'mouseout'){
			this.relatedTarget = evt.toElement;
			}
		}
	this.screenX = evt.screenX;
	this.screenY = evt.screenY;
	this.shiftKey = evt.shiftKey;
	this.target = (evt.target) ? evt.target : evt.srcElement;
	this.type = evt.type;
	this.which = (evt.which) ? evt.which : ((evt.charCode) ? evt.charCode : evt.keyCode);
	}

//Event Methods
Utilities.Event.prototype.preventDefault = function(){
	
	this.cancelled = true;
	if(this.Event.preventDefault){
		this.Event.preventDefault()
		}
	else{
		this.Event.returnValue = false;
		}
	}
Utilities.Event.prototype.stopPropagation = function(){
	
	if(this.Event.stopPropagation){
		this.Event.stopPropagation();
		}
	else{
		this.Event.cancelBubble = true;
		}
	}