
jQuery(function() {
	
	// Fade out the suggestions box when not active
	 jQuery("input").blur(function(){
	 	jQuery('#suggestions').fadeOut();
	 });

	});
function lookup(inputString) {
	if(inputString.length == 0) {
		jQuery('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
	jQuery('#suggestions').css({opacity: 0.8})
		jQuery.post(ajax_url, {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			if(data.length>5){
			jQuery('#suggestions').fadeIn(); // Show the suggestions box
			jQuery('#suggestions').html(data); // Fill the suggestions box
				}else{
		jQuery('#suggestions').fadeOut(); // Hide the suggestions box

				}
		});
	}
}
