

function onUpdated(e)
{
	function openInfoDialog() 
	{ 
		Dialog.info("The picture has been submitted.<br>It will appear in the gallery shortly.", {className: "alphacube", width:250, height:100}); 
		setTimeout(closedlg, 2500);
		function closedlg()
		{
			Dialog.closeInfo();
			new Effect.Fade("submit"+e.responseText);
		}	
	} 
	openInfoDialog(); 	
}

function onFailed(e)
{
	alert("Something went wrong on the server.\n\nPlease try again.");
}
function promote(id, src)
{	
    Dialog.confirm("Are you sure you want to send this picture to the community gallery?<br><br><img src='"+src+"' class='thumb'>", 
                   {top: 10, width:250, className: "alphacube", okLabel: "Yes", cancelLabel:"No", onOk:doPromote});

	function doPromote()
	{
		new Ajax.Request('/ajax/submit_picture_to_community.php', {postBody:"id="+id, onSuccess:onUpdated, onFailure:onFailed})
		return true;
	}
}

