function ajaxShelf(action, mid)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e)
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				// Something went wrong
				alert("Your browser is broken!");
				return false;
			}
		}
	}
		
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 1){
		
		}
		if(ajaxRequest.readyState == 2 || ajaxRequest.readyState == 3){
		
		}
		// If we get a response
		if(ajaxRequest.readyState == 4){
			var AjaxResult = ajaxRequest.responseText;
			switch (AjaxResult){
				case '#added':
					jQuery.facebox('<h2>Movie added to your Movie Shelf</h2>');
					break;
				case '#login':
					jQuery.facebox('<h2>Please login to add a movie<h2>');
				break;
				case '#removed':
					jQuery.facebox('<h2>Movie Removed from shelf</h2>');
				break;
				case '#duplicate':
					jQuery.facebox('<h2>Movie is already on your shelf</h2>');
				break;
			}
		}
	}
	var queryString = "?action="+action+"&mid="+mid;
	ajaxRequest.open("GET", "ajaxShelf.php" + queryString, true);
	ajaxRequest.send(null); 
}