document.pdoaTime = new Array; document.pdoaTime.hourData = 1; document.pdoaTime.hour = 1; document.pdoaTime.minute = 04; document.pdoaTime.tempSec = 56; document.pdoaTime.colon = 1; var tempMin = document.pdoaTime.minute; if (tempMin < 10) { tempMin = "0" + tempMin; } document.write ( '' + '' + document.pdoaTime.hour + '' + ':' + '' + tempMin + '' + '' ); setTimeout(function() { pdoaUpdateTime(); setInterval("pdoaUpdateTime()",60000); },(document.pdoaTime.tempSec * 1000)); setInterval(function() { if (document.pdoaTime.colon == 1) { document.pdoaTime.colon = 0; document.getElementById('pdoaTimeColon').style.visibility = "hidden"; } else { document.pdoaTime.colon = 1; document.getElementById('pdoaTimeColon').style.visibility = "visible"; } },500); function pdoaUpdateTime() { // Fetch Current Timedata var m = document.pdoaTime.minute; var h = document.pdoaTime.hour; var H = document.pdoaTime.hourData; // Update Minute var m = m - 0 + 1; if (m == 60) { m = 0; h = h - 0 + 1; H = H - 0 + 1; if (h == 13) { h = 1; } if (H == 24) { H = 0; } } if (m < 10) { m = "0" + m; } var color; // Decide on the Color if (H >= 20 || H < 4) { color = "darkblue"; } if (H >= 4 && H < 10) { color = "skyblue"; } if (H >=10 && H < 17) { color = "gold"; } if (H >=17 && H < 20) { color = "orange"; } // Set Time Data document.pdoaTime.minute = m; document.pdoaTime.hour = h; document.pdoaTime.hourData = H; // Update Time Data document.getElementById("pdoaTimeHour").innerHTML = h; document.getElementById("pdoaTimeMinute").innerHTML = m; document.getElementById("pdoaTimeAll").style.color = color; }