/****************************************************/
/** Free script for any use, but please include    **/
/** a link to i-code.co.uk in any redistribution.  **/
/**                                                **/
/** Author : Stephen Griffin, www.i-code.co.uk     **/
/****************************************************/

function album_odkaz()
{
	var list = document.getElementById('optionlist');
	if (list == null) //administrace
	{
		return 0;
	}
	else {	
		list = list.options[list.selectedIndex].value;
		list = list.substr(19);
		list = list.split("&");
		return 'f/'+list[0];
	}
}

function changeImage(n)
{
	var list = document.getElementById('optionlist');
	document.getElementById('mainimage').src = list.options[list.selectedIndex].value;
	
	if (n == 'bigmainimage')
	{
		list = list.options[list.selectedIndex].value;
		list = list.substr(19);
		list = list.split("&");
		document.getElementById('bigmainimage').src = 'f/'+list[0];
	}
}

function prevImage(n)
{
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == 0)
	{
		list.selectedIndex = list.options.length-1;
	}
	else
	{
		list.selectedIndex--;
	}
	changeImage(n);
}

function nextImage(n)
{
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == list.options.length-1)
	{
		list.selectedIndex = 0;
	}
	else
	{
		list.selectedIndex++;
	}
	changeImage(n);
}
