var localForm; 
function initForm(theForm) 
{ 
   localForm = theForm;
}
// Some global variables.
// Create a Date object representing today's date and current time.

var today = new Date();

// daysInMonth is an array that stores the number of days in each month.
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

function popDate (theForm, formTarget, targetPosition, calDate)
// Re-populates date select element with the appropriate number of days,
// based on which month is selected.
{
  var dayTarget;
  var monthTarget;
  var yearTarget;
	
  // If targetPosition is sent in the parameters,
  // we know that this is a multi-leg calendar.
  if (arguments.length > 2 && targetPosition != "null") {
    dayTarget = theForm.elements[formTarget+"-day"][targetPosition];
    monthTarget = theForm.elements[formTarget+"-month"][targetPosition];
    yearTarget = theForm.elements[formTarget+"-year"][targetPosition];
  } else {
    dayTarget = theForm.elements[formTarget+"-day"];
    monthTarget = theForm.elements[formTarget+"-month"];
    yearTarget = theForm.elements[formTarget+"-year"];
  }
	if ((yearTarget.value % 4) == 0) {
		if ((yearTarget.value % 100) == 0 && (yearTarget.value % 400) != 0)
			var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

		var daysInMonth = new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

	} else {
		var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

	}	
  // If date is not passed in, then create date object
  // from current settings of calendar.
  if (!calDate) {
    if (dayTarget.options[dayTarget.selectedIndex].value > daysInMonth[monthTarget.options[monthTarget.selectedIndex].value]) {
      var calDate = new Date(yearTarget.value, monthTarget.options[monthTarget.selectedIndex].value, 1);
    } else {
      var calDate = new Date(yearTarget.value, monthTarget.options[monthTarget.selectedIndex].value, dayTarget.options[dayTarget.selectedIndex].value);
    }
  }
	
  // Reset the date select element to remove the old dates.
  // Then we simply recreate each option element with the correct
  // number of dates.
  dayTarget.options.length = 0;
	
  for (var i = 0; i < monthTarget.options.length; i++) {
    if (monthTarget.options[i].value == calDate.getMonth()) {
      monthTarget.options[i].selected = true;
    }
  }
	
  // The following check is added for Destination Search; it will leave the
  // day pulldown empty if the month changes to a blank option
  if (monthTarget.options[monthTarget.options.selectedIndex].value != "") {
    for (var i = 0; i < daysInMonth[monthTarget.options.selectedIndex]; i++) {
      dayTarget.options[i] = new Option(i+1, i+1);
      if (i+1 == calDate.getDate()) {
        dayTarget.options[i].selected = true;
      }
    }
  }

  // check to see if the month is prior to current month,
  // and advance year if so
  if (calDate.getFullYear() <= today.getFullYear()) {
    yearTarget.value = today.getFullYear();
  } else{

    yearTarget.value = calDate.getFullYear();
  }
}

// change 07/26/01 bmartinez
// Stubbing out a checkDate function to prevent the calendar
// pop-up from breaking until I can rewrite the code.

function checkDate(theForm, calDate, formTarget, targetPosition) 
{
	if (calDate == 'null') {
		if (arguments.length > 3) {
			selectedYearValue = parseInt(theForm.elements[formTarget+"-year"][targetPosition].value,10);
			selectedDayValue = parseInt(theForm.elements[formTarget+"-day"][targetPosition].options[theForm.elements[formTarget+"-day"][targetPosition].selectedIndex].text,10);
			selectedMonValue = parseInt(theForm.elements[formTarget+"-month"][targetPosition].options[theForm.elements[formTarget+"-month"][targetPosition].selectedIndex].value,10);
		} else {
			selectedYearValue = parseInt(theForm.elements[formTarget+"-year"].value,10);
			selectedDayValue = parseInt(theForm.elements[formTarget+"-day"].options[theForm.elements[formTarget+"-day"].selectedIndex].text,10);
			selectedMonValue = parseInt(theForm.elements[formTarget+"-month"].options[theForm.elements[formTarget+"-month"].selectedIndex].value,10);
		}
	} else {
		theDate = new Date(calDate);
		selectedMonValue = theDate.getMonth();
		selectedDayValue = theDate.getDate(); 
		selectedYearValue = theDate.getFullYear();
	}
	var newDate = new Date(selectedYearValue, selectedMonValue, selectedDayValue);

	popDate(theForm, formTarget, targetPosition, newDate);
}

// Begin the Calendar Pop-up code.

var weekend = [0,6];
var dayCount = 0;
var gNow = new Date();
var ggWinCal;
var bColor = "#666666";	// bordercolor variable for Netscape compatibility

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, p_target)
{
	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.gTarget = p_target;
	this.gReturnItem = p_item;
}
// End Calendar Function

Calendar.get_month = Calendar_get_month;
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
Calendar.calc_month_year = Calendar_calc_month_year;

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;
}

// This is for compatibility with Navigator 3, we have to create and discard one object before the prototype object exists.
new Calendar();

Calendar.prototype.show = function() 
{
	var vCode = "";
	
	this.gWinCal.document.open();

	// 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];

	// Setup the page...
	this.wwrite("<html>");
	this.wwrite("<head><title>Calendar</title>");
	
	// write out style rules
	this.wwrite(this.createCSS());
	this.wwrite("</head>");

	this.wwrite("<body onblur=\"self.focus()\">");

	// create calendar header
	this.wwrite("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">");
	this.wwrite("<tr><td class=\"header-tool\">Calendar</td></tr>");
	this.wwrite("<tr><td align=\"center\"><b>To make a selection, click on a date below.</b></td></tr></table>");
		
	// Create the master table that contains all the tables making up the calendar.	
	this.wwrite("<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">");
	this.wwrite("<tr><td colspan=\"3\">");
	
	// create the table that contains the buttons to next and previous months and years.	
	this.wwrite("<!-- Begin Table with Navigation Arrows -->");
	this.wwrite("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">");
	this.wwrite("<tr>");
		
	//create hyperlink to the previous month button
	this.wwrite("<td>");
	this.wwrite("&lt;&#160;<a href=\"" + "javascript:window.opener.Build(" + "'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "'" + ","+this.gTarget+");" + "\" class=\"nav\">Previous</a></td>");
	
	//create hyperlink to the next month button
	this.wwrite("<td align=\"right\">");
	this.wwrite("<a href=\"" + "javascript:window.opener.Build(" + "'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "'" + ","+this.gTarget+");" + "\" class=\"nav\">Next</a>&#160;&gt;</td>");
		
	this.wwrite("<!-- End Table with Navigation Arrows -->");
	this.wwrite("</tr>");
	this.wwrite("</table></td></tr>");
	this.wwrite("<tr>");
	this.wwrite("<td align=\"center\" valign=\"top\">");
	
	for (z = 0; z < 2; z++) {
		this.gMonthName = Calendar.Months[this.gMonth];
		
		// Create the string with the month name and the year
		this.wwrite("<!-- Begin Table with Month/Year string -->");
		this.wwrite("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">");
		this.wwrite("<tr>");
		this.wwrite("<td class=\"calMonth\" align=\"center\">");
		this.wwrite("<b>" + this.gMonthName + " " + this.gYear + "</b>");
		this.wwrite("</tr>");
		this.wwrite("</table>");
		this.wwrite("<!-- End Table with Month/Year string -->");
		
		// Get the complete calendar code for the month..
		vCode = this.getMonthlyCalendarCode();
		this.wwrite(vCode);
	
		this.wwrite("</td>");
		if (z == 0) this.wwrite("<td width=\"10\">&#160;</td><td align=\"center\" valign=\"top\">");
		if (this.gMonth == 11) {
			this.gMonth = 0;
			this.gYear++;
		} else this.gMonth++;
	}
	
	this.wwrite("</tr></table>");
	
	this.wwrite("</body></html>");
	
	this.gWinCal.document.close();
}

Calendar.prototype.getMonthlyCalendarCode = function() 
{
	var vCode = "";
	var vHeader_Code = "";
	var vData_Code = "";
	
	// Begin Table code for the Calendar itself...
	vCode += "<!-- Begin Calendar Table -->\n";
	vCode += "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"3\" class=\"calBorder\" ";
	if (isNav) 
		vCode += "border=\"1\" bordercolor=\"" + bColor + "\"";
	vCode += ">";
	vHeader_Code = this.cal_header();
	vData_Code = this.cal_data();
	vCode += vHeader_Code + vData_Code;
	vCode += "</table>";
	vCode += "\n<!-- End Calendar Table -->";
		
	return vCode;
}

Calendar.prototype.wwrite = function(wtext) 
{
	this.gWinCal.document.writeln(wtext);
}

Calendar.prototype.wwriteA = function(wtext) 
{
	this.gWinCal.document.write(wtext);
}

// New function added 09/18/2001 bmartinez
// Not exactly the prettiest way to control color/fonts,
// but it's still a lot cleaner than what we were doing.
Calendar.prototype.createCSS = function()
{
	var vCode = "";
	
	vCode += "<style type=\"text/css\">\n";
	vCode += "body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #333333; background-color: #ffffff; margin: 0px }\n";
	vCode += "table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #333333 }\n";
	vCode += "td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #333333 }\n";
	vCode += "b { font-weight: bold }\n";
	vCode += "a:link { color: #003399; text-decoration: underline; font-weight: bold }\n";
	vCode += "a:visited { color: #003399; text-decoration: underline; font-weight: bold }\n";
	vCode += "a:active { color: #003399; text-decoration: underline; font-weight: bold }\n";
	vCode += "a:hover { color: #0000FF; text-decoration: underline; font-weight: bold }\n";
	vCode += ".header-tool { background-color: #006699; font-size: 12px; color: #ffffff; font-weight: bold }\n";
	vCode += ".calBorder { background-color: #bcd9e4}\n";
	vCode += ".calHeader { color: #006699; background-color: #bcd9e4 }\n";
	vCode += ".calBody { background-color: #ffffff }\n";
	vCode += ".calMonth { font-size: 12px }\n";
	vCode += "a.nav:link { color: #003399; text-decoration: underline; font-weight: bold }\n";
	vCode += "a.nav:visited { color: #003399; text-decoration: underline; font-weight: bold }\n";
	vCode += "a.nav:active { color: #003399; text-decoration: underline; font-weight: bold }\n";
	vCode += "a.nav:hover { color: #0000FF; text-decoration: underline; font-weight: bold }\n";
	vCode += ".invalid { color: #cccccc }\n";
	vCode += ".today { color: #ff3333 }\n";
	vCode += "</style>\n";
	
	return vCode;
}

Calendar.prototype.cal_header = function() 
{
	var vCode = "";
	
	vCode += "<tr>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Sun</td>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Mon</td>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Tue</td>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Wed</td>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Thu</td>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Fri</td>\n";
	vCode += "<td width=\"14%\" align=\"center\" class=\"calHeader\">Sat</td>\n";
	vCode += "</tr>\n";
	
	return vCode;
}

Calendar.prototype.cal_data = function() 
{
	var vDate = new Date();
	vDate.setDate(1);
	
	vDate.setMonth(this.gMonth);
	vDate.setFullYear(this.gYear);
	
	var rightNow = new Date();
	var msDay = 86400000;
	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 += "<tr>\n";
	for (i = 0; i < vFirstDay; i++) {
		vCode += "<td width=\"14%\" class=\"calBody\">&#160;</td>\n";
	}
	
	// Write rest of the 1st week
	for (j = vFirstDay; j < 7; j++) {
		vCode += "<td width=\"14%\" align=\"right\" class=\"calBody\">";
		var checkDay = new Date(this.gYear, this.gMonth, vDay);
		
		if ((checkDay.getFullYear() <= 2012) && (checkDay.getFullYear() >= 2004)) {
			vCode += "<a href=\"#\" ";
			if (this.gTarget != -1) {
				vCode += "onClick=\"self.opener.checkDate(self.opener.localForm,'" + this.format_data(vDay);
				vCode += "','"+this.gReturnItem+"',"+this.gTarget+");" + " window.close();\">" + this.format_day(vDay) + "</a>";
			} else {
				vCode += "onClick=\"self.opener.checkDate(self.opener.localForm,'"+this.format_data(vDay);
				vCode += "','"+this.gReturnItem+"','null');" + " window.close();\">" + this.format_day(vDay) + "</a>";
			}
		} else {
			vCode += "<span class=\"invalid\">" + this.format_day(vDay) + "</span>";
		}
		vCode += "</td>\n"; 
		vDay++;
	}
	vCode += "</tr>\n";
	
	// Write the rest of the weeks
	for (k = 2; k < 7; k++) {
		vCode += "<tr>\n";
		for (j = 0; j < 7; j++) {
			vCode += "<td width=\"14%\" align=\"right\" class=\"calBody\">";
			var checkDay = new Date(this.gYear, this.gMonth, vDay);
			
			if ((checkDay.getFullYear() <= 2012) && (checkDay.getFullYear() >= 2004)) {
				vCode += "<a href=\"#\" ";
				if (this.gTarget != -1) {
					vCode += "onClick=\"self.opener.checkDate(self.opener.localForm,'"+this.format_data(vDay)+"','"+this.gReturnItem+"',"+this.gTarget+");" + " window.close();\">" + this.format_day(vDay) + "</a>";
				} else {
					vCode += "onClick=\"self.opener.checkDate(self.opener.localForm,'"+this.format_data(vDay)+"','"+this.gReturnItem+"','null');" + " window.close();\">" + this.format_day(vDay) + "</a>";
				}
			} else {
				vCode += "<span class=\"invalid\">" + this.format_day(vDay) + "</span>";
			}
			
			vCode += "</td>\n"; 
			vDay++;
				 
			if (vDay > vLastDay) {
				vOnLastDay = 1;
				break;
			}
		}
		
		if (j == 6)
			vCode += "</tr>\n";
		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++) {
		vCode += "<td width=\"14%\" class=\"calBody\">&#160;</td>\n";
	}
	vCode += "</tr>";
	
	return vCode;
}

Calendar.prototype.format_day = function(vday) 
{
	var vNowDay = gNow.getDate();
	var vNowMonth = gNow.getMonth();
	var vNowYear = gNow.getFullYear();

	if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear) {
		return ("<span class=\"today\"><b>" + vday + "</b></span>");
	} else {
		return (vday);
	}
}

Calendar.prototype.format_data = function(p_day) 
{
	var vData;
	var vMonth = this.gMonth + 1;
	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 = new String(this.gYear.substring(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\/MON\/YYYY" :
			vData = vDD + "\/" + vMon + "\/" + vY4;
			break;
		case "DD\/MON\/YY" :
			vData = vDD + "\/" + vMon + "\/" + vY2;
			break;
		case "DD-MON-YYYY" :
			vData = vDD + "-" + vMon + "-" + vY4;
			break;
		case "DD-MON-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;

		default :
			vData = vMonth + "\/" + vDD + "\/" + vY4;
	}
	return vData;
}

function Build(p_item, p_month, p_year, p_format, p_target) 
{
	var p_WinCal = ggWinCal;
	gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format, p_target);

	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_target : position of form in document order
	*/

	p_item = arguments[0];
	if (arguments[1] == "" || 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];
	if (arguments[3] == null)
		p_format = "MM/DD/YYYY";
	else
		p_format = arguments[3];
	if (arguments[4] == null) {
		p_target = -1;
	} else {
		p_target = arguments[4];
	}

	if (isNav) {
		vWinCal = window.open("", "Calendar", "width=500,height=245,status=no,resizable=yes,top=200,left=200");
	} else {
		vWinCal = window.open("", "Calendar", "width=500,height=240,status=no,resizable=yes,top=200,left=200");
	}
		
	vWinCal.opener = self;
	ggWinCal = vWinCal;

	Build(p_item, p_month, p_year, p_format, p_target);
}


function show_calendar1() 
{
	/* 
		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_target : position of form in document order
	*/


	p_item = arguments[0];
	if (arguments[1] == ""|| 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];
	if (arguments[3] == null)
		p_format = "MM/DD/YYYY";
	else
		p_format = arguments[3];
	if (arguments[4] == null) {
		p_target = -1;
	} else {
		p_target = arguments[4];
	}

	if (isNav) {
		vWinCal = window.open("", "Calendar", "width=500,height=245,status=no,resizable=yes,top=200,left=200");
	} else {
		vWinCal = window.open("", "Calendar", "width=500,height=240,status=no,resizable=yes,top=200,left=200");
	}
		
	vWinCal.opener = self;
	ggWinCal = vWinCal;

	Build(p_item, p_month, p_year, p_format, p_target);
}



