// JavaScript Document


            YAHOO.example.onMenuBarReady = function(p_oEvent) {


                // Animation object

                var oAnim;


                // Utility function used to setup animation for submenus

                function setupMenuAnimation(p_oMenu) {

                    if(!p_oMenu.animationSetup) {

                        var aItems = p_oMenu.getItemGroups();
    
                        if(aItems && aItems[0]) {
    
                            var i = aItems[0].length - 1;
                            var oSubmenu;

                            do {

                                oSubmenu = p_oMenu.getItem(i).cfg.getProperty("submenu");
        
                                if(oSubmenu) {
        
                                    oSubmenu.beforeShowEvent.subscribe(onMenuBeforeShow, oSubmenu, true);
                                    oSubmenu.showEvent.subscribe(onMenuShow, oSubmenu, true);
        
                                }
                            
                            }
                            while(i--);
                        
                        }

                        p_oMenu.animationSetup = true;

                    }

                }


                // "beforeshow" event handler for each submenu of the menu bar

                function onMenuBeforeShow(p_sType, p_sArgs, p_oMenu) {

                    if(oAnim && oAnim.isAnimated()) {
                    
                        oAnim.stop();
                        oAnim = null;
                    
                    }

                    YAHOO.util.Dom.setStyle(this.element, "overflow", "hidden");
                    YAHOO.util.Dom.setStyle(this.body, "marginTop", ("-" + this.body.offsetHeight + "px"));

                }


                // "show" event handler for each submenu of the menu bar

                function onMenuShow(p_sType, p_sArgs, p_oMenu) {

                    oAnim = new YAHOO.util.Anim(
                        this.body, 
                        { marginTop: { to: 0 } },
                        .5, 
                        YAHOO.util.Easing.easeOut
                    );

                    oAnim.animate();

                    var me = this;
                        
                    function onTween() {

                        me.cfg.refireEvent("iframe");
                    
                    }

                    function onAnimationComplete() {

                        YAHOO.util.Dom.setStyle(me.body, "marginTop", ("0px"));
                        YAHOO.util.Dom.setStyle(me.element, "overflow", "visible");

                        setupMenuAnimation(me);

                    }
                    

                    /*
                         Refire the event handler for the "iframe" 
                         configuration property with each tween so that the  
                         size and position of the iframe shim remain in sync 
                         with the menu.
                    */

                    if(this.cfg.getProperty("iframe") == true) {

                        oAnim.onTween.subscribe(onTween);

                    }

                    oAnim.onComplete.subscribe(onAnimationComplete);
                
                }


                // "beforerender" event handler for the menu bar

                function onMenuBeforeRender(p_sType, p_sArgs, p_oMenu) {

                    var oSubmenuData = {
                    
                        "who": [
    
                            { text: "Who is PLS?", url: "who.php" },
							{ text: "Logistics Analysis", url: "mail_logistics.php" },
							{ text: "Distribution Management", url: "mail_distribution.php" },
							{ text: "Confirmation & Performance", url: "mail_confirmation.php" },
							{ text: "Redistribution Management", url: "redistribute.php" },
							{ text: "Postal Program", url: "postal.php" },
                            { text: "Commodities", url: "commodities.php" },
							{ text: "Insert Management", url: "insertmanagement.php" }
							 
                        ],
                        
                        "above": [
                            { text: "Above Industry Standard", url: "above.php" },   
                            { text: "Newspaper Insert Program", url: "inserts.php" },						
                            { text: "Insert Worksheet", url: "insert_worksheet.php" },
							{ text: "Customization", url: "customization.php" }
                        
                        ],
                        
                        "people": [
                            { text: "Premier People", url: "people.php" }    
                           		
                        ],
						

  						"premierlink": [
                           { text: "PremierLink Info", url: "premierlink.php" },     															
						   { text: "PremierLink Demo", url: "premierlink_demo.php" }

                        ]
	
                    
                    };


                    this.getItem(0).cfg.setProperty("submenu", { id:"who", itemdata: oSubmenuData["who"] });
                    this.getItem(1).cfg.setProperty("submenu", { id:"above", itemdata: oSubmenuData["above"] });
                    this.getItem(2).cfg.setProperty("submenu", { id:"people", itemdata: oSubmenuData["people"] });
                    this.getItem(3).cfg.setProperty("submenu", { id:"premierlink", itemdata: oSubmenuData["premierlink"] });

                    setupMenuAnimation(this);

                }


                // Initialize the root menu bar

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


                // Subscribe to the "beforerender" event

                oMenuBar.beforeRenderEvent.subscribe(onMenuBeforeRender, oMenuBar, true);


                // Render the menu bar

                oMenuBar.render();
                
            }


            // Initialize and render the menu bar when it is available in the DOM
			// NOTE: eric double-forcing this to wait until DOM available because of IE errors
			
//			onload = setTimeout('wishIEWouldHandleTheDOMCorrectly()',200);

			YAHOO.util.Event.on(window,'load',wishIEWouldHandleTheDOMCorrectly);

		// scripting fix for annoying DOM issue in IE, Jan 08
			function fubar2IEDOM()	{
//		        YAHOO.util.Event.onContentReady("productsandservices", YAHOO.example.onMenuBarReady);
//				YAHOO.util.Event.onDOMReady(wishIEWouldHandleTheDOMCorrectly);
			}
		
			function wishIEWouldHandleTheDOMCorrectly()	{
	            YAHOO.util.Event.onContentReady("productsandservices", YAHOO.example.onMenuBarReady);
		//		YAHOO.util.Event.onDOMReady(fubar2IEDOM);
			}

			 
			