var showId = "#vs1";
var nextId = "";
var nextNum = null;
var timeT = null;
var vszi = 2;
var nowid = "#vs1";

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(
				{"top": "23"},
				{duration: 400, easing: "easeOutBounce"}
			);
			break;
		case "#vs2":
			$("#arrow").animate(
				{"top": "88"},
				{duration: 400, easing: "easeOutBounce"}
			);
			break;
		case "#vs3":
			$("#arrow").animate(
				{"top": "154"},
				{duration: 400, easing: "easeOutBounce"}
			);
			break;
		case "#vs4":
			$("#arrow").animate(
				{"top": "219"},
				{duration: 400, easing: "easeOutBounce"}
			);
			break;
	}
	
	showId = sid;
	
	var nextNum = eval(sid.charAt(3))+1;

	if(nextNum == 5) nextNum = 1;
	nextId = "#vs"+nextNum;

	vszi++;
	clearInterval(timeT);
	timeT = setTimeout( 'slideVS(nextId)', 8000);
}
slideVS("#vs1");




$(document).ready(function(){
	$("#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");
		}
	});

	// foot baner
	$(".banner a").mouseover(function(){
		$(this).animate(
				{"opacity": "0.7"},
				{duration: 600, easing: "easeOutCubic"}
			);
	});
	$(".banner a").mouseout(function(){
		$(this).animate(
				{"opacity": "1"},
				{duration: 600, easing: "easeOutCubic"}
			);
	});

	//
	$(".mainmenu a").mouseover(function(){
		if(jQuery.browser.mozilla){
			$(this).stop().animate(
				{"backgroundPosition": "0px -43px"},
				{duration: 200, easing: "easeOutCubic"}
			);
		}
		else{
			$(this).stop().animate(
				{"backgroundPositionY": "-43px"},
				{duration: 200, easing: "easeOutCubic"}
			);
		}
	})
	$(".mainmenu a").mouseout(function(){
		if(jQuery.browser.mozilla){
			$(this).stop().animate(
				{"backgroundPosition": "0px 0px"},
				{duration: 200, easing: "easeOutCubic"}
			);
		}
		else{
			$(this).stop().animate(
				{"backgroundPositionY": "0px"},
				{duration: 200, easing: "easeOutCubic"}
			);
		}
	})

});

