function popupPicture(pictureURL) 
{ 
  var hoverDiv = document.getElementById( 'screenshotHover' );
  hoverDiv.style.position = 'absolute';
  hoverDiv.style.top = document.documentElement.scrollTop + 'px';
  hoverDiv.style.left = '0px';
  hoverDiv.innerHTML = '<img onclick="hidePicture();" src="' + pictureURL + '">';
  hoverDiv.style.zIndex = 1000;
  hoverDiv.style.width = '1024px';
  hoverDiv.style.height = '768px';
  
  var containerDiv = document.getElementById( 'container' );
  containerDiv.style.display = 'none';
}

function hidePicture() 
{
	var hoverDiv = document.getElementById( 'screenshotHover' );
	hoverDiv.innerHTML = "";
	hoverDiv.style.zIndex = -1;
	
	var containerDiv = document.getElementById( 'container' );
	containerDiv.style.display = 'block';
}

window.onbeforeunload = function()
{
	var hoverDiv = document.getElementById( 'screenshotHover' );
	if ( hoverDiv != undefined && hoverDiv.style.zIndex > 1 && hidePicture )
	{	
		hidePicture();
		return "The screenshot has been closed, but the quickest way to close these screenshots is just to click them.";
	}
}
