dojo.declare ("xng.imageMenuManager",null, { // Constructor initializer: function() { // Put setters here like: this.name=name; this.strLastOpenedMenu = null; }, hideAllPopUpMenus: function() { var popUpMenus = dojo.widget.byType('PopupMenu2'); for(var i = popUpMenus.length-1; i >= 0; i--){ popUpMenus[i].closeAll(); } }, hideLastMenuCompletely: function() { if (this.setLastMenuButtonOff() && this.hideLastOpenedPopUpMenu()) { return true; } else { return false; } }, setLastMenuButtonOff: function() { dojo.debug('Shutting off: '+'bt'+this.strLastOpenedMenu); if (this.strLastOpenedMenu != null) { var btMenu = dojo.byId('bt'+this.strLastOpenedMenu); btMenu.src = 'sp/images/btn_'+this.strLastOpenedMenu+'_off.gif'; return true; } return false; }, hideLastOpenedPopUpMenu: function() { dojo.debug('Closing: '+'menu'+this.strLastOpenedMenu); if (this.strLastOpenedMenu != null) { var lastPopUpMenu = dojo.widget.byId('menu'+this.strLastOpenedMenu); dojo.debug(lastPopUpMenu); if (!(typeof(lastPopUpMenu)=='undefined')) { lastPopUpMenu.closeAll(); return true; } } return false; }, showSubMenu: function (strMenu) { // If I am on the same menu as the last time do nothing this.hideLastMenuCompletely(); var btMenu = dojo.byId('bt'+strMenu); btMenu.src = 'sp/images/btn_'+strMenu+'_on.gif'; this.strLastOpenedMenu = strMenu; var popMenu = dojo.widget.byId('menu'+strMenu); if (!(typeof(popMenu)=='undefined')) { popMenu.move(dojo.html.getAbsolutePosition(btMenu).x+10,dojo.html.getScroll().top+dojo.html.getAbsolutePosition(btMenu).y+btMenu.height+5); popMenu.show(); } } }); var menuManager = new xng.imageMenuManager(); function Change_Action (act){ document.location = 'page.php?language=sp§ion=promo&action='+act+'¤t_page=1'; return true; } function changeLocation (section, action) { document.location = 'page.php?language=sp§ion='+section+'&action='+action+'¤t_page=1'; return true; } function init() { dojo.debug ('Everything ready to start'); var imgquees = new Image(); imgquees.src = 'sp/images/btn_quees_on.gif'; var imgasociados = new Image(); imgasociados.src = 'sp/images/btn_asociados_on.gif'; var imgventa = new Image(); imgventa.src = 'sp/images/btn_venta_on.gif'; var imgpanarg = new Image(); imgpanarg.src = 'sp/images/btn_panarg_on.gif'; var imgpanmun = new Image(); imgpanmun.src = 'sp/images/btn_panmun_on.gif'; var imgetica = new Image(); imgetica.src = 'sp/images/btn_etica_on.gif'; var imgnoticias = new Image(); imgnoticias.src = 'sp/images/btn_noticias_on.gif'; } dojo.addOnLoad(init);