$(document).ready(function(){
//マウスオーバー時
function megaHoverOver(){
   	 $(this).find(".sub").stop().fadeTo('fast', 1 , function(){ this.style.removeAttribute("filter"); }).show(); 
    (function($) {
        jQuery.fn.calcSubWidth = function() {
            rowWidth = 0;
            $(this).find("ul").each(function() { 
                rowWidth  = $(this).width(); 
            });
        };
    })(jQuery); 

    if ( $(this).find(".row").length > 0 ) {

        var biggestRow = 0;	

        $(this).find(".row").each(function() {
            $(this).calcSubWidth();
            //Find biggest row
            if(rowWidth > biggestRow) {
                biggestRow = rowWidth;
            }
        });

        $(this).find(".sub").css({'width' :biggestRow});
        $(this).find(".row:last").css({'margin':'0'});

    } else { 

        $(this).calcSubWidth(); 
        $(this).find(".sub").css({'width' : rowWidth});

    }
}
//On Hover Out
function megaHoverOut(){
  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
      $(this).hide();  //after fading, hide it
  });
}

var config = {
     sensitivity: 2,
     interval: 100,
     over: megaHoverOver,
     timeout: 500, 
     out: megaHoverOut 
};

$("li.salonSearch div.sub").css({'opacity':'0'});
$("li.salonSearch").hoverIntent(config);

$("div#sSearch div.sub").css({'opacity':'0'});
$("div#sSearch").hoverIntent(config);

$("div#backnumber div.sub").css({'opacity':'0'});
$("div#backnumber").hoverIntent(config);

$("div#salonMapSearch div.sub").css({'opacity':'0'});
$("div#salonMapSearch").hoverIntent(config);

$("li.search div.sub").css({'opacity':'0'});
$("li.search").hoverIntent(config);


});


