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



// CSSプロパティのopacityを書き換える
  $('#main a img,div.slide-box p.button,div#site-info a img,div#front-diving-menu p.button img,div#side-news div.button img,div#side-voice div.button img,div.pagetop img,#side-banner-area2 a img')
    .mouseover(function(){
        $(this).animate({opacity: 0.7}, 'fast');
    })
    .mouseout(function(){
        $(this).animate({opacity: 1.0}, 'fast');
    });
    
// はじめからロールオーバー後の画像になっている場合に対応
    $('ul#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);
    });
  $('div#snavi 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}, 800, "swing");  
     return false;  
    });


//交互

	$('#main li:odd').addClass('odd');
});







//最初
$(function(){
	$('h2:first').addClass('first');
	$('#main ul li:first').addClass('first');
});

//最後
$(function(){
	$('#main ul li:last').addClass('last');
});


//高さ揃える
$(function(){
	$("#front-diving-menu div.inner").equalbox();
});
$(function(){
	$("div.price div.iLeft div.price-inner,div.price div.iRight div.price-inner").equalbox();
});


//thickbox
$(function(){
	$('div.customfield-box a').addClass('thickbox');
});
$(function(){
	$('div.entry-content a').addClass('thickbox');
});
$(function(){
	$('div#news-list div.entry-body a').addClass('thickbox');
});

//要素を包む
$(function(){
	$('div.entry-content img').wrap('<span class="img-border"></span>');
});







