/*
    This file is part of "Horizontal menu for Joomla".

    "Horizontal menu for Joomla" is under the terms of the
    GNU General Public License as published by the Free Software
    Foundation, either version 3 of the License.

    "Horizontal menu for Joomla" is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with "Horizontal menu for Joomla". If not, see
    http://www.gnu.org/licenses/

    Horizontal menu for Joomla  Copyright (C) 2009  Janos Biro
*/

window.addEvent('domready', function() {

  $$('.menu_element').each( function(obj, i){
    var inside = new Fx.Styles(obj.getChildren()[0], {duration:1000, wait:false, transition: Fx.Transitions.Expo.easeOut});
    obj.addEvent('mouseenter', function(){
      inside.options.transition=Fx.Transitions.Expo.easeOut;
      inside.options.duration=1500;
      inside.start({
        height: obj.getChildren()[0].getSize().scrollSize.y
      });
    });
  
    obj.addEvent('mouseleave', function(){
      inside.options.duration=1500;
      inside.options.transition=Fx.Transitions.Expo.easeOut;
      inside.start({
        height: 0
      });
    });
  });
});
