/*
* Author:      Marco Kuiper (http://www.marcofolio.net/)
*/
// google.load("jquery", "1.4.2");
google.setOnLoadCallback(function()
{





// Then "Input" element focused then
// Hide Google Logo
$("input").focus(function(){ 
$("input").css({'background-image' : 'none'});
 })



// Then "Input" element blured then
// Show Google Logo
$("input").blur(function(){ 
if ($("input").attr("value") == '') {
$("input").css({'background-image' : 'url(http://www.google.com/coop/intl/en/images/google_custom_search_watermark.gif)'});
}


// And fide search results box
$('#searchresults').fadeOut();


 })


























  // Safely inject CSS3 and give the search results a shadow
  var cssObj = { 'box-shadow' : '#888 5px 10px 10px', // Added when CSS3 is standard
    '-webkit-box-shadow' : '#888 5px 10px 10px', // Safari
    '-moz-box-shadow' : '#888 5px 10px 10px'}; // Firefox 3.5+
  $("#suggestions").css(cssObj);
  
  // Fade out the suggestions box when not active
   blur(function(){

    $('#suggestions').fadeOut();

    // Hide menu
    $('#searchresults').fadeOut();

   });
});


































function lookup(inputString) {

  if(inputString.length == 0) {


    $('#suggestions').fadeOut(); // Hide the suggestions box
// Hide menu
    $('#searchresults').fadeOut();
  } 
else
  {
//    $.post("menu_rpc.php", { queryString: ""+inputString+"", userip: "192.168.1.1" }, function(data) { // Do an AJAX call


// My settings

/*
    $.post("menu_rpc.php", { queryString: ""+inputString+""}, function(data) { // Do an AJAX call
      $('#suggestions').fadeOut(); // Hide the suggestions box
      $('#suggestions').html(data); // Fill the suggestions box
      $('#suggestions').fadeIn(); // Show the suggestions box
    });
*/


    $('#suggestions').load("menu_rpc.php?queryString="+encodeURIComponent(inputString));

  }
}



