// Megadropdown
jQuery(function () {
  jQuery('.L1, .L1_Active').hover(function () {
    jQuery('.megadropdownDropArea',jQuery(this)).css('visibility','visible');
    },
  function () {
    jQuery('.megadropdownDropArea',jQuery(this)).css('visibility','hidden');
  });

  jQuery('.megadropdownDropArea').each(function () {
    var $this=jQuery(this);
    var col1Height=jQuery('ul.col1',$this).height();
    var col2Height=jQuery('ul.col2',$this).height();
    var col3Height=jQuery('ul.col3',$this).height();
    var iHeight=(col1Height>col2Height)?col1Height:col2Height;
    iHeight=(iHeight>col3Height)?iHeight:col3Height;

    var col1Width=jQuery('ul.col1',$this).width()+5;
    var col2Width=jQuery('ul.col2',$this).width()+5;
    var col3Width=jQuery('ul.col3',$this).width()+5;
    var iWidth=col1Width+col2Width+col3Width;
    
    if (typeof console!='undefined') console.log(col1Width+' '+col2Width+' '+col3Width+' => '+iWidth);

    $this.css({ 'height': iHeight+'px','width': iWidth+'px', 'padding':'8px'});
    jQuery('>ul',$this).css('height', iHeight+'px')
  })
});
