// JavaScript Document
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 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 getClientCenterX()
{
	return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}

function getClientCenterY()
{
	return parseInt(getClientHeight()/2)+getBodyScrollTop();
}



function BigImg(bi_action, bi_url, W, H)
{
	msg_prev = "prev";
	msg_next = "next";
	msg_close = "close";

	if(bi_action == "open")
	{
		//document.getElementById("big_img").style.visibility = "visible";
		//alert(getClientCenterY());
		
		document.getElementById("big_img").style.visibility = "visible";
		document.getElementById("big_img").style.top = (getClientCenterY()-parseInt(H/2))+"px";
		if(typeof(arr_images) != "undefined")
		{
			bi_prev = "";
			bi_next = "";
			bi_select = "";
			for(i=0;i<arr_images.length;i++)
			{
				if(bi_select != "" && bi_next == "") bi_next = "<a href=javascript:BigImg('open','"+arr_images[i]+"','"+lang+"');>"+msg_next+" ></a>";
				if(arr_images[i] == bi_url) bi_select = arr_images[i];
				if(bi_select == "") bi_prev = "<a href=javascript:BigImg('open','"+arr_images[i]+"','"+lang+"');>< "+msg_prev+"</a> ";
			}
			document.getElementById("here_img").innerHTML = "<img src='"+bi_url+"' border=0 OnClick=BigImg('close');><br><div class='nav_l'>"+bi_prev+bi_next+"</div><div class='nav_r'><a href=javascript:BigImg('close');>"+msg_close+"</a></div>";
		}
		else
		{
			document.getElementById("here_img").innerHTML = "<img src="+bi_url+" border=0 OnClick=BigImg('close');><br><div class='nav_r'><a href=javascript:BigImg('close');>"+msg_close+"</a></div>";
		}		
	}
	else
	{
		document.getElementById("here_img").innerHTML = "";
		document.getElementById("big_img").style.visibility = "hidden";
	}
//	document.getElementById("big_img").style.top = getClientCenterY()+parseInt(H/2);
}


