function FotoWindow(w,v,d,s)
{
eval("window.open('"+v+"','"+w+"','height="+s+",width="+d+",status=no,location=no,toolbar=no,directories=no,menubar=no');");
}

var w_cur = 0;
var h_cur = 0;
var block;

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 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 show_center_block(w,h)
{
w_cur = w;
h_cur = h;
block.style.display = "block";
block.style.width = w + "px";
block.style.height =  h + "px";
block.style.top = Math.floor(getClientHeight() / 2 + getBodyScrollTop()) + "px";
block.style.left = Math.floor(getClientWidth() / 2 + getBodyScrollLeft()) + "px";
block.style.margin = "-" + Math.floor(h / 2) + "px 0px 0px -" + Math.floor(w / 2) + "px";
}

function unshow_center_block()
{
block.style.display = "none";
}

window.onscroll = window.onresize = function ()
	{
		if (block)
		{
		if (block.style.display == "block")
			{
				block.style.top = Math.floor(getClientHeight() / 2 + getBodyScrollTop()) + "px";
				block.style.left = Math.floor(getClientWidth() / 2 + getBodyScrollLeft()) + "px";
				block.style.margin = "-" + Math.floor(h_cur / 2) + "px 0px 0px -" + Math.floor(w_cur / 2) + "px";
			}
		}
	}
