﻿// WARNING: Do NOT make any modification to this file, nor should you use this file in any commercial website or product.
// Using it without a proper license will be prosecuted by law.
var gd = new Date(), gToday = [gd.getFullYear(), gd.getMonth() + 1, gd.getDate()];
var gd1 = new Date(), gToday1 = [gd1.getFullYear(), gd1.getMonth() + 1, gd1.getDate()];
var ua = navigator.userAgent.toLowerCase();
var KO = ua.match(/konqueror\/(\d+)/), KO3 = KO && KO[1] == 3, SA = ua.match(/safari\/(\d+)/), SA1 = SA && SA[1] < 86; KO = !!KO; SA = !!SA;
var MAC = /mac/.test(ua), OP = !!self.opera, WEBTV = /webtv/.test(ua), IE = /msie/.test(ua) && !OP && !WEBTV && !SA && !KO, GK = /gecko/.test(ua), OP8 = /opera 8/.test(ua) && OP;
var NN4 = IE4 = NS6 = false, IE5 = IE && ![].push && !IE4;
var gfSelf = fGetById(parent.document, self.name);
var gTheme = self.name.split(":");
var gCurMonth = eval(gTheme[0]); gCurMonth = fCalibrate(gCurMonth[0], gCurMonth[1]);
var gContainer = parent, gDays = [31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var fOnResize, fRepaint, fHoliday, fOnChange, fAfterSelected, fOnDrag, gcOtherDayBG, fOnWeekClick, fIsSelected, fParseInput, fFormatInput, fOnDoWClick, fOnload;
var __agenda = [], popkey = ["Lite"], flatkey = ["Lite"], __stub = [], _charset = gTheme[5] ? " charset='" + gTheme[5] + "' " : "";
var MILLIDAY = 86400000, giInitDelay = 200, _lineThru = true, _noBound = false, _mcafee = false, _animPop = NN4 || IE && !IE4 && !MAC, _animInt = 20, _preferOOR = true, gbHideCalMiddle = false;
if (![].push) Array.prototype.push = function() {
    for (var i = 0; i < arguments.length; i++)
        this[this.length] = arguments[i];
    return this.length;
}

function varDate() {
    alert("Missing or invalid licence for PopCalendarXP!\nPlease make sure the licence file is in the right place.");
}

function fCalibrate(y, m) {
    if (m < 1) { y--; m += 12; }
    else if (m > 12) { y++; m -= 12; }
    return [y, m];
}

function fGetById(doc, id) {
    return doc.getElementById(id);
}

function fLoadScript(url) {
    if (!(IE4 || IE && MAC)) fGetById(document, "dynaScript").src = url;
}

function fFilterNull(str) {
    return str == null || str == "null" ? null : str;
}

function fAddEvent(y, m, d, message, action, bgcolor, fgcolor, bgimg, boxit, html, etc) {
    var ag = gbShareAgenda ? eval(gsAgShared) : __agenda;
    ag[y + "-" + m + "-" + d] = [message, fFilterNull(action), fFilterNull(bgcolor), fFilterNull(fgcolor), fFilterNull(bgimg), fFilterNull(boxit), fFilterNull(html), etc];
}

function fGetEvent(y, m, d) {
    var ag = gbShareAgenda ? eval(gsAgShared) : __agenda, id = y + "-" + m + "-" + d;
    return ag[id] ? ag[id].slice(0) : null;
}

function fRemoveEvent(y, m, d) {
    var ag = gbShareAgenda ? eval(gsAgShared) : __agenda;
    ag[y + "-" + m + "-" + d] = null;
}

function fWeekOffset(dow) {
    return dow <= 3 ? 1 : 0;
}

function fGetDays(y) {
    gDays[2] = y % 4 == 0 && y % 100 != 0 || y % 400 == 0 ? 29 : 28;
    return gDays;
}

document.write("<scr" + "ipt type='text/javascript' " + _charset + " src='" + gTheme[1] + ".js'></scr" + "ipt>");