<!--
/*
Title: Timestamp picker
Description: See the demo at url
URL: http:us.geocities.com/tspicker/
Script featured on: http:javascriptkit.com/script/script2/timestamp.shtml
Version:	1.0
Date:			12-05-2001 (mm-dd-yyyy)
Author:		Denis Gritcyuk <denis@softcomplex.com>; <tspicker@yahoo.com>
Notes:		Permission given to use this script in any kind of applications if
					header lines are left unchanged. Feel free to contact the author
					for feature requests and/or donations
Version:	1.01 (ABX implementation)
Date:			05-01-2002
Author:		Airborne Express Development
Notes:		Revised for airborne.com usage.
*/

	var gintIntervalID, gstrFromDateLast, gstrToDateLast;
	var gstrImagesPath  // added for UI Redesign Project
	
	function getCalendar(istrForm, istrHdnField, iblnFutureMode){
		// High-level calendar retrieval function.
		
		gstrImagesPath = document.form.hdnImagesPath.value; // added for UI Redesign Project
		
		if (istrHdnField == "from"){
			istrForm += ".hdnDateFrom";
		}
		else if (istrHdnField == "to"){
			istrForm += ".hdnDateTo";
		}
		else{
			istrForm += ".hdnDate";
		}
		if (iblnFutureMode){
			showCalendarFutureY("document." + istrForm, getHiddenDate(istrHdnField));
		}
		else{
			showCalendarFutureN("document." + istrForm, getHiddenDate(istrHdnField));
		}
		gintIntervalID = window.setInterval("checkForNewDate()", 500);
	}

	function showCalendarFutureY(istrTarget, istrDateTime){
		// Detail-level calendar engine.
		// and V var astrMonths				= ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
		// and V var astrWeekdays			= ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
		var astrMonths				= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
		var astrWeekdays			= ["S", "M", "T", "W", "T", "F", "S"];
		
		var intFirstDayOfWeek	= 0;
		var strFontWhtXs			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"1\">";
		// var strFontWhtSm			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"2\">";
		var strFontWhtSm			= "<font color=\"#000000\" face=\"arial, helvetica, sans-serif\" size=\"1\">";
		
		var strFontWhtLg			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"4\">";
		// var strFontBlkSm			= "<font color=\"#000000\" face=\"arial, helvetica, sans-serif\" size=\"2\">";
		var strFontBlkSm            = "<style face=\"arial\" type=\"text/css\">a.linkClass{COLOR: #000000;TEXT-DECORATION: none;FONT-SIZE: 11px}a.linkClass:hover{COLOR: #cc0000;TEXT-DECORATION: none;FONT-SIZE: 11px}A{COLOR: #cc0000;TEXT-DECORATION: none}A:hover{COLOR: #cc0000;TEXT-DECORATION: underline}</style>" //and V
		
		var strFontDkBlk			= "<font color=\"#000000\" style=\"FONT-WEIGHT: 600;TEXT-DECORATION: 'none'\" face=\"arial\" fontsize=\"10\"  style=\"FONT-WEIGHT: 'bold';FONT-SIZE: '11px'\" size=\"2\">";  //and V
		var strFontLtBlk			= "<font color=\"#000000\" face=\"arial\" style=\"FONT-SIZE: 12px;TEXT-DECORATION:none;\" size=\"1\">";                 //and V
		var strFontDis				= "<font color=\"#000000\" style=\"TEXT-DECORATION: 'none'\" face=\"arial\" style=\"FONT-WEIGHT: 'normal';FONT-SIZE: '11px'\" size=\"1\">";                 //and V 
		
		// var strFontGrySm			= "<font color=\"#999999\" face=\"arial, helvetica, sans-serif\" size=\"2\">";
		var strFontGrySm			= "<font color=\"#999999\" style=\"TEXT-DECORATION: 'none' face=\"arial\" style=\"FONT-WEIGHT: 'normal';FONT-SIZE: '11px'\" size=\"1\">"; //and V
		
		var intCounter				= 0

		// If input is null/blank, set new date, else validate input
		var dteDateTime = (((istrDateTime == null) || (istrDateTime == "")) ?  new Date() : stringToDate(istrDateTime));
		// Set previous month
		var dteMonthPrev = new Date(dteDateTime);
		dteMonthPrev.setMonth(dteDateTime.getMonth() - 1);
		// Set next month
		var dteMonthNext = new Date(dteDateTime);
		dteMonthNext.setMonth(dteDateTime.getMonth() + 1);
		// Set first day of month
		var dteDayFirst = new Date(dteDateTime);
		dteDayFirst.setDate(1);
		dteDayFirst.setDate(1 - (7 + dteDayFirst.getDay() - intFirstDayOfWeek) % 7);
		// Set last day of month
		var dteDayLast = new Date(dteMonthNext);
		dteDayLast.setDate(0);
		// Set today
		var dteDayToday = new Date(dteDayFirst);
			
		// Monthname/nav header
		var strTemp = new String (
			"<html>\n<head>\n	<title>DHL - Calendar</title>\n</head>\n" +
		//and V	"<body bgcolor=\"#f9f9f2\">\n" +
			"<body bgcolor=\"#ffffff\"  leftmargin='0' rightmargin='0' topmargin='0' marginheight='0' marginwidth='0'>\n" + //and V
			
			"<table cellspacing=\"0\" border=\"0\" width=\"100%\">\n" +
		//and V	"<tr>\n<td bgcolor=\"#cc0000\">\n" +
			"<tr>\n<td bgcolor=\"#ffffff\" style=\"border:solid 3px #cc0000;width=142px\">\n" + // and V
			
		//and V	"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n" +
			"<table cellspacing=\"1\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n<tr>\n"  + //and V
			
			
		//and V	"<tr>\n	<td bgcolor=\"#cc0000\"><a href=\"javascript:window.opener.showCalendarFutureY('" +
			"<tr>\n	<td bgcolor=\"#ffffff\" valign=\"top\" align\"left\" rowspan=\"30\" width='12'><a href=\"javascript:window.opener.showCalendarFutureY('" + // and V
		 
			istrTarget + "', '" + dateToDateString(dteMonthPrev) + "');\">" +
			
		// and V	strFontWhtLg + "<b>&#171;</b></font></a></td>\n" +
			strFontWhtLg + "<img src='"+ gstrImagesPath + "/btn_arrow_cal_left.gif' alt='' border='0'>" + "</a></td>\n" + 
		
		// and V	"	<td bgcolor=\"#cc0000\" colspan=\"5\" align=\"middle\">" +
			"	<td bgcolor=\"#ffcc00\" height='11' colspan=\"7\" align=\"middle\">" + // and V
		
		// and V	strFontWhtSm + "<b>" +
			 strFontDkBlk + 		
		
			astrMonths[dteDateTime.getMonth()] + " " + dteDateTime.getFullYear() + "</b></font></td>\n" +
			
		// and V	"	<td bgcolor=\"#cc0000\" align=\"right\" ><a href=\"javascript:window.opener.showCalendarFutureY('" +
			"	<td bgcolor=\"#ffffff\" align=\"right\" width='12'><a href=\"javascript:window.opener.showCalendarFutureY('" + // and V
			
			istrTarget + "', '" + dateToDateString(dteMonthNext) + "');\">" +
		// and V  strFontWhtLg + "<b>&#187;</b></font></a></td>\n</tr>\n"
		strFontWhtLg + "<img src='"+ gstrImagesPath + "/btn_arrow_cal_right.gif' alt='' border='0'>" + "</a></td>\n</tr>\n"  // and V
		
		
		);

		// Weekday header
		strTemp += "<tr>\n";
		for (var n = 0; n < 7; n++)
		// and V	strTemp += "	<td bgcolor=\"#ebebe0\" align=\"middle\">" + strFontBlkSm +
		// and V	"<b>" + astrWeekdays[(intFirstDayOfWeek + n)%7] + "</b></font></td>\n";
		
		strTemp += "	<td bgcolor=\"#ffffff\" align=\"center\">" + strFontLtBlk +  // and V	
			    astrWeekdays[(intFirstDayOfWeek + n)%7] + "</font></td>\n";			 // and V	
		
		
		// Grey line after Header // and V
		 strTemp += "</tr>\n";
		 strTemp+= "<tr style='BACKGROUND-COLOR: #cccccc'><td style=\"color=\"#000000\"\" colspan='7'><img src='" + gstrImagesPath + "/blank.gif' alt='' border='0' width='' height=''></td></tr>"
	
		// Detail rows
		strTemp += "</tr>\n";
		while (dteDayToday.getMonth() == dteDateTime.getMonth() ||
			dteDayToday.getMonth() == dteDayFirst.getMonth()){
			strTemp += "<tr>\n";
			for (var intWeekdayToday = 0; intWeekdayToday < 7; intWeekdayToday++){
					if (dteDayToday.getDate() == dteDateTime.getDate() &&
						dteDayToday.getMonth() == dteDateTime.getMonth())
						// Current date
					
					// and V	strTemp += "	<td bgcolor=\"#cc0000\" align=\"right\">";
						strTemp += "	<td bgcolor=\"#FFFFCC\" style=\"border:solid 1px #cc0000;\" align=\"center\">"; // and V
						
					else if (dteDayToday.getDay() == 0 || dteDayToday.getDay() == 6)
						// Weekends
					// and V	strTemp += "	<td bgcolor=\"#ebebe0\" align=\"right\">";
						strTemp += "	<td bgcolor=\"#ffffff\" align=\"center\">";			// and V
					
					else
						// Weekdays
					// and V	strTemp += "	<td bgcolor=\"#ffffff\" align=\"right\">";
						strTemp += "	<td bgcolor=\"#ffffff\" align=\"center\">"; // and V
						
					if (dteDayToday.getMonth() == dteDateTime.getMonth()){
						// Current month's days
						strTemp += 
					// and V	"<a href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">";
					"<a class=\"linkClass\" href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">"; // and V
					
						if (dteDayToday.getDate() == dteDateTime.getDate()){
							strTemp += strFontWhtSm;
						}
						else{
							strTemp += strFontBlkSm;
						}
					}
					else{
						// Prev/next months' days
						strTemp += 
						"<a href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">" + strFontGrySm;
					}
					// and V strTemp += "<b>" + dteDayToday.getDate()+"</b></font></a></td>\n";
					 strTemp +=  dteDayToday.getDate()+"</font></a></td>\n";
					 
					dteDayToday.setDate(dteDayToday.getDate() + 1);
			}
			strTemp += "</tr>\n";
			intCounter++
		}
		
		// Grey line after details // and V
		strTemp += "</tr>\n";
		strTemp+= "<tr style='BACKGROUND-COLOR: #cccccc'><td style=\"color=\"#000000\"\" colspan='7'><img src='" + gstrImagesPath + "/blank.gif' alt='' border='0' width='' height='1'></td></tr>"
		
		
		// Footer
		if (intCounter < 6){
			strTemp +=
				// and V "<tr>\n<td bgcolor=\"#ffffff\" colspan=\"7\">" + strFontWhtSm + "&nbsp;</font></td>\n</tr>\n" + 
				// and V "<tr>\n<td colspan=\"7\" align=\"middle\"><a href=\"javascript:window.close();\">" + strFontWhtXs + "close window</font></td>\n</tr>\n";
				
				"<tr style='BACKGROUND-COLOR: #ffffff'><td style=\"color=\"#000000\"\" colspan='7'><img src='" + gstrImagesPath + "/blank.gif' alt='' border='0' width='' height='12'></td></tr>" +  // and V
				"<tr>\n<td bgcolor=\"#ffffff\" colspan=\"7\" align=\"middle\"><img src='"+ gstrImagesPath + "/g_arrow_red.gif' alt='' border='0'>&nbsp;<a href=\"javascript:window.close();\" style=\"FONT-SIZE: 7pt;face=arial, helvetica, sans-serif\">"  + "Cancel</a></font></td>\n</tr>\n"; // and V
				
		}
		else{
			strTemp +=
				// and V "<tr>\n<td colspan=\"7\" align=\"middle\"><a href=\"javascript:window.close();\">" + strFontWhtXs + "close window</font></td>\n</tr>\n";
				"<tr>\n<td bgcolor=\"#ffffff\" colspan=\"7\" align=\"middle\"><img src='"+ gstrImagesPath + "/g_arrow_red.gif' alt='' border='0'>&nbsp;<a href=\"javascript:window.close();\" style='FONT-SIZE: 7pt;face=arial, helvetica, sans-serif'>"  + "Cancel</a></font></td>\n</tr>\n";  // and V
		}
		strTemp +=
			"</table>\n" +
			"</td>\n</tr>\n</table>\n" +
			"</body>\n" +
			"</html>\n";

		// and V var objWin		= window.open("", "Calendar", "width=200,height=250,status=no,resizable=no,top=200,left=200");
		var objWin		= window.open("", "Calendar", "width=150,height=159,status=no,resizable=no,top=200,left=200");  // and V
		
		objWin.opener	= self;
		objWin.focus();
		var objDoc		= objWin.document;
		objDoc.write (strTemp);
		objDoc.close();
	}

	function showCalendarFutureN(istrTarget, istrDateTime){
		// Detail-level calendar engine.
		var astrMonths				= ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
		var astrWeekdays			= ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
		var intFirstDayOfWeek	= 0;
		var strFontWhtXs			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"1\">";
		var strFontWhtSm			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"2\">";
		var strFontWhtLg			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"4\">";
		var strFontBlkSm			= "<font color=\"#000000\" face=\"arial, helvetica, sans-serif\" size=\"2\">";
		var strFontGrySm			= "<font color=\"#999999\" face=\"arial, helvetica, sans-serif\" size=\"2\">";
		var intCounter				= 0

		// If input is null/blank, set new date, else validate input
		var dteDateTime = (((istrDateTime == null) || (istrDateTime == "")) ?  new Date() : stringToDate(istrDateTime));
		// Set previous month
		var dteMonthPrev = new Date(dteDateTime);
		dteMonthPrev.setMonth(dteDateTime.getMonth() - 1);
		// Set next month
		var dteMonthNext = new Date(dteDateTime);
		dteMonthNext.setMonth(dteDateTime.getMonth() + 1);
		// Set first day of month
		var dteDayFirst = new Date(dteDateTime);
		dteDayFirst.setDate(1);
		dteDayFirst.setDate(1 - (7 + dteDayFirst.getDay() - intFirstDayOfWeek) % 7);
		// Set last day of month
		var dteDayLast = new Date(dteMonthNext);
		dteDayLast.setDate(0);
		// Set today
		var dteDayToday = new Date(dteDayFirst);
		// Set global today
		var dteDayCurrent = new Date();
			
		// Monthname/nav header
		var strTemp = new String (
			"<html>\n<head>\n	<title>DHL - Calendar</title>\n</head>\n" +
			"<body bgcolor=\"#f9f9f2\">\n" +
			"<table cellspacing=\"0\" border=\"0\" width=\"100%\">\n" +
			"<tr>\n<td bgcolor=\"#cc0000\">\n" +
			"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n<tr>\n"
		);
		
		if (dteDayToday.getYear() == (dteDayCurrent.getYear() - 2)){
			strTemp += " <td bgcolor=\"#cc0000\">&nbsp;</td>\n";
		}
		else{
			strTemp +=
				" <td bgcolor=\"#cc0000\"><a href=\"javascript:window.opener.showCalendarFutureN('" +
				istrTarget + "', '" + dateToDateString(dteMonthPrev) + "');\">" +
				strFontWhtLg + "<b>&#171;</b></font></a></td>\n";
		}
		strTemp +=
			"	<td bgcolor=\"#cc0000\" colspan=\"5\" align=\"middle\">" +
			strFontWhtSm + "<b>" +
			astrMonths[dteDateTime.getMonth()] + " " + dteDateTime.getFullYear() + "</b></font></td>\n";
			
		if ((dteDayCurrent.getMonth() == dteDateTime.getMonth()) && (dteDayCurrent.getYear() == dteDateTime.getYear())){
			strTemp += " <td bgcolor=\"#cc0000\">&nbsp;</td>\n</tr>\n";
		}
		else{
			strTemp += 
				"	<td bgcolor=\"#cc0000\" align=\"right\"><a href=\"javascript:window.opener.showCalendarFutureN('" +
				istrTarget + "', '" + dateToDateString(dteMonthNext) + "');\">" +
				strFontWhtLg + "<b>&#187;</b></font></a></td>\n</tr>\n";
		}

		// Weekday header
		strTemp += "<tr>\n";
		for (var n = 0; n < 7; n++)
			strTemp += "	<td bgcolor=\"#ebebe0\" align=\"middle\">" + strFontBlkSm +
			"<b>" + astrWeekdays[(intFirstDayOfWeek + n)%7] + "</b></font></td>\n";
			
		// Detail rows
		strTemp += "</tr>\n";
		while (dteDayToday.getMonth() == dteDateTime.getMonth() ||
			dteDayToday.getMonth() == dteDayFirst.getMonth()){
			strTemp += "<tr>\n";
			for (var intWeekdayToday = 0; intWeekdayToday < 7; intWeekdayToday++){
					if (dteDayToday.getDate() == dteDateTime.getDate() &&
						dteDayToday.getMonth() == dteDateTime.getMonth())
						// Current date
						strTemp += "	<td bgcolor=\"#cc0000\" align=\"right\">";
					else if (dteDayToday.getDay() == 0 || dteDayToday.getDay() == 6)
						// Weekends
						strTemp += "	<td bgcolor=\"#ebebe0\" align=\"right\">";
					else
						// Weekdays
						strTemp += "	<td bgcolor=\"#ffffff\" align=\"right\">";

					if (dteDayToday.getMonth() == dteDateTime.getMonth()){
						// Current month's days
						if ((dteDayToday.getMonth() == dteDayCurrent.getMonth()) && (dteDayToday.getDate() > dteDayCurrent.getDate())){
							strTemp += strFontBlkSm + "<b>" + dteDayToday.getDate() + "</b></font></td>\n";
						}
						else{
							strTemp += 
							"<a href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">";
							if (dteDayToday.getDate() == dteDateTime.getDate()){
								strTemp += strFontWhtSm;
							}
							else{
								strTemp += strFontBlkSm;
							}
							strTemp += "<b>" + dteDayToday.getDate() + "</b></font></a></td>\n";
						}
					}
					else if (((dteDayToday.getMonth() > dteDayCurrent.getMonth()) && (dteDayToday.getYear() >= dteDayCurrent.getYear())) || ((dteDayToday.getMonth() < dteDayCurrent.getMonth()) && (dteDayToday.getYear() > dteDayCurrent.getYear()))){
						// Next month's days
						strTemp += strFontGrySm + "<b>" + dteDayToday.getDate() + "</b></font></td>\n";
					}
					else if (dteDayToday.getYear() == (dteDayCurrent.getYear() - 2)){
						// Disable dates with years two years prior
						strTemp += strFontGrySm + "<b>" + dteDayToday.getDate() + "</b></font></td>\n";
					}
					else{
						strTemp += "<a href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">" + strFontGrySm + 
						"<b>" + dteDayToday.getDate() + "</b></font></a></td>\n";
					}
					dteDayToday.setDate(dteDayToday.getDate() + 1);
			}
			strTemp += "</tr>\n";
			intCounter++
		}
		// Footer
		if (intCounter < 6){
			strTemp +=
				"<tr>\n<td bgcolor=\"#ffffff\" colspan=\"7\">" + strFontWhtSm + "&nbsp;</font></td>\n</tr>\n" + 
				"<tr>\n<td colspan=\"7\" align=\"middle\"><a href=\"javascript:window.close();\">" + strFontWhtXs + "close window</font></td>\n</tr>\n";
		}
		else{
			strTemp +=
				"<tr>\n<td colspan=\"7\" align=\"middle\"><a href=\"javascript:window.close();\">" + strFontWhtXs + "close window</font></td>\n</tr>\n";
		}
		strTemp +=
			"</table>\n" +
			"</td>\n</tr>\n</table>\n" +
			"</body>\n" +
			"</html>\n";

		var objWin		= window.open("", "Calendar", "width=200,height=235,status=no,resizable=no,top=200,left=200");
		objWin.opener	= self;
		objWin.focus();
		var objDoc		= objWin.document;
		objDoc.write (strTemp);
		objDoc.close();
	}

	function checkForNewDate(){
		// Checks whether hidden date field values have changed and updates the <select> elements appropriately.
		var strToMonth, strToDay, strToYear;
		var strFromMonth, strFromDay, strFromYear;
		var MonthPattern		= /^\d+/;
		var Day1Pattern			= /\/\d+\//;
		var Day2Pattern			= /\d+/;
		var YearPattern			= /\d{4}$/;
		//var strFromDate			= document.form.hdnDateFrom.value;
		var strToDate				= document.form.hdnDateTo.value;

		
		if ((strToDate != "") && (gstrToDateLast != strToDate)){
			if (MonthPattern.test(strToDate)){
				strToMonth = MonthPattern.exec(strToDate)[0];
			}
			if (Day1Pattern.test(strToDate)){
				strToDay = Day1Pattern.exec(strToDate)[0];
				strToDay = Day2Pattern.exec(strToDay)[0];
			}
			if (YearPattern.test(strToDate)){
				strToYear = YearPattern.exec(strToDate)[0];
			}
			changeSelectedOption("F10078A", strToDay);
			changeSelectedOption("F10078B", strToMonth);
			changeSelectedOption("F10078C", strToYear);
			gstrToDateLast = strToDate;
		}
	}

	function changeSelectedOption(istrElementName, istrValue){
		// Assigns input value to <select> form element.
		var objSel = eval("document.form." + istrElementName);
					
		for (var i = 0; i < objSel.options.length; i++){
			if(istrValue == objSel.options[i].value){
				objSel.options[i].selected = true;
			}
		}
	}

	function getHiddenDate(istrHdnField){
		// Returns value of "from" or "to" hidden date field.
		var objForm	= document.form;
		// alert (objForm);
		if (istrHdnField == 'from'){
			return objForm.selFromMonth.options[objForm.selFromMonth.selectedIndex].value + "/" + 
				objForm.selFromDay.options[objForm.selFromDay.selectedIndex].value + "/" + 
				objForm.selFromYear.options[objForm.selFromYear.selectedIndex].value;
		}
		else if (istrHdnField == "to"){
			return objForm.F10078B.options[objForm.F10078B.selectedIndex].value + "/" + 
				objForm.F10078A.options[objForm.F10078A.selectedIndex].value + "/" + 
				objForm.F10078C.options[objForm.F10078C.selectedIndex].value;
		}
		else{
			return objForm.selMonth.options[objForm.selMonth.selectedIndex].value + "/" + 
				objForm.selDay.options[objForm.selDay.selectedIndex].value + "/" + 
				objForm.selYear.options[objForm.selYear.selectedIndex].value;
		}
	}

	function getHiddenDate_new(istrHdnField){
		// Returns value of "from" or "to" hidden date field.
		var objForm	= document.form;
		if (istrHdnField == 'from'){
			return objForm.selFromMonth.options[objForm.selFromMonth.selectedIndex].value + "/" + 
				objForm.selFromDay.options[objForm.selFromDay.selectedIndex].value + "/" + 
				objForm.selFromYear.options[objForm.selFromYear.selectedIndex].value;
		}
		else if (istrHdnField == "to"){
			return objForm.selToMonth.options[objForm.selToMonth.selectedIndex].value + "/" + 
				objForm.selToDay.options[objForm.selToDay.selectedIndex].value + "/" + 
				objForm.selToYear.options[objForm.selToYear.selectedIndex].value;
		}
		else{
			return objForm.selMonth.options[objForm.selMonth.selectedIndex].value + "/" + 
				objForm.selDay.options[objForm.selDay.selectedIndex].value + "/" + 
				objForm.selYear.options[objForm.selYear.selectedIndex].value;
		}
	}

	// Date formatting/parsing functions.
	function stringToDate(istrDateTime){
		var dteTemp;
		var dteLast = new Date();			// added for UI Redesign Project
		var dteToday		= new Date();
		var regExpDate	= /^(\d+)\/(\d+)\/(\d+)$/;
		if (!regExpDate.exec(istrDateTime))
			return alert("Invalid Date: " + istrDateTime);
		dteTemp					= new Date(RegExp.$3, RegExp.$1-1, RegExp.$2);
	
	//	if (dteTemp > dteToday){  // commented to allow future dates - start
	//		return dteToday;
	//	}
	//	else{
	//		return dteTemp;
	//	}						  // commented to allow future dates - end	
	
	// added to prevent earlier year and future year - Start
		if ((dteTemp.getYear() < dteToday.getYear())||(dteTemp.getYear() > (dteToday.getYear() + 1)) ){
			 if ((dteTemp.getYear() > (dteToday.getYear() + 1))){
			 dteLast.setMonth(dteTemp.getMonth() + 23 )
			 return dteLast;
			 }
			return dteToday;
		}
		else{
			
			return dteTemp;
		}	
	// added to prevent earlier year and future year  - End		
	}
	function dateToDateString(dteDateTime){
		return (new String((dteDateTime.getMonth() + 1) + "/" + (dteDateTime.getDate()) + "/" + (dteDateTime.getFullYear())));
	}

//-->