nmdgf = {

	loadingImage :'/static/js/yui/assets/skins/sam/wait.gif',

	ajax : function(method, uri, callback, postdata) {
		return YAHOO.util.Connect.asyncRequest(method, uri, callback, postdata);
	},

	byId : function(id) {
		return YAHOO.util.Dom.get(id);
	},

	byEvent : function(e) {
		return YAHOO.util.Event.getTarget(e);
	},

	addListener : function(id, type, callback, scope, useScope) {
		useScope = useScope || true;
		YAHOO.util.Event.addListener(id, type, callback, scope, useScope);
	},

	addOnLoad : function(callback, scope) {
		nmdgf.addListener(window, 'load', callback, scope);
	},

	addClass : function(el, className) {
		YAHOO.util.Dom.addClass(el, className);
	},

	removeClass : function(el, className) {
		YAHOO.util.Dom.removeClass(el, className);
	},

	query : function(selector, root, firstOnly) {
		return YAHOO.util.Selector.query(selector, root, firstOnly);
	},

	stopEvent : function(e) {
		YAHOO.util.Event.stopEvent(e);
	},

	registerWidget : function(widget, callNow) {
		callNow = callNow || false;
		if (widget.initialize !== undefined) {
			if(callNow === true || YAHOO.util.Event.DOMReady == true) {
				widget.initialize();
			}else {
				nmdgf.addOnLoad(widget.initialize, widget);
			}
		}
	},

	parseJSON : function(jsonString) {
		return YAHOO.lang.JSON.parse(jsonString);
	},
	
	stringifyJSON : function(jsonObject) {
		return YAHOO.lang.JSON.stringify(jsonObject);
	},

	/**
	 * Namespace for page specific utility objects
	 */
	pageutil : {}

};
