function SectionManager(){
	SectionManager.instance = this;
	this.currentSection;
	this.taskMap;
};


SectionManager.getInstance =  function(){
	if (SectionManager.instance != undefined) 
		return SectionManager.instance;
};


SectionManager.prototype = {
	
	switchSection : function(param_map){
		if(this.currentSection != null){
			this.taskMap = param_map;
			this.closeSection();
			return false;
		}
		this.openSection(param_map);
	},
	
	openSection : function(param_map){
		var definition = Sitemap.getInstance().getNode(param_map);
		var sectionId = StringUtils.ucFirst(definition.id);
		this.currentSection = eval('new '+ sectionId +'(definition)');
		this.currentSection.appear();
		this.taskMap = null;
	},
	
	closeSection : function(){
		$(document).bind('SECTION_TRANSITION_OUT_COMPLETE' , $.proxy(this.onSectionDisappearComplete , this));
		this.currentSection.disappear();
	},
	
	
	onSectionAppearComplete : function(){
	},
	
	
	onSectionDisappearComplete : function(){
		$(document).unbind('SECTION_TRANSITION_OUT_COMPLETE');;
		this.currentSection = null;
		this.switchSection(this.taskMap)
	}
	
};
