
	function validateSearchInfo(form) {

		//Validate Start Date Before End Date
		dTmpStart = form.iSearchStartMonth .options[form.iSearchStartMonth .selectedIndex].value + "/" + form.iSearchStartDay.options[form.iSearchStartDay.selectedIndex].value + "/" + form.iSearchStartYear.options[form.iSearchStartYear.selectedIndex].value
		if ( dTmpStart.length > 2 && validate_date(dTmpStart, 4) == 2) {
			alert( dTmpStart + " is not a valid Search From date"); return false;
		}
		dTmpEnd = form.iSearchEndMonth.options[form.iSearchEndMonth.selectedIndex].value + "/" + form.iSearchEndDay.options[form.iSearchEndDay.selectedIndex].value + "/" + form.iSearchEndYear.options[form.iSearchEndYear.selectedIndex].value
		if ( dTmpEnd.length > 2 && validate_date(dTmpEnd, 4) == 2) {
			alert( dTmpEnd + " is not a valid Search To date"); return false;
		}
		
		dTmpEnd = dTmpEnd + " " + "00" + ":00 "+ ":00";
		dTmpStart = dTmpStart + " " + "00" + ":00" + ":00";
		msEnd = Date.parse(dTmpEnd);
		msStart = Date.parse(dTmpStart);
		if (msEnd - msStart < 0){alert("Search To Date cannot occur before Search From Date.");return false;}

		//if ( form.resolveEstStartYr.selectedIndex == 1 ) 
		//	{
		//	if ( ! confirm("The Estimated Start Year has already passed.  Select 'OK' if this is correct, or 'Cancel' to change the year.") ) {
		//		return false
		//	}
		//}


	}
	
	function validate_date(field, yrDigits)
	{
		//Validates whether a  date is valid (handles 2 and 4 digit years)
		//return values:
		// 0 - validated
		// 1 - zero length
		// 2 - not a valid date
		//
		// valid yrDigits args: 2, 4, defaults to 2

		var d_length = field.length;
		var min_length, max_length;
		var n,s,idx, month, day, year,j, febDays;
		a = new Array();
		var valid = true;

		//Check Zero Length
		if (d_length == 0)
			return 1;
		else
		{
			//Check proper length
			min_length = 6;
			max_length = 8;
			if (yrDigits == 4)
			{
				min_length += 2;
				max_length += 2;
			}
			if (d_length >= min_length && d_length <=max_length)
			{
				//Pull portions of date
				a = field.split("/")
				month = a[0];
				day = a[1];
				year = a[2];

				//Check month
				if (month != null && month.length > 0)
				{
					for (idx=0;idx < month.length;idx++)
					{
						n=parseInt(month.charAt(idx),10);
						if (isNaN(n))
						{
							valid = false;
						}
					}
					if (valid)
					{
						n=parseInt(month,10);

						if (n < 1 || n > 12)
						{
							valid = false;
						}
					}
				}
				else
				{
					valid = false;
				}

				//Check Day
				if (day!=null && day.length > 0)
				{
					for (idx=0;idx < day.length;idx++)
					{
						n=parseInt(day.charAt(idx),10);
						if (isNaN(n))
						{
							valid = false;
						}
					}
					if (valid)
					{
						n=parseInt(day,10);
						if (month==1 || month==3  || month==5  || month==7  || month==8  || month==10  || month==12)
						{
							if (n < 1 || n > 31)
							{
								valid = false;
							}
						}
						else
						{
							if (month==4  || month==6  || month==9  || month==11)
							{
								if (n < 1 || n > 30)
								{
									valid = false;
								}
							}
							else
							{
								if (month==2)
								{
									j = year/4;
									remainder = j - Math.round(j);
									if (remainder == 0)
									{
										febDays = 29;
									}
									else
									{
										febDays = 28;
									}
									if (n < 1 || n > febDays)
									{
										valid = false;
									}
								}
							}
						}
					}
				}
				else
				{
					valid = false;
				}

				//Check Year
				if (year != null && year.length > 0)
				{
					for (idx=0;idx < year.length;idx++)
					{
						n=parseInt(year.charAt(idx),10);
						if (isNaN(n))
						{
							valid = false;
						}
					}

					if (valid)
					{
						n=parseInt(year,10);
						if (max_length == 10)
						{
							if (n < 0 || n > 9999)
							{
								valid = false;
							}
						}
						else
						{
							if (n < 0 || n > 99)
							{
								valid = false;
							}
						}
					}
				}
				else
				{
					valid = false;
				}

				if (valid)
					return 0;
				else
					return 2;
			}
			else
				return 2;
		}
	}

