
function MenuHierarchy(){
  this.menu_items = new Array();
  this.init();
}

MenuHierarchy.prototype.init					= MenuHierarchy_init;
MenuHierarchy.prototype.getMenu				= MenuHierarchy_getMenu;

function MenuHierarchy_getMenu(MenuItemID){
  for (var i=0; i < this.menu_items.length; i++){
    if (this.menu_items[i].getId() == MenuItemID) return this.menu_items[i];
  }
  return null;
}

function MenuHierarchy_init(){
    
    this.menu_items.push(new Menu(this, 1177, null, 1369, "MultiTERM"));
    
    
    this.menu_items.push(new Menu(this, 1178, 798, 1177, "Home"));
    
    
    this.menu_items.push(new Menu(this, 1179, 799, 1177, "Project Summary"));
    
    
    this.menu_items.push(new Menu(this, 1192, 812, 1179, "Summary"));
    
    
    this.menu_items.push(new Menu(this, 1180, 800, 1179, "Background"));
    
    
    this.menu_items.push(new Menu(this, 1181, 801, 1179, "Scientific objectives"));
    
    
    this.menu_items.push(new Menu(this, 1182, 802, 1181, "Work Package 1"));
    
    
    this.menu_items.push(new Menu(this, 1183, 803, 1181, "Work Package 2"));
    
    
    this.menu_items.push(new Menu(this, 1184, 804, 1181, "Work Package 3"));
    
    
    this.menu_items.push(new Menu(this, 1185, 805, 1181, "Work Package 4"));
    
    
    this.menu_items.push(new Menu(this, 1186, 806, 1181, "Work Package 5"));
    
    
    this.menu_items.push(new Menu(this, 1188, 808, 1179, "Training objectives	"));
    
    
    this.menu_items.push(new Menu(this, 1191, 799, 1177, "Participants"));
    
    
    this.menu_items.push(new Menu(this, 1293, 910, 1191, "Participants"));
    
    
    this.menu_items.push(new Menu(this, 1193, 813, 1191, "Team 1"));
    
    
    this.menu_items.push(new Menu(this, 1224, 842, 1193, "Expertise"));
    
    
    this.menu_items.push(new Menu(this, 1228, 846, 1193, "Team members"));
    
    
    this.menu_items.push(new Menu(this, 1227, 819, 1193, "Publications"));
    
    
    this.menu_items.push(new Menu(this, 1296, 912, 1193, "Fellows appointed"));
    
    
    this.menu_items.push(new Menu(this, 1194, 814, 1191, "Team 2"));
    
    
    this.menu_items.push(new Menu(this, 1195, 815, 1194, "Expertise"));
    
    
    this.menu_items.push(new Menu(this, 1198, 818, 1194, "Team members"));
    
    
    this.menu_items.push(new Menu(this, 1306, 922, 1194, "Publications"));
    
    
    this.menu_items.push(new Menu(this, 1297, 913, 1194, "Fellows appointed"));
    
    
    this.menu_items.push(new Menu(this, 1204, 824, 1191, "Team 3"));
    
    
    this.menu_items.push(new Menu(this, 1229, 847, 1204, "Expertise"));
    
    
    this.menu_items.push(new Menu(this, 1232, 850, 1204, "Team members"));
    
    
    this.menu_items.push(new Menu(this, 1233, 851, 1204, "Publications"));
    
    
    this.menu_items.push(new Menu(this, 1298, 914, 1204, "Fellows appointed"));
    
    
    this.menu_items.push(new Menu(this, 1205, 825, 1191, "Team 4"));
    
    
    this.menu_items.push(new Menu(this, 1234, 852, 1205, "Expertise"));
    
    
    this.menu_items.push(new Menu(this, 1237, 855, 1205, "Team members"));
    
    
    this.menu_items.push(new Menu(this, 1238, 856, 1205, "Publications"));
    
    
    this.menu_items.push(new Menu(this, 1299, 915, 1205, "Fellows appointed"));
    
    
    this.menu_items.push(new Menu(this, 1206, 826, 1191, "Team 5"));
    
    
    this.menu_items.push(new Menu(this, 1239, 857, 1206, "Expertise"));
    
    
    this.menu_items.push(new Menu(this, 1242, 860, 1206, "Team members"));
    
    
    this.menu_items.push(new Menu(this, 1300, 916, 1206, "Fellows appointed"));
    
    
    this.menu_items.push(new Menu(this, 1200, 820, 1177, "News and Events"));
    
    
    this.menu_items.push(new Menu(this, 1368, 976, 1177, "Publications"));
    
    
    this.menu_items.push(new Menu(this, 1202, 822, 1177, "Contacts"));
    
    
    this.menu_items.push(new Menu(this, 1203, 823, 1177, "Links"));
    
    
    this.menu_items.push(new Menu(this, 1223, 841, 1177, "Private website"));
    
}

/* Menu class */
function Menu(Hierarchy, MenuItemID, DocumentRef, Parent, Label){
    this._Id = MenuItemID;
    this._DocumentRef = DocumentRef;
    this._Parent = Parent;
    this._Label = Label;
    this._Hierarchy = Hierarchy;
}

Menu.prototype.getId							= Menu_getId;
Menu.prototype.getDocumentRef			= Menu_getDocumentRef;
Menu.prototype.getParent					= Menu_getParent;
Menu.prototype.getLabel						= Menu_getLabel;
Menu.prototype.getAncestorTabMenu = Menu_getAncestorTabMenu;

function Menu_getId(){
    return this._Id;
}

function Menu_getDocumentRef(){
    return this._DocumentRef;
}

function Menu_getParent(){
    return this._Hierarchy.getMenu(this._Parent);
}

function Menu_getLabel(){
    return this._Label;
}

function Menu_getAncestorTabMenu(){
    var objParent = this.getParent();
    while (objParent != null){
        if (objParent.getTab()){
            return objParent.getId();
        }
        objParent = objParent.getParent();
    }
    return null;
}
