function Dispatcher(param_sitemap) {	
	this._sitemap = param_sitemap;
	$(document).bind('URL_CHANGE'  , $.proxy(this.onUrlChange, this));	
};


Dispatcher.prototype = {
		
	onUrlChange:function(e , url , map) {
		var definition = Config.getInstance().get('default_url_command');
		var nodeInfo = this._sitemap.getNode(map);
		if (nodeInfo != null) {
			if (nodeInfo.hasOwnProperty('command'))
				definition = nodeInfo.command;
		}
		
		var newCommand  = eval('new ' + definition+ '(map)');
		newCommand.execute();
	}
	
};
