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 myDate = new Date; var weekday = myDate.getDay; var d = new Date; var weekday = new Array; 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";

function dayCheck(z) { if(h<15) { var fixedDay = weekday[d.getUTCDay - 1]; } }

var n = weekday[d.getUTCDay]; var o = weekday[d.getUTCDay + 1]; h1=checkTime(h1); m1=checkTime(m1); s1=checkTime(s1); currDay= fixedDay; nextDay= fixedDay + 1; result = h1 + ":" + m1 + ":" + s1; document.getElementById("countdown").innerHTML = "Current Daily Quests: " + currDay + " Next Daily Quests: " + nextDay +"  " + result + "   Until New  Daily Quests" ; t=setTimeout('startTime',500); } 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; } }