
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 winInfo(id)
{
	var Obj=document.getElementById(id);
	var width=parseInt(Obj.style.width);
	var height=parseInt(Obj.style.height);
	
	var ObjW=parseInt(width)/2;
	var ObjH=parseInt(height)/2;
	
	var W=getClientWidth()/2-ObjW + getBodyScrollLeft();
	var H=getClientHeight()/2-ObjH + getBodyScrollTop();
	
	
	Obj.style.display="block";
	Obj.style.position="absolute";
	Obj.style.top=H;
	Obj.style.left=W;
	Obj.style.width=width+"px";
	Obj.style.height=height+"px";
	
}

function winInfoDestroy(id)
{
	var divObj=document.getElementById(id);
	divObj.style.display="none";
}

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);
}

/* Функции для класса List.php */
function listNameClick(par)
		{
			var n=par.nextSibling;
			n.style.display=n.style.display=="block" ? "none" : "block";
			/*par.className = par.className == "listNameMinus" ? "listNamePlus" : "listNameMinus"; */
		}
function listNameClickLast(par)
		{
			var n=par.nextSibling;
			n.style.display=n.style.display=="block" ? "none" : "block";
			/*par.className = par.className == "listNameMinusLast" ? "listNamePlusLast" : "listNameMinusLast"; */
		}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
function showPicture(pictureObject)
{
	//var width = (!pictureObject.width) ? 800:pictureObject.width;
	//var height = (!pictureObject.height) ? 600:pictureObject.height;
	var width = 800;
	var height = 600;
	
	var hostName=window.location.host;
	
	var pictureSrc=str_replace("http://"+hostName,"",pictureObject.src);
	var pictureSrc=str_replace("http://www."+hostName,"",pictureSrc);
	
	var newWin=window.open("/viewPicture.php?src="+pictureSrc,"","width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,directories=no,scrollbars=yes,dependent=yes,resizeable=no,center=yes");
	//newWin.document.write("<body></body>");
	moveWindowToCenter(newWin);
	//newWin.location.href=pageUrl;

}

function moveWindowToCenter(winObj)
{
	if(winObj.innerWidth)
	{
		var w=winObj.outerWidth;
		var h=winObj.outerHeight;
	}
	else
	{
		with(winObj.document.body)
		{
			var w=clientWidth;
			var h=clientHeight;
		}
	}
	
	var X=parseInt(getClientCenterX() - w/2);
	var Y=parseInt(getClientCenterY() - h/2);
	//alert("x="+X+" , Y="+Y);
	winObj.moveTo(X,Y);
	
	return 1;
}



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 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);
}

function getClientCenterY()
{
	return parseInt(getClientHeight()/2);
}



