var totalSeconds = 1733569; function countdown() { if(totalSeconds > 0) { //using the seconds left- calculate the days, hours, minutes, and seconds left daysLeft = Math.floor(totalSeconds / 86400); hoursLeft = Math.floor((totalSeconds % 86400) / 3600); minutesLeft = Math.floor(((totalSeconds % 86400) % 3600) / 60); var siteText = '';    if(daysLeft != 0)  {   siteText = daysLeft + " Days ";  }    siteText = siteText + hoursLeft + " Hours " + minutesLeft + " Minutes To View";    document.getElementById("countdown").innerHTML = siteText; totalSeconds = totalSeconds - 1; setTimeout("countdown()",1000); } else { document.getElementById("countdown").innerHTML = "0 Hours 0 Minutes"; } }