// JavaScript Document
function showImage(theFile, theX, theY)
{
	
//Get available height in browser
	if (window.innerHeight) //if browser supports window.innerWidth
	{
		bHeight=window.innerHeight
		bWidth=window.innerWidth
	}
	else if (document.all) //else if browser supports document.all (IE 4+)
	{
		bHeight=screen.availHeight
		bWidth=screen.availWidth
	}
	
	
//Get scroll
scrollY=0

  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrollY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollTop ) ) {
    //DOM compliant
    scrollY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrollY = document.documentElement.scrollTop;
  }
  
  //How much to offset pic from top
  yOffset=(bHeight-theY)/2
  if (yOffset<1)
  {
	yOffset=10
  }
  theTop=scrollY+yOffset;

  
notice="";
screenwidth=bWidth;
aspect=theY/theX;
	document.getElementById("black").style.display='block'
	document.getElementById("black").style.top=theTop+"px"
	
	if (theX>bWidth)
	{
		notice='The image is downscaled from '+theX+'x'+theY+'. <a href="'+theFile+'" target="_blank" >Click here</a> to open in full size.'
		theX=bWidth-500
		theY=theX*aspect
		document.getElementById("black").style.width=theX+"px"
		theNewY=(theY+40)
		document.getElementById("black").style.height=theNewY+"px"
		document.getElementById("black").style.left=(screenwidth/2)-(theX/2)-10+"px"
		document.getElementById("black").innerHTML=notice+'<a href="javascript:clearPic()"><img src="'+theFile+'" width="'+theX+'" height="'+theY+'" /></a><br />Click on image to close.'
	}
	else
	{
	document.getElementById("black").style.width=theX+"px"
	document.getElementById("black").style.height=(theY*1)+20+"px"
	document.getElementById("black").style.left=(screenwidth/2)-(theX/2)-10+"px"
	document.getElementById("black").innerHTML='<a href="javascript:clearPic()"><img src="'+theFile+'" width="'+theX+'" height="'+theY+'" /></a><br />Click on image to close.'
	}
	
}
function clearPic()
{
	document.getElementById("black").style.display='none'
}