function goto(url) 
{
	document.location.href = document.getElementsByTagName('base')[0].href + url;
}

var active = 0;

function initScroller()
{
	changeImage(active);
	
	/*for (var i=0; i < images_arr.length; i++)
	{
		
	}*/
}

function changeImage(num)
{
	if (active == 0)
	{
		$('thumb-div-' + active).style.display = 'none';
		$('thumb-div-' + (active+1)).style.display = 'none';
		$('thumb-div-' + (active+2)).style.display = 'none';		
	}
	else if (active == images_arr.length - 1)
	{
		$('thumb-div-' + (active-2)).style.display = 'none';
		$('thumb-div-' + (active-1)).style.display = 'none';
		$('thumb-div-' + active).style.display = 'none';
	}
	else
	{
		$('thumb-div-' + (active-1)).style.display = 'none';
		$('thumb-div-' + active).style.display = 'none';
		$('thumb-div-' + (active+1)).style.display = 'none';		
	}
	
	$('image-thumb-' + active).removeClassName('active');
	$('image-thumb-' + num).addClassName('active');
	
	$('image-holder').src = images_arr[num];
	active = num;
	
	if (active == 0)
	{
		$('thumb-div-' + active).style.display = 'block';
		$('thumb-div-' + (active+1)).style.display = 'block';
		$('thumb-div-' + (active+2)).style.display = 'block';		
	}
	else if (active == images_arr.length - 1)
	{
		$('thumb-div-' + active).style.display = 'block';
		$('thumb-div-' + (active-1)).style.display = 'block';
		$('thumb-div-' + (active-2)).style.display = 'block';		
	}
	else
	{
		$('thumb-div-' + active).style.display = 'block';
		$('thumb-div-' + (active-1)).style.display = 'block';
		$('thumb-div-' + (active+1)).style.display = 'block';		
	}
}

function imageNext()
{
	if (active < images_arr.length - 1)
	{
		changeImage(active + 1);
	}
}

function imagePrev()
{
	if (active > 0)
	{
		changeImage(active - 1);
	}
}
