$(document).ready(function(){
	
	
	// ロールオーバー処理
	$("a img[src*='_on']").addClass("current");
    $("a img").mouseover(function(){
		if ($(this).attr("src").match(/_off./)){
			$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
			return;
		}
	});
	
	$("a img[class!='current']").mouseout(function(){
		if($(this).hasClass("current")) return;
		if($(this).attr("src").match(/_on./)){
			$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
			return;
		}
	});
	
	var images = [];
	$("a img").each(function(index){
		if($(this).attr("src").match(/_off./)){
			images[index]= new Image();
			images[index].src = $(this).attr("src").replace("_on.", "_off.");
		}
	});
	
	// スクロール処理
	function smoothScroll() { 
		var target = $(this.hash); 
		if(target.size()) { 
			var top = target.offset().top;
			$($.browser.safari ? 'body' : 'html').animate({scrollTop:(top)}, 800, 'easeOutQuint',function(){
				$(this).animate({scrollTop:top}, 1000, 'easeOutQuint')
			
			}); 
		} 
		return false; 
	} 
 	$('a[href^=#]').bind("click",smoothScroll);
	
});


