function y2k(number){
		return (number < 1000) ? number + 1900 : number;
	}	

	function validateForm(){
	
		with (document.searchForm) {
		
		if (keywords.value=="") {    
			alert("You can not conduct a search without\nentering key word(s) to search by.")
			return false
		}
		
		//set the variable "valIn" as the selected index from the "drop down : limit search by"
		valIn = searchby.selectedIndex 
		
		// condition 1: when user selected date to limit his/her search
		// the following code will process 
		if (searchby.options[valIn].value == "issuedate"){ 
			
			//condition 2: check for the total length value of the search criteria as the date length(Ex: 05/25/2000) 
			  if (keywords.value.length == 10) {
		       //when the search criteria value length equal 10 characters
				 
				 //condition 3: define the date separator "/" on the search criteria value at the position
				 //between 2 & 3 and 5 & 6 
				 if (keywords.value.substring(2,3) == "/" && keywords.value.substring(5,6) == "/") {
				      
						//set the month , day , year variable to the value found at the search criteria field 
						 var month  = keywords.value.substring(0,2);
		             var day    = keywords.value.substring(3,5);
		             var year  = keywords.value.substring(6,10);
						
						 // Javascript alerts if date is invalid (e.g. literal string)
						 // Javascript starts months at 0=January
		             var test = new Date(year, month-1,day);
						 
					    //condition 4: validate the year, month, and day
						 if (year == y2k(test.getYear()) && (month-1 == test.getMonth()) && (day == test.getDate())) {
							 
							 //the year, month and day value are valid
							 //window.alert(y2k(test.getYear()))
							  reason = '';
		                 return true;
		             }
		             else {
						 
							  // the year, month and day value are in valid
							  alert ("You entered an invalid date. Please enter a valid selection.")
		                 return false;
		             }//end of condition 4
		       }
		       else {
				 
				 		// the separator of the date is invalid (should be as "/")
		             alert ("The value you entered contains an invalid separators for the date.\n It should be in this format (Ex: 05/16/2000)")
		             return false;
		       }// end of condition 3
         	}
	    	else {
			
				// the user entered an invalid length for the search criteria (should be 10 character)
	         alert ("The date value should be in this format (Ex: 05/16/2000)")
	         return false;
	    	} //end of condition 2
		} //end  of condition 1
		} //end of with
	}//end of function
