// JavaScript Document
function showLogin()
{
	if(document.getElementById("login").style.display=='none')
	{
		document.getElementById("login").style.display='block'
	}
	else
	{
		document.getElementById("login").style.display='none'
	}
}
function checkAll(obj)
{
	var ms=document.getElementById("messages");
	var ch=ms.getElementsByTagName("input");
	for(var i=0;i<ch.length;i++)
	{
		ch.item(i).checked=obj.checked;
	}
}
function searchClick(url)
{
	var txt=document.getElementById("search").value;
	if(txt.length>2)
	{
		window.location=url+"&search="+txt;
	}
}
function ShowPopUp()
{
	var p=document.getElementById("pop");
	p.style.display='';
	var w=GetWidth();
	var h=GetHeight();
	p.style.left=(w/2-300)+"px";
	p.style.top=(h/2-240)+"px";
	window.scrollTo(0,0);
	window.onscroll=function() { window.scrollTo(0,0) }
	openImg();
}
function ClosePopUp()
{
	var p=document.getElementById("pop");
	p.style.display='none';	
	window.onscroll=function() {}
}
function Next()
{
	++imgsel;
	if(imgsel>ar.length-1)
	{
		--imgsel;
	}
	openImg()
}
function Previous()
{
	--imgsel;
	if(imgsel<0)
	{
		imgsel=0;
	}
	openImg()
}
function openImg()
{
	var img=document.getElementById("popImg");
	img.src='files/photo_galleries/big/'+gallery+'/'+ar[imgsel];
}
function GetHeight()
{
	var y = 0;
	if (self.innerHeight)
	{
			y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
			y = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
			y = document.body.clientHeight;
	}
	return y;
}
function GetWidth()
{
	var y = 0;
	if (self.innerWidth)
	{
			y = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
			y = document.documentElement.clientWidth;
	}
	else if (document.body)
	{
			y = document.body.clientWidth;
	}
	return y;
}