<!--
	function validateDateEntry(istrMonth, istrDay, istrYear, istrDesc){
	// Validates date is a valid selection.
		var strMsg						= "";
		if ((istrMonth == 4 || istrMonth == 6 || istrMonth == 9 || istrMonth == 11) && (istrDay > 30)){
			strMsg += "You have entered an invalid " + istrDesc + " Date.\n\n";
		}
		if ((istrMonth == 2) && ((isLeapYear(istrYear) && (istrDay > 29)) || (istrDay > 28))){
			strMsg += "You have entered an invalid " + istrDesc + " Date.\n\n";
		}
		return strMsg;
	}
	function validateInPastYear(istrDate, istrDesc){
	// Validates istrDateFrom is within the past physical year.
		var strMsg		= "";
		var dteToday	= new Date();
		var strMonth	= dteToday.getMonth() + 1;
		var strDay		= dteToday.getDate();
		var strYear		= dteToday.getFullYear() - 1;
		
		if (Date.parse(istrDate) < Date.parse(strMonth + "/" + strDay + "/" + strYear)){
			strMsg += istrDesc + " Date cannot be over one year in the past.\n\n";
		}
		return strMsg;
	}
	function validateDateOrder(istrDateFrom, istrDateTo, istrDesc){
	// Validates istrDateFrom is before istrDateTo.
		var strMsg						= "";
		if (Date.parse(istrDateTo) < Date.parse(istrDateFrom)){
			if (isEmpty(istrDesc)){
				strMsg += "'From' Date cannot be after 'To' Date.\n\n";
			}
			else{
				strMsg += istrDesc + " Date cannot be a future date.\n\n";
			}
		}
		return strMsg;
	}
	function getTodaysDate(){	
		var dteToday	= new Date();
		var strMonth	= dteToday.getMonth() + 1;
		var strDay		= dteToday.getDate();
		var strYear		= dteToday.getFullYear();
		return (strMonth + "/" + strDay + "/" + strYear);
	}	
	function isLeapYear(istrYear){
		if (istrYear % 100 == 0){
			if (istrYear % 400 == 0){return true;}
		}
		else{
			if ((istrYear % 4) == 0){return true;}
		}
		return false;
	}
	function stripSpaces(istrUserEntry){
	// Strips string of spaces
		var strStrippedEntry = '';
		for (var i = 0; i < istrUserEntry.length; i++){
			if (!(istrUserEntry.charAt(i) == ' ')){
				strStrippedEntry += istrUserEntry.charAt(i);
			}
		}
		return strStrippedEntry;
	}
	function isBlank(istrUserEntry){
	// Validates input string is not blank
		for (var i = 0; i < istrUserEntry.length; i++){
			var strChar = istrUserEntry.charAt(i);
			if ((strChar != ' ') && (strChar != '\n') && (strChar != '')){return false;}
		}
		return true;
	}
	function isEmpty(istrUserEntry){
	// Validates input string is not empty
		if ((istrUserEntry == null) || (istrUserEntry == "") || (isBlank(istrUserEntry))){return true;}
		return false;
	}
	function isValidLength(istrUserEntry){
	// Validates input string has length of 11.
		if (isNaN(istrUserEntry)){
			if (istrUserEntry.substring(1).length <= 11){
				return true;
			}
			else{
				if (hasInitialZero(istrUserEntry)){
					return true;
				}
			}
		}
		else{
			if (istrUserEntry.length <= 11){
				return true;
			}
			else{
				if (hasInitialZero(istrUserEntry)){
					return true;
				}
			}
		}
		return false;
	}
	function isNumber(istrUserEntry){
	// Validates input string is all digits or is all digits after the initial character.
		if (isNaN(istrUserEntry)){
			if (isNaN(istrUserEntry.substring(1))){return false;}
			else{
				if (isAllZeros(istrUserEntry.substring(1))){return false;}
				return true;
			}
		}
		return true;
	}
	function isAllZeros(istrUserEntry){
		for (var i = 0; i < istrUserEntry.length; i++){
			if (istrUserEntry.charAt(i) != "0"){return false;}
		} 
		return true;
	}
	function hasInitialZero(istrUserEntry){
		if ((istrUserEntry.charAt(0) == "0") && (istrUserEntry.length == 12)){
			return true;
		}
		return false;
	}
	function hasInitialAlpha(istrUserEntry){
	// Validates input string has an initial alpha, if relevant.
		var strPattern = /[a-zA-Z]{1}/;
		if (isNaN(istrUserEntry)){
			if (istrUserEntry.match(strPattern) == null){return false;}
			return true;
		}
		return true;
	}
	function validateNumber(istrUserEntry){
		var strMsg = "";

		if (isEmpty(istrUserEntry)){
			strMsg += "Please enter a Tracking Number.\n\n";
		}
		else{
			if (!(isValidLength(istrUserEntry)) || !(isNumber(istrUserEntry)) || (isAllZeros(istrUserEntry)) || !(hasInitialAlpha(istrUserEntry.substring(0, 1)))){
				strMsg += "You have entered an invalid Tracking Number.\n\n";
			}
		}
		return strMsg;
	}
	function validateEntries(){
	// High-level validation function
		var strErrMsg				= "";
		var strTempMsg			= "";
		var objForm					= document.frmSigByNbr;
		var strShipNbr			= stripSpaces(objForm.txtShipNbr.value);
		var strFromMonth		= objForm.selFromMonth.options[objForm.selFromMonth.selectedIndex].value
		var strFromDay			= objForm.selFromDay.options[objForm.selFromDay.selectedIndex].value
		var strFromYear 		= objForm.selFromYear.options[objForm.selFromYear.selectedIndex].value
		var strToMonth			= objForm.selToMonth.options[objForm.selToMonth.selectedIndex].value
		var strToDay				= objForm.selToDay.options[objForm.selToDay.selectedIndex].value
		var strToYear				= objForm.selToYear.options[objForm.selToYear.selectedIndex].value
		var strDateToday		= getTodaysDate();
		var strDateBeg			= strFromMonth + "/" + strFromDay + "/" + strFromYear;
		var strDateEnd			= strToMonth + "/" + strToDay + "/" + strToYear;

		strErrMsg		+= validateNumber(strShipNbr);
		strErrMsg		+= validateDateEntry(strFromMonth, strFromDay, strFromYear, "'From'");
		strErrMsg		+= validateDateEntry(strToMonth, strToDay, strToYear, "'To'");

		strTempMsg	+= validateInPastYear(strDateBeg, "'From'");
		strTempMsg	+= validateInPastYear(strDateEnd, "'To'");
		strErrMsg		+= strTempMsg;

		strErrMsg		+= validateDateOrder(strDateBeg, strDateToday, "'From'");
		strErrMsg		+= validateDateOrder(strDateEnd, strDateToday, "'To'");
		if (isEmpty(strTempMsg)){
			strErrMsg		+= validateDateOrder(strDateBeg, strDateEnd, "");
		}

		// Show errors and return false
		if (!isEmpty(strErrMsg)){
			//alert(strErrMsg);// commented by Vipin for avoiding alerts
			//objForm.lblErr.value = strErrMsg;
			objForm.txtShipNbr.focus();
			return strErrMsg;
		}
		// No errors
		else {return strErrMsg;}
	}
//-->
