    function selectedMenu ( subcat, subm ) {
        $(subcat).className = "selected";
        subMenu(subm);
    }

    function subMenu (subm) {
      if (subm != "")
        var desplegar	= subm;
      else
        var desplegar	= 10;      
      var accordion	= new Accordion( "a.atStart", "ul.atStart", {
        opacity:	false,
        alwaysHide:	true,
        display:	desplegar,
        onActive:	function(toggler, element) {
          toggler.setStyle('background-position', 'bottom');
        },
        onBackground: function(toggler, element){
          toggler.setStyle('background-position', 'top');
        }
      }, $("menu"));
    }

    function mostrar( tipo ) {
      $("disp_menu_video").className  = (tipo == "video") ? "selected" : "";
      $("disp_menu_fotos").className  = (tipo == "fotos") ? "selected" : "";
      $("display_video").style.display  = (tipo == "video") ? "block" : "none";
      $("display_fotos").style.display  = (tipo == "fotos") ? "block" : "none";
    }

    function mostrarFoto( title, archivo ) {
      $("foto").title	= title;
      $("foto").src	= archivo;
    }

    window.addEvent( "domready", function() {
      if ( $("banners_home") ) {
        var glowH  = new Fx.Styles( "bannerHistoria", { duration: 500, wait: false } );
        var glowN  = new Fx.Styles( "bannerNegocios", { duration: 500, wait: false } );
        var glowF  = new Fx.Styles( "bannerFabricas", { duration: 500, wait: false } );
        glowH.start({ "opacity": 0.001 });
        glowN.start({ "opacity": 0.001 });
        glowF.start({ "opacity": 0.001 });
        $( "bannerHistoria" ).addEvents({ "mouseenter": function() { glowH.start({ "opacity": 1 }); }, "mouseleave": function() { glowH.start( {"opacity": 0.001 }); } });
        $( "bannerNegocios" ).addEvents({ "mouseenter": function() { glowN.start({ "opacity": 1 }); }, "mouseleave": function() { glowN.start( {"opacity": 0.001 }); } });
        $( "bannerFabricas" ).addEvents({ "mouseenter": function() { glowF.start({ "opacity": 1 }); }, "mouseleave": function() { glowF.start( {"opacity": 0.001 }); } });
      }
      if ( $("fotos") ) {
        var fotosNoob = makeSlide( "listaFotos", 4, "foto_left", "foto_right", 270, 500 );
      /*
        new iCarousel( "listaFotos", {
          idPrevious:	"foto_left",
          idNext:	"foto_right",
          idToggle:	"undefined",
          item: {
            klass:	"pic",
            size:	45
          },
          animation: {
            duration:	1000,
            amount:	6
          }
        });
        */
        var links	= $("listaFotos").getElementsByTagName("a");
        for ( var i = 0; i < links.length; i++ ) {
          links[i].href	= "javascript:mostrarFoto('" + links[i].title + "','" + links[i].href + "');"
        }
      }
    });

    function makeSlide( element, items, previous, next, size, duration, direction, handles ) {
      strItems                    = "";
      for ( var i = 1; i <= items; i++ )
        strItems                 += i + ",";
      size                        = (size) ? size : 640;
      duration                    = (duration) ? duration : 2500;
      direction                   = (direction) ? direction : "horizontal";
      handles                     = (handles) ? handles : null;
      var noob                    = new noobSlide({
        box: $( element ),
        items: eval("[" + strItems + "]") ,
        size: size,
        mode: direction,
        handles: handles,
        onWalk: function( currentItem, currentHandle ) {
          if ( handles ) {
            this.handles.removeClass("active");
            currentHandle.addClass("active");
          }
        },
        fxOptions: {
          duration: duration,
          transition: Fx.Transitions.Quint.easeOut,
          wait: false
        },
        buttons: {
          previous: ($( previous ) ? $( previous ) : null),
          next: ($( next ) ? $( next ) : null)
        }
      });
      return noob;
    }
