// Xin Calendar 2.7 (In-Page Core)
// Copyright 2004  Xin Yang    All Rights Reserved.

// Last Modified: 25-Jun-2005
// Web Site: yxScripts.com
// Email: m_yangxin@hotmail.com

// the following copyright display settings should remain intact all the time if you are not a licensed user
// otherwise the use of Xin Calendar 2 is illegal
// --------------------------------------
var xcCalCopyright = "Copyright 2004 Xin Yang";
var xcCalHome = "http://www.yxScripts.com";
var xcCopyrightDisplay = "&#169;";
var xcShowCopyright = 0;
// --------------------------------------
var xcCore = 1;
var xc_ax = new Array(), xc_fb = new Array(), xc_ef = {};
var xc_bg = xc_df = xc_bs = null;
var xc_dx = xc_dw = null;
var xc_dl = xc_dm = xc_dt = 0;
var xc_fw = -1;
var xc_ca = ["", "100%", "50%", "33%", "25%", "20%"];
var xc_fi = " CELLPADDING='0' CELLSPACING='0' BORDER='0'>";
var xc_fj = " CELLPADDING='0' CELLSPACING='0' BORDER='0' ALIGN='CENTER'>";
var xc_fk = " CELLPADDING='0' CELLSPACING='" + xcGridWidth + "' BORDER='0' ALIGN='CENTER'>";
var xc_fm = "<TABLE" + xc_fi;
var xc_fn = "<TABLE" + xc_fj;
var xc_fo = "<TABLE WIDTH='100%'" + xc_fj;
var xc_fp = "<TABLE WIDTH='100%'" + xc_fk;
var xc_fl = "</TABLE>";
var xc_fg = "<TR VALIGN='TOP'>";
var xc_fh = "<TR ALIGN='CENTER' VALIGN='MIDDLE'>";
var xc_ff = "</TR>";
var xcCSSOpen = "this.className=\"";
var xcCSSClose = "\"";
var xc_fq = /TR|TBODY|THEAD|TFOOT|TABLE/i;
var xc_da = "yyyymmdd";
var xc_bv = "E", xc_ee = "R", xc_am = "1", xc_ds = "0";
var xcNav = navigator.userAgent.toLowerCase();
var xcIsMac = (xcNav.indexOf("mac") != -1);
var xcIsOpera = (xcNav.indexOf("opera") != -1);
var xcIsSafari = (xcNav.indexOf("safari") != -1);
var xcIsKon = (xcNav.indexOf("konqueror") != -1);
var xcIsIE = (!xcIsOpera && !xcIsKon && xcNav.indexOf("msie") != -1);
var xcIsIE4 = (xcIsIE && xcNav.indexOf("msie 4") != -1);
var xcIsIE5 = (xcIsIE && !xcIsIE4);
var xcIsIE55 = (xcIsIE && xcNav.indexOf("msie 5.5") != -1);
var xcIsIE6 = (xcIsIE && xcNav.indexOf("msie 6") != -1);
var xcIsIE55up = (xcIsIE55 || xcIsIE6);
var xcIsIEMac = xcIsIE && xcIsMac;
var xcIsN4 = (xcNav.indexOf("mozilla") != -1 && xcNav.search(/msie|gecko|opera|spoofer|compatible|webtv|hotjava/) == -1);
var xcIsN6 = (xcNav.indexOf("gecko") != -1 && !xcIsSafari);
var xcIsO7 = (xcNav.indexOf("opera 7") != -1 || xcNav.indexOf("opera/7") != -1 || xcNav.indexOf("opera 8") != -1 || xcNav.indexOf("opera/8") != -1);
var xcIsK3 = (xcIsKon && navigator.appVersion.indexOf("Konqueror/3") != -1);
var xcCalSafe = (xcIsN6 || xcIsIE5 || xcIsK3 || xcIsO7 || xcIsSafari) && !xcIsN4 && !xcIsIE4;
function xc_fy() {
	return true;
}
function xc_em() {
	setTimeout("xc_dn()", 100);
}
function xc_dn() {
	for (var i = 0; i < xc_ax.length; i++) {
		var dt = xc_ax[i];
		if (dt.gk.style.visibility == "visible") {
			var l = xc_cj(dt.gl);
			if (l != null) {
				xc_dp(dt.gk, dt.dx + xc_cm(l), dt.dy + xc_cn(l));
			} else {
				xc_cv(i);
			}
		}
	}
	xc_dx();
}
function xc_ft(e) {
	if (xcIsIE || xcIsK3 || xcIsOpera) {
		xc_dl = event.clientX + (xcIsK3 ? 0 : (document.documentElement.scrollLeft || document.body.scrollLeft));
		xc_dm = event.clientY + (xcIsK3 ? 0 : (document.documentElement.scrollTop || document.body.scrollTop));
		event.cancelBubble = false;
	} else {
		xc_dl = e.pageX;
		xc_dm = e.pageY;
		if (xcIsN6) {
			document.routeEvent(e);
		} else {
			if (xcIsSafari) {
				event.cancelBubble = false;
			}
		}
	}
}
function xc_fx() {
	if (xc_fw < 0) {
		xc_fw = document.getElementsByTagName("SELECT").length + document.getElementsByTagName("OBJECT").length + document.getElementsByTagName("APPLET").length + document.getElementsByTagName("EMBED").length;
	}
	return (xc_fw > 0);
}
function xc_cj(id) {
	return id == "" ? null : document.getElementById(id);
}
function xc_cm(l, gc) {
	if (xcIsIEMac) {
		if (xc_fq.test(l.tagName)) {
			gc = 1;
		}
		var x = l.offsetLeft;
		if (l.tagName == "TD" && typeof (gc) == "undefined") {
			x += xc_cm(l.parentElement, 1);
		} else {
			if (l.offsetParent) {
				x += xc_cm(l.offsetParent, gc);
			} else {
				x += isNaN(parseInt(document.body.style.marginLeft)) ? parseInt(document.body.leftMargin) : parseInt(document.body.style.marginLeft);
			}
		}
		return x;
	} else {
		return l.offsetLeft + (l.offsetParent ? xc_cm(l.offsetParent) : 0);
	}
}
function xc_cn(l, gc) {
	if (xcIsIEMac) {
		if (xc_fq.test(l.tagName)) {
			gc = 1;
		}
		var x = l.offsetTop;
		if (l.tagName == "TD" && typeof (gc) == "undefined") {
			x += xc_cn(l.parentElement, 1);
		} else {
			if (l.offsetParent) {
				x += xc_cn(l.offsetParent, gc);
			} else {
				x += isNaN(parseInt(document.body.style.marginTop)) ? parseInt(document.body.topMargin) : parseInt(document.body.style.marginTop);
			}
		}
		return x;
	} else {
		return l.offsetTop + (l.offsetParent ? xc_cn(l.offsetParent) : 0);
	}
}
function xc_gb(l, cm) {
	l.innerHTML = cm;
}
function xc_dp(l, x, y) {
	l.style.top = y + "px";
	l.style.left = x + "px";
}
function xc_do(l, x, y) {
	l.style.top = (parseInt(l.style.top) + y) + "px";
	l.style.left = (parseInt(l.style.left) + x) + "px";
}
function xc_ex(l) {
	l.style.visibility = "visible";
}
function xc_cw(l) {
	l.style.visibility = "hidden";
}
function xc_db() {
	var l = document.createElement("DIV");
	with (l.style) {
		position = "absolute";
		visibility = "hidden";
		left = "-1000px";
		top = "-1000px";
		zIndex = ++xcBaseZIndex;
	}
	if (xcIsIE && !xcIsMac) {
		document.body.insertBefore(l, document.body.firstChild);
	} else {
		document.body.appendChild(l);
	}
	l.gr = null;
	if (xcIsIE55up && xc_fx() && !xcIsMac) {
		l.gr = document.createElement("IFRAME");
		l.gr.src = "javascript:false";
		with (l.gr.style) {
			position = "absolute";
			visibility = "hidden";
			left = "-1000px";
			top = "-1000px";
			width = "20px";
			height = "20px";
			zIndex = l.style.zIndex - 1;
			filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
		}
		document.body.insertBefore(l.gr, l);
		l.gr.ip = false;
	}
	return l;
}
function xc_cd(n) {
	return ((n < 10) ? "0" : "") + n;
}
function xc_bt(y, m, d) {
	return xcWeekdayShortNames[(new Date(y, m, d)).getDay()];
}
function xc_cp() {
	var hh = {};
	for (var i = 0; i < xcMonthShortNames.length; i++) {
		hh[xcMonthShortNames[i].toLowerCase()] = i;
	}
	return hh;
}
function xc_de(mon) {
	if (xc_df == null) {
		xc_df = xc_cp();
	}
	return xc_df[mon.toLowerCase()] || 0;
}
function xc_cg() {
	var eu = {};
	for (var i = 0; i < xcWeekdayShortNames.length - 1; i++) {
		eu[xcWeekdayShortNames[i].toLowerCase()] = i;
	}
	return eu;
}
function xc_br(day) {
	if (xc_bs == null) {
		xc_bs = xc_cg();
	}
	return xc_bs[day.toLowerCase()] || 0;
}
function xc_fr(iw, style, fj, title) {
	return "<" + iw + " " + fj + " " + (title ? "TITLE='" + title.replace(/'/g, "&#39;") + "' " : "") + (style ? "CLASS='" + style + "'" : "") + ">";
}
function xc_be(style, fj, title) {
	return xc_fr("DIV", style, fj || "", title || "");
}
var xc_bd = "</DIV>";
function xcDIV(style, cm, fj, title) {
	return xc_be(style, fj || "", title || "") + cm + xc_bd;
}
function xc_fe(style, cm, width, fj, title) {
	return "<TD" + (width != "" ? " WIDTH='" + width + "'" : "") + ">" + xcDIV(style, cm, fj || "", title || "") + "</TD>";
}
function xc_fa(a, b) {
	return a.order - b.order;
}
function xc_ck(y, m, d) {
	return y + xc_cd(m + 1) + xc_cd(d);
}
function xc_bx(gq) {
	return xc_ax[gq];
}
function xc_cb(ii, iy, ih, fa, gl, dx, dy, he) {
	var dt = null;
	for (var i = 0; i < xc_ax.length; i++) {
		if (xc_ax[i].js || xc_ax[i].iy == iy && iy != null || xcMultiCalendar == 0 && xc_ax[i].he == 1) {
			dt = xc_ax[i];
			dt.js = false;
			break;
		}
	}
	if (dt == null) {
		dt = new xc_av(xc_ax.length);
		xc_ax[xc_ax.length] = dt;
	} else {
		dt.ik();
	}
	dt.ck = xc_ef[ii] || {};
	dt.iy = iy || null;
	dt.ih = ih || iy;
	dt.fa = fa || "";
	dt.gl = gl || "";
	dt.dx = dx || 0;
	dt.dy = dy || 0;
	dt.he = he;
	return dt;
}
function xc_eg(ii, hc, ba, value, he) {
	if (typeof (xc_ef[ii]) == "undefined") {
		xc_ef[ii] = {};
	}
	if (typeof (xc_ef[ii][hc]) == "undefined") {
		xc_ef[ii][hc] = {};
	}
	if (he == 0) {
		xc_ef[ii][hc][ba] = value;
	} else {
		if (he == 1) {
			if (typeof (xc_ef[ii][hc][ba]) == "undefined") {
				xc_ef[ii][hc][ba] = new Array();
			}
			xc_ef[ii][hc][ba][xc_ef[ii][hc][ba].length] = value;
		} else {
			if (he == 2) {
				if (typeof (xc_ef[ii][hc][ba]) == "undefined") {
					xc_ef[ii][hc][ba] = "";
				}
				xc_ef[ii][hc][ba] += value;
			}
		}
	}
}
function ag(f) {
	var eb = f || xcDateFormat;
	eb = eb.replace(/\\/g, "\\\\");
	eb = eb.replace(/\//g, "\\/");
	eb = eb.replace(/\[/g, "\\[");
	eb = eb.replace(/\]/g, "\\]");
	eb = eb.replace(/\(/g, "\\(");
	eb = eb.replace(/\)/g, "\\)");
	eb = eb.replace(/\{/g, "\\{");
	eb = eb.replace(/\}/g, "\\}");
	eb = eb.replace(/\</g, "\\<");
	eb = eb.replace(/\>/g, "\\>");
	eb = eb.replace(/\|/g, "\\|");
	eb = eb.replace(/\*/g, "\\*");
	eb = eb.replace(/\?/g, "\\?");
	eb = eb.replace(/\+/g, "\\+");
	eb = eb.replace(/\^/g, "\\^");
	eb = eb.replace(/\$/g, "\\$");
	eb = eb.replace(/dd/gi, "\\d\\d");
	eb = eb.replace(/mm/gi, "\\d\\d");
	eb = eb.replace(/yyyy/gi, "\\d\\d\\d\\d");
	eb = eb.replace(/yy/gi, "\\d\\d");
	eb = eb.replace(/day/gi, "\\w\\w\\w");
	eb = eb.replace(/mon/gi, "\\w\\w\\w");
	eb = eb.replace(/hr/gi, "\\d\\d");
	eb = eb.replace(/mi/gi, "\\d\\d");
	eb = eb.replace(/am/gi, "\\w\\w");
	return eb;
}
function xc_ce(f) {
	if (xc_bg == null) {
		xc_bg = new RegExp("^" + ag(f) + "$");
	}
	return xc_bg;
}
function xc_cs(date, eb) {
	var y, m, d, ab = eb || xcDateFormat;
	var jx = ab.search(/yyyy/i);
	var gx = ab.search(/mm/i);
	var gw = ab.search(/mon/i);
	var dv = ab.search(/dd/i);
	y = date.substring(jx, jx + 4) - 0;
	if (gx != -1) {
		m = date.substring(gx, gx + 2) - 1;
	} else {
		m = xc_de(date.substring(gw, gw + 3)) - 0;
	}
	d = date.substring(dv, dv + 2) - 0;
	return new Array(y, m, d);
}
function xc_cf(y, m, d, eb) {
	var ab = eb || xcDateFormat;
	ab = ab.replace(/yyyy/i, y);
	ab = ab.replace(/mm/i, xc_cd(m + 1));
	ab = ab.replace(/MON/, xcMonthShortNames[m].toUpperCase());
	ab = ab.replace(/mon/i, xcMonthShortNames[m]);
	ab = ab.replace(/dd/i, xc_cd(d));
	ab = ab.replace(/DAY/, xc_bt(y, m, d).toUpperCase());
	ab = ab.replace(/day/i, xc_bt(y, m, d));
	return ab;
}
function xc_fu(date, ec, ed) {
	if (date == "") {
		return "";
	}
	var hp = xc_cs(date, ec);
	return xc_cf(hp[0], hp[1], hp[2], ed);
}
function xc_ct(y) {
	var ka = y + "";
	return xcYearDigits[ka.charAt(0)] + xcYearDigits[ka.charAt(1)] + xcYearDigits[ka.charAt(2)] + xcYearDigits[ka.charAt(3)];
}
function xc_av(gq) {
	this.gq = gq;
	this.iy = null;
	this.ih = null;
	this.fa = "";
	this.gl = "";
	this.dx = 0;
	this.dy = 0;
	this.he = 1;
	this.jg = 0;
	this.jy = 0;
	this.month = 0;
	this.date = "";
	this.js = false;
	this.gt = "";
	this.ce = 0;
	this.cc = 0;
	this.ca = 0;
	this.cb = 0;
	this.cd = 0;
	this.gk = xc_db();
	this.gk.bg = this;
	if (xcIsIE55up && !xcIsMac) {
		this.gk.onmouseenter = xc_ej;
		this.gk.onmouseleave = xc_eu;
	} else {
		this.gk.onmouseover = xc_ej;
		this.gk.onmouseout = xc_eu;
	}
	this.ck = {};
	this.fy = xc_cc;
	this.io = xc_ew;
	this.be = xc_ak;
	this.an = xc_ag;
	this.cf = xc_ba;
	this.ei = xc_bj;
	this.ej = xc_bk;
	this.iq = xc_fc;
	this.hk = xc_dk;
	this.hj = xc_dj;
	this.ci = xc_dh;
	this.ik = xc_ek;
	this.ij = xc_ei;
	this.cg = xc_bb;
	this.fx = xcGet;
	this.bc = xc_ai;
	this.al = xc_ae;
	this.jq = xc_fv;
	this.bf = xc_al;
	this.ao = xc_ah;
	this.im = xc_en;
	this.bd = xc_aj;
	this.am = xc_af;
	this.bt = xc_aw;
	this.bj = xc_aq;
	this.bw = xc_az();
	this.bo = xc_at;
	this.bv = xc_ay;
	this.bs = xc_au;
	this.bh = xc_ao;
	this.bi = xc_ap;
	this.ep = xc_bq;
	this.bn = xc_as;
	this.bm = xc_ar;
	this.aj = xc_ab;
	this.ak = xc_ac;
}
function xc_cc(hc, ba) {
	return typeof (this.ck[hc]) != "undefined" ? this.ck[hc][ba] || null : null;
}
function xc_bj() {
	return false;
}
function xc_bk(date) {
	return false;
}
function xc_fc() {
	var gb = null;
	for (var i = 0; i < xc_fb.length; i++) {
		gb = xc_fb[i](this);
		if (gb) {
			break;
		}
	}
	return gb;
}
function xc_ba(fb) {
}
function xc_dk() {
	return "";
}
function xc_dj() {
	return "";
}
function xc_dh() {
	return ["", 1];
}
function xc_ak() {
}
function xc_ag() {
}
function xc_ew() {
	var dx = this.dx, dy = this.dy, l = xc_cj(this.gl);
	var du = "", hr = null, bu = xc_ce(), bl = "";
	if (l != null) {
		dx += xc_cm(l);
		dy += xc_cn(l);
	} else {
		dx += xc_dl;
		dy += xc_dm;
	}
	this.bc();
	bl = this.al(this.fx() || this.fa);
	if (this.gt == "") {
		this.gt = bl ? bl : getCurrentDate();
	}
	if (bl != "" && bu.test(bl)) {
		var ig = xc_cs(bl);
		hr = new Date(ig[0], ig[1], ig[2]);
	} else {
		hr = new Date();
	}
	du = xc_ck(hr.getFullYear(), hr.getMonth(), hr.getDate());
	this.jy = hr.getFullYear();
	this.month = hr.getMonth();
	this.cf(0);
	if (this.jy != hr.getFullYear() || this.month != hr.getMonth()) {
		hr = new Date(this.jy, this.month, 1);
		du = "";
	}
	var h = this.gk;
	xc_dp(h, dx, dy);
	xc_gb(h, this.bo() + this.bh(du) + this.bn());
	h.style.zIndex = ++xcBaseZIndex;
	if (h.gr) {
		if (!h.gr.ip) {
			h.gr.style.width = h.offsetWidth + "px";
			h.gr.style.height = h.offsetHeight + "px";
			h.gr.ip = true;
		}
		xc_dp(h.gr, dx, dy);
		h.gr.style.zIndex = h.style.zIndex - 1;
	}
	this.be();
	if (h.gr) {
		xc_ex(h.gr);
	}
	xc_ex(h);
	this.an();
}
function xc_ek() {
	this.cg();
	this.iy = null;
	this.ih = null;
	this.fa = "";
	this.gl = "";
	this.dx = 0;
	this.dy = 0;
	this.he = 1;
	this.jy = 0;
	this.month = 0;
	this.date = "";
	this.js = false;
	this.gt = "";
	this.ce = 0;
	this.cc = 0;
	this.ca = 0;
	this.cb = 0;
	this.cd = 0;
	this.ck = {};
}
function xc_ei() {
	this.cg();
	this.js = true;
}
function xc_bb() {
	if (this.jg) {
		clearTimeout(this.jg);
		this.jg = 0;
	}
}
function xc_aj() {
}
function xc_af() {
}
function xc_en() {
	var date = new Date(this.jy, this.month, 1);
	var du = "", ah = null, bu = xc_ce(), bl = "";
	this.bc();
	bl = this.al(this.fx() || this.gt || this.fa);
	if (bl != "" && bu.test(bl)) {
		var ig = xc_cs(bl);
		ah = new Date(ig[0], ig[1], ig[2]);
	} else {
		ah = new Date();
	}
	if (ah != null && ah.getFullYear() == date.getFullYear() && ah.getMonth() == date.getMonth()) {
		du = xc_ck(ah.getFullYear(), ah.getMonth(), ah.getDate());
	}
	this.bd();
	xc_gb(this.gk, this.bo() + this.bh(du) + this.bn());
	xc_ex(this.gk);
	this.am();
}
function xc_ai() {
	beforeGetDateValue(this.ih, this.iy, this.gq);
}
function xc_ae(date) {
	return afterGetDateValue(this.ih, this.iy, date, this.gq);
}
function xc_ch(fk) {
	return fk ? getDateValue(fk) : "";
}
function xcGet() {
	return xc_ch(this.ih) || xc_ch(this.iy);
}
function xc_al(date) {
	return beforeSetDateValue(this.ih, this.iy, date, this.gq);
}
function xc_ah(date) {
	afterSetDateValue(this.ih, this.iy, date, this.gq);
}
function xc_fv(date) {
	if (this.iy) {
		setDateValue(this.iy, date);
	}
}
function xc_bq(style, cm, width, fj) {
	return xc_fe(style, cm, width, fj);
}
function xc_ab() {
	return "";
}
function xc_ac() {
	return "";
}
function xc_aw() {
	return xc_fm + xc_fg + "<TD>" + this.aj() + xc_be(xcCSSPanel) + (xcIsIEMac ? xc_fm + xc_fg + "<TD>" : "");
}
function xc_aq() {
	return (xcIsIEMac ? "</TD>" + xc_ff + xc_fl : "") + xc_bd + this.ak() + "</TD>" + xc_ff + xc_fl;
}
function xc_eu() {
	if (xcAutoHide && this.bg.he == 1) {
		this.bg.jg = setTimeout("xc_cv(" + this.bg.gq + ")", xcAutoHide);
	}
}
function xc_ej() {
	if (xcAutoHide) {
		this.bg.cg();
	}
}
function xc_di(dc, da, db, fi, fg, fh) {
	var s = "";
	if (dc || fi) {
		s += (xcIsIE55up && !xcIsMac) ? " onmouseenter='" : " onmouseover='";
		if (dc) {
			s += xcCSSOpen + dc + xcCSSClose + ";";
		}
		if (fi) {
			s += fi;
		}
		s += "' ";
	}
	if (da) {
		s += " onmousedown='" + xcCSSOpen + da + xcCSSClose + "' ";
	}
	if (fg) {
		s += " onclick='" + fg + "' ";
	}
	if (db || fh) {
		s += (xcIsIE55up && !xcIsMac) ? " onmouseleave='" : " onmouseout='";
		if (db) {
			s += xcCSSOpen + db + xcCSSClose + ";";
		}
		if (db) {
			s += fh;
		}
		s += "' ";
	}
	return s;
}
function xc_an(gq) {
	var hx = "xc_dr(" + gq + ",-1)", ho = "xc_dr(" + gq + ",1)";
	var hu = "xc_dq(" + gq + ",-1)", hl = "xc_dq(" + gq + ",1)";
	var az = "", ay = "";
	if (xcArrowSwitch[0] == 1) {
		var aw = xcCSSArrowYearPrev, av = xcCSSArrowYearNext;
		az = xc_fe(aw[0], xcArrowYear[0], "", xc_di(aw[1], aw[2], aw[0], "", hx, ""));
		ay = xc_fe(av[0], xcArrowYear[1], "", xc_di(av[1], av[2], av[0], "", ho, ""));
	}
	if (xcArrowSwitch[1] == 1) {
		var au = xcCSSArrowMonthPrev, at = xcCSSArrowMonthNext;
		az += xc_fe(au[0], xcArrowMonth[0], "", xc_di(au[1], au[2], au[0], "", hu, ""));
		ay = xc_fe(at[0], xcArrowMonth[1], "", xc_di(at[1], at[2], at[0], "", hl, "")) + ay;
	}
	return [az, ay];
}
function xc_au() {
	var yy = xcYearPrefix + xc_ct(this.jy) + xcYearSuffix, mm = xcMonthPrefix + xcMonthNames[this.month] + xcMonthSuffix;
	return xc_fe(xcCSSHead, xcHeadTagOrder == 1 ? mm + xcHeadSeparator + yy : yy + xcHeadSeparator + mm, xcHeadTagAdjustment == 1 ? "100%" : "");
}
function xc_ay() {
	var ax = ["", ""];
	if (xcArrowPosition == 0) {
		ax = xc_an(this.gq);
	}
	s = xc_be(xcCSSHeadBlock) + (xcHeadTagAdjustment == 1 ? xc_fo : xc_fn) + xc_fh;
	s += ax[0];
	s += this.bs();
	s += ax[1];
	s += xc_ff + xc_fl + xc_bd;
	return s;
}
function xc_az() {
	var s = xc_be(xcCSSWeekdayBlock) + xc_fp + xc_fg;
	for (var i = xcWeekStart; i < xcWeekStart + 7; i++) {
		s += xc_fe(xcCSSWeekday, xcWeekdayDisplay[i], "");
	}
	s += xc_ff + xc_fl + xc_bd;
	return s;
}
function xc_at() {
	return this.bt() + this.bv() + this.bw;
}
function xc_ap(he, du) {
	var s = "", gq = this.gq, ew = xcCSSDay, er = xcCSSDayCurrent, ex = xcCSSDayOther;
	if (he == xc_ee) {
		var bk = "this.title=\"" + xcCalCopyright + "\"";
		var bq = "window.open(\"" + xcCalHome + "\")";
		s = this.ep(er[0], xcCopyrightDisplay, "", xc_di(er[1], er[2], er[0], bk, bq, ""));
	} else {
		if (he == xc_bv) {
			s = this.ep(xcCSSDayEmpty, xcDayContents[0], "");
		} else {
			var ei = this.ei(), ct = this.iq();
			var fi = this.hk(), fh = this.hj(), ac = this.ci();
			var fg = ac[0] + (ac[1] ? "xc_ec(" + gq + ",\"" + this.date + "\");" : "");
			if (ei) {
				if (ct && ct[1]) {
					s = this.ep(ct[1], xcDayContentsDisabled[this.ca], "");
				} else {
					s = this.ep(ew[3], xcDayContentsDisabled[this.ca], "");
				}
			} else {
				if (du == this.date && xcShowCurrentDate) {
					s = this.ep(er[0], xcDayContentsCurrent[this.ca], "", xc_di(er[1], er[2], er[0], fi, fg, fh));
				} else {
					if (ct) {
						s = this.ep(ct[0], xcDayContents[this.ca], "", xc_di(ew[1], ew[2], ct[0], fi, fg, fh));
					} else {
						if (he == 1) {
							s = this.ep(ew[0], xcDayContents[this.ca], "", xc_di(ew[1], ew[2], ew[0], fi, fg, fh));
						} else {
							s = this.ep(ex[0], xcDayContents[this.ca], "", xc_di(ew[1], ew[2], ex[0], fi, fg, fh));
						}
					}
				}
			}
		}
	}
	return s;
}
function xc_ao(du) {
	var dayOffset = 0, eq = 1, fm = (new Date(this.jy, this.month, 1)).getDay();
	var iz = new Date(this.jy, this.month + 1, 0), gu = iz.getDate();
	var hu = new Date(this.jy, this.month, 0), hw = hu.getFullYear(), hv = hu.getMonth(), ht = hu.getDate();
	var hl = new Date(this.jy, this.month + 1, 1), hn = hl.getFullYear(), hm = hl.getMonth();
	if (xcWeekStart > 0 && fm == 0) {
		fm = 7;
	}
	var s = xc_be(xcCSSDayBlock) + xc_fp;
	for (var i = 0; i < 6; i++) {
		this.cd = i;
		s += xc_fg;
		for (var j = xcWeekStart; j < xcWeekStart + 7; j++) {
			this.cb = j;
			this.date = "";
			if (i == 5 && j == xcWeekStart + 6 && xcShowCopyright) {
				s += this.bi(xc_ee);
			} else {
				if (i * 7 + j < fm || eq > gu) {
					if (xcShowPrevNextMonth && i * 7 + j < fm) {
						dayOffset = i * 7 + j - fm + 1;
						this.ce = hw;
						this.cc = hv;
						this.ca = ht + dayOffset;
						this.date = xc_ck(this.ce, this.cc, this.ca);
						s += this.bi(xc_ds, du);
					} else {
						if (xcShowPrevNextMonth && eq > gu) {
							this.ce = hn;
							this.cc = hm;
							this.ca = (eq++) - gu;
							this.date = xc_ck(this.ce, this.cc, this.ca);
							s += this.bi(xc_ds, du);
						} else {
							s += this.bi(xc_bv);
						}
					}
				} else {
					this.ce = this.jy;
					this.cc = this.month;
					this.ca = eq++;
					this.date = xc_ck(this.ce, this.cc, this.ca);
					s += this.bi(xc_am, du);
				}
			}
		}
		s += xc_ff;
	}
	s += xc_fl + xc_bd;
	return s;
}
function xc_ar() {
	var s = "", ft = 0, fv = xcCSSFootToday, fo = xcCSSFootClear, fn = xcCSSFootBack, fp = xcCSSFootClose, fs = xcCSSFootReset;
	var fu = xcFootTagSwitch.concat(xcFootButtonSwitch);
	for (var i = 0; i < fu.length; i++) {
		if (fu[i]) {
			ft++;
		}
	}
	if (ft > 0) {
		var gq = this.gq, jm = getCurrentDate(), fa = xc_ce().test(this.fa) ? this.fa : jm;
		var jn = "xc_ec(" + gq + ",\"" + xc_fu(getCurrentDate(), xcDateFormat, xc_da) + "\")", ch = "xc_bc(" + gq + ")", bb = "xc_er(" + gq + ")", cj = "xc_cv(" + gq + ")", il = "xc_el(" + gq + ")";
		var ad = [{"order":fu[0], "fc":xcFootTags[0], "by":jn, "jo":"Today is " + jm, "dr":fv[0], "ds":fv[1], "dq":fv[2]}, {"order":fu[1], "fc":xcFootTags[1], "by":ch, "jo":"Clear the date input", "dr":fo[0], "ds":fo[1], "dq":fo[2]}, {"order":fu[2], "fc":xcFootTags[2], "by":bb, "jo":"Scroll to " + (this.gt || jm), "dr":fn[0], "ds":fn[1], "dq":fn[2]}, {"order":fu[3], "fc":xcFootTags[3], "by":cj, "jo":"Close the calendar", "dr":fp[0], "ds":fp[1], "dq":fp[2]}, {"order":fu[4], "fc":xcFootTags[4], "by":il, "jo":"Pick the default date of " + fa, "dr":fs[0], "ds":fs[1], "dq":fs[2]}, {"order":fu[5], "fc":jm, "by":jn, "jo":"Today", "dr":fv[0], "ds":fv[1], "dq":fv[2]}, {"order":fu[6], "fc":this.gt, "by":bb, "jo":"Scroll to this date", "dr":fn[0], "ds":fn[1], "dq":fn[2]}, {"order":fu[7], "fc":fa, "by":il, "jo":"Pick the default date", "dr":fs[0], "ds":fs[1], "dq":fs[2]}];
		for (var i = 0; i < xcFootButtonSwitch.length; i++) {
			ad[ad.length] = {"order":xcFootButtonSwitch[i], "fc":typeof (xcFootButtons[i]) == "function" ? xcFootButtons[i](this.iy, this.ih, this.fa, this.gt, this.gq) : xcFootButtons[i], "by":xcFootButtonLinks[i] == null ? "" : "xc_bz(" + gq + "," + i + ")", "jo":"", "dr":xcCSSFootOther[i][0], "ds":xcCSSFootOther[i][1], "dq":xcCSSFootOther[i][2]};
		}
		var fr = ad.sort(xc_fa);
		var ax = ["", ""];
		if (xcArrowPosition == 1) {
			ax = xc_an(gq);
		}
		w = xcFootTagAdjustment == 1 ? xc_ca[ft > 5 ? 5 : ft] : "";
		s += xc_be(xcCSSFootBlock) + (xcFootTagAdjustment == 0 ? xc_fn : xc_fo) + xc_fh;
		s += ax[0];
		for (var i = 0; i < fr.length; i++) {
			if (fr[i].order != 0) {
				s += xc_fe(fr[i].dr, fr[i].fc, w, xc_di(fr[i].ds, fr[i].dq, fr[i].dr, "", fr[i].by, ""), fr[i].jo);
			}
		}
		s += ax[1];
		s += xc_ff + xc_fl + xc_bd;
	}
	return s;
}
function xc_as() {
	return this.bm() + this.bj();
}
function xc_dr(gq, dy) {
	var dt = xc_bx(gq);
	dt.jy += dy;
	dt.cf(dy);
	dt.im();
}
function xc_dq(gq, dm) {
	var dt = xc_bx(gq);
	dt.month += dm;
	if (dt.month < 0) {
		dt.month = 11;
		dt.jy--;
	}
	if (dt.month > 11) {
		dt.month = 0;
		dt.jy++;
	}
	dt.cf(dm);
	dt.im();
}
function xc_bc(gq) {
	var dt = xc_bx(gq);
	dt.bf("");
	dt.jq("");
	dt.ao("");
	dt.gt = "";
	if (dt.he == 1 && !xcStickyMode) {
		xc_cv(gq);
	} else {
		dt.im();
	}
}
function xc_ec(gq, date) {
	var dt = xc_bx(gq);
	var en = xc_cs(date, xc_da);
	dt.jy = en[0];
	dt.month = en[1];
	if (dt.ej(date)) {
		dt.im();
		return;
	}
	var bl = dt.bf(xc_fu(date, xc_da, xcDateFormat));
	dt.jq(bl);
	dt.ao(bl);
	dt.gt = bl;
	if (dt.he == 1 && !xcStickyMode) {
		xc_cv(gq);
	} else {
		dt.im();
	}
}
function xc_er(gq) {
	var dt = xc_bx(gq), d = xc_cs(dt.gt || getCurrentDate());
	dt.jy = d[0];
	dt.month = d[1];
	dt.im();
}
function xc_el(gq) {
	var dt = xc_bx(gq), d = xc_cs(xc_ce().test(dt.fa) ? dt.fa : getCurrentDate());
	dt.jy = d[0];
	dt.month = d[1];
	xc_ec(gq, xc_ck(d[0], d[1], d[2]));
}
function xc_cv(gq) {
	var dt = xc_bx(gq), h = dt.gk;
	if (dt.he == 1) {
		if (h.gr) {
			xc_cw(h.gr);
		}
		xc_cw(h);
		dt.ij();
	}
}
function xc_bz(gq, i) {
	var dt = xc_bx(gq), fq = xcFootButtonLinks[i];
	fq(dt.iy, dt.ih, dt.fa, dt.gt, gq);
	if (dt.he == 1 && !xcStickyMode) {
		xc_cv(gq);
	} else {
		dt.im();
	}
}
function showCalendar(ii, iy, ih, fa, gl, dx, dy, he) {
	if (!xcCalSafe) {
		return;
	}
	if (!xc_dt) {
		xc_dt = 1;
		xc_dx = window.onresize ? window.onresize : xc_fy;
		window.onresize = xc_em;
	}
	var dt = xc_cb(ii, iy, ih, fa, gl, dx, dy, he);
	dt.io();
}
function hideCalendars() {
	for (var i = 0; i < xc_ax.length; i++) {
		if (!xc_ax[i].js && xc_ax[i].he == 1) {
			xc_ax[i].ik();
			xc_cv(i);
		}
	}
}
function toCalendarDate(date) {
	return xc_cf(date.getFullYear(), date.getMonth(), date.getDate());
}
var toCalDate = toCalendarDate;
function toJSDate(date) {
	var bu = xc_ce();
	if (bu.test(date)) {
		var d = xc_cs(date);
		return (new Date(d[0], d[1], d[2]));
	} else {
		return (new Date());
	}
}
function getCurrentDate() {
	return toCalendarDate(new Date());
}
function checkDate(date) {
	if (date) {
		var bu = xc_ce();
		if (bu.test(date)) {
			return 0;
		} else {
			return 1;
		}
	} else {
		return 2;
	}
}
function compareDates(dw, dz) {
	var bu = xc_ce();
	var d1 = getDateNumbers(bu.test(dw) ? dw : getCurrentDate()).join("");
	var d2 = getDateNumbers(bu.test(dz) ? dz : getCurrentDate()).join("");
	return (d1 == d2 ? 0 : d1 > d2 ? 1 : -1);
}
function getDateNumbers(date) {
	var bu = xc_ce();
	if (bu.test(date)) {
		var d = xc_cs(date);
		return new Array(xc_cd(d[0]), xc_cd(d[1] + 1), xc_cd(d[2]));
	} else {
		return new Array("", "", "");
	}
}
var getNumbers = getDateNumbers;
function beforeGetDateValue(ih, iy, gq) {
}
function afterGetDateValue(ih, iy, date, gq) {
	return date;
}
function getDateValue(fk) {
	return fk.value;
}
function beforeSetDateValue(ih, iy, date, gq) {
	return date;
}
function afterSetDateValue(ih, iy, date, gq) {
}
function setDateValue(fk, date) {
	fk.value = date;
}
function xc_eh() {
	if (xcIsN6) {
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = xc_ft;
	document.body.onmousemove = null;
	if (xc_dw) {
		xc_dw();
	}
}
if (xcCalSafe) {
	xc_dw = window.onload ? window.onload : function () {
	};
	window.onload = xc_eh;
	var hd = xcMods.sort(xc_fa);
	for (var i = 0; i < hd.length; i++) {
		if (hd[i].order != 0) {
			document.write("<scr" + "ipt language='javascript' src='" + xcModPath + hd[i].script + "' jp='text/javascript'></scr" + "ipt>");
		}
	}
}

