$(document).ready(function () 
{
	$("#tbxSearchItem").focus();
/*		$("#tbxSearchItem").keyup(function()
		{
		//alert("here");
			if($("#tbxSearchItem").val().length > 1)
			{
				url = 'http://playground.bradley.edu/~rpunia/tgdMVC/index.php/ajaxsearch/search';
					tbxSearchItem = $("#tbxSearchItem").val();
						$.post(url, {tbxSearchItem: ""+tbxSearchItem+""}, function(data) { // Do an AJAX call
							$('#suggestionsSearch').slideDown("fast"); // Show the suggestions box
							$('#suggestionsSearch').html(data); // Fill the suggestions box
						});
			
			}//end if
		});//end keyup

		$("#tbxSearchItem").blur(function()
		{
			$('#suggestionsSearch').slideUp("slow");
		});//end blur

*/

$('#tbxSearchItem').autocomplete('http://ciliate.org/index.php/ajaxsearch/search', {
		//autoFill: true,
		selectFirst: false,
		delay: 0,
		minChars: 1
	}).result(function() {
  	window.location = "http://ciliate.org/index.php/feature/details/"+$('#tbxSearchItem').val();
});
	
	/*$('#tbxSearchItem').autocomplete('http://playground.bradley.edu/~rpunia/tgdMVC/index.php/ajaxsearch/search').result(function(value) {
  	window.location = "http://playground.bradley.edu/~rpunia/tgdMVC/index.php/feature/details/"+value;
});
*/

});//end document.ready fn


/*
function fillSearchBox(value)
{
//alert("hi");
	$("#tbxSearchItem").val(value);
   $('#suggestCourseSell').slideUp("slow"); // Show the suggestions box
	window.location = "http://playground.bradley.edu/~rpunia/tgdMVC/index.php/feature/details/"+value;
	//$('#frmSearch').submit();
}

*/

