$(document).ready(
  function()
    {
      if ($('.nxc_lb_content').length > 0)
      {
        $('a.nxc_lb').click(function(e)
		{
			show_content();
			e.preventDefault();
		});
		
		if( window.location.hash == "#openlb" )
		{
			show_content();
		}
		
		$('.nxc_lb_content span.close').live('click',function(e)
		{
		  remove_layout();
		});
	}
    });

function show_content()
{
  var layout = $('<div id="layout"><div id="lb_content"/></div>');
  var lb_content = $('.nxc_lb_content').clone();
  
	$(document.body).append(layout);
	$(layout).children().append(lb_content);
	$(lb_content).fadeIn('slow');
}

function remove_layout()
{
	var layout = $('#layout').fadeOut('slow',function()
		{
		  layout.remove();
		});
}
