var RICOLACalendarErrorColor="#FFCC66";
var RICOLACalendarRegColor="#FFFFFF";
var HolidayColor = "#6699CC";
var showUPHolidays = false;
var RICOLAValidDateCheckFailed=false;
var RICOLACalendarNoClose=false;
var RICOLACalendarReturnMultiple=false;
var RICOLACalendarReturnMultipleDelim=new String(" ");
var RICOLACalendarLeapString=new String("");
var RICOLACalendarPossFormats=new Array("MM\/DD\/YYYY","MM\/DD\/YY", "MM-DD-YYYY","MM-DD-YY", "DD\/MMM\/YYYY","DD\/MMM\/YY", "DD-MMM-YYYY","DD-MMM-YY", "DD\/MONTH\/YYYY","DD\/MONTH\/YY", "DD-MONTH-YYYY","DD-MONTH-YY", "DD\/MM\/YYYY","DD\/MM\/YY", "DD-MM-YYYY","DD-MM-YY", "YYYY-DD-MM","YY-DD-MM", "YYYY-MM-DD","YY-MM-DD","YYYY*MM*DD","YY*MM*DD","YYYY\/MM\/DD","YY\/MM\/DD","MM*DD*YYYY", "MM*DD*YY");
var RICOLACalendarPossFSize=new Array(10,8,10,8,10,8,10,8,10,8,10,8,10,8,10,8,10,8,10,8,8,6,10,8);
var RICOLACalendarRegExpFormats=new Array("^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d)(\\d\\d)(\\d\\d|\\d\\d\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d|\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$",
"^(\\d\\d|\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d|\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d|\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$", "^(\\d\\d|\\d\\d\\d\\d)(\\d\\d)(\\d\\d)$","^(\\d\\d)(\\d\\d)(\\d\\d)$");
var RICOLACalendarCheckVDateErrNum=0;
var RICOLACalendarUnClickableReason=new String("");

var RICOLACalendarUnClickableBefore=new String("");
var RICOLACalendarUnClickableAfter=new String("");
var RICOLACalendarUnClickableAry=new Array("");

var PossDelimAry=new Array("/","-",".","\\","~");
var noCheckKeys=new Array(37,39,40,38,8,46);
var LastDayAry=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
var LastDayLeapAry=new Array(0,31,29,31,30,31,30,31,31,30,31,30,31);
var MonthNameAry=new Array("Not Valid MonthName", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var RICOLACENTURYCHECK=40;

var RICOLAmultiDateObj=new Object();
RICOLAmultiDateObj.value = "";
RICOLAmultiDateObj.style=new Object();
RICOLAmultiDateObj.style.backgroundColor = "";
var RICOLACalendarUsingCustJS = false;


// UPRR Holiday specific stuff
// assign variables to be used to make a 'Holiday Specific' title tag
var listHolidayNames = "New Year's Day,President's Day,Good Friday,Memorial Day,July 4th,Labor Day,Thanksgiving Day,Day after Thanksgiving,Christmas Eve,Christmas,New Year's Eve";
var arrHolidayNames  = listHolidayNames.split(",");

// Now initialize the list of Holiday variables
var Holidays2001 = '1/1,2/19,4/12,5/28,7/4,9/3,11/22,11/23,12/24,12/25,12/31';
var Holidays2002 = '1/1,2/18,3/29,5/27,7/4,9/2,11/28,11/29,12/24,12/25,12/31';
var Holidays2003 = '1/1,2/17,4/18,5/26,7/4,9/1,11/27,11/28,12/24,12/25,12/31';
var Holidays2004 = '1/1,2/16,4/9,5/31,7/4,9/6,11/25,11/26,12/24,12/25,12/31';
var Holidays2005 = '1/1,2/21,3/25,5/30,7/4,9/5,11/24,11/25,12/24,12/25,12/31';
var Holidays2006 = '1/1,2/20,4/14,5/29,7/4,9/4,11/23,11/24,12/24,12/25,12/31';
var Holidays2007 = '1/1,2/19,4/6,5/28,7/4,9/3,11/22,11/23,12/24,12/25,12/31';
var Holidays2008 = '1/1,2/18,3/21,5/26,7/4,9/1,11/27,11/28,12/24,12/25,12/31';
var Holidays2009 = '1/1,2/16,4/10,5/25,7/4,9/7,11/26,11/27,12/24,12/25,12/31';
var Holidays2010 = '1/1,2/15,4/2,5/31,7/4,9/6,11/25,11/26,12/24,12/25,12/31';
var Holidays2011 = '1/1,2/21,4/22,5/30,7/4,9/5,11/24,11/25,12/24,12/25,12/31';
var Holidays2012 = '1/1,2/20,4/6,5/28,7/4,9/3,11/23,11/24,12/24,12/25,12/31';
var Holidays2013 = '1/1,2/18,3/29,5/27,7/4,9/2,11/28,11/29,12/24,12/25,12/31';
var Holidays2014 = '1/1,2/17,4/18,5/26,7/4,9/1,11/27,11/28,12/24,12/25,12/31';
var Holidays2015 = '1/1,2/16,4/3,5/25,7/4,9/7,11/26,11/27,12/24,12/25,12/31';
var Holidays2016 = '1/1,2/15,3/25,5/30,7/4,9/5,11/24,11/25,12/24,12/25,12/31';
var Holidays2017 = '1/1,2/20,4/14,5/29,7/4,9/4,11/23,11/24,12/24,12/25,12/31';
var Holidays2018 = '1/1,2/19,3/30,5/28,7/4,9/3,11/22,11/23,12/24,12/25,12/31';
var Holidays2019 = '1/1,2/18,4/19,5/27,7/4,9/2,11/28/11/29,12/24,12/25,12/31';
var Holidays2020 = '1/1,2/17,4/10,5/25,7/4,9/7,11/26,11/27,12/24,12/25,12/31';
var Holidays2021 = '1/1,2/15,4/2,5/31,7/4,9/6,11/25,11/26,12/24,12/25,12/31';
var Holidays2022 = '1/1,2/21,4/15,5/30,7/4,9/5,11/24,11/25,12/24,12/25,12/31';
var Holidays2023 = '1/1,2/20,4/7,5/29,7/4,9/4,11/23,11/24,12/24,12/25,12/31';
var Holidays2024 = '1/1,2/19,3/29,5/27,7/4,9/2,11/28,11/29,12/24,12/25,12/31';
var Holidays2025 = '1/1,2/17,4/18,5/26,7/4,9/1,11/27,11/28,12/24,12/25,12/31';
var Holidays2026 = '1/1,2/16,4/3,5/25,7/4,9/7,11/26,11/27,12/24,12/25,12/31';
var Holidays2027 = '1/1,2/15,3/26,5/31,7/4,9/6,11/25,11/26,12/24,12/25,12/31';
var Holidays2028 = '1/1,2/21,4/14,5/29,7/4,9/4,11/23,11/24,12/24,12/25,12/31';
var Holidays2029 = '1/1,2/19,3/30,5/28,7/4,9/3,11/22,11/23,12/24,12/25,12/31';
var Holidays2030 = '1/1,2/18,4/19,5/27,7/4,9/2,11/28,11/29,12/24,12/25,12/31';
var Holidays2031 = '1/1,2/17,4/11,5/26,7/4,9/1,11/27,11/28,12/24,12/25,12/31';
var Holidays2032 = '1/1,2/16,3/26,5/31,7/4,9/6,11/25,11/26,12/24,12/25,12/31';
var Holidays2033 = '1/1,2/21,4/15,5/30,7/4,9/5,11/24,11/25,12/24,12/25,12/31';
var Holidays2034 = '1/1,2/20,4/7,5/29,7/4,9/4,11/23,11/24,12/24,12/25,12/31';
var Holidays2035 = '1/1,2/19,3/23,5/28,7/4,9/3,11/22,11/23,12/24,12/25,12/31';
var Holidays2036 = '1/1,2/18,4/11,5/26,7/4,9/1,11/27,11/28,12/24,12/25,12/31';
var Holidays2037 = '1/1,2/16,4/3,5/25,7/4,9/7,11/26,11/27,12/24,12/25,12/31';
//  end of UPRR Holiday specific stuff


/* ************************************ DateFieldCheckBlur Function **************************************** */


function DateFieldCheckBlur(inDate) {
	if (RICOLAValidDateCheckFailed) {
		inDate.focus();
	}
	RICOLAValidDateCheckFailed=false;
}

/* ************************************ checkValidDate Function **************************************** */

function RICOLACalendarReturn() {
	if (RICOLACalendarUsingCustJS) {
		if (window.RICOLACalendarHasReturned) {
			RICOLACalendarHasReturned();
		} else {
			alert("Calendar Error #5599: You have specificed \"using custom javascript\" but have not defined the function: RICOLACalendarHasReturned(). \nPlease code a JavaScript function titled \"RICOLACalendarHasReturned\" (Case Sensitive).\n\nFor more information, please visit the documentation online at: http://home.www.uprr.com/emp/it/hf/ricola/calendar/");
			return false;
		}
	}
}

/* ************************************ checkValidDate Function **************************************** */

function checkValidDate(inMonth, inDate, inYear)
{
	RICOLACalendarCheckVDateErrNum=0;
	var numMonth=parseInt(inMonth,10);
	var numDate=parseInt(inDate,10);
	var numYear=parseInt(inYear,10);
	if ((numMonth < 1) || (numMonth > 12)) {
		RICOLACalendarCheckVDateErrNum=2;
		return false;
	} else if (numYear % 4 == 0) {  		// Leap Year
		if (LastDayLeapAry[numMonth] >= inDate) {
			RICOLACalendarCheckVDateErrNum=0;
		} else {
			if (numMonth == 2) {
				RICOLACalendarLeapString="Leap Year "
			}
			RICOLACalendarCheckVDateErrNum=3;
			return false;
		}
	} else {
		if (LastDayAry[numMonth] >= inDate) {
			RICOLACalendarCheckVDateErrNum=0;
		} else {
			if (numMonth == 2) {
				RICOLACalendarLeapString="non-Leap Year "
			}
			RICOLACalendarCheckVDateErrNum=3;
			return false;
		}

	}
	var currRegExp=new RegExp(/^\s*\d{1,2}\/\d{1,2}\/\d{4}\s*$/);

	if (((RICOLACalendarUnClickableBefore != "") && (RICOLACalendarUnClickableBefore.search(currRegExp) != -1)) || ((RICOLACalendarUnClickableAfter != "") && (RICOLACalendarUnClickableAfter.search(currRegExp) != -1)) || (RICOLACalendarUnClickableAry.length > 0)){
		if (!RICOLACalendarTestUnClickable((numMonth - 1), numYear, numDate, 0)) {
			RICOLACalendarCheckVDateErrNum=4;
			return false;
		}
	}

	RICOLACalendarCheckVDateErrNum=0;
	return true;
}

/* ************************************ RICOLACalendarDispError Function **************************************** */

function RICOLACalendarDispError(inErrNum, inFormatNum, inObj, inMonth, inDay, inYear) {
	inObj.style.backgroundColor=RICOLACalendarErrorColor;
	RICOLAValidDateCheckFailed=true;
	switch (inErrNum) {
		case 1:
			alert("\"" + inObj.value + "\" is not in the correct date format.\n\nPlease re-input the date in " + RICOLACalendarPossFormats[inFormatNum] + " format.");
			break;
		case 2:
			alert("The Month: \"" + inMonth + "\" is not a valid month (valid months are 1 through 12).  Please re-enter a valid date in " + RICOLACalendarPossFormats[inFormatNum] + " format.");
			break;
		case 3:
			alert("The date: \"" + inMonth + "/" + inDay + "/" + inYear + "\" is an invalid date.\nThere are not " +  inDay + " days in " + RICOLACalendarLeapString + MonthNameAry[inMonth] + ".\nPlease re-enter a valid date in " + RICOLACalendarPossFormats[inFormatNum] + " format.");
			break;
		case 4:
			alert("The date: \"" + inMonth + "/" + inDay + "/" + inYear + "\" cannot be used because it " + RICOLACalendarUnClickableReason + ".\nPlease enter a different date.");
			break;
	}
}

/* ************************************ RICOLACalendarFormatDate Function **************************************** */

function RICOLACalendarFormatDate(inFormatNum, aMonth, aDay, aYear, inObj) {
	inMonth=parseInt(aMonth,10);
	inDay=parseInt(aDay,10);
	inYear=parseInt(aYear,10);
	if (isNaN(inMonth) || isNaN(inMonth) || isNaN(inMonth)) {
		RICOLACalendarDispError(1, inFormatNum, inObj, inMonth, inDay, inYear);
		return false;
	}
	var retDate=new String(RICOLACalendarPossFormats[inFormatNum]);
	if ((retDate.search(/YYYY/gi) != -1) && (inYear < 100)) {  // wants a 4Digit Year and inputed year is 2Digit
		(inYear > RICOLACENTURYCHECK) ? inYear+=1900 : inYear+=2000;
	} else if ((retDate.search(/YYYY/gi) == -1) && (retDate.search(/YY/gi) != -1) && (inYear > 100)) {
		/* wants a 2Digit Year and inputed year is 4Digit */
		inYear=inYear.toString().substring(2);
	} else if ((inYear > 99) && (inYear < 1000)) {  // Three digit year
		inYear+=2000;
	}
	var cMonth=new String(inMonth);
	var cDay=new String(inDay);
	var cYear=new String(inYear);
	var i=0;
	var ti=new String("");
	if (retDate.search(/MONTH/gi) != -1) {
		cMonth=MonthNameAry[inMonth];
		retDate=retDate.replace(/MONTH/gi,cMonth);
	} else if (retDate.search(/MMM/gi) != -1) {
		cMonth=MonthNameAry[inMonth].substring(0,3);
		retDate=retDate.replace(/MMM/gi,cMonth);
	} else {
		if (cMonth.length == 1) { cMonth="0" + cMonth; }
		retDate=retDate.replace(/MM/gi,cMonth);
	}
	if (cDay.length == 1) { cDay="0" + cDay; }
	retDate=retDate.replace(/DD/gi,cDay);
	/* This prepends a zero to the cYear string so we don't end up with a single
	digit year (e.g. "6" instead of "06"). */
	if (cYear.length == 1) {
		cYear = "0" + cYear;
	}
	retDate=retDate.replace(/YYYY/gi,cYear);
	retDate=retDate.replace(/YY/gi,cYear);
	retDate=retDate.replace(/\*/gi,"");			// * used for formats that have no delimiter
	return retDate;
}

/* ************************************ DateFieldCheck Function **************************************** */

function DateFieldCheck() {
	if (arguments.length < 1) {
		alert("Calendar Error #5591: There is no field passed to the DateFieldCheck function.  You must have specify a field to validate.  Please visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
		return false;
	} else if (typeof arguments[0] != "object") {
		alert("Calendar Error #5592: The field passed to the DateFieldCheck function was not an element.\nPlease visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
		return false;
	}
	RICOLAValidDateCheckFailed=false;
	var currBGColor=new String(arguments[0].style.backgroundColor);
	if (currBGColor.toUpperCase() != RICOLACalendarErrorColor.toUpperCase()) {
		if (arguments[0].style.backgroundColor != "") {
			RICOLACalendarRegColor=arguments[0].style.backgroundColor;
		}
	} else {
		arguments[0].style.backgroundColor = RICOLACalendarRegColor;
	}
	if (arguments[0].value == "") {
		return true;
	}
	var i=0;
	var ti=new String("");
	var x=0;
	var currFormat=1;
	if (arguments.length > 1) {
		var convertFormat=new String(arguments[1]);
		if (convertFormat.search(/^format:/i) != -1) {
			arguments[1]=parseInt(convertFormat.replace(/^format:?\s*(.*)$/i,"$1"),10);
		} else if (!isNaN(parseInt(convertFormat,10))) {
			arguments[1]=parseInt(convertFormat,10);
		}
		currFormat=arguments[1];


		for (i=2; i < arguments.length; i++) {	// handle the rest of the arguments
			if (arguments[i].search(/^\s*prevent:/i) != -1) {
				if (arguments[i].search(/^\s*prevent:\s*before\s*\d{1,2}\/\d{1,2}\/\d\d\d\d\s*$/i) != -1) {
					RICOLACalendarUnClickableBefore=arguments[i].replace(/^\s*prevent:\s*before\s*(\d{1,2})\/(\d{1,2})\/(\d\d\d\d)\s*$/i, "$1/$2/$3");
				} else if (arguments[i].search(/^\s*prevent:\s*after\s*\d{1,2}\/\d{1,2}\/\d\d\d\d\s*$/i) != -1) {
					RICOLACalendarUnClickableAfter=arguments[i].replace(/^\s*prevent:\s*after\s*(\d{1,2})\/(\d{1,2})\/(\d\d\d\d)\s*$/i, "$1/$2/$3");
				} else if (arguments[i].search(/^\s*prevent:\s*no\s*(holi|sun|mon|tues|wednes|thurs|fri|satur)days?\s*$/i) != -1) {
					RICOLACalendarUnClickableAry[RICOLACalendarUnClickableAry.length]=arguments[i].replace(/^\s*prevent:\s*no\s*(holi|sun|mon|tues|wednes|thurs|fri|satur)days?\s*$/i, "no $1days");
				} else if (arguments[i].search(/^\s*prevent:\s*no\s*weekends?\s*$/i) != -1) {
					RICOLACalendarUnClickableAry[RICOLACalendarUnClickableAry.length]=arguments[i].replace(/^\s*prevent:\s*no\s*weekends?\s*$/i, "no $1ends");
				} else {
					var daYYYYcheck=new String("Did not contain a valid specification of the prevent feature.  ");
					if (arguments[i].search(/^\s*prevent:\s*(before|after)\s*\d{1,2}\/\d{1,2}\/\d{1,3}\s*$/i) != -1) {
						daYYYYcheck="Did not contain a four (4) digit year.  ";
					}
					alert("Calendar Error #5597: Invalid 'Prevent' specified. The following:\n\n" + arguments[i] + "\n\n" + daYYYYcheck + "Please visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
					return false;
				}
			}
		}
	}

	if ((currFormat < 1) || (currFormat > RICOLACalendarPossFormats.length)) {
		alert("Calendar Error #5595: There is no format available for format #" + currFormat + ".\nPlease choose a value between 1 and " + RICOLACalendarPossFormats.length + " or visit the documentation online at: \nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
		return false;
	}
	currFormat--;
	var inObjStr=new String(arguments[0].value);

	inObjStr=inObjStr.replace(/^\s*/,"");	// Remove Beginning Spaces
	inObjStr=inObjStr.replace(/\s*$/,"");	// Remove Trailing Spaces

	var monthWasTyped = false;
	for (i=1; i < MonthNameAry.length; i++) {
		(i < 10)? ti="0" + i.toString() : ti=i.toString();
		if(eval("inObjStr.search(/(" + MonthNameAry[i] + "|" + MonthNameAry[i].substring(0,3) + ")/gi) != -1")) {
			monthWasTyped = true;
		}
		eval("inObjStr=inObjStr.replace(/(" + MonthNameAry[i] + "|" + MonthNameAry[i].substring(0,3) + ")/gi, \"" + ti + "\");");
	}

	var DelimList=new String("");
	var currD=new String("");
	var findDelim=inObjStr.replace(/\d/g,"").toLowerCase();	// Removes Digits
	var tempAry=new Array();
	var currMonth=-1856;
	var currDay=-1856;
	var currYear=-1856;
	var BrkDateAry=new Array();
	var WhichFormatAry=new Array();
	var ValIsEmpty=false;
	if ((currFormat == 0) && (inObjStr.search(/^\d+\/\d\d$/) != -1)) {
		var gCurrYear=new Date();
		inObjStr+="/" + gCurrYear.getFullYear();
	} else if ((currFormat == 0) && (inObjStr.search(/^\d\d\d\d$/) != -1)) {
		var gCurrYear=new Date();
		inObjStr=inObjStr.replace(/\d\d$/, "") + "/" + inObjStr.replace(/^\d\d/,"") + "/" + gCurrYear.getFullYear();
	}
	for (i=0; i < findDelim.length; i++) {
		ValIsEmpty=false;
		tempAry=inObjStr.split(findDelim.charAt(i));
		for (x=0; x < tempAry.length; x++) {
			if (tempAry[x] == "") { ValIsEmpty=true; }
		}
		if ((tempAry.length == 3) && (DelimList.indexOf(findDelim.charAt(i)) == -1) && (!ValIsEmpty)) {
			DelimList+=findDelim.charAt(i);
		}
	}
	if (DelimList.length < 1) {		// No Delimiter Found, just treat numbers
		inObjStr=inObjStr.replace(/\D/g,"");
		var currRegExp=new RegExp(RICOLACalendarRegExpFormats[currFormat]);
		if (inObjStr.search(currRegExp) == -1) {
			RICOLACalendarDispError(1,currFormat,arguments[0]);
			return false;
		}
		BrkDateAry[0]=inObjStr.replace(currRegExp,"$1");
		BrkDateAry[1]=inObjStr.replace(currRegExp,"$2");
		BrkDateAry[2]=inObjStr.replace(currRegExp,"$3");
		WhichFormatAry=RICOLACalendarPossFormats[currFormat].split(RICOLACalendarPossFormats[currFormat].match(/[^a-z]/i));
		for(i=0; i< WhichFormatAry.length; i++) {
			if (WhichFormatAry[i].charAt(0).toUpperCase() == "M") {
				currMonth=BrkDateAry[i];
			} else if (WhichFormatAry[i].charAt(0).toUpperCase() == "D") {
				currDay=BrkDateAry[i];
			} else if (WhichFormatAry[i].charAt(0).toUpperCase() == "Y") {
				currYear=BrkDateAry[i];
			}
		}
		checkValidDate(currMonth, currDay, currYear);
		var isValidDateRtn=RICOLACalendarCheckVDateErrNum;
		if (isValidDateRtn != 0) {
			if ((RICOLACalendarPossFormats[currFormat].search(/D.*M/gi) != -1) && checkValidDate(currDay, currMonth, currYear)) {
				var holder = currMonth;
				currMonth = currDay;
				currDay = holder;
			} else {
				checkValidDate(currMonth, currDay, currYear);
				RICOLACalendarDispError(isValidDateRtn,currFormat,arguments[0],currMonth,currDay,currYear);
				return false;
			}
		}
		var holdFormattedDate=RICOLACalendarFormatDate(currFormat,currMonth,currDay,currYear,arguments[0]);
		if (holdFormattedDate != false) {
			arguments[0].value=holdFormattedDate;
		}
	} else {	// Has Delimiter
		var DateWasValid=false;
		for(i=0; i < DelimList.length; i++) {
			currD=DelimList.charAt(i);
			WhichFormatAry = RICOLACalendarPossFormats[currFormat].split(RICOLACalendarPossFormats[currFormat].match(/[^a-z]/i));
			BrkDateAry=inObjStr.split(currD);
			for (x=0; x < BrkDateAry.length; x++) {
				BrkDateAry[x]=BrkDateAry[x].replace(/\D/g,"");
				if (BrkDateAry[x] == "") {
					RICOLACalendarDispError(1,currFormat,arguments[0],currMonth,currDay,currYear);
					return false;
				}
			}
			for(x=0; x< WhichFormatAry.length; x++) {
				if (WhichFormatAry[x].charAt(0).toUpperCase() == "M") {
					currMonth=BrkDateAry[x];
				} else if (WhichFormatAry[x].charAt(0).toUpperCase() == "D") {
					currDay=BrkDateAry[x];
				} else if (WhichFormatAry[x].charAt(0).toUpperCase() == "Y") {
					currYear=BrkDateAry[x];
				}
			}
			if ((currFormat >= 4) && (currFormat <= 11) &&  !monthWasTyped) {	// If D-M-Y Style, swap the D and M
				var holdVar = currMonth;
				currMonth = currDay;
				currDay = holdVar;
			}
			checkValidDate(currMonth, currDay, currYear);
			var isValidDateRtn=RICOLACalendarCheckVDateErrNum;
			if (isValidDateRtn != 0) {
				if ((RICOLACalendarPossFormats[currFormat].search(/D.*M/gi) != -1) && checkValidDate(currDay, currMonth, currYear)) {
					var holder = currMonth;
					currMonth = currDay;
					currDay = holder;
					DateWasValid=true;
					i=DelimList.length;
				} else {
					checkValidDate(currMonth, currDay, currYear);
					DateWasValid=false;
				}
			} else {
				DateWasValid=true;
				i=DelimList.length;
			}
		}

		if (DateWasValid) {
			var holdFormattedDate=RICOLACalendarFormatDate(currFormat,currMonth,currDay,currYear,arguments[0]);
			if (holdFormattedDate != false) {
				arguments[0].value=holdFormattedDate;
			}
		} else {
			RICOLACalendarDispError(isValidDateRtn,currFormat,arguments[0],currMonth,currDay,currYear);
			return false;
		}
	}
}

/* ************************************ MultipleDateFieldCheck Function **************************************** */


function MultipleDateFieldCheck() {
	if (arguments.length < 1) {
		alert("Calendar Error #5593: There is no field associated with the Multiple Date Verification Utility.\nPlease visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
		return false;
	} else if (typeof arguments[0] != "object") {
		alert("Calendar Error #5594: The field passed to the MultipleDateFieldCheck function was not an element.\nPlease visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
		return false;
	}
	var Delimiter=new String(" ");
	var formatNum=1;
	var DatesTCAry=new Array();
	var UsePrevents=false;
	var PreventAry=new Array();

	for (i=1; i < arguments.length; i++) {
		if (arguments[i].search(/^\s*delim[ie]?ter:/i) != -1) {
			Delimiter=arguments[i].replace(/^delim[ie]?ter:\s*(.*)$/i, "$1");
		} else if (arguments[i].search(/^format:/i) != -1) {
			formatNum=parseInt(arguments[i].replace(/^format:?\s*(.*)$/i,"$1"),10) ;
			if ((formatNum < 1) || (formatNum > RICOLACalendarPossFormats.length) || (isNaN(formatNum))) {
				alert("Calendar Error #5596: There is no format available for format #" + formatNum + ".\nPlease choose a value between 1 and " + RICOLACalendarPossFormats.length + " or visit the documentation online at: \nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
				return false;
			}
		} else if (arguments[i].search(/^\s*prevent:/i) != -1) {
			UsePrevents=true;
			PreventAry[PreventAry.length]=arguments[i];
		}
	}
	DatesTCAry=arguments[0].value.split(Delimiter);
	arguments[0].style.backgroundColor=RICOLACalendarErrorColor;
	var i=0;
	var isErrored=false;
	RICOLAValidDateCheckFailed=false;
	var currBGColor=new String(arguments[0].style.backgroundColor);
	if (currBGColor.toUpperCase() != RICOLACalendarErrorColor.toUpperCase()) {
		if (arguments[0].style.backgroundColor != "") {
			RICOLACalendarRegColor=arguments[0].style.backgroundColor;
		}
	} else {
		arguments[0].style.backgroundColor = RICOLACalendarRegColor;
	}
	for (i=0; i< DatesTCAry.length; i++) {
		RICOLAmultiDateObj.value=DatesTCAry[i].toString();
		if (UsePrevents) {
			var executeDFC=new String("DateFieldCheck(RICOLAmultiDateObj," + formatNum);
			for(k=0; k < PreventAry.length; k++) {
				executeDFC+=",'" + PreventAry[k] + "'";

			}
			executeDFC+=");";
			eval(executeDFC);
		} else {
			DateFieldCheck(RICOLAmultiDateObj,formatNum);
		}
		if (RICOLAValidDateCheckFailed == true) { isErrored = true; }
		DatesTCAry[i]=RICOLAmultiDateObj.value;
	}
	if (isErrored) {
		arguments[0].style.backgroundColor=RICOLACalendarErrorColor;
		RICOLAValidDateCheckFailed = true;
	} else {
		arguments[0].value=DatesTCAry.join(Delimiter);
	}
}

/* ************************************ RICOLACalendarTestUnClickable Function **************************************** */

function RICOLACalendarTestUnClickable(inMonth, inYear, inDay) {
	var i=0;
	RICOLACalendarUnClickableReason="";
	var x=RICOLACalendarUnClickableBefore;
	var y=RICOLACalendarUnClickableAfter;
	var z=RICOLACalendarUnClickableAry;
	var holdj=new Date(inYear, inMonth, inDay);
	var j=holdj.getDay();  				// j is day of the week 0 through 6
	inMonth++;

	var currRegExp=new RegExp(/^\s*(\d{1,2})\/(\d{1,2})\/(\d{4})\s*$/);
	if (inYear < 100) {
		if (inYear <= RICOLACENTURYCHECK) {
			if (inYear < 10) { inYear = "0" + inYear; }
			inYear = "20" + inYear;
		} else {
			if (inYear < 10) { inYear = "0" + inYear; }
			inYear = "19" + inYear;
		}
	}


	for (i=0; i < z.length; i++) {
		if ((z[i].search(/^\s*no\s*holidays?\s*$/i) != -1) && (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1)) {
			RICOLACalendarUnClickableReason="is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
			return false;
		} else if ((z[i].search(/^\s*no\s*sundays?\s*$/i) != -1) && (j == 0)) {
			RICOLACalendarUnClickableReason="is a Sunday";
			return false;
		} else if ((z[i].search(/^\s*no\s*mondays?\s*$/i) != -1) && (j == 1))  {
			RICOLACalendarUnClickableReason="is a Monday";
			return false;
		} else if ((z[i].search(/^\s*no\s*tuesdays?\s*$/i) != -1) && (j == 2))  {
			RICOLACalendarUnClickableReason="is a Tuesday";
			return false;
		} else if ((z[i].search(/^\s*no\s*wednesdays?\s*$/i) != -1) && (j == 3))  {
			RICOLACalendarUnClickableReason="is a Wednesday";
			return false;
		} else if ((z[i].search(/^\s*no\s*thursdays?\s*$/i) != -1) && (j == 4))  {
			RICOLACalendarUnClickableReason="is a Thursday";
			return false;
		} else if ((z[i].search(/^\s*no\s*fridays?\s*$/i) != -1) && (j == 5))  {
			RICOLACalendarUnClickableReason="is a Friday";
			return false;
		} else if ((z[i].search(/^\s*no\s*saturdays?\s*$/i) != -1) && (j == 6))  {
			RICOLACalendarUnClickableReason="is a Saturday";
			return false;
		} else if ((z[i].search(/^\s*no\s*weekends?\s*$/i) != -1) && ((j == 0) || (j == 6)))  {
			RICOLACalendarUnClickableReason="is a Weekend Day";
			return false;
		}
	}


	if (x != "") {
		if (inYear < parseInt(x.replace(currRegExp, "$3"), 10)) {
			RICOLACalendarUnClickableReason="occurs before " + x.replace(currRegExp, "$1") + "/" + x.replace(currRegExp, "$2") + "/" + x.replace(currRegExp, "$3");
			if (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1) {
				RICOLACalendarUnClickableReason += " and is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
			}
			return false;
		} else if (inYear == parseInt(x.replace(currRegExp, "$3"), 10)) {
			if (inMonth < parseInt(x.replace(currRegExp, "$1"), 10)) {
				RICOLACalendarUnClickableReason="Occurs before " + x.replace(currRegExp, "$1") + "/" + x.replace(currRegExp, "$2") + "/" + x.replace(currRegExp, "$3");
				if (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1) {
					RICOLACalendarUnClickableReason += " and is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
				}
				return false;
			} else if (inMonth == parseInt(x.replace(currRegExp, "$1"), 10)) {
				if (inDay < parseInt(x.replace(currRegExp, "$2"), 10)) {
					RICOLACalendarUnClickableReason="occurs before " + x.replace(currRegExp, "$1") + "/" + x.replace(currRegExp, "$2") + "/" + x.replace(currRegExp, "$3");
					if (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1) {
						RICOLACalendarUnClickableReason += " and is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
					}
					return false;
				}
			}
		}
	}

	if (y != "") {
		if (inYear > parseInt(y.replace(currRegExp, "$3"), 10)) {
			RICOLACalendarUnClickableReason="occurs after " + y.replace(currRegExp, "$1") + "/" + y.replace(currRegExp, "$2") + "/" + y.replace(currRegExp, "$3");
			if (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1) {
				RICOLACalendarUnClickableReason += " and is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
			}
			return false;
		} else if (inYear == parseInt(y.replace(currRegExp, "$3"), 10)) {
			if (inMonth > parseInt(y.replace(currRegExp, "$1"), 10)) {
				RICOLACalendarUnClickableReason="occurs after " + y.replace(currRegExp, "$1") + "/" + y.replace(currRegExp, "$2") + "/" + y.replace(currRegExp, "$3");
				if (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1) {
					RICOLACalendarUnClickableReason += " and is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
				}
				return false;
			} else if (inMonth == parseInt(y.replace(currRegExp, "$1"), 10)) {
				if (inDay > parseInt(y.replace(currRegExp, "$2"), 10)) {
					RICOLACalendarUnClickableReason="occurs after " + y.replace(currRegExp, "$1") + "/" + y.replace(currRegExp, "$2") + "/" + y.replace(currRegExp, "$3");
					if (isUPRRHoliday((inMonth - 1), inDay, inYear) != -1) {
						RICOLACalendarUnClickableReason += " and is a Union Pacific Holiday: " + arrHolidayNames[isUPRRHoliday((inMonth - 1), inDay, inYear)];
					}
					return false;
				}
			}
		}
	}

	return true;
}

/* ************************************ calendarPopup Function **************************************** */

function calendarPopup(inControl, inshowUPHolidays) {
	if (!inControl) {
		alert("Calendar Error #5589: There is no control associated with the Calendar Popup.\nPlease visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
		return false;
	}
	if (!inshowUPHolidays) {
		showUPHolidays=false;
	} else {
		showUPHolidays=true;
	}
	var i=0;
	var FormatToUse=new String(", '" + RICOLACalendarPossFormats[0] + "'");
	var ExtraToUse=new String("");
	var CReturnMultipleDelim=new String("");
	for (i=2; i<arguments.length; i++) {
		if (arguments[i].search(/^noclose:\s*1$/i) != -1) {
			ExtraToUse+=", 'No_Close'";
//			RICOLACalendarNoClose=true;
		} else if (arguments[i].search(/^multipledates:/i) != -1) {
//			RICOLACalendarReturnMultiple=true;
			if (arguments[i].replace(/multipledates:\s*(.*)/i,"$1") != "") {
				RICOLACalendarReturnMultipleDelim=arguments[i].replace(/multipledates:\s*(.*)/i,"$1");
			}
			ExtraToUse+=", '" + arguments[i] + "'";
		} else if (arguments[i].search(/^format:/i) != -1) {
			var formatNum=parseInt(arguments[i].replace(/^format:?\s*(.*)$/i,"$1"),10);
			if ((formatNum < 1) || (formatNum > RICOLACalendarPossFormats.length) || (isNaN(formatNum))) {
				alert("Calendar Error #5590: There is no format available for format #" + formatNum + ".\nPlease choose a value between 1 and " + RICOLACalendarPossFormats.length + " or visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
				return false;
			} else {
				FormatToUse=", '" + RICOLACalendarPossFormats[(formatNum - 1)] + "'";
			}
		} else if (arguments[i].search(/^\s*set\s*month\:\s*(1|2|3|4|5|6|7|8|9|10|11|12)\s*$/i) != -1) {
			ExtraToUse+=", '" + arguments[i] + "'";
		} else if (arguments[i].search(/^\s*set\s*year\:\s*(19|20)(\d\d)\s*$/i) != -1) {
			ExtraToUse+=", '" + arguments[i] + "'";
		} else if (arguments[i].search(/^\s*prevent:/i) != -1) {
			ExtraToUse+=", '" + arguments[i] + "'";
		} else if (arguments[i].search(/^\s*(use|using)\s*custom\s*javascript\s*$/i) != -1) {
			ExtraToUse+=", 'using custom javascript'";
		}
	}
	document.write("<A HREF=\"javascript: void show_calendar('" + inControl  + "'" + FormatToUse + ExtraToUse + ");\" TABINDEX=\"-1\"><IMG SRC=\"/graphics/apps/calendar/calendar.gif\" WIDTH=\"30\" HEIGHT=\"25\" BORDER=\"0\" TABINDEX=\"-1\" ></A>");

}

/* ***************************************************************************************************************** */
/* ***************************************************************************************************************** */
/* ***************************************************************************************************************** */
/* ***************************************************************************************************************** */
/* ***************************************************************************************************************** */
/* ***************************************************************************************************************** */

// Start PopUp Window Verifier

var weekend = [7];
// var weekend = [0,6];
var weekendColor = "#e0e0e0";
var fontface = "Verdana";
var fontsize = 2;

var gNow = new Date();
var ggWinCal;
isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;

Calendar.Months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];

// Non-Leap year Month days..
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Leap year Month days..
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

function Calendar(p_item, p_WinCal, p_month, p_year, p_format) {
	if ((p_month == null) && (p_year == null))	return;

	if (p_WinCal == null)
		this.gWinCal = ggWinCal;
	else
		this.gWinCal = p_WinCal;

	if (p_month == null) {
		this.gMonthName = null;
		this.gMonth = null;
		this.gYearly = true;
	} else {
		this.gMonthName = Calendar.get_month(p_month);
		this.gMonth = new Number(p_month);
		this.gYearly = false;
	}

	this.gYear = p_year;
	this.gFormat = p_format;
	this.gBGColor = "white";
	this.gFGColor = "black";
	this.gTextColor = "black";
	this.gHeaderColor = "black";
	this.gReturnItem = p_item;
}

Calendar.get_month = Calendar_get_month;
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
Calendar.calc_month_year = Calendar_calc_month_year;
Calendar.print = Calendar_print;

function Calendar_get_month(monthNo) {
	return Calendar.Months[monthNo];
}

function Calendar_get_daysofmonth(monthNo, p_year) {
	/*
	Check for leap year ..
	1.Years evenly divisible by four are normally leap years, except for...
	2.Years also evenly divisible by 100 are not leap years, except for...
	3.Years also evenly divisible by 400 are leap years.
	*/
	if ((p_year % 4) == 0) {
		if ((p_year % 100) == 0 && (p_year % 400) != 0)
			return Calendar.DOMonth[monthNo];

		return Calendar.lDOMonth[monthNo];
	} else
		return Calendar.DOMonth[monthNo];
}

function Calendar_calc_month_year(p_Month, p_Year, incr) {
	/*
	Will return an 1-D array with 1st element being the calculated month
	and second being the calculated year
	after applying the month increment/decrement as specified by 'incr' parameter.
	'incr' will normally have 1/-1 to navigate thru the months.
	*/
	var ret_arr = new Array();

	if (incr == -1) {
		// B A C K W A R D
		if (p_Month == 0) {
			ret_arr[0] = 11;
			ret_arr[1] = parseInt(p_Year) - 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) - 1;
			ret_arr[1] = parseInt(p_Year);
		}
	} else if (incr == 1) {
		// F O R W A R D
		if (p_Month == 11) {
			ret_arr[0] = 0;
			ret_arr[1] = parseInt(p_Year) + 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) + 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}

	return ret_arr;
}

function Calendar_print() {
	ggWinCal.print();
}

function Calendar_calc_month_year(p_Month, p_Year, incr) {
	/*
	Will return an 1-D array with 1st element being the calculated month
	and second being the calculated year
	after applying the month increment/decrement as specified by 'incr' parameter.
	'incr' will normally have 1/-1 to navigate thru the months.
	*/
	var ret_arr = new Array();

	if (incr == -1) {
		// B A C K W A R D
		if (p_Month == 0) {
			ret_arr[0] = 11;
			ret_arr[1] = parseInt(p_Year) - 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) - 1;
			ret_arr[1] = parseInt(p_Year);
		}
	} else if (incr == 1) {
		// F O R W A R D
		if (p_Month == 11) {
			ret_arr[0] = 0;
			ret_arr[1] = parseInt(p_Year) + 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) + 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}

	return ret_arr;
}

// This is for compatibility with Navigator 3, we have to create and discard one object before the prototype object exists.
new Calendar();

Calendar.prototype.getMonthlyCalendarCode = function() {
	var vCode = "";
	var vHeader_Code = "";
	var vData_Code = "";

	// Begin Table Drawing code here..  For Actual Calendar!
	vCode = vCode + "<TABLE CELLSPACING='0' class='calendar'>";
	vCode = vCode + "<col class='weekend' />";
	vCode = vCode + "<col />";
	vCode = vCode + "<col />";
	vCode = vCode + "<col />";
	vCode = vCode + "<col />";
	vCode = vCode + "<col />";
	vCode = vCode + "<col class='weekend' />";

	vHeader_Code = this.cal_header();
	vData_Code = this.cal_data();
	vCode = vCode + vHeader_Code + vData_Code;

	vCode = vCode + "</TABLE>";

	return vCode;
}

Calendar.prototype.show = function() {
	var vCode = "";

	this.gWinCal.document.open();

	// Setup the page...
	this.wwrite("<html>");
	this.wwrite("<head>");
	try {
		if (window.location.hostname.toString().search(/\.up(rr)?\.com$/i) != -1) {
			this.wwrite("<title>UP Calendar</title>");
		} else {
			this.wwrite("<title>Calendar</title>");
		}
	} catch (e) {
		this.wwrite("<title>UP Calendar</title>");
	}
	this.wwrite("<STYLE TYPE='text/css'>");
	this.wwrite("	body { font-size: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;	padding: 0px; margin: 0px; } ");
	this.wwrite("	td { font-size: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-align: center; }");
	this.wwrite("	table.calendar { width: 100%; } ");
	this.wwrite("	tr.DayOfWeek td {  background-color: #F9E6B2;  padding: 2px;  color: #000000; font-weight: 900; }");
	this.wwrite("	div.monthYear { background-color: #F4CD65; color: #000000; text-align: center; font-weight: 900; font-size: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding: 2px 0px 2px 0px; }");
	this.wwrite("	A, A:visited, A:hover, A:link { text-decoration : none; font-weight : 900; color: #003399; }");
	this.wwrite("	table.calendar col.weekend { background-color: #FDF7E5; }");
	this.wwrite("	table.calendar tr.weekRow td { text-align: center; cursor: pointer; border: 1px solid #F9E6B2; } ");
	this.wwrite("	table.calendar tr.weekRow td.holiday { background-color: #C3D4B2; } ");
	this.wwrite("	table.calendar tr.weekRow td.disabled { background-color: #E4E2DC; color: #C9C5BA; cursor: default; } ");
	this.wwrite("	table.calendar tr.weekRow td.today { background-color: #FFFFFF; color: #003399;  } ");
	this.wwrite("	table.calendar tr.weekRow td.today { text-decoration: underline; color: #003399;  } ");
	this.wwrite("	a.arrowColor { text-decoration: none; color: #000000;  } ");

	this.wwrite(" </STYLE>");
	this.wwrite("</head>");
/*
	this.wwrite("<body " +
		"link=\"" + this.gLinkColor + "\" " +
		"vlink=\"" + this.gLinkColor + "\" " +
		"alink=\"" + this.gLinkColor + "\" " +
		"text=\"" + this.gTextColor + "\" BGCOLOR='Black'>");

		*/
this.wwrite("<body>");

//	this.wwriteA("<TABLE WIDTH='100%'><TR><TD ALIGN='left' VALIGN='top'><IMG SRC='/graphics/apps/uplogo_main_n.gif' BORDER='0' WIDTH='153' HEIGHT='45' ALT='Union Pacific Logo'></TD><TD ALIGN='right' VALIGN='middle'></TD></TR></TABLE>\n<BR>\n");
//	this.wwriteA("<FONT FACE='" + fontface + "' SIZE=2><B>");

// START: This Prints the Month and the Year
//	this.wwriteA(this.gMonthName + " " + this.gYear);
// END: This Prints the Month and the Year


//	this.wwriteA("</B><BR>");

	// Show navigation buttons
	var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
	var prevMM = prevMMYYYY[0];
	var prevYYYY = prevMMYYYY[1];

	var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
	var nextMM = nextMMYYYY[0];
	var nextYYYY = nextMMYYYY[1];

	var RICOLACal_returnItemStr = new String(this.gReturnItem);
	RICOLACal_returnItemStr = RICOLACal_returnItemStr.replace(/\'/g, "\\\'");

/*
// START: This Prints the Month and the Year
	this.wwriteA("<FONT FACE='" + fontface + "' SIZE=2><B>");
	this.wwriteA(this.gMonthName + " " + this.gYear + "</B></TD><TD ALIGN='center'>");
// END: This Prints the Month and the Year
*/
	this.wwrite("<div class='monthYear'>" + this.gMonthName + " " + this.gYear + "</div>");

	// Get the complete calendar code for the month..
	vCode = this.getMonthlyCalendarCode();
	this.wwrite(vCode);



	this.wwrite("<TABLE WIDTH='100%' BORDER='0' CELLSPACING=0 CELLPADDING=0><TR><TD ALIGN=center width='25%'>");
	this.wwrite("<A class='arrowColor arrowRollbackYear' HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + RICOLACal_returnItemStr + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "'" +
		");" +
		"\">&lt;&lt;<\/A></TD><TD ALIGN=center width='25%'>");
// <IMG SRC='/graphics/apps/calendar/dblleft2.gif' WIDTH='16' HEIGHT='16' BORDER='0' ALT='Previous Year'>
	this.wwrite("<A class='arrowColor arrowRollbackMonth' HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + RICOLACal_returnItemStr + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\">&lt;<\/A></TD><TD width='25%' ALIGN=center>");
//<IMG SRC='/graphics/apps/calendar/left2.gif' WIDTH='16' HEIGHT='16' BORDER='0' ALT='Previous Month'>

//	this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>");

	this.wwrite("<A class='arrowColor arrowAdvanceMonth' HREF=\"" + "javascript:window.opener.Build(" + "'" + RICOLACal_returnItemStr + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "'" + ");" + "\">&gt;<\/A></TD><TD ALIGN=center width='25%'>");
// <IMG SRC='/graphics/apps/calendar/right2.gif' WIDTH='16' HEIGHT='16' BORDER='0' ALT='Next Month'>

	this.wwrite("<A class='arrowColor arrowAdvanceYear' HREF=\"" + "javascript:window.opener.Build(" + "'" + RICOLACal_returnItemStr + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "'" + ");" + "\">&gt;&gt;<\/A></TD></TR></TABLE>");
// <IMG SRC='/graphics/apps/calendar/dblright2.gif' WIDTH='16' HEIGHT='16' BORDER='0' ALT='Next Year'>

	this.wwrite("</body></html>");
	this.gWinCal.document.close();
}

Calendar.prototype.showY = function() {
	var vCode = "";
	var i;
	var vr, vc, vx, vy;		// Row, Column, X-coord, Y-coord
	var vxf = 285;			// X-Factor
	var vyf = 200;			// Y-Factor
	var vxm = 10;			// X-margin
	var vym;				// Y-margin
	if (isIE)	vym = 75;
	else if (isNav)	vym = 25;

	this.gWinCal.document.open();

	this.wwrite("<html>");
	this.wwrite("<head><title>Calendar</title>");
	this.wwrite("<style type='text/css'>\n<!--");
	for (i=0; i<12; i++) {
		vc = i % 3;
		if (i>=0 && i<= 2)	vr = 0;
		if (i>=3 && i<= 5)	vr = 1;
		if (i>=6 && i<= 8)	vr = 2;
		if (i>=9 && i<= 11)	vr = 3;

		vx = parseInt(vxf * vc) + vxm;
		vy = parseInt(vyf * vr) + vym;

		this.wwrite(".lclass" + i + " {position:absolute;top:" + vy + ";left:" + vx + ";}");
	}
	this.wwrite("-->\n</style>");
	this.wwrite("</head>");

	this.wwrite("<body " +
		"link=\"" + this.gLinkColor + "\" " +
		"vlink=\"" + this.gLinkColor + "\" " +
		"alink=\"" + this.gLinkColor + "\" " +
		"text=\"" + this.gTextColor + "\">");
	this.wwrite("<FONT FACE='" + fontface + "' SIZE=2><B>");
	this.wwrite("Year : " + this.gYear);
	this.wwrite("</B><BR>");


	// Get the complete calendar code for each month..
	var j;
	for (i=11; i>=0; i--) {
		if (isIE)
			this.wwrite("<DIV ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");
		else if (isNav)
			this.wwrite("<LAYER ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");

		this.gMonth = i;
		this.gMonthName = Calendar.get_month(this.gMonth);
		vCode = this.getMonthlyCalendarCode();
		this.wwrite(this.gMonthName + "/" + this.gYear + "<BR>");
		this.wwrite(vCode);

		if (isIE)
			this.wwrite("</DIV>");
		else if (isNav)
			this.wwrite("</LAYER>");
	}

	// Show navigation buttons
	var prevYYYY = parseInt(this.gYear) - 1;
	var nextYYYY = parseInt(this.gYear) + 1;

	this.wwrite("<TABLE WIDTH='100%' CELLSPACING=0 CELLPADDING=0 class='navigationTable'><TR><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', null, '" + prevYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\" alt='Prev Year'><<<\/A>]</TD><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"" +
		"javascript:window.opener.Build(" +
		"'" + this.gReturnItem + "', null, '" + nextYYYY + "', '" + this.gFormat + "'" +
		");" +
		"\">>><\/A>]</TD></TR></TABLE><BR>");


	this.wwrite("</font><BR></body></html>");
	this.gWinCal.document.close();
}

Calendar.prototype.wwrite = function(wtext) {
	this.gWinCal.document.writeln(wtext);
}

Calendar.prototype.wwriteA = function(wtext) {
	this.gWinCal.document.write(wtext);
}

Calendar.prototype.cal_header = function() {
	var vCode = "";

	vCode = vCode + "<TR CLASS='DayOfWeek'>";
	vCode = vCode + "<TD >Su</TD>";
	vCode = vCode + "<TD >Mo</TD>";
	vCode = vCode + "<TD >Tu</TD>";
	vCode = vCode + "<TD >We</TD>";
	vCode = vCode + "<TD >Th</TD>";
	vCode = vCode + "<TD >Fr</TD>";
	vCode = vCode + "<TD >Sa</TD>";
	vCode = vCode + "</TR>";

	return vCode;
}

Calendar.prototype.cal_data = function() {
	var vDate = new Date();
	vDate.setDate(1);
	vDate.setMonth(this.gMonth);
	vDate.setFullYear(this.gYear);

	var vFirstDay=vDate.getDay();
	var vDay=1;
	var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
	var vOnLastDay=0;
	var vCode = "";

	/*
	Get day for the 1st of the requested month/year..
	Place as many blank cells before the 1st day of the month as necessary.
	*/

	vCode = vCode + "\n<TR class='weekRow'>";
	for (i=0; i<vFirstDay; i++) {
		vCode = vCode + "\n\t<TD " + this.write_weekend_string(i) + ">&#160;</TD>";
	}

	// Write rest of the 1st week

	for (j=vFirstDay; j<7; j++) {
		vCode = vCode + "\n\t<TD " + this.write_weekend_string(j) + " ";
		if (RICOLACalendarTestUnClickable(this.gMonth, this.gYear, vDay, j)) {
//			vCode = vCode + "<A HREF='#' ";
			if (RICOLACalendarReturnMultiple) {
				vCode = vCode + "onClick=\"if(self.opener.document." + this.gReturnItem + ".value != '') { self.opener.document." + this.gReturnItem + ".value+='" + RICOLACalendarReturnMultipleDelim + "'; } self.opener.document." + this.gReturnItem + ".value+='" + this.format_data(vDay) + "'; ";
			} else {
				vCode = vCode + "onClick=\"self.opener.document." + this.gReturnItem + ".value='" + this.format_data(vDay) + "';";
			}
			vCode = vCode + " self.opener.RICOLACalendarReturn();";
			if (!RICOLACalendarNoClose) {
				vCode = vCode + " window.close();";
			}
			vCode = vCode + "\" onMouseOver=\"this.style.backgroundColor='#C3D3E5'; this.style.color='#003399'; this.style.border='1px solid #6A92BF';\" onMouseOut=\"this.style.backgroundColor=''; this.style.color=''; this.style.border='1px solid #F9E6B2';\" " + this.format_day(vDay) + ""
		} else {
			vCode = vCode + " class='disabled'><SPAN TITLE=\"Date Unavailable (Date " + RICOLACalendarUnClickableReason + ")\">";
			if (showUPHolidays && (isUPRRHoliday(this.gMonth, vDay, this.gYear) >= 0)) { // if a holiday add in the title tag for IE users
				vCode = vCode + "<span style=\"border: 1px solid " + HolidayColor + "; padding: 1px;\">" + vDay + "</span>";
			} else {
				vCode = vCode + vDay;
			}
			vCode = vCode + "</SPAN>";
			RICOLACalendarUnClickableReason="";
		}
		vCode = vCode + "</FONT></TD>";
		vDay=vDay + 1;
	}
	vCode = vCode + "</TR>";

	// Write the rest of the weeks
	var RowsWritten = 1;
	for (k=2; k<7; k++) {
		vCode = vCode + "\n<TR class='weekRow'>";

		for (j=0; j<7; j++) {
			vCode = vCode + "\n\t<TD " + this.write_weekend_string(j) + "";
			if (RICOLACalendarTestUnClickable(this.gMonth, this.gYear, vDay, j)) {
//				vCode = vCode + "<A HREF='#' ";
				if (RICOLACalendarReturnMultiple) {
					vCode = vCode + "onClick=\"if(self.opener.document." + this.gReturnItem + ".value != '') { self.opener.document." + this.gReturnItem + ".value+='" + RICOLACalendarReturnMultipleDelim + "'; } self.opener.document." + this.gReturnItem + ".value+='" + this.format_data(vDay) + "'; ";
				} else {
					vCode = vCode + "onClick=\"self.opener.document." + this.gReturnItem + ".value='" + this.format_data(vDay) + "';";
				}
				vCode = vCode + " self.opener.RICOLACalendarReturn();";
				if (!RICOLACalendarNoClose) {
					vCode = vCode + " window.close();";
				}
				vCode = vCode + "\"  onMouseOver=\"this.style.backgroundColor='#C3D3E5'; this.style.color='#003399'; this.style.border='1px solid #6A92BF';\" onMouseOut=\"this.style.backgroundColor=''; this.style.color=''; this.style.border='1px solid #F9E6B2';\" " + this.format_day(vDay) + ""
			} else {
				vCode = vCode + " class='disabled'><SPAN TITLE=\"Date Unavailable (Date " + RICOLACalendarUnClickableReason + ")\">";
				if (showUPHolidays && (isUPRRHoliday(this.gMonth, vDay, this.gYear) >= 0)) { // if a holiday add in the title tag for IE users
					vCode = vCode + "<span style=\"border: 1px solid " + HolidayColor + "; padding: 1px;\">" + vDay + "</span>";
				} else {
					vCode = vCode + vDay;
				}
				vCode = vCode + "</SPAN>";
				RICOLACalendarUnClickableReason="";
			}
			vCode = vCode + "</FONT></TD>";
			vDay=vDay + 1;

			if (vDay > vLastDay) {
				vOnLastDay = 1;
				break;
			}
		}
		RowsWritten++;
		if (j == 6)
			vCode = vCode + "</TR>";
		if (vOnLastDay == 1)
			break;
	}

	// Fill up the rest of last week with proper blanks, so that we get proper square blocks
	for (m=1; m<(7-j); m++) {
		if (this.gYearly) {
//			vCode = vCode + "\n\t<TD WIDTH='14%'" + this.write_weekend_string(j+m) + "><FONT SIZE='2' FACE='" + fontface + "' COLOR='gray'> </FONT></TD>";
			vCode = vCode + "\n\t<TD " + this.write_weekend_string(j+m) + ">&#160;</TD>";
		} else {
//			vCode = vCode + "\n\t<TD WIDTH='14%'" + this.write_weekend_string(j+m) + "><FONT SIZE='2' FACE='" + fontface + "' COLOR='gray'>" + m + "</FONT></TD>";
			vCode = vCode + "\n\t<TD " + this.write_weekend_string(j+m) + "> <!-- " + m + " --> &#160;</TD>";
		}
	}
	for (var i=RowsWritten; i < 6; i++) {
		vCode = vCode + "<tr class='weekRow'><td>&#160;</td><td>&#160;</td><td>&#160;</td><td>&#160;</td><td>&#160;</td><td>&#160;</td><td>&#160;</td></tr>";
	}

	return vCode;
}

Calendar.prototype.format_day = function(vday) {
	var vNowDay = gNow.getDate();
	var vNowMonth = gNow.getMonth();
	var vNowYear = gNow.getFullYear();

   flgIsHoliday = isUPRRHoliday(this.gMonth, vday, this.gYear);

	if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
//		return ("<FONT COLOR=\"RED\"><B>" + vday + "</B></FONT>");
		return " class='today'>" + vday;

	else if (showUPHolidays && (flgIsHoliday >= 0))  // if a holiday add in the title tag for IE users
//      return ("<FONT title=\"" + arrHolidayNames[flgIsHoliday] + " (UP Holiday)\" COLOR=\"" + HolidayColor + "\"><B>" + vday + "</B></FONT>");
		return " class='holiday' title=\"" + arrHolidayNames[flgIsHoliday] + " (UP Holiday)\" COLOR=\"" + HolidayColor + "\">" + vday;
   else
//		return (vday);
		return ">" + vday;
}

function isUPRRHoliday(szMonth, szDay, szYear) {
	var szMonth = szMonth + 1;
	var szMMDD = parseInt(szMonth, 10) + "/" + parseInt(szDay, 10);
	if ((szYear >= 2001) && (szYear <= 2037)) {
		var listHolidays = eval("Holidays" + szYear);
          	var arrHolidays  = listHolidays.split(",");
           	for (var i = 0; i < arrHolidays.length; i++) {
           		if (arrHolidays[i] == szMMDD) {
           			return i;
			}
		}
	}
	return -1;
}


Calendar.prototype.write_weekend_string = function(vday) {
	var i;

	// Return special formatting for the weekend day.
	for (i=0; i<weekend.length; i++) {
		if (vday == weekend[i])
			return (" BGCOLOR=\"" + weekendColor + "\"");
	}

	return "";
}

Calendar.prototype.format_data = function(p_day) {
	var vData;
	var vMonth = 1 + this.gMonth;
	vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
	var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
	var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
	var vY4 = new String(this.gYear);
	var vY2 = vY4.substr(2,2);
	var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day;

	switch (this.gFormat) {
		case "MM\/DD\/YYYY" :
			vData = vMonth + "\/" + vDD + "\/" + vY4;
			break;
		case "MM\/DD\/YY" :
			vData = vMonth + "\/" + vDD + "\/" + vY2;
			break;
		case "MM-DD-YYYY" :
			vData = vMonth + "-" + vDD + "-" + vY4;
			break;
		case "MM-DD-YY" :
			vData = vMonth + "-" + vDD + "-" + vY2;
			break;

		case "DD\/MMM\/YYYY" :
			vData = vDD + "\/" + vMon + "\/" + vY4;
			break;
		case "DD\/MMM\/YY" :
			vData = vDD + "\/" + vMon + "\/" + vY2;
			break;
		case "DD-MMM-YYYY" :
			vData = vDD + "-" + vMon + "-" + vY4;
			break;
		case "DD-MMM-YY" :
			vData = vDD + "-" + vMon + "-" + vY2;
			break;

		case "DD\/MONTH\/YYYY" :
			vData = vDD + "\/" + vFMon + "\/" + vY4;
			break;
		case "DD\/MONTH\/YY" :
			vData = vDD + "\/" + vFMon + "\/" + vY2;
			break;
		case "DD-MONTH-YYYY" :
			vData = vDD + "-" + vFMon + "-" + vY4;
			break;
		case "DD-MONTH-YY" :
			vData = vDD + "-" + vFMon + "-" + vY2;
			break;
		case "DD\/MM\/YYYY" :
			vData = vDD + "\/" + vMonth + "\/" + vY4;
			break;
		case "DD\/MM\/YY" :
			vData = vDD + "\/" + vMonth + "\/" + vY2;
			break;
		case "DD-MM-YYYY" :
			vData = vDD + "-" + vMonth + "-" + vY4;
			break;
		case "DD-MM-YY" :
			vData = vDD + "-" + vMonth + "-" + vY2;
			break;
		case "YYYY-DD-MM" :
			vData = vY4+ "-" + vDD + "-" + vMonth;
			break;
		case "YY-DD-MM" :
			vData = vY2+ "-" + vDD + "-" + vMonth;
			break;
		case "YYYY-MM-DD" :
			vData = vY4+ "-" + vMonth + "-" + vDD;
			break;
		case "YY-MM-DD" :
			vData = vY2+ "-" + vMonth + "-" + vDD;
			break;
		case "YYYY*MM*DD" :
			vData = vY4 + vMonth + vDD;
			break;
		case "YY*MM*DD" :
			vData = vY2 + vMonth + vDD;
			break;
		case "YYYY\/MM\/DD" :
			vData = vY4 + "\/" + vMonth + "\/" + vDD;
			break;
		case "YY\/MM\/DD" :
			vData = vY2 + "\/" + vMonth + "\/" + vDD;
			break;
		case "MM*DD*YYYY" :
			vData = vMonth + vDD + vY4;
			break;
		case "MM*DD*YY" :
			vData = vMonth + vDD + vY2;
			break;
		default :
			vData = vMonth + "\/" + vDD + "\/" + vY4;
	}
	return vData;
}

function Build(p_item, p_month, p_year, p_format) {
	var p_WinCal = ggWinCal;
	gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);

	// Customize your Calendar here..
	gCal.gBGColor="#EEEEEE";
	gCal.gLinkColor="#000000";
	gCal.gTextColor="#000000";
	gCal.gHeaderColor="#FFFFFF";

	// Choose appropriate show function
	if (gCal.gYearly)	gCal.showY();
	else	gCal.show();
}

function show_calendar() {
	/*
		p_month : 0-11 for Jan-Dec; 12 for All Months.
		p_year	: 4-digit year
		p_format: Date format (mm/dd/yyyy, dd/mm/yy, ...)
		p_item	: Return Item.
	*/

	p_item = arguments[0];

	if (arguments[1] == null) {
		p_format = "MM/DD/YYYY";
	} else {
		p_format = arguments[1];
	}
//	if (arguments[1] == null)
		p_month = new String(gNow.getMonth());
//	else
//		p_month = arguments[1];
//	if (arguments[2] == "" || arguments[2] == null)
		p_year = new String(gNow.getFullYear().toString());
//	else
//		p_year = arguments[2];
	var i=0;
	RICOLACalendarReturnMultipleDelim=" ";
	RICOLACalendarNoClose=false;
	RICOLACalendarReturnMultiple=false;
	RICOLACalendarUnClickableAry.length=0;
	RICOLACalendarUsingCustJS = false;
	for (i=2; i<arguments.length; i++) {
		if (arguments[i].search(/^no_close$/i) != -1) {
			RICOLACalendarNoClose=true;
		} else if (arguments[i].search(/^multipledates:/i) != -1) {
			RICOLACalendarReturnMultiple=true;
			if (arguments[i].replace(/multipledates:\s*(.*)/i,"$1") != "") {
				RICOLACalendarReturnMultipleDelim=arguments[i].replace(/multipledates:\s*(.*)/i,"$1");
			}
		} else if (arguments[i].search(/^\s*set\s*month\:\s*(1|2|3|4|5|6|7|8|9|10|11|12)\s*$/i) != -1) {
			p_month=parseInt(arguments[i].replace(/^\s*set\s*month\:\s*(1|2|3|4|5|6|7|8|9|10|11|12)\s*$/i, "$1"), 10) - 1;
		} else if (arguments[i].search(/^\s*set\s*year\:\s*(19|20)(\d\d)\s*$/i) != -1) {
			p_year=parseInt(arguments[i].replace(/^\s*set\s*year\:\s*(19|20)(\d\d)\s*$/i, "$1$2"), 10);
		} else if (arguments[i].search(/^\s*prevent:\s*(before|after)\s*\d{1,2}\/\d{1,2}\/\d{4}\s*$/i) != -1) {
			if (arguments[i].search(/before/i) != -1) {
				RICOLACalendarUnClickableBefore=arguments[i].replace(/^\s*prevent:\s*before\s*(\d{1,2}\/\d{1,2}\/\d{4})\s*$/i, "$1");
			} else {
				RICOLACalendarUnClickableAfter=arguments[i].replace(/^\s*prevent:\s*after\s*(\d{1,2}\/\d{1,2}\/\d{4})\s*$/i, "$1");
			}
		} else if (arguments[i].search(/^\s*prevent:\s*no\s*(sun|mon|tues|wednes|thurs|fri|satur|holi)days?\s*$/i) != -1) {
			RICOLACalendarUnClickableAry[RICOLACalendarUnClickableAry.length] = arguments[i].replace(/^\s*prevent:\s*no\s*(sun|mon|tues|wednes|thurs|fri|satur|holi)days?\s*$/i, "no $1days");
		} else if (arguments[i].search(/^\s*prevent:\sno\s*weekends?\s*$/i) != -1) {
			RICOLACalendarUnClickableAry[RICOLACalendarUnClickableAry.length] = "no weekends";
		} else if (arguments[i].search(/^\s*prevent:/i) != -1) {
			if (arguments[i].search(/^\s*prevent:\s*(before|after)\s*/i) != -1) {
				var objholder;
				try {
					objholder = eval(arguments[i].replace(/^\s*prevent:\s*(before|after)\s*(.*)$/i, "$2").replace(/\s*$/, ""));
				} catch (e) {
					// do nothing
				}
				if (typeof objholder == "object") {
					if (objholder.value.search(/^\s*\d{1,2}\/\d{1,2}\/\d{4}\s*$/i) != -1) {
						if (arguments[i].search(/before/i) != -1) {
							RICOLACalendarUnClickableBefore=objholder.value.replace(/^\s*(\d{1,2}\/\d{1,2}\/\d{4})\s*$/i, "$1");
						} else {
							RICOLACalendarUnClickableAfter=objholder.value.replace(/^\s*(\d{1,2}\/\d{1,2}\/\d{4})\s*$/i, "$1");
						}
					}
				} else {
					var daYYYYcheck=new String("Form element did not contain a valid specification of the prevent feature.  ");
					if (arguments[i].search(/^\s*prevent:\s*(before|after)\s*\d{1,2}\/\d{1,2}\/\d{1,3}\s*$/i) != -1) {
							daYYYYcheck="Form element did not contain a four (4) digit year.  ";
					}
					alert("Calendar Error #5599: Invalid 'Prevent' specified. The following:\n\n" + arguments[i] + "\n\n" + daYYYYcheck + "Please visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
				}
			} else {
				var daYYYYcheck=new String("Did not contain a valid specification of the prevent feature.  ");
				if (arguments[i].search(/^\s*prevent:\s*(before|after)\s*\d{1,2}\/\d{1,2}\/\d{1,3}\s*$/i) != -1) {
						daYYYYcheck="Did not contain a four (4) digit year.  ";
				}
				alert("Calendar Error #5598: Invalid 'Prevent' specified. The following:\n\n" + arguments[i] + "\n\n" + daYYYYcheck + "Please visit the documentation online at:\nhttp://home.www.uprr.com/emp/it/hf/ricola/calendar/");
			}

		} else if (arguments[i] == "using custom javascript") {
			RICOLACalendarUsingCustJS = true;
		}
	}

	vWinCal = window.open("", "Calendar",
		"width=250,height=200,status=no,resizable=yes,top=200,left=200");


   // bring the window to the foreground...
	vWinCal.focus();
	vWinCal.opener = self;
	ggWinCal = vWinCal;

	Build(p_item, p_month, p_year, p_format);
}
/*
Yearly Calendar Code Starts here
*/
function show_yearly_calendar(p_item, p_year, p_format) {
	// Load the defaults..
	if (p_year == null || p_year == "")
		p_year = new String(gNow.getFullYear().toString());
	if (p_format == null || p_format == "")
		p_format = "MM/DD/YYYY";

	var vWinCal = window.open("", "Calendar", "scrollbars=yes");
   // bring the window to the foreground...
   vWinCal.focus();
	vWinCal.opener = self;
	ggWinCal = vWinCal;

	Build(p_item, null, p_year, p_format);
}
