
var channel3 = "dainagoya1";
var api = "http://api.ustream.tv/json/channel/";
var ustobjId;

$(function()
{
	var url3 = api 
		+ channel3
		+ "/getInfo?key=433A0E4A0ACBBCEB9F065DA8E95592F2"
		+ '&callback={callback}';

	checkOnAir3();
	setInterval(checkOnAir3, 30000);	

}
);

function checkOnAir3()
{
	// ステータスを取得する
	var url3 = api 
		+ channel3
		+ "/getValueOf/status?key=433A0E4A0ACBBCEB9F065DA8E95592F2"
		+ '&callback={callback}';
		
	$.getJSONP(url3, function(res) {
		if(res == "live") { // On Air中
		//	$('#checkair_mini').text("On Air");
			$('#uc3').css({"background": "url(http://mychubu.chu.jp/images/ustch_dnu.gif) left bottom no-repeat"});
			$('#uc3-1').css({"background": "url(http://mychubu.chu.jp/images/ustch_dnu.gif) left bottom no-repeat"});
		}
		else { // Off Air
		//	$('#checkair_mini').text("Off Air");
			$('#uc3').css({"background": "url(http://mychubu.chu.jp/images/ustch_dnu.gif) left top no-repeat"});
			$('#uc3-1').css({"background": "url(http://mychubu.chu.jp/images/ustch_dnu.gif) left top no-repeat"});
		}
	});

}
