var MuEvents = {};
MuEvents.text = [
[lang[0], lang[1]],
[lang[2], lang[3]]
];
MuEvents.sked = [
['Blood Castle', 0, '00:30', '01:30', '02:30', '03:30', '04:30', '05:30', '06:30', '07:30', '08:30', '09:30', '10:30', '11:30', '12:30', '13:30', '14:30', '15:30', '16:30', '17:30', '18:30', '19:30', '20:30', '21:30', '22:30', '23:30'],
['Chaos Castle', 0, '01:45', '03:45', '05:45', '07:45', '09:45', '11:45', '13:45', '15:45', '17:45', '19:45', '21:45', '23:45'],
['Devil Square', 0, '01:00', '03:00', '05:00', '07:00', '09:00', '11:00', '13:00', '15:00', '17:00', '19:00', '21:00', '23:00'],
['Illusion Temple', 0, '10:10', '22:10'],
['CryWolf', 0, '00:00', '08:00', '18:00'],
['White Wizard', 1, '00:30', '04:30', '08:30', '12:30', '16:30', '20:30'],
['Golden Invasion', 1, '00:30', '04:30', '08:30', '12:30', '16:30', '20:30'],
['Red Dragon Invasion', 1, '02:10', '06:10', '10:10', '14:10', '18:10', '22:10'],
['Loren Deep', 0, '04:00', '12:00', '20:00']
];
MuEvents.init = function (e) {
if (typeof e == "string")
var g = new Date(new Date().toString().replace(/\date('H')+:\date('i')+:\date('s')+/g, e));
var f = (typeof e == "number" ? e : (g.getHours() * 60 + g.getMinutes()) * 60 + g.getSeconds()), q = MuEvents.sked, j = [];
for (var a = 0; a < q.length; a++) {
var n = q[a];
for (var k = 2; k < q[a].length; k++) {
var b = 0, p = q[a][k].split(":"), o = (p[0] * 60 + p[1] * 1) * 60, c = q[a][2].split(":");
if (q[a].length - 1 == k && (o - f) < 0) b = 1;
var r = b ? (1440 * 60 - f) + ((c[0] * 60 + c[1] * 1) * 60) : o - f;
if (f <= o || b) {
var l = Math.floor((r / 60) / 60), l = l < 10 ? "0" + l : l, d = Math.floor((r / 60) % 60), d = d < 10 ? "0" + d : d, u = r % 60, u = u < 10 ? "0" + u : u;
j.push('<dt class="event">' + (l == 0 && !q[a][1] && d < 5 ? '<img src="
http://www.thegifcollector.com.ar/TgC_images_2016/botones/TgC_boton08.gif" />' : '') + '<b class="rightfloat">' + q[a][b ? 2 : k] + "</b><b>" + n[0] + '</b><span><div class="rightfloat">' + (l + ":" + d + ":" + u) + "</div>" + (MuEvents.text[q[a][1]][+(l == 0 && d < (q[a][1] ? 1 : 5))]) + "</span>");
break;
};
};
};
document.getElementById("events").innerHTML = j.join("");
setTimeout(function () {
MuEvents.init(f == 86400 ? 1 : ++f);
}, 1000);
};