/**
 * A class to control a popup.
 */
Synergy.Popup = function( selector )
{
	var button = $(selector);
	var overlayApi = button.overlay( {
		// effect : 'apple',
		closeOnClick : false,
		fixed : false,
		oneInstance : false,
		api : true,
		onBeforeLoad : function()
		{
			button.hide();
			button.boxShadow('hide');
		},
		onClose : function()
		{
			button.show();
			button.boxShadow();

		},
		onBeforeClose : function()
		{
			$('#detailsContainer').boxShadow('hide');
		},
		onLoad : function()
		{
			$('#detailsContainer').boxShadow();
		}

	});

	this.close = function()
	{
		overlayApi.close();

	};

	this.open = function()
	{
		overlayApi.load();
		// button.removeShadow();
	};
};
