
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, 1174, null, 1331, "BIOEXPLOIT"));
    
    
    this.menu_items.push(new Menu(this, 1175, 798, 1174, "Home"));
    
    
    this.menu_items.push(new Menu(this, 1176, 799, 1174, "News and events"));
    
    
    this.menu_items.push(new Menu(this, 1313, 936, 1176, "BioExploit"));
    
    
    this.menu_items.push(new Menu(this, 1314, 951, 1176, "EUCARPIA"));
    
    
    this.menu_items.push(new Menu(this, 1330, 957, 1314, "Euphytica paper on the SWOT analysis on MAS in organic breeding programs"));
    
    
    this.menu_items.push(new Menu(this, 1324, 951, 1314, "EAPR-EUCARPIA congress, 27-30 June, Wageningen, the Netherlands"));
    
    
    this.menu_items.push(new Menu(this, 1325, 952, 1314, "The XIVth EUCARPIA Meeting, 30 August-1 September 2010, Valencia, Spain"));
    
    
    this.menu_items.push(new Menu(this, 1315, 938, 1176, "EAPR"));
    
    
    this.menu_items.push(new Menu(this, 1316, 939, 1176, "Other events"));
    
    
    this.menu_items.push(new Menu(this, 1317, 940, 1176, "New publications"));
    
    
    this.menu_items.push(new Menu(this, 1177, 800, 1174, "Partners"));
    
    
    this.menu_items.push(new Menu(this, 1178, 801, 1174, "Project"));
    
    
    this.menu_items.push(new Menu(this, 1320, 943, 1178, "Project summary"));
    
    
    this.menu_items.push(new Menu(this, 1190, 813, 1178, "Subproject 1"));
    
    
    this.menu_items.push(new Menu(this, 1191, 814, 1178, "Subproject 2"));
    
    
    this.menu_items.push(new Menu(this, 1192, 815, 1178, "Subproject 3"));
    
    
    this.menu_items.push(new Menu(this, 1193, 816, 1178, "Subproject 4"));
    
    
    this.menu_items.push(new Menu(this, 1194, 817, 1178, "Subproject 5"));
    
    
    this.menu_items.push(new Menu(this, 1195, 818, 1178, "Subproject 6"));
    
    
    this.menu_items.push(new Menu(this, 1196, 819, 1178, "Subproject 7"));
    
    
    this.menu_items.push(new Menu(this, 1197, 820, 1178, "Subproject 8"));
    
    
    this.menu_items.push(new Menu(this, 1183, 806, 1174, "Training"));
    
    
    this.menu_items.push(new Menu(this, 1318, 941, 1183, "Overview"));
    
    
    this.menu_items.push(new Menu(this, 1300, 946, 1183, "Workshops"));
    
    
    this.menu_items.push(new Menu(this, 1321, 946, 1300, "Technology workshop on MAS: from discovery to application"));
    
    
    this.menu_items.push(new Menu(this, 1322, 947, 1300, "Workshop on the role of Marker Assisted Selection in breeding varieties for organic agriculture"));
    
    
    this.menu_items.push(new Menu(this, 1319, 942, 1183, "PhD summerschools"));
    
    
    this.menu_items.push(new Menu(this, 1299, 922, 1183, "Distance learning courses"));
    
    
    this.menu_items.push(new Menu(this, 1298, 921, 1183, "Fellowships"));
    
    
    this.menu_items.push(new Menu(this, 1184, 807, 1174, "Dissemination"));
    
    
    this.menu_items.push(new Menu(this, 1301, 924, 1184, "Project deliverables"));
    
    
    this.menu_items.push(new Menu(this, 1302, 925, 1184, "Publications"));
    
    
    this.menu_items.push(new Menu(this, 1306, 929, 1302, "Scientific"));
    
    
    this.menu_items.push(new Menu(this, 1326, 953, 1306, "The BioExploit project"));
    
    
    this.menu_items.push(new Menu(this, 1327, 954, 1306, "Unlocking wheat genetic resources for the molecular identification of ..."));
    
    
    this.menu_items.push(new Menu(this, 1328, 955, 1306, "STANDing strong, resistance proteins instigators of plant defence"));
    
    
    this.menu_items.push(new Menu(this, 1329, 956, 1306, "To Nibble at Plant Resistance Proteins"));
    
    
    this.menu_items.push(new Menu(this, 1307, 930, 1302, "General"));
    
    
    this.menu_items.push(new Menu(this, 1303, 926, 1184, "Meetings"));
    
    
    this.menu_items.push(new Menu(this, 1304, 927, 1184, "Presentations"));
    
    
    this.menu_items.push(new Menu(this, 1305, 928, 1184, "Excursions and demonstrations"));
    
    
    this.menu_items.push(new Menu(this, 1308, 931, 1174, "Vacancies"));
    
    
    this.menu_items.push(new Menu(this, 1309, 932, 1174, "Links"));
    
    
    this.menu_items.push(new Menu(this, 1185, 808, 1174, "Contact us"));
    
}

/* 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;
}
