function create_lb(id)
{
	id = (id == undefined ? '' : 'id="' + id + '" ');
	$('body').append('<div id="darkLayer"></div>');
	$('body').append('<div class="lightboxWrapper"><div ' + id + 'class="lightbox"></div></div>');
}

function do_lb_open(href, callback)
{	
	$('.lightbox').load(href, 'type=111', function()
	{
		$('#darkLayer').css({
			height: $(document).height()
		});
		
		do_lb_position();

		$('#darkLayer').css({ opacity: '0.5' });

		$('#darkLayer').fadeIn(300, function() {
			$('.lightbox').fadeIn(350);
		});
		
		if(callback != undefined)
		{
			callback();
		}
	});
}

function do_lb_position()
{
	var offset = 70;
	/*
	if($(document).height() > $('.lightbox').height())
	{
		offset = ($(document).height() - $('.lightbox').height()) / 2;
	}
	*/
	// positioning the lightbox in the optical mid
	$('.lightbox').css({
		marginTop: parseInt($(window).scrollTop() + offset) + 'px'
	});
}
