function getDocumentHeight()
{
	return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}

function getDocumentWidth()
{
	return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
}

function getBodyScrollTop()
{
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
  return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}

function getClientCenterX()
{
	return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}

function getClientCenterY() 
{
	return parseInt(getClientHeight()/2)+getBodyScrollTop();
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function showPhoto(src)
{
    document.getElementById('back_photo').style.height = getClientHeight();
    document.getElementById('back_photo').style.top = getBodyScrollTop();      
    document.getElementById('photo').src = src;
    document.getElementById('dark_back_photo').style.height = getDocumentHeight();
    document.getElementById('dark_back_photo').style.display = 'block';
}

function closePhoto(src)
{
    document.getElementById('dark_back_photo').style.display = 'none';
}