$(document).ready(function(){
// シンプルな画像ロールオーバー
  $('.img-over a img')
    .mouseover(function(){
      var onSrc = $(this).attr('src').replace('.jpg', '_o.jpg');
      $(this).attr('src', onSrc);
    })
    .mouseout(function(){
      var offSrc = $(this).attr('src').replace('_o.jpg', '.jpg');
      $(this).attr('src', offSrc);
    });

// CSSプロパティのopacityを書き換える
  $('ul#navi-service a img')
    .mouseover(function(){
        $(this).animate({opacity: 0.7}, 'fast');
    })
    .mouseout(function(){
        $(this).animate({opacity: 1.0}, 'fast');
    });
    
// はじめからロールオーバー後の画像になっている場合に対応
    $('ul#main-navi li:not(.current) a img')
    .mouseover(function(){
      var onSrc = $(this).attr('src').replace('.jpg', '_o.jpg');
      $(this).attr('src', onSrc);
    })
    .mouseout(function(){
      var offSrc = $(this).attr('src').replace('_o.jpg', '.jpg');
      $(this).attr('src', offSrc);
    });
  $('ul#navi-service li:not(.current) a img')
    .mouseover(function(){
      var onSrc = $(this).attr('src').replace('.jpg', '_o.jpg');
      $(this).attr('src', onSrc);
    })
    .mouseout(function(){
      var offSrc = $(this).attr('src').replace('_o.jpg', '.jpg');
      $(this).attr('src', offSrc);
    });
    
// スムーズスクロール
    $("a[href^=#]").click(function() {  
     var hash = this.hash;  
     if(!hash || hash == "#")  
         return false;  
     $($.browser.safari ? 'body' : 'html')  
         .animate({scrollTop: $(hash).offset().top}, 400, "swing");  
     return false;  
    });
});

