var gotoURL;

function showMessage(message, title, url)
{
	if (!title)
		title = gettext("Message")
	var boxTitle = "<div id='lightboxTitle' class='roundCorners'>"+title+"</div>"
	var boxContent = "<div id='lightboxContent'> <div id='lightboxMsg'>"+message+"</div> <div id='buttonBar'><input type='button' value='OK' id='lightboxBtn'/> </div> </div>"
	
	var htmlContent = boxTitle+boxContent;
	
	$.fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'fade',
		'speedIn'			: 500, 
		'speedOut'			: 500,
		'overlayOpacity'	: 0.4,
		'overlayColor'		: "black",
		'content'			: htmlContent,
		'autoDimensions'	: false,
		'width'				: 320,
		'height'			: 240,
		'showCloseButton'	: false,
		'hideOnOverlayClick': false,
		'onComplete'		: fixBoxWidth
	});	
	
	$("#fancybox-outer").addClass("roundCorners");
	$("#fancybox-inner").css("left","0px").css("top","0px");
	makeNiceButtons("#lightboxBtn");
	
	gotoURL = url;	
	$("#lightboxBtn").click(function(){
		$.fancybox.close();
		if (gotoURL)
			window.location = gotoURL;
	});
}

function fixBoxWidth()
{
	$("#fancybox-inner").css("width","340px").css("height","260px");
}
