$(function(){
	$(".fade").load(function(){$(this).fadeTo("slow", 1.0);});
	$(".fade").hover(function(){$(this).fadeTo("slow", 0.50);
},function(){$(this).fadeTo("slow", 1.0)});});

var __rJ = {
	// img
	intervalSec:7,
	interval:null,
	beforeImg:0,
	nowImg:1,
	imgMax:0,

	// navi
	navis:$("#navi ul li[class*='l']"),

	displayWindows:$("ul.image  li"),
	displayThumbnail:$("ul.thumbnail li a"),
	init:function(){
		this.imgMax=this.displayWindows.length;
		__rJ.interval=setInterval(function(){__rJ.imgInterval();},__rJ.intervalSec*1000);
		this.displayThumbnail.each(function(){$(this).attr("href","javascript:void(0);");$(this).click(function(){clearInterval(__rJ.interval);__rJ.nowImg=$(this).parent().attr("class").replace(/l([0-9]+)/,"$1")-1;__rJ.imgInterval();__rJ.interval=setInterval(function(){__rJ.imgInterval();},__rJ.intervalSec*1000);})})
		this.navis.each(function(){if($(this).find("ul")==null){return false;}$(this).mouseover(function(){$(this).find("ul").css("display","block");});$(this).mouseout(function(){$(this).find("ul").css("display","none");});});
	},
	displayWindowsRefresh:function(){$(__rJ.displayWindows[__rJ.beforeImg]).css("display","none");$(__rJ.displayThumbnail[__rJ.beforeImg]).parent().removeClass("l"+(__rJ.beforeImg+1)+"_on");$(__rJ.displayThumbnail[__rJ.beforeImg]).parent().addClass("l"+(__rJ.beforeImg+1));
			},

	imgInterval:function(){if(__rJ.beforeImg==__rJ.nowImg){return false;}this.displayWindowsRefresh();$(this.displayThumbnail[__rJ.nowImg]).parent().removeClass("l"+(__rJ.nowImg+1));$(this.displayThumbnail[__rJ.nowImg]).parent().addClass("l"+(__rJ.nowImg+1)+"_on");$(this.displayWindows[__rJ.nowImg]).fadeIn("slow");__rJ.beforeImg=__rJ.nowImg;if(__rJ.nowImg+1>=__rJ.imgMax){__rJ.nowImg=0;}else{__rJ.nowImg++;}},

	navisRefresh:function(){}
}
__rJ.init();

$(function(){
	$("#tab li").click(function(){
		var num = $("#tab li").index(this);
		$(".select").addClass('none');
		$(".select").eq(num).removeClass('none');
		$("#tab li").removeClass('on');
		$(this).addClass('on')
	});
});
