﻿function InitMenuFunctions() {
  jQuery("li.main").mouseover(function () {
    jQuery(this).find('.subnav').stop().animate({ height: jQuery(this).attr('menuBoxHeight'), opacity: '1', width: jQuery(this).find('.subnav').attr('targetWidth') },
                                                { queue: false, duration: 1500, easing: 'easeOutBounce' }); // easeOutElastic easeOutBounce
    jQuery(this).find('.subnav').css('display', 'block');
    jQuery(this).css('backgroundColor', '#C13D93');
  });

  jQuery("li.main").mouseout(function () { //When mouse out ...
    //Following event is applied to the subnav itself (making height of subnav 0px)
    jQuery(this).find('.subnav').stop().animate({ height: '0px', opacity: '0', width: '0px' }, { queue: false, duration: 1600, easing: 'easeOutBounce' })
    //jQuery(this).find('.subnav').css('display', 'none');
    jQuery(this).css('backgroundColor', 'transparent');

    jQuery(this).stop().animate({opacity: 1}, 'slow');
  });

  //menu itembackground color animation			
  jQuery("ul.subnav li").hover(function () {
    jQuery(this).stop().animate({ backgroundColor: "#C13D93" }, 600);
  },
  function () {
    jQuery(this).stop().animate({ backgroundColor: "silver" }, 600);
  });  
}

