// http://api.jquery.com/
var popup = 
{
	open : function(url, data)
	{
		if (!data) data = {};
		data.random = Math.random();

		$("#popup_content").html('<div class="popup_loader"></div>');
		$("#popup_loader").show();
		$("#popup_content").load(
			url, 
			data,
			function(responseText, textStatus, XMLHttpRequest) 
			{ 
				if (textStatus === "error") $("#popup").hide();
        else {
          $('body').scroll(function(e)
          {
			$('body').scrollTop(0); // only IE wants to scroll when the scrollbar is behind a layer
            e.preventDefault(); });
          }
				// to show errors uncomment the line below and command-out the line above	
				//if (textStatus === "error") $("#popup_content").html(responseText); 
			}
		);
		$("#popup").animate({opacity: "show"}, "fast");
	},
	close : function()
	{
		$("#popup").animate({opacity: "hide"}, "fast");
        $('body').unbind('scroll');
	}
};

