/**
 * @author Chris Lambe
 */
var Registry = {
	_debug:true,
	_components: new Object(),
	_registry: new Array(),
	init: function() {
		$(Registry._registry).each(function(){
			if (Registry.getComponent(this)) {
				Registry.getComponent(this).init();
			} else {
				//if(console && Registry._debug) console.warn(this + " hasn't been registered!");
			}
		});
	},
	add: function(component) {
		if (component._name) {
			Registry._components[component._name] = component;
			Registry._registry.push(component._name);
		} else {
			//if(console && Registry._debug) console.warn("A component is missing the _name variable!");
		}
	},
	getComponent:function(componentName) {
		if(Registry._components[componentName])
			return Registry._components[componentName];
		return false;
	}
}