var currentLightbox = null;

function closeLightbox()
{
	if(currentLightbox)
	{
		currentLightbox.style.display = 'none';
		currentLightbox = null;
	}
	return false;
}

var zIndex = 10000;

function showLightbox(img)
{
	if(!img)
		return;
		
	var box = img.parentNode.previousSibling;
	while(box && box.nodeType != 1)
		box = box.previousSibling;
	
	if(box && box.className.indexOf('Lightbox') >= 0)
	{
		closeLightbox();
		currentLightbox = box;
		box.style.display = 'block';
		box.style.zIndex = (zIndex++);
	}
	
	return false;
}

