﻿
function TabHierarchy() {
	this.arrTabs = new Array();
	this.arrTabSets = new Array();
	this.arrAncestorTabset = new Array();
	this.arrAncestorTab = new Array();	
	this.init();
}

TabHierarchy.prototype.isTabSet  				= TabHierarchy_isTabSet;
TabHierarchy.prototype.getTabSet  				= TabHierarchy_getTabSet;
TabHierarchy.prototype.init  					= TabHierarchy_init;
TabHierarchy.prototype.isTab  					= TabHierarchy_isTab;
TabHierarchy.prototype.getTabSetFromTab		= TabHierarchy_getTabSetFromTab;
TabHierarchy.prototype.getTabFromChildren		= TabHierarchy_getTabFromChildren;

function TabHierarchy_isTabSet(intMenuItemID) {
	for (var i=0; i < this.arrTabSets.length; i++) {
		if(this.arrTabSets[i] == intMenuItemID) return true;
	}
	return false;
}

function TabHierarchy_isTab(intMenuItemID) {
	return this.getTabSetFromTab(intMenuItemID) != -1;	
}

function TabHierarchy_getTabSetFromTab(intMenuItemID){
	if (typeof(this.arrTabs[intMenuItemID]) == "undefined") return -1;
	else return this.arrTabs[intMenuItemID];
}

function TabHierarchy_getTabSet(intChildMenuItemID) {
	if (typeof(this.arrAncestorTabset[intChildMenuItemID]) == "undefined") return -1;
	else return this.arrAncestorTabset[intChildMenuItemID];
}

function TabHierarchy_getTabFromChildren(intChildMenuItemID) {
	if (typeof(this.arrAncestorTab[intChildMenuItemID]) == "undefined") return -1;
	else return this.arrAncestorTab[intChildMenuItemID];	
}

function TabHierarchy_init() {
	this.arrTabSets.push(1179); 
	this.arrTabs[1192] = 1179; 
	this.arrTabs[1180] = 1179; 
	this.arrTabs[1181] = 1179; 
	this.arrAncestorTabset[1182] = 1179; 
	this.arrAncestorTab[1182] = 1181; 
	this.arrAncestorTabset[1183] = 1179; 
	this.arrAncestorTab[1183] = 1181; 
	this.arrAncestorTabset[1184] = 1179; 
	this.arrAncestorTab[1184] = 1181; 
	this.arrAncestorTabset[1185] = 1179; 
	this.arrAncestorTab[1185] = 1181; 
	this.arrAncestorTabset[1186] = 1179; 
	this.arrAncestorTab[1186] = 1181; 
	this.arrTabs[1188] = 1179; 
	this.arrTabSets.push(1191); 
	this.arrTabs[1293] = 1191; 
	this.arrTabs[1193] = 1191; 
	this.arrAncestorTabset[1224] = 1191; 
	this.arrAncestorTab[1224] = 1193; 
	this.arrAncestorTabset[1228] = 1191; 
	this.arrAncestorTab[1228] = 1193; 
	this.arrAncestorTabset[1227] = 1191; 
	this.arrAncestorTab[1227] = 1193; 
	this.arrAncestorTabset[1296] = 1191; 
	this.arrAncestorTab[1296] = 1193; 
	this.arrTabs[1194] = 1191; 
	this.arrAncestorTabset[1195] = 1191; 
	this.arrAncestorTab[1195] = 1194; 
	this.arrAncestorTabset[1198] = 1191; 
	this.arrAncestorTab[1198] = 1194; 
	this.arrAncestorTabset[1306] = 1191; 
	this.arrAncestorTab[1306] = 1194; 
	this.arrAncestorTabset[1297] = 1191; 
	this.arrAncestorTab[1297] = 1194; 
	this.arrTabs[1204] = 1191; 
	this.arrAncestorTabset[1229] = 1191; 
	this.arrAncestorTab[1229] = 1204; 
	this.arrAncestorTabset[1232] = 1191; 
	this.arrAncestorTab[1232] = 1204; 
	this.arrAncestorTabset[1233] = 1191; 
	this.arrAncestorTab[1233] = 1204; 
	this.arrAncestorTabset[1298] = 1191; 
	this.arrAncestorTab[1298] = 1204; 
	this.arrTabs[1205] = 1191; 
	this.arrAncestorTabset[1234] = 1191; 
	this.arrAncestorTab[1234] = 1205; 
	this.arrAncestorTabset[1237] = 1191; 
	this.arrAncestorTab[1237] = 1205; 
	this.arrAncestorTabset[1238] = 1191; 
	this.arrAncestorTab[1238] = 1205; 
	this.arrAncestorTabset[1299] = 1191; 
	this.arrAncestorTab[1299] = 1205; 
	this.arrTabs[1206] = 1191; 
	this.arrAncestorTabset[1239] = 1191; 
	this.arrAncestorTab[1239] = 1206; 
	this.arrAncestorTabset[1242] = 1191; 
	this.arrAncestorTab[1242] = 1206; 
	this.arrAncestorTabset[1300] = 1191; 
	this.arrAncestorTab[1300] = 1206; 
	
}
