$(function() {
	$('.list_link').click(function(e) {
								   
		e.preventDefault();	
		
		var listId = $(this).attr('id');
		var listIdSplit = listId.split('_');
		var listNum = listIdSplit[2];
		
		$('.list_text').hide();
		$('.list_link').removeClass('current');
		
		$('#list_text_' + listNum).show();
		$('#list_link_' + listNum).addClass('current');
		
	});
});

var imgStart = 1; // image number to start with
var imgCurrent = imgStart; // current image, assigned start image value
var imgNext = imgStart + 1; // image number of queued image
var imgCount = false; // total number of images
var imgElement = '#tour_image_'; // <img> id that holds rotating images
var imgArray = new Array(); // array that stores image objects of rotating images
imgArray[imgStart] = true;
var imgPath = '../../global_images/tour/';

function swapInit(count, delay)
{
	imgCount = count;
	imgDelay = delay;
	
	var t = setInterval("swapImage()", imgDelay); // start the rotation
}


function swapImage()
{
	$(imgElement + imgNext).css('display', 'none').css('z-index', '2').show();
	
	$(imgElement + imgCurrent).css('z-index', '1');						
								
	imgCurrent = imgNext;
			
	imgNext = (imgCurrent < imgCount) ? imgCurrent + 1 : imgStart;
}

