
var channel2 = "cappatv";
var api = "http://api.ustream.tv/json/channel/";
var ustobjId;

$(function()
{
	var url2 = api 
		+ channel2
		+ "/getInfo?key=1286BCA06537763794F1684C58D0ECD6"
		+ '&callback={callback}';

	checkOnAir2();
	setInterval(checkOnAir2, 30000);	

}
);

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

}
