// JavaScript Document
function validateSearchSelections(searchType, searchText){
	/* == means equals; can use single or double quotation 
	 * marks-- '' or "" means nothing because there is nothing 
	 * between the quotation marks 
	 */

	if(searchText==''){ //Is searchText field empty?
		alert('You forgot to type a keyword for which you wish to search.');
		return false;
	}else if(searchType == 3){ //Is searchType field Year (3)?
		var allNumbers=/^\d{4}$/;	// means any number  /^[a-z]{3}$/;
		if(!allNumbers.test(searchText)){ //test to see if searchText has any letters
			alert('You must type a 4 digit year.');
			return false;
		}//end if NOT all numbers
	}//end if searchtext
	alert('You followed all the rules');
	return true;
		/* //If not empty check to see if text in 0,1,2,4 and numbers in 3
		switch(searchType){
			case 0: // All
				
				break;
			case 1:  // Author
				alert('Case 1'); 
				break;
			case 2: // Title
				alert('Case\n 3'); 
				break;
			case 3: // Year
				var onlyNumbers = \d;
				break;
			case 4: // ISBN
			
				break;			
		}
	*/
	
}// end validateSearchSelections



function deleteDefaultSearchText(searchFieldObject){
	searchFieldObject.value="";
}