$(document).ready(function(){

    // FirefoxとSafariで、戻るボタンを押した際に前表示したドロップダウンメニューが残っている問題の対策
    $(window).unload(function(){});

    //スライドショー
    $('#renew1103_slideshow').cycle({
        fx: 'fade',
        speed:'slow',
        timeout: 10000,
        pause:1,
        pauseOnPagerHover:1,
        pager:'#slider_nav',
        pagerEvent:'mouseover',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
    
    $('#slider_nav li a').click(function() { location.href = $(this).attr("href"); });

    //ポップアップ
    $('#tpbanner img[title]').tinyTips('saqwa', 'title');
    
    //PNGの透過処理 for IE6
    $(document).pngFix();

    //もっと
    $(".renew1103_ttlBtn").mopHover({'target':'this','slide':true,'slideTarget':'more'});
    
    //メガドロップ
    $("ul.megamenu").megamenu();
    
    // グロナビのカレント表示
    tabChange();
    
    // ローカルナビの切り替え
    leftMenuChange();
    
    // 主にグロナビのロールオーバー
    // swapクラスを付与したaタグ内の画像をロールオーバーする
    var swapSrc;
    
    $("a.swap").hover(function(){
        swapSrc = $(this).children().attr("src");
        if( swapSrc.lastIndexOf('_0.gif') > 0){
            swapSrc = swapSrc.substr(0, swapSrc.lastIndexOf('_0.gif')) + "_1.gif";
            $(this).children().attr({src:swapSrc});
        }
    }, function(){
        swapSrc = $(this).children().attr("src");
        if( swapSrc.lastIndexOf('_1.gif') > 0){
            swapSrc = swapSrc.substr(0, swapSrc.lastIndexOf('_1.gif')) + "_0.gif";
            $(this).children().attr({src:swapSrc});
        }
    });
    
});
