$(function(){
	$.i81.setScrolls();
	$.i81.rollOver();
	$.i81.setClass();
});
	
$.i81 = {
	setScrolls: function(){
		$('a[href^=#]').click(function(){
			var top = $(this.hash).offset().top; 
   $($.browser.safari ? 'body' : 'html').animate({scrollTop:top}, 700, 'swing');
			return false;
		});
	},
	rollOver: function(){
		$('img.btn').each(function(){
			this.oSrc = $(this).attr("src");
			this.hSrc = this.oSrc.replace(/(¥.gif|¥.jpg|¥.png)$/, "_over$1");
			this.cache = new Image();
			this.cache.src = this.hSrc;
		}).hover(function(){
			$(this).attr('src',this.hSrc);
		},function(){
			$(this).attr('src',this.oSrc);
		});
	},
	setClass: function() {
		$('.shocase_thumb_list li:nth-child(3n)').addClass('third-child').next().addClass('third-child-next');
		$('#local_nav li').each(function(ind,e){
			var href = $(e).find('a').attr('href');
			var url = location.href;
			if(url == href) {
				$(e).find('a').addClass('hover');
			}
		});
		$('#page_nav li').each(function(ind,e){
			var href = $(e).find('a').attr('href');
			var url = location.href;
			if(url == href) {
				$(e).find('a').addClass('hover');
			}
		});
		$('#footer_archives a').each(function(){
			var innerHTML = $(this).html();
			$(this).html(innerHTML+'年');
		});
	}
}
