img1 = new Image(16, 16);  
img1.src="images/spinner.gif";
img2 = new Image(220, 19);  
img2.src="images/ajax-loader.gif";

// When DOM is ready
$(document).ready(function(){
$("#status > form").submit(function(){  
$('#submit').hide();
$('#ajax_loading').show();
var str = $(this).serialize();  

$.ajax({  
    type: "POST",
    url: "do-login.php",  // Send the login info to this page
    data: str,  
    success: function(msg){  
		$("#status").ajaxComplete(function(event, request, settings){  
		$('#ajax_loading').hide();
		$('#status').hide();		
		var login_response = msg;
			$('#login_response').html(login_response);
			setTimeout('go_to_private_page()', 5000); 
		});  
	}  
});  
 
return false;
});

});

function go_to_private_page()
{
window.close();
}