/**********************************************************
pageScroll
--------
ページスクロール
**********************************************************/
function pageScroll() {
	$("a[href*=#]").click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 500);
				return false;
			}
		}
	});
}


/**********************************************************
実行処理
**********************************************************/
$(document).ready(pageScroll);





/**********************************************************
lytebox
--------
ライトボックス <a rel="lytebox">で使用可能
**********************************************************/
$(function() {
	$('a[rel*=lytebox]').lightpop();
});


/**********************************************************
hover

classにrolloverと指定した画像は_overとついた画像をホバー時表示
**********************************************************/
$(document).ready(function(){

	//マウスオーバー時に_overとついた画像に切替
	$("img.rollover").mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_over$2"));
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_over(\.[a-z]+)$/, "$1$2"));
	}).mouseup(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_over(\.[a-z]+)$/, "$1$2"));
	}).click(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_over(\.[a-z]+)$/, "$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_over$2"));
	});
});




