$(document).ready(function() {
	
		$( "#theSearch" ).autocomplete({
			delay:  0,
			source: "terms.asp",
			select:  function(event, ui)  { 
				$("#theSearch").val(ui.item.value);
				$("#searchForm").submit();
			}
		});
	/*
		minLength: 1,
		source:  function( request, response ) {
			alert('test');
			var term = request.term;
			
			if(term in cache) { 
				response( cache[ term ] );
				return;
			}
			
			lastxhr = $.getJSON("terms.asp", request, function(data, status, xhr ) {
				cache[ term ] = data;
				
				if ( xhr === lastxhr ) { 
					response( data );
				}
				
			}
		}	*/
		
});

