function show_login_box()
{
	$("#login_box").slideDown("slow");
	// this hides the login box after 60 seconds
	setTimeout("hide_login_box()", 60000);
}
function hide_login_box()
{
	$("#login_box").slideUp("slow");
}
function login_box_submit()
{   
	// jQuery documentation is really helpful, search their docs pages for help

	// path for AJAX code to check login     
    var url = "session/check_login.php";   

	var username = $("#login_box_email").val();
	var password = $("#login_box_password").val();
	
	// here we post via jQuery to our AJAX script, with username (email addy) and password
	$.post(url, { username: username, password: password, box_login: "true" }, function(data)
		{
		 	$("#login_box").slideUp(0, function() {
		 		$("#login_box").html(data);
		 	});				 	
		 	
		 	$("#login_box").html(data);
	   	}
	);
}	

// this code see if they press enter while in the password box
// if so, submit the form
$(document).ready(function() {
	$("#login_box_password").keypress(function (e) {
		if (e.which == 13) 
		{
			login_box_submit();
			return false;
		}
	});		
});	

