MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ function startTime { var today=new Date; var h=today.getUTCHours; var m=today.getUTCMinutes; var sec=today.getUTCSeconds; var s1=(sec!=00)?60-sec:sec; var m1=(m!=00)?60-m:m; var h1=(24 - (h-14)); var n = today.getUTCDay; var o = today.getUTCDay + 1; h1=checkTime(h1); m1=checkTime(m1); s1=checkTime(s1); result = h1 + ":" + m1 + ":" + s1; var weekday = new Array(7); weekday [0] = "(Sun) Bond Points | Master EXP"; weekday [1] = "(Mon) Knight EXP | QP"; weekday [2] = "(Tue) Horse EXP | Knight Ascension"; weekday [3] = "(Wed) QP | Horse Ascension"; weekday [4] = "(Thu) Knight EXP | Knight Skill"; weekday [5] = "(Fri) Horse EXP + Horse Skill"; weekday [6] = "(Sat) QP | All EXP"; n = weekday[checkDay(n)]; o = weekday[checkDay(o)]; document.getElementById("countdown").innerHTML = " Current Daily Quests: " + n + " Next Daily Quests: " + o +"  " + result + "   Until New  Daily Quests" ; t=setTimeout('startTime',500); }

function checkDay(z) { var p = today.getUTCHours; if (p>=15) { return z + 1; }   return z; } function checkTime(i) { if (i<10) { i="0" + i;   } return i; } if(window.addEventListener){ window.addEventListener('load',createClock,false); //W3C } else{ window.attachEvent('onload',createClock); //IE } function createClock { var mpsidebar = document.getElementById('clock'); if ( mpsidebar != null ) { //Create Div, set style, and append to code. var countdownDisplay = document.createElement("div"); countdownDisplay.id = "countdown"; countdownDisplay.className = "tally"; countdownDisplay.style.right = "110px"; countdownDisplay.style.top = "8px"; document.getElementById('clock').appendChild(countdownDisplay); startTime; } }