function openGallery(period)
{
	document.gallery.period.value = period;

	// Set the action of the form (the next page that will appear to the user)
		document.gallery.action = "thumbs.php"
		// Submit the form
		document.gallery.submit();
		return true;

}

function openGalleryfrom(period)
{
	document.gallery.period.value = period;

	// Set the action of the form (the next page that will appear to the user)
		document.gallery.action = "EFlyers/thumbs.php"
		// Submit the form
		document.gallery.submit();
		return true;

}

function showPicture(period, image)
{
	document.thumbs.period.value = period;
	//document.thumbs.folder.value = folder;
	document.thumbs.image.value = image;

	// Set the action of the form (the next page that will appear to the user)
		document.thumbs.action = "thumbs_slideshow.php"
		// Submit the form
		document.thumbs.submit();
		return true;

}

function underConst()
{
	alert("Large size photos coming soon!!!");	
	//document.thumbs.submit() = false;
	//return false;
}

function movePicture(where)
{

	var imagescomma = document.slide.allimages.value;
	var imagesarray = imagescomma.split(",");
	var counter = 0;
	var pos=0;
	
	if (where == "first")
	{
		pos = 0;
	}
	else if (where == "next" )
	{
		for (i=0;i<imagesarray.length;i++)
		{
			if (document.slide.image.value == imagesarray[i])
			{
				counter = i;
				break;
			}
			
		}
		if (counter<imagesarray.length-2)
		{
			pos=counter+1;
		}
		else
		{
			pos = imagesarray.length-1;
		}
	}
	else if (where == "previous")
	{
		for (i=0;i<imagesarray.length;i++)
		{
			if (document.slide.image.value == imagesarray[i])
			{
				counter = i;
				break;
			}
			
		}
		if (counter>0)
		{
			pos=counter-1;
		}
		else
		{
			pos = 0;
		}
	}
	else
	{
		pos=imagesarray.length-1;
	}
	
	document.slide.image.value=imagesarray[pos];
	var image = document.getElementById("display"); 
	var source = document.slide.period.value + "/" + imagesarray[pos];
	
	image.src = source;
	
	return false;
}

// Created by Christoforos Nikitas