var showId = "#vs1";
var nextId = "";
var nextNum = null;
var timeT = null;
var vszi = 2;
var nowid = "#vs1";

function defimg(){
	$("#vss1 img").attr("src","images/lineup120215/story-01.gif");
	$("#vss2 img").attr("src","images/lineup120215/story-02.gif");
	$("#vss3 img").attr("src","images/lineup120215/story-03.gif");
	$("#vss4 img").attr("src","images/lineup120215/story-04.gif");
	$("#vss5 img").attr("src","images/lineup120215/story-05.gif");
	$("#vss6 img").attr("src","images/lineup120215/story-06.gif");
}

function slideVS(sid){
	//$(nowid).stop();
	//$(sid).stop();
	$("#arrow").stop();
	
	$(sid).css({"z-index" : vszi});
	$(sid).fadeIn("slow", function(){$(nowid).fadeOut("0");nowid = sid;});
	switch(sid){
		case "#vs1":
			$("#arrow").animate(
				{"marginLeft": "55px"},
				{duration: 600, easing: "easeOutCubic"}
			);
			defimg();
			$("#vss1 img").attr("src","images/lineup120215/story-01-ov.gif");
			break;
		case "#vs2":
			$("#arrow").animate(
				{"marginLeft": "190px"},
				{duration: 600, easing: "easeOutCubic"}
			);
			defimg();
			$("#vss2 img").attr("src","images/lineup120215/story-02-ov.gif");
			break;
		case "#vs3":
			$("#arrow").animate(
				{"marginLeft": "325px"},
				{duration: 600, easing: "easeOutCubic"}
			);
			defimg();
			$("#vss3 img").attr("src","images/lineup120215/story-03-ov.gif");
			break;



		case "#vs4":
			$("#arrow").animate(
				{"marginLeft": "460px"},
				{duration: 600, easing: "easeOutCubic"}
			);
			defimg();
			$("#vss4 img").attr("src","images/lineup120215/story-04-ov.gif");
			break;
		case "#vs5":
			$("#arrow").animate(
				{"marginLeft": "595px"},
				{duration: 600, easing: "easeOutCubic"}
			);
			defimg();
			$("#vss5 img").attr("src","images/lineup120215/story-05-ov.gif");
			break;
		case "#vs6":
			$("#arrow").animate(
				{"marginLeft": "730px"},
				{duration: 600, easing: "easeOutCubic"}
			);
			defimg();
			$("#vss6 img").attr("src","images/lineup120215/story-06-ov.gif");
			break;
	}
	
	showId = sid;
	
	var nextNum = eval(sid.charAt(3))+1;

	if(nextNum == 7) nextNum = 1;
	nextId = "#vs"+nextNum;

	vszi++;
	clearInterval(timeT);
	timeT = setTimeout( 'slideVS(nextId)', 6000);
}
slideVS("#vs1");




$(document).ready(function(){

	$("#rm1 a img").mouseover(function(){
		$("#rm1 a").animate(
			{"opacity": "0.3"},
			{duration: 200, easing: "easeOutCubic"}
		);
	});
	$("#rm1 img").mouseout(function(){
		$("#rm1 a").animate(
			{"opacity": "1"},
			{duration: 200, easing: "easeOutCubic"}
		);
	});
	$("#rm2 img").mouseover(function(){
		$("#rm2 a").animate(
			{"opacity": "0.3"},
			{duration: 200, easing: "easeOutCubic"}
		);
	});
	$("#rm2 img").mouseout(function(){
		$("#rm2 a").animate(
			{"opacity": "1"},
			{duration: 200, easing: "easeOutCubic"}
		);
	});
/*
	$("#rm3 img").mouseover(function(){
		$("#rm3 a").animate(
			{"opacity": "0.3"},
			{duration: 200, easing: "easeOutCubic"}
		);
	});
	$("#rm3 img").mouseout(function(){
		$("#rm3 a").animate(
			{"opacity": "1"},
			{duration: 200, easing: "easeOutCubic"}
		);
	});
*/


	$("#vss1").mouseover(function(){
		if("#vs1" != nowid){
			slideVS("#vs1");
		}
	});
	$("#vss2").mouseover(function(){
		if("#vs2" != nowid){
			slideVS("#vs2");
		}
	});
	$("#vss3").mouseover(function(){
		if("#vs3" != nowid){
			slideVS("#vs3");
		}
	});


	$("#vss4").mouseover(function(){
		if("#vs4" != nowid){
			slideVS("#vs4");
		}
	});
	$("#vss5").mouseover(function(){
		if("#vs5" != nowid){
			slideVS("#vs5");
		}
	});
	$("#vss6").mouseover(function(){
		if("#vs6" != nowid){
			slideVS("#vs6");
		}
	});

});

