$(function(){
	status_interval=setInterval(status_check, 1000);

	function status_check() {
		var cur_status = <?PHP  $qry=mysql_query("SELECT status FROM whstatus"); while ($row=mysql_fetch_array($qry) {echo $row[0]; } ?>;

		if (cur_status == 1) {
			stream.hide(1000);
			video.show(1000);
			<?PHP $qry=mysql_query("UPDATE whstatus SET status='0'; ?>
		};
		if (cur_status == 2) {
			stream.show();
			video.hide();
			<?PHP $qry=mysql_query("UPDATE whstatus SET status='0'; ?>
		};

	});

});
