// JavaScript Document
// Initialize and render the menu bar when it is available in the DOM

    YAHOO.util.Event.onContentReady("topmenu", function () {

        // "beforerender" event handler for the menu bar
		function onMenuBarBeforeRender(p_sType, p_sArgs) {

                    var oSubmenuData = {
                    
                        "accomo_menulink": [ 
                
							{ text: "standard", url: "html/room-descriptions.html#st" },
							{ text: "executive", url: "html/room-descriptions.html#stdbl" },
							{ text: "deluxe", url: "html/room-descriptions.html#deluxe" },
							{ text: "mini suite", url: "html/room-descriptions.html#mini" }					 
									
				
						],
    
                        "dining_menulink": [

							
							{ text: "gordon's", url: "gordons.html", submenu: { id: "gordon_link", itemdata: [
		
									{ text: "menu", url: "gordons-menu.html" },
									{ text: "reserve", url: "gordons-reserve.html" } ,
									{ text: "Events", url: "hgordon-events.html" }
									
		
								] }						
							
							}
									   
		
						],
                        
                        "acctivities_menulink": [
							
							{ text: "area attractions", url: "activities-area-attractions.html" },
							{ text: "resident's newsletter", url: "http://www.lakesanmarcosresort.com/images/Newsletter/Newsletter.pdf" },
							{ text: "helping others", url: "charities.html" },
							{ text: "CDC Improvements", url: "http://www.lakesanmarcosresort.com/progress.html" }
						
						],
                        
						"weddings_menulink": [

							{ text: "weddings", url: "wedding-description.html", submenu: { id: "weddings_sublink", itemdata: [
		
									{ text: "locations", url: "wedding-locations.html" },
									{ text: "menus", url: "wedding-menus.html" },
									{ text: "contact", url: "wedding-desc-contact.html" },
									{ text: "Gallery", url: "wedding-gallery.html" },
		
								] }						
							
							},
							{ text: "social events", url: "social-events.html", submenu: { id: "events_sublink", itemdata: [
		
									{ text: "locations", url: "social-locations.html" },
									{ text: "menus", url: "social-menus.html" },
									{ text: "contact", url: "social-contact.html" }                           
		
								] }						
							
							},
							{ text: "corporate events", url: "corporate-events.html", submenu: { id: "corp_events_sublink", itemdata: [
			
									{ text: "locations", url: "corporate-locations.html" },
									{ text: "menus", url: "corporate-menus.html" },
									{ text: "contact", url: "corporate-contact.html" }
									
		
								] }						
							
							},
							{ text: "room layout", url: "room-layout.html" },
							{ text: "meeting planner", url: "meeting-planner.html" },
							{ text: "request for proposal - RFP", url: "rfp.html" },
							{ text: "contact", url: "weddings-contact.html" }                    
						],
						
						"resort_menulink": [

							{ text: "packages", url: "html/resort-packages.html" },
							{ text: "events/promos", url: "html/resort-events.html" },
							{ text: "directions", url: "html/resort-directions.html" },
							{ text: "community involvement", url: "html/resort-comm-inv.html" },
							{ text: "guest survey comment", url: "html/resort-survey.html" },
							{ text: "press room", url: "html/resort-press.html" },
							{ text: "fitness center", url: "html/fitness_center.html" },
							
							                    
						],
						
						"ccclub_menulink": [
		
							{ text: "country club membership", url: "cc-membership.html" },
							{ text: "events", url: "cc-events.html" },
							{ text: "info request form", url: "cc-info-request.html" },
							{ text: "directions", url: "cc-directions.html" },
							{ text: "careers", url: "cc-careers.html" }							              
						],
						
						"golf_menulink": [
										  { text: "Tournaments", url: "tournament.html"},

							{ text: "north course", url: "north-course.html", submenu: { id: "northcourse_sublink", itemdata: [
		
									{ text: "score card", url: "north-scorecard.html" }									                            
		
								] }						
							
							},
							{ text: "south course", url: "south-course.html", submenu: { id: "southcourse_sublink", itemdata: [
		
									{ text: "score card", url: "south-scorecard.html" },
									{ text: "reserve", url: "golf-reservations.html" }                            
		
								] }						
							
							}
									   
		
						],
						
						"members_menulink": [
		
							{ text: "newsletter", url: "http://www.lakesanmarcoscountryclub.com" },
							{ text: "billing statement", url: "http://www.lakesanmarcoscountryclub.com" },
							{ text: "dual membership", url: "dualmembership.html" }
						],
						
						
						"contact_menulink": [
		
							{ text: "main contact", url: "contact.html" },
							{ text: "dining contact", url: "contact.html" },
							{ text: "golf contact", url: "contact.html" },
							{ text: "lodging contact", url: "contact.html" },
							{ text: "careers", url: "resort-careers.html" }
						]	
						
						
						
                    
                    };

                    // Add a submenu to each of the menu items in the menu bar

					this.getItem(1).cfg.setProperty("submenu", { id: "dining_menulink", itemdata: oSubmenuData["dining_menulink"] });
					this.getItem(2).cfg.setProperty("submenu", { id: "acctivities_menulink", itemdata: oSubmenuData["acctivities_menulink"] });
					this.getItem(3).cfg.setProperty("submenu", { id: "weddings_menulink", itemdata: oSubmenuData["weddings_menulink"] });
					this.getItem(5).cfg.setProperty("submenu", { id: "ccclub_menulink", itemdata: oSubmenuData["ccclub_menulink"] });
					this.getItem(6).cfg.setProperty("submenu", { id: "golf_menulink", itemdata: oSubmenuData["golf_menulink"] });
					this.getItem(7).cfg.setProperty("submenu", { id: "members_menulink", itemdata: oSubmenuData["members_menulink"] });
					this.getItem(8).cfg.setProperty("submenu", { id: "contact_menulink", itemdata: oSubmenuData["contact_menulink"] });					

                }

        /*
             Instantiate the menubar.  The first argument passed to the 
             constructor is the id of the element in the DOM that 
             represents the menubar; the second is an object literal 
             representing a set of configuration properties for 
             the menubar.
        */

        var oMenuBar = new YAHOO.widget.MenuBar("topmenu", { autosubmenudisplay: true, showdelay: 250, hidedelay:  750, lazyload: true });


        // Subscribe to the "beforerender" event

        oMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender);


        /*
             Call the "render" method with no arguments since the markup for 
             this menu already exists in the DOM.
        */

        oMenuBar.render();            
    
    });

