
var CustomEvent = function() {
	//name of the event
	this.eventName = arguments[0];
	var mEventName = this.eventName;

	//function to call on event fire
	var eventAction = null;

	//subscribe a function to the event
	this.subscribe = function(fn) {
		eventAction = fn;
	};

	//fire the event
	this.fire = function(sender, eventArgs) {
		if (eventAction != null) {
			eventAction(sender, eventArgs);
		}
		else {
			alert('There was no function subscribed to the ' + mEventName + ' event!');
		}
	};
};

// Alert if user is about to leave the page
/*
setDirtyFlag: function (docDirty)
{
$.cbexp.isDirty = docDirty;
if (docDirty)
$(window).bind('beforeunload', $.cbexp.confirmExit);
else
$(window).unbind('beforeunload', $.cbexp.confirmExit);
},

getDirtyFlag: function ()
{
return $.cbexp.isDirty;
},

confirmExit: function ()
{
if ($.cbexp.isDirty)
return "Exiting this page will end your session. If you haven't saved your info, it could be lost.";
},
*/
