/*
* Author:      Marco Kuiper (http://www.marcofolio.net/)
*/
google.load("jquery", "1.4.4");
google.setOnLoadCallback(function()
{
	// Safely inject CSS3 and give the search results a shadow
	var cssObj = { }; // Firefox 3.5+
	$("#suggestions").css(cssObj);
	$("#suggestions-uppskriftir").css(cssObj);
	
	// Fade out the suggestions box when not active
	 $("input").blur(function(){
	 	$('#suggestions').fadeOut();
	 });
});

function lookup(inputString) {
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
		$.post("/clients/innnes.is/php/search.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
		});
	}
}

function lookuppskrift(inputString) {
	if(inputString.length == 0) {
		$('#suggestions-uppskriftir').fadeOut(); // Hide the suggestions box
	} else {
		$.post("/clients/innnes.is/php/uppskriftir.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions-uppskriftir').fadeIn(); // Show the suggestions box
			$('#suggestions-uppskriftir').html(data); // Fill the suggestions box
		});
	}
}


