$(function() {
    // グローバルメニュー
    $('#globalNavi ul').hide();
    $('#globalNavi li').hover(
        function(){$('ul', this).fadeIn('fast')},
        function(){$('ul', this).fadeOut('fast')}
        //function(){$('ul', this).slideDown('fast')},
        //function(){$('ul', this).slideUp('fast')}
    );

    // 取扱化粧品メニュー
    $('#cosmeMenu ul').hide();
    $('#cosmeMenu li').hover(
        function(){$('ul', this).show()},
        function(){$('ul', this).hide()}
    );

    //ブラウザチェック 
    var VarUsrAgt = navigator.userAgent.toLowerCase();//小文字
    isMac = (navigator.appVersion.indexOf("Mac") != -1);
    isWin = (navigator.appVersion.indexOf("Win") != -1);
    isSafari = VarUsrAgt.indexOf("safari");
	
    // sideContentの高さを合わせる
    var height = $("div#mainContent").height() - 1;
      if ($("div#mainContent.home").size() != 0) { 
        height = $("div#mainContent.home").height() - 18;
        $("div#container div#stage").css("margin-bottom", "0px");
      }
      if ($("div#mainContent.facial").size() != 0) { height = $("div#mainContent.facial").height() - 365; }
      if ($("div#mainContent.body").size() != 0) { height = $("div#mainContent.body").height() - 404; }
      if ($("div#mainContent.head").size() != 0) { height = $("div#mainContent.head").height() - 221; }

// listing 用
if ($("div#mainContent.headlisting").size() != 0) { height = $("div#mainContent.head").height() - 20; }

      padding = height - 1600;
      if (isMac && isSafari != -1){//safari
        if (height < 1430) padding = 102;
      } else {
        if (height < 1430) padding = 82;
      }
      $("div#sideContent div.roundGrayBox div.inner").css("padding-bottom", padding + "px");

    // アコーディオン
    $('.accordion').click(function() {
        $(this).next().slideToggle('slow');
    }).next().hide();

    //
    //reservationページ
    //連絡方法選択時の制御
    //ここから
    // slideDown
    $('#contact-0').click(function() {
        $("#content_contact_slide").slideDown('slow');
    });
    // slideUp
    $('#contact-1').click(function() {
        $("#content_contact_slide").slideUp('slow');
    });
    // ページロード時処理
    var contactval = $("input:radio[name='contact']:checked").val()
    if ( contactval != 0 ) {
    		$("#content_contact_slide").slideUp('slow');
    }
    //ここまで

	// Easingの追加
	jQuery.easing.quart = function (x, t, b, c, d) {
	    return -c * ((t=t/d-1)*t*t*t - 1) + b;
	};
    adjPosition = -30;

    // スムーズページング
    $('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = jQuery(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top -10;
                $('html,body').animate({ scrollTop: targetOffset }, 800, 'quart');
                return false;
            }
        }
    });
    

});

/*
window.onload=loadGoogleMap;
window.onunload=GUnload;

function loadGoogleMap() {
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("googleMap"));
        map.setCenter(new GLatLng(35.749246,139.80345), 17);

        // マーカー設置
        var marker = new GMarker(new GLatLng(35.747061,139.80153));
        map.addOverlay(marker);

        // マーカークリックで吹き出し表示
        GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml("<p>東京都足立区千住1-24-5 本橋ビル(モトハシビル)4F</p>");
        });

        // 縮尺コントローラ
        //map.addControl(new GLargeMapControl());
        //3Dのズームコントローラ (v=2.144 を忘れずに)
        map.addControl(new GLargeMapControl3D());

        // 地図タイプ変更コントローラ。階層式
        //map.addControl(new GMapTypeControl());
        map.addControl(new GHierarchicalMapTypeControl());

        // 尺度定規表示
        map.addControl(new GScaleControl());

        var p1 = new GLatLng(35.749740, 139.804523);
        var p2 = new GLatLng(35.75030, 139.802774);
        var points=[];
        points.push(p1);
        points.push(p2);

        //直線の描画
        line = new GPolyline(points, "#FF0000", 6);
        map.addOverlay(line);

        var p1 = new GLatLng(35.75030, 139.802774);
        var p2 = new GLatLng( 35.743901, 139.804701);
        var points=[];
        points.push(p1);
        points.push(p2);

        //直線の描画
        line = new GPolyline(points, "#FF0000", 6);
        map.addOverlay(line);

    }
}
*/

