<!--
/*
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
	
	function getCalendar(istrForm, istrHdnField, iblnFutureMode){
		// High-level calendar retrieval function.
		
		gstrImagesPath = document.frmSigByNbr.hdnImagesPath.value;
		
		if (istrHdnField == "from"){
			istrForm += ".hdnDateFrom";
		}
		else if (istrHdnField == "to"){
			istrForm += ".hdnDateTo";
		}
		else{
			istrForm += ".hdnDate";
		}
		if (iblnFutureMode){
			showCalendarFutureY("document." + istrForm, getHiddenDate_new(istrHdnField));
		}
		else{
			showCalendarFutureN("document." + istrForm, getHiddenDate_new(istrHdnField));
		}
		gintIntervalID = window.setInterval("checkForNewDate()", 500);
	}

	function showCalendarFutureY(istrTarget, istrDateTime){
		// Detail-level calendar engine.
		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 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=\"2\">";
		
		var strFontWhtLg			= "<font color=\"#ffffff\" face=\"arial, helvetica, sans-serif\" size=\"4\">";
		var strFontLtBlk			= "<font color=\"#000000\" style=\"TEXT-DECORATION: 'none'\" face=\"arial\" style=\"FONT-WEIGHT: 'normal';FONT-SIZE: '11px'\" size=\"1\">";
		
		var strFontBlkSm			= "<font color=\"#000000\" size=\"1\">";
		var strFontGrySm			= "<font color=\"#999999\" face=\"arial, helvetica, sans-serif\" size=\"1\">";
		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" +
			"<body bgcolor=\"#f9f9f2\">\n" +
			"<table cellspacing=\"0\" border=\"0\" width=\"100%\">\n" +
			"<tr>\n<td bgcolor=\"#cc0000\">\n" +
			"<table cellspacing=\"1\" cellpadding=\"2\" border=\"1\" width=\"100%\">\n" +
			"<tr>\n	<td bgcolor=\"#ffffff\"><a href=\"javascript:window.opener.showCalendarFutureY('" +
			istrTarget + "', '" + dateToDateString(dteMonthPrev) + "');\">" +
			strFontWhtLg + "<b>&#171;</b></font></a></td>\n" +
			"	<td bgcolor=\"#cc0000\" colspan=\"5\" align=\"middle\" height=\"10\">" +
			strFontWhtSm + "<b>" +
			astrMonths[dteDateTime.getMonth()] + " " + dteDateTime.getFullYear() + "</b></font></td>\n" +
			"	<td bgcolor=\"#ffffff\" align=\"right\"><a href=\"javascript:window.opener.showCalendarFutureY('" +
			istrTarget + "', '" + dateToDateString(dteMonthNext) + "');\">" +
			 strFontWhtLg + "<b>&#187;</b></font></a></td>\n</tr>\n"
			//strFontWhtLg + "<img src='"+ gstrImagesPath + "/btn_arrow_cal_left.gif' alt='' border='0'>" + "</a></td>\n</tr>\n";
		);

		// Weekday header
		strTemp += "<tr>\n";
		for (var n = 0; n < 7; n++)
			strTemp += "	<td bgcolor=\"#ffffff\" align=\"middle\">" + strFontLtBlk +
			"<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=\"#ffffff\" align=\"right\">";
					else
						// Weekdays
						strTemp += "	<td bgcolor=\"#ffffff\" align=\"right\">";

					if (dteDayToday.getMonth() == dteDateTime.getMonth()){
						// Current month's days
						strTemp += 
						"<a class=\"linkClass\" href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">";
						if (dteDayToday.getDate() == dteDateTime.getDate()){
							strTemp += strFontWhtSm;
						}
						else{
							strTemp += strFontBlkSm;
						}
					}
					else{
						// Prev/next months' days
						strTemp += 
						"<a class=\"linkClass\" href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">" + strFontGrySm;
					}
					strTemp += "<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=170,height=250,status=no,resizable=no,top=200,left=200");
		objWin.opener	= self;
		objWin.focus();
		var objDoc		= objWin.document;
		objDoc.write (strTemp);
		objDoc.close();
	}

	function showCalendarFutureN(istrTarget, istrDateTime){
		// Detail-level calendar engine.
		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=\"1\">";
		//var strFontBlkSm			= "<font color=\"#000000\" style=\"TEXT-DECORATION: ' none'\" face=\"arial, helvetica, sans-serif\" size=\"1\">";
		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>"
		
		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\">";
		
		//var strFontDkBlk			= "<font color=\"#000000\" style=\"TEXT-DECORATION: 'none'\" face=\"arial\" fontsize=\"10\"  style=\"FONT-WEIGHT: 'bold';FONT-SIZE: '11px'\" size=\"2\">";
		var strFontLtBlk			= "<font color=\"#000000\" style=\"TEXT-DECORATION: 'none'\" face=\"arial\" style=\"FONT-WEIGHT: 'normal';FONT-SIZE: '12px'\" size=\"1\">";
		var strFontDis				= "<font color=\"#000000\" style=\"TEXT-DECORATION: 'none'\" face=\"arial\" style=\"FONT-WEIGHT: 'normal';FONT-SIZE: '11px'\" size=\"1\">";
				
		//var strFontGrySm			= "<font color=\"#999999\" style=\"TEXT-DECORATION: 'none';FONT-WEIGHT: 'normal';FONT-SIZE: '11px'\" face=\"arial, helvetica, sans-serif\" size=\"1\">";
		var strFontGrySm			= "<font color=\"#999999\" style=\"TEXT-DECORATION: 'none' face=\"arial\" style=\"FONT-WEIGHT: 'normal';FONT-SIZE: '11px'\" size=\"1\">";
		
		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" + strFontBlkSm + "</head>\n" +
			"<body bgcolor=\"#ffffff\"  leftmargin='0' rightmargin='0' topmargin='0' marginheight='0' marginwidth='0'>\n" +
			"<table cellspacing=\"0\" border=\"0\" width=\"100%\">\n" +
			"<tr>\n<td bgcolor=\"#ffffff\" style=\"border:solid 3px #cc0000;width=142px\">\n" +
			"<table cellspacing=\"1\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n<tr>\n"
		);
		
		if (dteDayToday.getYear() == (dteDayCurrent.getYear() - 2)){
			//strTemp += " <td bgcolor=\"#cc0000\" height='12'>&nbsp;</td>\n";
			strTemp += " <td bgcolor=\"#ffffff\" rowspan=\"30\" height='12' width='12'><img src='"+ gstrImagesPath + "/blank.gif' alt='' border='0' width='1' height='1'></td>\n";
		}
		else{
			strTemp +=
				" <td bgcolor=\"#ffffff\" valign=\"top\" align\"left\" rowspan=\"30\" width='12'><a href=\"javascript:window.opener.showCalendarFutureN('" +
				istrTarget + "', '" + dateToDateString(dteMonthPrev) + "');\">" +
				// strFontWhtLg + "<b>&#171;</b></font></a></td>\n";
				strFontWhtLg + "<img src='"+ gstrImagesPath + "/btn_arrow_cal_left.gif' alt='' border='0'>" + "</a></td>\n";
				
		}
		strTemp +=
			"	<td bgcolor=\"#ffcc00\" height='11' colspan=\"7\" align=\"middle\">" + 
			  strFontDkBlk + 
			astrMonths[dteDateTime.getMonth()] + " " +  dteDateTime.getFullYear() + "</b></font></td>\n";
			
		if ((dteDayCurrent.getMonth() == dteDateTime.getMonth()) && (dteDayCurrent.getYear() == dteDateTime.getYear())){
			strTemp += " <td bgcolor=\"#ffffff\" width='12'><img src='"+ gstrImagesPath + "/blank.gif' alt='' border='0' width='1' height='1'></td>\n</tr>\n";
		}
		else{
			strTemp += 
				"	<td bgcolor=\"#ffffff\" align=\"right\"  width='12'><a href=\"javascript:window.opener.showCalendarFutureN('" +
				istrTarget + "', '" + dateToDateString(dteMonthNext) + "');\">" +
				// 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";
		}

		// Weekday header
		strTemp += "<tr>\n";
		for (var n = 0; n < 7; n++)
			strTemp += "	<td bgcolor=\"#ffffff\" align=\"center\">" + strFontLtBlk +
			 astrWeekdays[(intFirstDayOfWeek + n)%7] + "</font></td>\n";
		
		// Grey line after Header
		 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
						strTemp += "	<td bgcolor=\"#FFFFCC\" style=\"border:solid 1px #cc0000;\" align=\"center\">";
												
					else if (dteDayToday.getDay() == 0 || dteDayToday.getDay() == 6)
						// Weekends
						strTemp += "	<td bgcolor=\"#ffffff\" align=\"center\">";
					else
						// Weekdays
						strTemp += "	<td bgcolor=\"#ffffff\" align=\"center\">";

					if (dteDayToday.getMonth() == dteDateTime.getMonth()){
						// Current month's days
						if ((dteDayToday.getMonth() == dteDayCurrent.getMonth()) && (dteDayToday.getDate() > dteDayCurrent.getDate())){
							strTemp +=  strFontDis  + dteDayToday.getDate() + "</font></td>\n";
						}
						else{
							strTemp += 
							"<a class=\"linkClass\" href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">";
							if (dteDayToday.getDate() == dteDateTime.getDate()){
								strTemp += "<b>" +  strFontWhtSm + "</b>";
							}
							else{
								strTemp += strFontBlkSm;
							}
							strTemp += dteDayToday.getDate() + "</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 + dteDayToday.getDate() + "</font></td>\n";
					}
					else if (dteDayToday.getYear() == (dteDayCurrent.getYear() - 2)){
						// Disable dates with years two years prior
						strTemp += strFontGrySm +  dteDayToday.getDate() + "</font></td>\n";
					}
					else{
						strTemp += "<a class=\"linkClass\" href=\"javascript:window.opener." + istrTarget + ".value='" + dateToDateString(dteDayToday) + "'; window.close();\">" + strFontGrySm + 
						 dteDayToday.getDate() + "</font></a></td>\n";
					}
					dteDayToday.setDate(dteDayToday.getDate() + 1);
			}
			strTemp += "</tr>\n";
			intCounter++
		}
		
		// Grey line after details
		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 +=
				//"<tr>\n<td bgcolor=\"#ffffff\" colspan=\"7\">" + strFontWhtSm + "&nbsp;</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='15'></td></tr>" +
				"<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";
		}
		else{
			strTemp +=
				//"<tr>\n<td bgcolor=\"#ffffff\" colspan=\"7\">" + strFontWhtSm + "&nbsp;</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";
				//"<tr>\n<td colspan=\"7\" align=\"middle\"><a href=\"javascript:window.close();\">" + strFontWhtXs + "Cancel</font></td>\n</tr>\n";
		}
		
		strTemp += "</tr>\n";
		 strTemp+= "<tr style='BACKGROUND-COLOR: #ffffff'><td style=\"color=\"#000000\"\" colspan='7'><img src='" + gstrImagesPath + "/blank.gif' alt='' border='0' width='' height='2'></td></tr>"
		
		
		strTemp +=
			"</table>\n" +
			"</td>\n</tr>\n</table>\n" +
			"</body>\n" +
			"</html>\n";

		//var objWin		= window.open("", "Calendar", "width=150,height=" +  if (intCounter < 6) { "150" } else { "160" } + ",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");
		
		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.frmSigByNbr.hdnDateFrom.value;
		var strToDate				= document.frmSigByNbr.hdnDateTo.value;

		if ((strFromDate != "") && (gstrFromDateLast != strFromDate)){
			if (MonthPattern.test(strFromDate)){
				strFromMonth = MonthPattern.exec(strFromDate)[0];
			}
			if (Day1Pattern.test(strFromDate)){
				strFromDay = Day1Pattern.exec(strFromDate)[0];
				strFromDay = Day2Pattern.exec(strFromDay)[0];
			}
			if (YearPattern.test(strFromDate)){
				strFromYear = YearPattern.exec(strFromDate)[0];
			}
			changeSelectedOption("selFromDay", strFromDay);
			changeSelectedOption("selFromMonth", strFromMonth);
			changeSelectedOption("selFromYear", strFromYear);
			gstrFromDateLast = strFromDate;
		}
		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("selToDay", strToDay);
			changeSelectedOption("selToMonth", strToMonth);
			changeSelectedOption("selToYear", strToYear);
			gstrToDateLast = strToDate;
		}
	}

	function changeSelectedOption(istrElementName, istrValue){
		// Assigns input value to <select> form element.
		var objSel = eval("document.frmSigByNbr." + 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.forms[1];
		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;
		}
	}

	function getHiddenDate_new(istrHdnField){
		// Returns value of "from" or "to" hidden date field.
		var objForm	= document.frmSigByNbr;
		
		// Start of addition by Vipin
		// objForm	= document.frmSigByNbr;
		//alert(objForm.name);
		// End of addition by Vipin
		
		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 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){
			return dteToday;
		}
		else{
			return dteTemp;
		}
	}
	function dateToDateString(dteDateTime){
		return (new String((dteDateTime.getMonth() + 1) + "/" + (dteDateTime.getDate()) + "/" + (dteDateTime.getFullYear())));
	}

//-->