function tc2ShowMonth(curMonth, month) {
	if ( document.getElementById('tc_month_' + curMonth) ) {
		document.getElementById('tc_month_' + curMonth).style.display = 'none';
	} else {
		alert('TinyCalendar2 Error: Unable to hide the specificed month!');
	}
	
	if ( document.getElementById('tc_month_' + month) ) {
		document.getElementById('tc_month_' + month).style.display = '';
	} else {
		alert('TinyCalendar2 Error: Unable to show the specificed month!');
	}
}

function tc2ShowEvents(date) {
	if ( document.getElementById('tc_events_' + date) ) {
		document.getElementById('tc_events_' + date).style.left = cursorX + 10 + "px";
		document.getElementById('tc_events_' + date).style.top = cursorY + 10 + "px";
		document.getElementById('tc_events_' + date).style.display = '';
	} else {
		alert('TinyCalendar2 Error: Unable to show the specificed events!');
	}
}

function tc2UpdateEventPosition(date) {
	if ( document.getElementById('tc_events_' + date) ) {
		document.getElementById('tc_events_' + date).style.left = cursorX + 10 + "px";
		document.getElementById('tc_events_' + date).style.top = cursorY + 10 + "px";
	} else {
		alert('TinyCalendar2 Error: Unable to modify the specificed events!');
	}
}

function tc2HideEvents(date) {
	if ( document.getElementById('tc_events_' + date) ) {
		document.getElementById('tc_events_' + date).style.display = 'none';
	} else {
		alert('TinyCalendar2 Error: Unable to show the specificed events!');
	}
}

if ((navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) && (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1)) {
	calHover = function() {
		if (getElementsByClass("tc_contain")) {
			var calendars = getElementsByClass("tc_contain");
			for (var j=0; j<calendars.length; j++) {
				var tcEls = calendars[j].getElementsByTagName("LI");
				for (var i=0; i<tcEls.length; i++) {
					if (tcEls[i].className.indexOf('tc_date') != -1) {
						tcEls[i].onmouseenter=function() {
							if (this.className.indexOf('tc_hasevents') != -1)
								this.className+=" tc_event_hover";
							else 
								this.className+=" tc_hover";
						}
						tcEls[i].onmouseleave=function() {
							this.className=this.className.replace(new RegExp(" tc_hover\\b"), "");
							this.className=this.className.replace(new RegExp(" tc_event_hover\\b"), "");
						}
					}
				}
			}
		}	
	}
	if (window.attachEvent) window.attachEvent("onload", calHover);
}
