﻿$(document).ready(function() {
						   					   
						   
	$("#inputString").focus(function() {
					
					$("#inputString").val("");
					
					$("#inputString").css("color", "#559abe");
					//$('#publictribute').hide();
	});
	
	$("#inputString").keyup(function(inputString) {
	//test the length of the input box this is a self refrence to the input object on which you clicked
	$('#loading').hide();
	mysearch = $(this).val();
	if($(this).val().length == '0') {
		
			// Hide the suggestion box.
			$('#suggestions').hide();
			
		} else {
				//alert($(this).val().length) debug the string from the input box for search;
				$.post("autoComplete/get-details.php", {queryString: ""+mysearch+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
					
					
				}
				return false;
			});
		}
	
	});
	
$("#inputString").keydown(function(inputString) {	
$('#loading').show();

});
						   
});
//function lookup(inputString) {
		
//} // lookup
	
function fill(thisValue,id) {
		$('#inputString').val(thisValue);
		$('#loading').hide();
		setTimeout("$('#suggestions').hide();", 3000);
		
}

