﻿
function MenuContainer() {
	this.arrMenus = new Array();
	this.init();
}

MenuContainer.prototype.isInRightMenu					= MenuContainer_isInRightMenu;
MenuContainer.prototype.combinationExists				= MenuContainer_combinationExists;
MenuContainer.prototype.getAncestorDocument				= MenuContainer_getAncestorDocument;
MenuContainer.prototype.getAncestorMenuItem				= MenuContainer_getAncestorMenuItem;
MenuContainer.prototype.init							= MenuContainer_init;

// this function detects whether a menuitem, document combination exists in the right menu of a parent menuitem, document combination
// the child combination is given as a parameter
function MenuContainer_isInRightMenu(intMenuItemID, intDocumentID) {
	// this.arrMenus is an index of child (document id, menuitem id) mapped to the ancestor (document id, menuitem id) 	
	return this.getAncestorMenuItem(intMenuItemID, intDocumentID) != -1;
}

// get the ancestor document id which contains this menuitem, document combination in the right menu
function MenuContainer_getAncestorDocument(intMenuItemID, intDocumentID) {
	if (this.combinationExists(intMenuItemID, intDocumentID)) {
		return (this.arrMenus[intMenuItemID][intDocumentID][0]).intDocumentID;
	}
	return -1;
}

// get the ancestor menuitem id which contains this menuitem, document combination in the right menu
function MenuContainer_getAncestorMenuItem(intMenuItemID, intDocumentID) {
	if (this.combinationExists(intMenuItemID, intDocumentID)) {
		return (this.arrMenus[intMenuItemID][intDocumentID][0]).intMenuItemID;
	}
	return -1;
}

function MenuContainer_combinationExists(intMenuItemID, intDocumentID) {
	return (typeof(this.arrMenus[intMenuItemID]) != "undefined" && this.arrMenus[intMenuItemID].length > 0) &&
			(typeof(this.arrMenus[intMenuItemID][intDocumentID]) != "undefined" && this.arrMenus[intMenuItemID][intDocumentID].length > 0);
}

function MenuContainer_init() {
	var objParentCombination = null;
	
	this.arrMenus[1198] = new Array();
	this.arrMenus[1198][817] = new Array();
	objParentCombination = new Object();
	objParentCombination.intMenuItemID = 1182;
	objParentCombination.intDocumentID = 803;
	this.arrMenus[1198][817].push(objParentCombination);
	
	this.arrMenus[1204] = new Array();
	this.arrMenus[1204][823] = new Array();	
	this.arrMenus[1204][823].push(objParentCombination);
	
	this.arrMenus[1212] = new Array();
	this.arrMenus[1212][831] = new Array();	
	this.arrMenus[1212][831].push(objParentCombination);
	
	this.arrMenus[1213] = new Array();
	this.arrMenus[1213][832] = new Array();	
	this.arrMenus[1213][832].push(objParentCombination);
	
	this.arrMenus[1215] = new Array();
	this.arrMenus[1215][834] = new Array();	
	this.arrMenus[1215][834].push(objParentCombination);
	
	this.arrMenus[1216] = new Array();
	this.arrMenus[1216][835] = new Array();	
	this.arrMenus[1216][835].push(objParentCombination);
	
	this.arrMenus[1246] = new Array();
	this.arrMenus[1246][865] = new Array();	
	this.arrMenus[1246][865].push(objParentCombination);
	
	this.arrMenus[1217] = new Array();
	this.arrMenus[1217][836] = new Array();	
	this.arrMenus[1217][836].push(objParentCombination);
	
	this.arrMenus[1205] = new Array();
	this.arrMenus[1205][824] = new Array();	
	this.arrMenus[1205][824].push(objParentCombination);
	
	this.arrMenus[1218] = new Array();
	this.arrMenus[1218][837] = new Array();	
	this.arrMenus[1218][837].push(objParentCombination);
	
	this.arrMenus[1219] = new Array();
	this.arrMenus[1219][838] = new Array();	
	this.arrMenus[1219][838].push(objParentCombination);
	
	this.arrMenus[1220] = new Array();
	this.arrMenus[1220][839] = new Array();	
	this.arrMenus[1220][839].push(objParentCombination);
	
	this.arrMenus[1221] = new Array();
	this.arrMenus[1221][840] = new Array();	
	this.arrMenus[1221][840].push(objParentCombination);
	
	this.arrMenus[1247] = new Array();
	this.arrMenus[1247][866] = new Array();	
	this.arrMenus[1247][866].push(objParentCombination);
	
	this.arrMenus[1222] = new Array();
	this.arrMenus[1222][841] = new Array();	
	this.arrMenus[1222][841].push(objParentCombination);
	
	this.arrMenus[1206] = new Array();
	this.arrMenus[1206][825] = new Array();	
	this.arrMenus[1206][825].push(objParentCombination);
	
	this.arrMenus[1295] = new Array();
	this.arrMenus[1295][914] = new Array();	
	this.arrMenus[1295][914].push(objParentCombination);
	
	this.arrMenus[1223] = new Array();
	this.arrMenus[1223][842] = new Array();	
	this.arrMenus[1223][842].push(objParentCombination);
	
	this.arrMenus[1224] = new Array();
	this.arrMenus[1224][843] = new Array();	
	this.arrMenus[1224][843].push(objParentCombination);
	
	this.arrMenus[1225] = new Array();
	this.arrMenus[1225][844] = new Array();	
	this.arrMenus[1225][844].push(objParentCombination);
	
	this.arrMenus[1226] = new Array();
	this.arrMenus[1226][845] = new Array();	
	this.arrMenus[1226][845].push(objParentCombination);
	
	this.arrMenus[1248] = new Array();
	this.arrMenus[1248][867] = new Array();	
	this.arrMenus[1248][867].push(objParentCombination);
	
	this.arrMenus[1227] = new Array();
	this.arrMenus[1227][846] = new Array();	
	this.arrMenus[1227][846].push(objParentCombination);
	
	this.arrMenus[1207] = new Array();
	this.arrMenus[1207][826] = new Array();	
	this.arrMenus[1207][826].push(objParentCombination);
	
	this.arrMenus[1253] = new Array();
	this.arrMenus[1253][872] = new Array();	
	this.arrMenus[1253][872].push(objParentCombination);
	
	this.arrMenus[1254] = new Array();
	this.arrMenus[1254][873] = new Array();	
	this.arrMenus[1254][873].push(objParentCombination);
	
	this.arrMenus[1255] = new Array();
	this.arrMenus[1255][874] = new Array();	
	this.arrMenus[1255][874].push(objParentCombination);
	
	this.arrMenus[1256] = new Array();
	this.arrMenus[1256][875] = new Array();	
	this.arrMenus[1256][875].push(objParentCombination);
	
	this.arrMenus[1258] = new Array();
	this.arrMenus[1258][877] = new Array();	
	this.arrMenus[1258][877].push(objParentCombination);
	
	this.arrMenus[1208] = new Array();
	this.arrMenus[1208][827] = new Array();	
	this.arrMenus[1208][827].push(objParentCombination);
	
	this.arrMenus[1209] = new Array();
	this.arrMenus[1209][828] = new Array();	
	this.arrMenus[1209][828].push(objParentCombination);
	
	this.arrMenus[1212] = new Array();
	this.arrMenus[1212][831] = new Array();
	objParentCombination = new Object();
	objParentCombination.intMenuItemID = 1204;
	objParentCombination.intDocumentID = 823;
	this.arrMenus[1212][831].push(objParentCombination);
	
}

