// JavaScript Document

function submenue(id)
{
	document.getElementById(id).style.visibility = "visible";
}

function submenue_exit(id)
{
	document.getElementById(id).style.visibility = "hidden";
}

var pic_index = 1;

function goleft(name, filetype, imgId)
{
	if(pic_index > 1)
	{
		pic_index--;
		document.getElementById(imgId).src = "../image/" + name + pic_index + filetype;		
	}
}

function goright(name, filetype, imgId, maxValue)
{
	if(pic_index < maxValue)
	{
		pic_index++;
		document.getElementById(imgId).src = "../image/" + name + pic_index + filetype;		
	}
}

function goleftTitle(name, filetype, imgId)
{
	if(pic_index > 1)
	{
		pic_index--;
		document.getElementById(imgId).src = "../image/" + name + pic_index + filetype;
		document.getElementById('title').innerHTML = imgTitles[pic_index - 1];
	}
}

function gorightTitle(name, filetype, imgId, maxValue)
{
	if(pic_index < maxValue)
	{
		pic_index++;
		document.getElementById(imgId).src = "../image/" + name + pic_index + filetype;
		document.getElementById('title').innerHTML = imgTitles[pic_index - 1];
	}
}

var img1 = '<img src="../image/';
var img2 = '" alt="" height="333" id="gallery_pic"/>';
function goleftLightbox(name, filetype, imgId)
{
	if(pic_index > 1)
	{
		pic_index--;
		var str = '';
		for(i = 0; i < pic_index - 1; i++)
			str += imgs[i] + '</a>';
		str += imgs[pic_index - 1] + img1 + name + pic_index + filetype +  img2 + '<a/>';
		for(j = pic_index; j < 15; j++)
		  	str += imgs[j] + '</a>';
		document.getElementById('img').innerHTML = str;	
	}
}

function gorightLightbox(name, filetype, imgId, maxValue)
{
	if(pic_index < maxValue)
	{
		pic_index++;
		var str = '';
		for(i = 0; i < pic_index - 1; i++)
			str += imgs[i] + '</a>';
		str += imgs[pic_index - 1] + img1 + name + pic_index + filetype + img2 + '<a/>';
		for(j = pic_index; j < 15; j++)
		  	str += imgs[j] + '</a>';
		document.getElementById('img').innerHTML = str;	
	}
}

