// Instantiate and render the menu when the page's DOM is ready

    YAHOO.util.Event.onDOMReady(function () {

        /*
             Instantiate the menu.  The first argument passed to the 
             constructor is the id of the DOM element to be created for the 
             menu; the second is an object literal representing a set of 
             configuration properties for the menu. { hidedelay: 600, submenuhidedelay: 600, lazyload: true});
        */

        var oMenu = new YAHOO.widget.Menu("basicmenu", { hidedelay: 600});
        
        /*
            Add items to the menu by passing an array of object literals 
            (each of which represents a set of YAHOO.widget.MenuItem 
            configuration properties) to the "addItems" method.
        */

        oMenu.addItems([

                { text: "New Homes", url: "NewHomes.aspx",
					submenu: {  
						id: "newhomes",  
						itemdata: [
							{ text: "Colts Neck, Currently Under Construction", url: "NewHomeColtsNeckUC.aspx" },
							{ text: "Colts Neck, Custom Home 8,000 sq'", url: "NewHomeColtsNeck.aspx" },
							{ text: "Freehold, Custom Lakefront Home 5,400 sq'", url: "NewHomeFreehold.aspx" },
							{ text: "Rumson, Custom Home 7,200 sq'", url: "NewHomeRumson.aspx" },
							{ text: "Marlboro, Custom Home 6,800 sq'", url: "NewHomeMarlboro.aspx" },
							{ text: "Long Beach Island, Custom Waterfront 2,950 sq'", url: "NewHomeLBI.aspx" },
							{ text: "Freehold, Custom Home Ranch 5,400 sq'", url: "NewHomeFreeholdRanch.aspx" }
						] // Array of YAHOO.widget.MenuItem configuration properties 
					} 
				 },
                { text: "Additions", 
					submenu: {  
						id: "additions",  
						itemdata: [
							{ text: "Colts Neck, Currently Under Construction", url: "AddColtsNeckUC.aspx" },
							{ text: "Colts Neck, 2 Story Addition 2,500 sq'", url: "AddColtsNeck1.aspx" },
							{ text: "Colts Neck, 2 Story Addition 2,000 sq'", url: "AddColtsNeck2.aspx" },
							{ text: "Colts Neck, 2 Story Addition 3,000 sq'", url: "AddColtsNeck3.aspx" },
							{ text: "Colts Neck, Addition 1,200 sq'", url: "AddColtsNeck4.aspx" },
							{ text: "Colts Neck, 2nd Story Addition 3,500 sq'", url: "AddColtsNeck5.aspx" },
							{ text: "Colts Neck, 2nd Story Addition 3,000 sq'", url: "AddColtsNeck6.aspx" },
							{ text: "Colts Neck, 1st Floor Addition 1,500 sq'", url: "AddColtsNeck7.aspx" }//,
							//{ text: "Freehold 1", url: "AddFreehold1.aspx" },
							//{ text: "Freehold 2", url: "AddFreehold2.aspx" }
						] // Array of YAHOO.widget.MenuItem configuration properties 
					} 
                },
                { text: "Kitchens", url: "Kitchens.aspx" },
                { text: "Baths",  url: "Baths.aspx" },
                { text: "Front Doors &amp; Porches", url: "FrontDoorsPorches.aspx" },
                { text: "Windows &amp; Doors", url: "WindowsDoors.aspx" },
                { text: "Fireplaces", url: "Fireplaces.aspx" },
                { text: "Steps &amp; Railings", url: "StepsRailings.aspx" },
                { text: "Theatres &amp; Basement Renovations", url: "TheatresBasements.aspx" },
                { text: "Bars &amp; Wall Units", url: "BarsWallUnits.aspx" }

            ]);

        oMenu.showEvent.subscribe(function () {

            this.focus();
        
        });

        /*
             Since this menu is built completely from script, call the "render" 
             method passing in the id of the DOM element that the menu's 
             root element should be appended to.
        */

        oMenu.render("rendertarget");
        
         /*oMenu.cfg.setProperty("hidedelay", 700);
        alert(oMenu.cfg.getProperty("hidedelay"));*/
        
        //Detect IE
        var browser=navigator;
		var version=0
		if (navigator.appVersion.indexOf("MSIE")!=-1){ //IE
			oMenu.cfg.setProperty("y", 185);
			//alert(oMenu.cfg.getProperty("y"));
		}
		else { //Not IE
	        oMenu.cfg.setProperty("y", 183);
	        //alert(oMenu.cfg.getProperty("y"));
	    }

        YAHOO.util.Event.addListener("gallery", "mouseover", oMenu.show, null, oMenu);    
        /*Hides the Module element by setting the visible configuration 
property to false. Also fires two events: beforeHideEvent prior to 
the visibility change, and hideEvent after.*/
        /*YAHOO.util.Event.addListener("gallery", "mouseout", oMenu.hide, null, oMenu);*/
    
    });