
function setFormDates(month, year, day)
{
	var select_arrMnthYr_length = document.resLauncher.arrMnthYr.options.length;
	var select_arrMnthYr_index = 0;
	
	var arrMnthYr_date = new Date(year, month, 01);
	
	for (m = 0; m < select_arrMnthYr_length; m++)
	{
		var select_arrMnthYr = document.resLauncher.arrMnthYr.options[m].value;
		
		if (arrMnthYr_date == select_arrMnthYr)
		{
			select_arrMnthYr_index = m;
		}
	}
	
	document.resLauncher.arrMnthYr.selectedIndex = select_arrMnthYr_index;
	
	setDates(true);
	
	// set Day
	
	var select_arrDay_length = document.resLauncher.arrDay.options.length;
	var select_arrDay_index = 0;
	
	var arrDay_date = new Date(year, month, day);
	
	for (d = 0; d < select_arrDay_length; d++)
	{
		var select_arrDay = document.resLauncher.arrDay.options[d].value;
		
		if (arrDay_date == select_arrDay)
		{
			select_arrDay_index = d;
		}
	}
	
	document.resLauncher.arrDay.selectedIndex = select_arrDay_index;
	
	setDates(false);
}

function calePopUp(width, height)
{
	// get the selected month & date values

	// Month/Year
	var selmnthYr = new Date(document.resLauncher.arrMnthYr.options[document.resLauncher.arrMnthYr.selectedIndex].value);
	var selMnth = selmnthYr.getMonth();
	var selYear = selmnthYr.getFullYear();
	// Day
	var seldt = new Date(document.resLauncher.arrDay.options[document.resLauncher.arrDay.selectedIndex].value);
	var selDay = seldt.getDate();
	
	// form the calendar url with variables to be passed in order to open the calendar
	// to the month,year,date that is set on this form.
	
	var winURL = "cal.html?var_month=" + selMnth + "&var_year=" + selYear + "&var_day=" + selDay;
	
	// open popup
	
	window.open(winURL,"winCale","toolbar=no,location=no,status=no,directories=no,width=" +width+ ",height=" +height+ ",scrollbars=no,resizable=no,left="+(winX+winOffsetY)+",top="+(winY+winOffsetY));
}

if (isN4 || isN6) 
{
  document.captureEvents(Event.CLICK);
}
document.onclick = mouseClick;


