/*
** Initialize and render the MenuBar when its elements are ready 
** to be scripted.
*/

var BEMA = {};

// Prepare menu bar
BEMA.initMenuBar = function () {
    BEMA.menuBar = new YAHOO.widget.MenuBar("productsandservices", 
                                            { autosubmenudisplay: true, 
                                              hidedelay: 500, 
                                              lazyload: true });
    BEMA.menuBar.render();
}

// Init when page is loaded.
BEMA.init = function () {
    // Prepare floating pane to hold pop up
    BEMA.floatingPane = new YAHOO.widget.Panel("floatingPane", 
                        { width:"780px", 
                          visible:false,
                          constraintoviewport:true,
                          modal:true,
                          draggable:true,
                          fixedcenter:true
                        } );
    BEMA.floatingPane.setHeader("");
    BEMA.floatingPane.setBody("");
    BEMA.floatingPane.setFooter("");
    BEMA.floatingPane.render(document.body);
}

BEMA.showFloatingPane = function (hd, bd, ft) {
    BEMA.floatingPane.setHeader(hd);
    BEMA.floatingPane.setBody(bd);
    BEMA.floatingPane.setFooter(ft);

    BEMA.floatingPane.show();
}

YAHOO.util.Event.onContentReady("productsandservices", BEMA.initMenuBar);
YAHOO.util.Event.addListener(window, "load", BEMA.init);
