/*
GALLERY FUNCTIONS FOR H.O.C. TEMPLATE SYSTEM
REQUIRES JWPLAYER
*/
function getFotoIndex(src)
{
	rtv = 0;
	for (i=1;i<=fotomax;i++) {if (unescape(foto[i]) == unescape(src)) {rtv = i;}}
	return rtv;
}

function showfull(id,src)
{
	if (fvstatus == 0)
	{
		gdiv = document.getElementById('grayout');
		gdiv.style.visibility = 'visible';
		fdiv = document.getElementById('fullview');
		fdiv.style.visibility = 'visible';
		fvstatus = 1;
	}
	fdiv.style.left = (document.body.clientWidth / 2) - 90;
	fdiv.style.top = 10 + document.body.scrollTop;
	currentfoto = getFotoIndex(src);
	document.images['fullviewfoto'].src = '/files/gallery/450/'+foto[currentfoto];
	document.getElementById('fullviewtitle').innerHTML = fototitle[currentfoto];
}

function fullviewclose()
{
	if (fvstatus == 1)
	{
		document.images['fullviewfoto'].src = '/plugins/nofoto.jpg';
		gdiv = document.getElementById('grayout');
		gdiv.style.visibility = 'hidden';
		fdiv = document.getElementById('fullview');
		fdiv.style.visibility = 'hidden';
		fvstatus = 0;
		currentfoto = 0;
	}
}

function fullnavi(dir)
{
  if (currentfoto > 0)
  {
		currentfoto = currentfoto + dir;
		if (currentfoto < 1) {currentfoto = fotomax}
		if (currentfoto > fotomax) {currentfoto = 1}
		document.images['fullviewfoto'].src = '/files/gallery/450/'+foto[currentfoto];
	document.getElementById('fullviewtitle').innerHTML = fototitle[currentfoto];
  }
}
