if (document.all||document.getElementById)
	kickCountDown();
else
	window.onload = kickcountDown;

function kickCountDown()
{
	if (document.all)
	{
	  countDownInterval = document.all.timeleft.innerText;
	}
	else if (document.getElementById)
	{
	  countDownInterval = document.getElementById("timeleft").innerHTML;
	}
	
	countDownTime = countDownInterval;
	countDown();
}

function countDown()
{
	countDownTime--;
    if (countDownTime == 0) {
      countDownTime = countDownInterval;
      location.href = location.href;
      //window.location.reload();
	  
      return;
    }
    else if (countDownTime < 0)
      countDownTime = 30;
    if (document.all)
      document.all.countDownText.innerText = secsToMins(countDownTime);
    else if (document.getElementById)
      document.getElementById("countDownText").innerHTML = secsToMins(countDownTime);
    counter = setTimeout("countDown()", 1000);
}

function secsToMins(theValue)
{
	var theMin = Math.floor(theValue / 60);
    var theSec = (theValue % 60);
    if (theSec < 10)
      theSec = "0" + theSec;
    return(theMin + ":" + theSec);
}