//--------Don't edit!!!!!!!!!!!
//--------Не редактировать!!!!!
//--------bearbeit nicht!!!!!!
document.write("<script language='javascript' type='text/javascript' src='/js/global.js'></"+"script>");
//---------------------------------------------------------------------
function openImg(obj)
{
	var img = obj.href;
	img = img.split(document.domain+'/');
	img = img[1];
	WaitScreen (true, 'empty');
	document.getElementById(DarkID).onclick = function () { WaitScreen(false); };
	doLoad('/imginfo/'+img+'?w='+screen.width+'&h='+screen.height, null, openImgRes);
	return false;
}
function openImgRes(res)
{
	res = eval ('( ' + res + ' )');
	if (res.error)
	{
		alert(res.error);
		WaitScreen (false);
	}
	else
	{

		var back = document.getElementById(DarkID);
		var div = document.createElement('DIV');
		div.id = DarkID+'img';
		var l = ( getClientWidth() - res.width)/2;
		var t = getBodyScrollTop() + findDimensions()/2 - res.height/2 ;
		if (l < 0) l = 0;	if (t < 0) t = 0;
		div.setAttribute('style','position: absolute; left:'+l+'px; top:'+t+'px; background-color: #000000; width:'+res.width+'px; height:'+res.height+'px; z-index:'+(back.style.zIndex+1));
		var img = document.createElement('IMG');
		img.style.backgroundColor = '#000000';
		img.style.width = res.width+'px';
		img.style.height = res.height+'px';
		img.style.cursor = 'hand';
		img.style.border = '2px SOLID #060606';
		img.src = '/'+res.src;
		back.onclick = img.onclick = function () {	var div = document.getElementById(DarkID+'img');div.parentNode.removeChild(div);	 WaitScreen (false);	} 
		div.appendChild(img);
		document.body.appendChild(div);
	}
}
//---------------------------------------------------------------------

function findDimensions(dim){ 
	var width = 0, height = 0; 
	if(window.innerWidth){ 
		width = window.innerWidth; 
		height = window.innerHeight; 
	} 
	else if(document.documentElement && document.documentElement.clientWidth){ 
		width = document.documentElement.clientWidth; 
		height = document.documentElement.clientHeight; 
	} 
	else if(document.body && document.body.clientWidth){ 
		width = document.body.clientWidth; 
		height = document.body.clientHeight; 
	} 
	if (dim)return width;
	else    return height;
} 


