/**
 * コンテンツスライド用スクリプト
 */
$(document).ready(function() {
	current = 1;
	prev = 1;
	contents = 2;
	width = 500;
	
	$('#p1').animate( { "left":"0px" }, 700, "swing");
	//$('#loading').css("display", "none");
	
	function animateLeft(current,prev) {
		$("#p" + current).css("left", width + "px");
		$("#p" + current).animate( { "left" : "0px" }, 700, "swing");
		$('#p' + prev).animate({ "left": -width + "px" }, 700, "swing");
	}
	
	function movingNext() {
    	prev = current;
    	current++
    	if (current == (contents + 1)) { current = 1 }
    	animateLeft(current,prev);
  	}
	
	setInterval(movingNext,5000);
});
