$(document).ready(function(e)
{
	$('#messagewrapper').slideDown('fast');
	$('#messagewrapper').delay(3000).slideUp('fast');

	if ($('#q').hasClass('notshit') == true)
	{
		$('#q').focus(function()
		{
			$('#suggestions').fadeIn('fast');
		});
		$('#q').blur(function()
		{
			$('#suggestions').fadeOut('fast');
		});
		
		$("#q").keydown(function (e)
		{
			if (e.which == 40)
			{
				// down
			}
			else if (e.which == 39)
			{
				// up
			}
		});
	}
});
function lookup()
{
	if($('#q').val().length == 0)
	{
		$('#suggestions').fadeOut('fast');
	}
	else if($('#q').val().length > 2)
	{
		$.ajax({
			type: "POST",
			url: "/search/box",
			data: {q: $('#q').val()},
			dataType: "html",
			success: function(results)
			{
        		$('#suggestions').fadeIn('fast');
				$('#suggestions').html(results);
			},
			error: function(e, m)
			{
        		$('#suggestions').fadeIn('fast');
				$('#q').html("<p>error</p>");
			}
		});
	}
}
function closemessage()
{
	$('#messagewrapper').slideUp('fast');
}
function destroymesssage()
{
	$('#messagewrapper').remove();
}
