package classes.matuto.core
{
	
	/*
		Classe responsavel pelo gerenciamento do 
		Xml do site, onde vai estar os modulos e 
		a configuracao do site.
		
		autor: gustavo cosme
		data:  18/maio/2011
	*/
	
	import classes.matuto.core.Config;
	import classes.matuto.core.module.ModuleCollection;
	import classes.matuto.model.Model;
	
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	public class SiteMaps
	{
		
		private static  var  xml						:XML;
		private static  var  COMPLETE					:Function;
		private static  var  modulesCollection			:ModuleCollection;
		private static  var  config						:Config;
		
		public static   var ENDERECO						:String = 'http://10.0.1.35/projetos/2011/flash/MATUTO PREMIUM/html/';

		
		public function SiteMaps()
		{
			
		}
		
		public static function init(value:Function):void
		{
			COMPLETE = value;
			Model.XML_CONNECT("visao/xml/SiteMaps.xml",INICIALIZE_COLLECTION,"ERRO NO SITEMAPS");
		}
	
		private static function INICIALIZE_COLLECTION(value:XML):void
		{
			xml = value;			

			modulesCollection 	= 	new ModuleCollection(xml.modules.module);		
			config				=   new Config(xml.config);
			COMPLETE();		
		}
			
		//GET
		
		public static function get getXML():XML
		{
			return xml;
		}
		
		public static function get getConfig():Config
		{
		   return config;
		}
		
		public static function get getCollection():ModuleCollection
		{
		   return modulesCollection;
		}
		
		
	}//end class
}