( function($) {
	var _v = $("#epovelo");
	var _c = $("#epocargot");
	$( function() {
		$("#s01_02").css("top", 170);
		$("#s01_01, #s02_01, #s02_02, #s03_01, #s03_02, #epovelo, #epovelo .circ, #epocargot, #epocargot .circ").css("opacity", 0);
		_v.find(".spec").css("left", -330);		
		_c.find(".spec").css("right", -330);		
		$(window).load( function() {
			step01();
		} );
	} );
	
	/* step01 */
	function step01() {
		$("#animeS01").show();
		$("#s01_02").delay(1000).animate( {"top":250}, {"duration":1000, "easing":"easeOutCubic", "complete":step01_01} );
	}
	function step01_01() {
		$("#s01_01").animate( {"opacity":1}, {"duration":1500, "easing":"easeOutCubic", "complete":step01_02} );
	}
	function step01_02() {
		$("#animeS01").delay(1000).animate( {"opacity":0}, {"duration":1500, "easing":"easeOutCubic", "complete":step02} );
	}
	
	/* step02 */
	function step02() {
		$("#animeS01").remove();
		$("#animeS02").show();
		$("#s02_01").css("left", -30).animate( {"opacity":1, "left":0}, {"duration":700, "easing":"easeOutCubic"} );
		$("#s02_02").delay(400).css("left", 550).animate( {"opacity":1, "left":580}, {"duration":700, "easing":"easeOutCubic", "complete":step02_01} );
	}
	function step02_01() {
		$("#animeS02").delay(1000).animate( {"opacity":0}, {"duration":1000, "easing":"easeOutCubic", "complete":step03} );
	}
	
	/* step03 */
	function step03() {
		$("#animeS02").remove();
		$("#animeS03").show();
		$("#s03_01").css("left", 355).animate( {"opacity":1, "left":395}, {"duration":700, "easing":"easeOutCubic"} );
		$("#s03_02").delay(400).css("left", 20).animate( {"opacity":1, "left":60}, {"duration":700, "easing":"easeOutCubic", "complete":step03_01} );
	}
	function step03_01() {
		$("#animeS03").delay(1000).animate( {"opacity":0}, {"duration":1000, "easing":"easeOutCubic", "complete":step04} );
	}
	
	function step04() {
		$("#animeS03").remove();
		$("#animeS04").show();
		_v.delay(400).animate( {"opacity":1}, {"duration":1000, "easing":"easeOutCubic", "complete":steo04_01} );
		_c.animate( {"opacity":1}, {"duration":1000, "easing":"easeOutCubic"} );
	}
	function steo04_01() {
		_c.find(".circ").animate( {"opacity":1}, {"duration":1000, "easing":"easeOutCubic"} );
		_v.find(".circ").animate( {"opacity":1}, {"duration":1000, "easing":"easeOutCubic", "complete":steo04_02} );

		_v.find(".spec").animate({"left":-303}, {"duration":500, "easing":"easeOutCubic"});
		_c.find(".spec").animate({"right":-303}, {"duration":500, "easing":"easeOutCubic"});
	}
	function steo04_02() {
		_v.click( goLink );
		_v.find(".spec a").click( goLinkStop ).alphaRo();
		_v.hover( function() {
			/* epovelo */
			_v.stop().queue([]).animate({"width":555});
			_v.find(".spec").stop().queue([]).animate({"left":0}, {"duration":500, "easing":"easeOutCubic"});
			/* epocargot */
			_c.stop().queue([]).animate({"width":395, "left":555, "backgroundPositionX":-80});
		}, function() {
			/* epovelo */
			_v.stop().queue([]).animate({"width":475});
			_v.find(".spec").stop().queue([]).animate({"left":-303}, {"duration":500, "easing":"easeOutCubic"});
			/* epocargot */
			_c.stop().queue([]).animate({"width":475, "left":475, "backgroundPositionX":-40});
		} );
		_c.click( goLink );
		_c.find(".spec a").click( goLinkStop ).alphaRo();
		_c.hover( function() {
			/* epovelo */
			_v.stop().queue([]).animate({"width":395});
			/* epocargot */
			_c.stop().queue([]).animate({"width":555, "left":395, "backgroundPositionX":0});
			_c.find(".spec").stop().queue([]).animate({"right":0}, {"duration":500, "easing":"easeOutCubic"});
		}, function() {
			/* epovelo */
			_v.stop().queue([]).animate({"width":475});
			/* epocargot */
			_c.stop().queue([]).animate({"width":475, "left":475, "backgroundPositionX":-40});
			_c.find(".spec").stop().queue([]).animate({"right":-303}, {"duration":500, "easing":"easeOutCubic"});
		} );
	}
	function goLink(e) {
		window.location = $(this).find(".circ a").attr("href");
		e.preventDefault();
	}
	function goLinkStop(e) {
		e.stopPropagation();
	}
} )(jQuery);
