
/* ChatScripting.js */
var updateCount = 0;
function refreshImage(rooturl, id, configid)
{
var date1 = new Date(),
detector = document.getElementById('detect' + id);
detector.src = rooturl + "ChatScript.ashx?config=" + configid + "&refresh=1&time=" + date1.getTime();
}
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);
}
