/*
* Author:      Marco Kuiper (http://www.marcofolio.net/)
*/

google.setOnLoadCallback(function()
{
	// 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
	 $("input").blur(function(){
	 	$('#suggestions').fadeOut();
	 });
});

function PlaceBox() {

    $("#suggestions").css({
        "position": "absolute",
        "top": $("#site_search").height() + 120,
        "left": $("#site_search").width() + 580
        //"top": windowHeight / 2 - popupHeight / 2,
        //"left": windowWidth / 2 - popupWidth / 2
    });
    return;
}
function lookup(inputString) {
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
	   PlaceBox();
		$.get("/SearchBoxResult.aspx", {text: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
			//$('#suggestions').html("anthony<br>ashley<br>cellphones<br>computers!");
			
		});
	}
}