

var Application = new Class({

	current_module : null,
	user : null,
	rc : null,
	
	initialize : function()
	{
		this.user = new User();
		this.rc = new RC();
	},
	
	load: function(module_name, params, options)
	{
//		if(module_name == app.current_module)
//			return;
		if(!options) 
			options = {};
		
		if(!options.update)
			options.update = $('content');
		
		options = $merge(options, {params : params });	
						
		new Module(module_name).load(options);
//		{
//			update: $('content'),
//			params : params,
//			onComplete : function()
//			{
//				if(app.current_module)
//					$('img_header_' + app.current_module).src = 'images/' + app.current_module + '.gif'; 
//				
//				$('img_header_' + module_name).src = 'images/' + module_name + '_active.gif';
//				app.current_module = module_name;
//					
//				if(module_name == 'convert')
//					app.convert = new Convert();
//				
//			}
//		});
	},
	
	Highlight : function(type)
	{
		if(type == this.current_highlight)
			return;
			
		if(this.current_highlight)
			$('img_header_' + this.current_highlight).src = 'images/' + this.current_highlight + '.gif';
		
		$('img_header_' + type).src = 'images/' + type + '_active.gif';
		this.current_highlight = type; 
	}

});