<!--  to hide script contents from old browsers
var arrSpecialDays=new Array();


/* 
Create the Key for the lookup of Special Days
Convert this date string into Date object.
Time is set to 0.
Return Date object
*/
function setKey(strDateIn) {
	var strDate=strDateIn
	if (isNaN(Date.parse(strDate))) {
		strDate=strDate.replace(/[^0-9A-Za-z ]/g, " ");
	} else if (Zapatec.is_opera) {
		if (typeof strDate == "string") strDate=strDate.replace(/[^0-9A-Za-z ]/g, " ");
	}
	/*if (isNaN(Date.parse(strDate)))
	{
		alert("ERR:"+strDate+" not a valid date")
		return false;
	}*/
	var d=new Date(strDate)
	d.setHours(0,0,0,0)
	
	return d
}
/*
strDate: Date for special day, DD-MMM-YY
strDesc: Text for Special Day
return string where each line is Date,Special Day Text
*/
function add_SpecialDay(strDate, strDesc) {
	arrSpecialDays[setKey(strDate).toGMTString()]=strDesc
}
/* return a string of all special days for debug only*/
function dump_SpecialDays() {
	var strDump=""
	var i
	for (i in arrSpecialDays)
		strDump+= (strDump ? "\n" : "") + i + " is " + arrSpecialDays[i]
	return strDump
}
/* 
Function to check if this date is a Special Day 
return true special day date is defined via add_SpecialDays calls
*/
function isSpecialDay(strDate) {
	return typeof(getSpecialDay(strDate)) != "undefined"
}
/* return string for the special day */
function getSpecialDay(strDate) {
	return arrSpecialDays[setKey(strDate).toGMTString()]
}
/*
Option: dateText
Use this function to set the Text in the calendar.
This function is called for each DAY cell.
You need to define the 
-Use this function to display special day text.
NOTE:When you use this function you MUST define the contents of the cell for the day.  For example, if the day
is NOT a special day then you still need to return the day number
*/
function getDateText(date) {
	return date.getDate()
	var strInfo=getSpecialDay(date);
	if (!strInfo)
		// No special day, just return the Day of Month
		return date.getDate() + "<br/><div class='zpCal-no-DayInfo'>&nbsp;<" + "/div>";

	var strText=new String(strInfo)
	// Use special class zpCalDayInfo to visually show special day in calendar using CSS

	// Use this code to display the SpecialDay text in calendar
	if (strText.length > 8)
	{
		strText=strText.substring(0, 10)
		strText+="..."
	}
	//return date.getDate() + "<br/><div class='zpCalDayInfo'>" + strText + "<" + "/div>";
	return date.getDate() + "<br/><pre style='width:8em;'>" + strText + "<" + "/pre>";

	// Just show day number with special CSS, NO TEXT
	//return "<span class='zpCalDayInfo'>" + date.getDate() + "<" + "/span>";
}

/*
Option: dateStatusFunc
A function that receives a JS Date object and returns a boolean or a string. This function allows one to set a certain CSS 
class to some date, therefore making it look different. 
If it returns true then the date will be disabled. 
If it returns false nothing special happens with the given date. 
If it returns a string then that will be taken as a CSS class and appended to the date element. 
If this string contains disabled then the date is also disabled (therefore is like returning true) but with your own custom style.
*/
function check_special(strDate) {
	if (isSpecialDay(strDate)) 
		return "zpCalSpecialDay";

	return false; // ALL other dates are enabled
	// NOTE:return true to disable a specific date
}


