function meltdown(){
	var d=document;
	var s=d.createElement("script");
	s.charset="UTF-8";
	s.src="js/meltdown.js?"+(new Date()).getTime();
	d.body.appendChild(s)
}

function set_topimg(){
  s = 4;
  n = Math.floor(Math.random()*s) + 1;
  img = "img/t" + n + ".jpg";
  document.topimg.src = img;
}
set_samune();

function bgwhite(){
	document.body.style.backgroundImage = "";
	document.bgColor = "#ffffff";
}

function bgblack(){
	document.body.style.backgroundImage = "";
	document.bgColor = "#000000";
}

function bgpink(){
	document.body.style.backgroundImage = "";
	document.bgColor = "#ffc0cb";
}

function bgimg(n){
	document.body.style.backgroundImage = "url(img/bg" + n + ".png)";
}


var tID =null;
function acl(){
  if( tID != null ){clearInterval(tID);tID=null;}
  $.ajaxSetup({scriptCharset:'utf-8'});
  var z  = 'http://api.justin.tv/api/stream/list.json?channel=lushida&jsonp=?';
  $.getJSON( z,function(a){
    document.getElementById('v').innerHTML = '　'+a[0].stream_count+'人視聴中 / トータル'+a[0].channel['views_count']+'人';
    if( tID == null ){tID = setInterval('acl()',60000);}
  });
}

