//rollover 

$.fn.rollOver = function() {
    return $(this).each( function() {
        this.osrc = $(this).attr('src');
        this.hsrc = this.osrc.replace(/^(.+)(\.[a-z]+)$/, '$1_o$2');
        this.preload = new Image();
        $(this.preload).attr('src',this.hsrc);
        $(this).mouseover( function() {
            $(this).attr('src',this.hsrc);
        }).mouseout( function() {
            $(this).attr('src',this.osrc);
        });
    });
}


//active
function activeImg(a){
	$(a).removeClass().attr("src",$(a).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"));
}

function evenTalbe(ev) {
  $(ev).each(function(){
    jQuery(this).find("tr:even").addClass("even");
  });
}

//Smooth scroll
// <a href="#***">の場合、スクロール処理を追加
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
jQuery(document).ready(function(){

	jQuery('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 800, 'quart');
				return false;
			}
		}
	});

});
