/**
 * eCommunities ECMS Navigation Class 
 * @author Kevin Farley
 * @version 2.0
 */

// Declare the required ECMS namespaces if they do not already exist
if (ECMS == null || typeof(ECMS) != "object") { var ECMS = new Object(); }
if (ECMS.ECORE == null || typeof(ECMS.ECORE) != "object") { ECMS.ECORE = new Object(); }
if (ECMS.ECORE.navigation == null || typeof(ECMS.ECORE.navigation) != "object") { ECMS.ECORE.navigation = new Object(); }

ECMS.ECORE.navigation = {

	init: function () {
		// Nothing to do.
	},
	
	changeTab: function (active,inactive) {
		var iTabs = inactive.split(',');
		for (var i in iTabs) {
			var iTab = document.getElementById(iTabs[i] + "Tab");
			var iDiv = document.getElementById(iTabs[i] + "Div");
			var iEdit = document.getElementById(iTabs[i] + "Edit");
			var iContent = document.getElementById(iTabs[i] + "Content");
			
			if (iTab) { iTab.className = "tab_i"; }
			if (iDiv) { iDiv.style.display = "none"; }
			if (iEdit) { iEdit.style.display = "none"; }
			if (iContent) { iContent.style.display = "none"; }
		}
		
		var aTab = document.getElementById(active + "Tab");
		var aDiv = document.getElementById(active + "Div");
		var aEdit = document.getElementById(active + "Edit");
		var aContent = document.getElementById(active + "Content");
		
		if (aTab) { aTab.className = "tab_a"; }
		if (aDiv) { aDiv.style.display = "block"; }
		if (aEdit) { aEdit.style.display = "block"; }
		if (aContent) { aContent.style.display = "block"; }
	}
}
