
/* ChatScripting.js */
var updateCount = 0;
function checkRefreshTime(rooturl,id,configid,sec)
{
var detector = document.getElementById('detect'+id);
if (detector.src && detector.src != '')
{
var thisheight = detector.offsetHeight;
if (thisheight == 2)
{
document.getElementById('a'+id+'on').style.display = 'none';
document.getElementById('a'+id+'off').style.display = '';
}
else if (thisheight == 1)
{
document.getElementById('a'+id+'on').style.display = '';
document.getElementById('a'+id+'off').style.display = 'none';
}
}
updateCount++;
if ((updateCount % sec) == 0)
{
refreshImage(rooturl,id,configid);
}
setTimeout("checkRefreshTime('"+rooturl+"','"+id+"','"+configid+"',"+sec+");", 1000);
}
function refreshImage(rooturl,id,configid)
{
date1 = new Date();
updateurl = rooturl+"ChatScript.ashx?config="+configid+"&refresh=1&time="+date1.getTime();
var detector = document.getElementById('detect'+id);
detector.src = updateurl;
}
