$(function() {

		//そいのんティッカー
		var count = 1;
		var end = $("p", "#emergency div").length;
		var interval = 15000;
		
		$("#emergency div p").css("marginTop","0");
		
		$("#emergency div p:first").css("marginLeft","540px");
		$("#emergency div p:first").animate({
			marginLeft : "0"
		},"slow","swing")

		setInterval(function(){
				$("#emergency div p:nth-child("+count+")").hide();
				
				if (count == end){
						count = 1;
				} else {
						count ++;
				}
				
				$("#emergency div p:nth-child("+count+")").show();
				$("#emergency div p:nth-child("+count+")").css("marginLeft","540px");
				$("#emergency div p:nth-child("+count+")").animate({
					marginLeft : "0"
				},"slow","swing")

		}, interval);
		
		//Ustreamティッカー
		var ucnt = 1;
		var uend = $("p", "div.ustream_info").length;
		
		if(uend > 1) {
			$("div.ustream_info p:not(:first)").css("display", "none");

			setInterval(function(){
					$("div.ustream_info p:nth-child("+ucnt+")").hide();
					if (ucnt == uend){
							ucnt = 1;
					} else {
							ucnt ++;
					}
					$("div.ustream_info p:nth-child("+ucnt+")").fadeIn('slow');
			}, interval);
		}
		
		
		/* みんなのツイート
		var tweetcnt = 0;
		var tweetinterval = 10000;
		var tweetchange = 2000;

		$.post( "./function/ajax/twitter.php", {
				count: tweetcnt
			}, function(data){
				$("#twitter").html(data);
			}
		);

		setInterval(function(){
			tweetcnt++;
			$.post( "./function/ajax/twitter.php", {
					count: tweetcnt
				}, function(data){
					$("#twitter").html(data);
				}
			);
			$("#twitter table").fadeOut("slow");
		}, tweetinterval);
		*/
});
