//= require <mootools-core-1.3-full-nocompat>
/**
 * Constructor - Creates a new instance of the UICEvent object.
 *
 * @param type String used to identify the type of event.
 * @param bubbles Boolean indicating whether or not the event bubbles.
 * @param cancelable Boolean indicates whether this event is cancelable.
 * @param data Object used to store arbitrary data.
 */
var UICEvent = function(type, bubbles, cancelable, data){

	/**
     * @ignore
     */
	this.initialize = function(type, bubbles, cancelable, data)
	{
		this.type = type;
		this.bubbles = bubbles;
		this.cancelable = cancelable;
		this.data = data;
		this.eventPhase = 0;

		this.propagationStopped = false;
		this.immediatePropagationStopped = false;
		this.isDefaultPrevented = false;
	};

	/**
     * Stops the event from propagating to further
     * nodes in the event phases.  Any listeners in the
     * current node are processed but the event is stopped
     * afterwards.
     */
	this.stopPropagation = function()
	{
		this.propagationStopped = true;
	};

	/**
     * Stops the event from processing listeners
     * in the current node and prevents other nodes
     * from being processed.
     */
	this.stopImmediatePropagation = function()
	{
		this.propagationStopped = true;
		this.immediatePropagationStopped = true;
	};

	this.preventDefault = function()
	{
		this.defaultPrevented = true;
	};
};
UICEvent = new Class(new UICEvent());
// Event phases
UICEvent.CAPTURING_PHASE = 1;
UICEvent.AT_TARGET = 2;
UICEvent.BUBBLING_PHASE = 3;
