
	
	//google.load("jquery", "1.3.1");
	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();
		 });
	});
	
	var req = false;
	
	function lookup(inputString) {
		if(inputString.length == 0) {
			$('#suggestions').fadeOut(); // Hide the suggestions box
		} else {
			if (req) req.abort();
			req = $.ajax({
				type: "GET",
				url: "search.php?queryString="+inputString,
				datatype: "html",
				success: function(data){
					$('#suggestions').fadeIn(); // Show the suggestions box
					$('#suggestions').html(data); // Fill the suggestions box
				}
			});
			
			/*$.get("search.php", {queryString: inputString}, function(data) { // Do an AJAX call
				$('#suggestions').fadeIn(); // Show the suggestions box
				$('#suggestions').html(data); // Fill the suggestions box
			});*/
		}
	}
	
	
	function loadPage(page){
		$.ajax({
			type: "GET",
			url: "parts/pages.php?ajax=true&p="+page,
			datatype: "html",
			beforeSend: function(){
				$("#contentLoader").css("display","block");
			},
			complete: function(){
				$("#contentLoader").css("display","none");
			},
			success: function(res){
				$("#contentDiv").css( { opacity: 0 } );
				
				var from = $("#contentDiv").height();
				$("#contentDiv").html(res).css("height","auto");
				var to = $("#contentDiv").height();
				
				$("#contentDiv").height(from);
				$("#contentDiv").animate( { opacity: 1 }, { queue:false, duration:1000 } )
				.animate( { height: to }, 500 );
			}
		});
		
		return false;
	}
	
	function loadCategory(category){
		$.ajax({
			type: "GET",
			url: "parts/pages.php?ajax=true"+((category) ? "&c="+category : ""),
			datatype: "html",
			beforeSend: function(){
				$("#contentLoader").css("display","block");
			},
			complete: function(){
				$("#contentLoader").css("display","none");
			},
			success: function(res){
				$("#contentDiv").css( { opacity: 0 } );
				
				var from = $("#contentDiv").height();
				$("#contentDiv").html(res).css("height","auto");
				var to = $("#contentDiv").height();
				$("#contentDiv").height(from)
					.animate( { opacity: 1 }, { queue:false, duration:500 } )
					.animate( { height: to }, 500 );
			}
		});
		
		return false;
	}
	
	function loadArtist(artist, category){
		$.ajax({
			type: "GET",
			url: "parts/pages.php?ajax=true&a="+artist+((category) ? "&cat="+category : ""),
			datatype: "html",
			beforeSend: function(){
				$("#contentLoader").css("display","block");
			},
			complete: function(){
				$("#contentLoader").css("display","none");
			},
			success: function(res){
				$("#contentDiv").css( { opacity: 0 } );
				
				var from = $("#contentDiv").height();
				$("#contentDiv").html(res).css("height","auto");
				var to = $("#contentDiv").height();
				$("#contentDiv").height(from)
					.animate( { opacity: 1 }, { queue:false, duration:500 } )
					.animate( { height: to }, 500 );
					
				$('#gallery a').lightBox();

			}
		});
		
		return false;
	}
