YAHOO.util.Event.onContentReady("mid-top-level-navigation", function () {

                var oMenuBar = new YAHOO.widget.MenuBar("mid-top-level-navigation", { 
                                                            autosubmenudisplay: true, 
                                                            hidedelay: 750, 
                                                            lazyload: true });
                var aSubmenuData = [
                
                    {
                        id: "about", 
                        itemdata: []
                    },

                    {
                        id: "services", 
                        itemdata: [
        					{ text: "Barium Enema", url: "barium_enema.php" },
							{ text: "Bone Scan", url: "bone_scan.php" },
						    { text: "CAT Scan ", url: "ct_scans.php" },
							{ text: "Dexa Scan", url: "dexa_scan.php" },
							{ text: "Gastric Emptying Study", url: "gastric_emptying_study.php" },
							{ text: "Guided Needle Biopsies ", url: "imaging_guided_needle_biopsies.php" },
							{ text: "HIDA Scan" ,url: "hida_scan.php" },
							{ text: "HIDA Scan with CCK" ,url: "hida_scan_with_cck.php" },
						    { text: "Interventional Radiology ", url: "interventional_radiology.php" },
							{ text: "Mammography", url: "mammography.php" },
	    	                { text: "MRI", url: "mri.php" },
							{ text: "PET Scan", url: "pet.php" },					
							{ text: "Ultrasound", url: "ultrasound.php" },
							{ text: "Upper GI Series", url: "upper_gi.php" }
							

                        ]    
                    },
                    
                	{
                        id: "Doctors", 
                        itemdata: []    
                    },
                    
                    {
                        id: "patients", 
                        itemdata: [
                             { text: "Billing FAQ", url: "billing_faq.php" },
							  { text: "Links", url: "links.php" },
							 { text: "Online Bill Pay", url: "payments.php" }
                        ]    
                    },   
				    {
                        id: "locations", 
                        itemdata: [
                                                { text: "Hospitals ", url: "hospitals.php" },
                                                { text: "Imaging Centers", url: "imaging_centers.php" }
                                            ]   
                    },
					{
                        id: "contact", 
                        itemdata: [
 							//{ text: "Contact Us", url: "contact_us.php" }
                                         
                        ]    
                    }
                ];
/*
submenu: { 
                                            id: "nuclearmeds", 
                                            itemdata: [
                                                { text: "Thyroid Scan", url: "" },
                                                { text: "Bone Scan", url: "" },
                                                { text: "Cardiac Nuclear Medicine",  url: "" },
												{ text: "Hida Scan",  url: "" },
												{ text: "Hida Scan w CCK",  url: "" },
												{ text: "Lung Scan",  url: "" },
												{ text: "Renal Scan",  url: "" },
												{ text: "Gastric Emptying Study",  url: "" }
                                            ] 
                                        }
                            
*/
                var ua = YAHOO.env.ua,
                    oAnim; 


                /*
                     "beforeshow" event handler for each submenu of the MenuBar
                     instance, used to setup certain style properties before
                     the menu is animated.
                */

                function onSubmenuBeforeShow(p_sType, p_sArgs) {

                    var oBody,
                        oElement,
                        oShadow,
                        oUL;
                

                    if (this.parent) {

                        oElement = this.element;

                        /*
                             Get a reference to the Menu's shadow element and 
                             set its "height" property to "0px" to syncronize 
                             it with the height of the Menu instance.
                        */

                        oShadow = oElement.lastChild;
                        oShadow.style.height = "0px";

                        
                        /*
                            Stop the Animation instance if it is currently 
                            animating a Menu.
                        */ 
                    
                        if (oAnim && oAnim.isAnimated()) {
                        
                            oAnim.stop();
                            oAnim = null;
                        
                        }


                        oBody = this.body;


                        if (this.parent && 
                            !(this.parent instanceof YAHOO.widget.MenuBarItem)) {
                        

                            if (ua.gecko || ua.opera) {
                            
                                oBody.style.width = oBody.clientWidth + "px";
                            
                            }
                            
                            

                            if (ua.ie == 7) {

                                oElement.style.width = oElement.clientWidth + "px";

                            }
                        
                        }

    
                        oBody.style.overflow = "hidden";

                        oUL = oBody.getElementsByTagName("ul")[0];

                        oUL.style.marginTop = ("-" + oUL.offsetHeight + "px");
                    
                    }

                }

                function onTween(p_sType, p_aArgs, p_oShadow) {

                    if (this.cfg.getProperty("iframe")) {
                    
                        this.syncIframe();
                
                    }
                
                    if (p_oShadow) {
                
                        p_oShadow.style.height = this.element.offsetHeight + "px";
                    
                    }
                
                }

                function onAnimationComplete(p_sType, p_aArgs, p_oShadow) {

                    var oBody = this.body,
                        oUL = oBody.getElementsByTagName("ul")[0];

                    if (p_oShadow) {
                    
                        p_oShadow.style.height = this.element.offsetHeight + "px";
                    
                    }


                    oUL.style.marginTop = "";
                    oBody.style.overflow = "";
                    
                    if (this.parent && 
                        !(this.parent instanceof YAHOO.widget.MenuBarItem)) {

                        if (ua.gecko || ua.opera) {
                        
                            oBody.style.width = "";
                        
                        }
                        
                        if (ua.ie == 7) {

                            this.element.style.width = "";

                        }
                    
                    }
                    
                }

                function onSubmenuShow(p_sType, p_sArgs) {

                    var oElement,
                        oShadow,
                        oUL;
                
                    if (this.parent) {

                        oElement = this.element;
                        oShadow = oElement.lastChild;
                        oUL = this.body.getElementsByTagName("ul")[0];
                    
                        oAnim = new YAHOO.util.Anim(oUL, 
                            { marginTop: { to: 0 } },
                            .5, YAHOO.util.Easing.easeOut);


                        oAnim.onStart.subscribe(function () {
        
                            oShadow.style.height = "100%";
                        
                        });
    

                        oAnim.animate();

                        if (YAHOO.env.ua.ie) {
                            
                            oShadow.style.height = oElement.offsetHeight + "px";

                            oAnim.onTween.subscribe(onTween, oShadow, this);
    
                        }

                        oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);
                    
                    }
                
                }

                oMenuBar.subscribe("beforeRender", function () {

                    if (this.getRoot() == this) {

                        this.getItem(0).cfg.setProperty("submenu", aSubmenuData[0]);
                        this.getItem(1).cfg.setProperty("submenu", aSubmenuData[1]);
                        this.getItem(2).cfg.setProperty("submenu", aSubmenuData[2]);
                        this.getItem(3).cfg.setProperty("submenu", aSubmenuData[3]);
						this.getItem(4).cfg.setProperty("submenu", aSubmenuData[4]);
						this.getItem(5).cfg.setProperty("submenu", aSubmenuData[5]);

                    }

                });

                oMenuBar.subscribe("beforeShow", onSubmenuBeforeShow);
                oMenuBar.subscribe("show", onSubmenuShow);

                oMenuBar.render();         
            
            });
