function changeSlide(tag, slide, maxSlides) {
		
	//  Change the slide...
	$(tag + ' > ul > li').each(
		function (index) {
			// Hide all other slides.
			$(this).hide();
		
			// Show the desired slide.
			if(index == slide) {
				$(this).show();
			}
		}
	);
	
	// Put buttons down that we can click to change images/video/text, whatever...
	$(tag).parent().parent().find('#viewerSlideNumber').html('');
	$(tag).parent().parent().find('#viewerSlideNumber').append((slide+1) + '/' + maxSlides);
}


function setViewer (tag) {

	// Keep track of some things...
	var maxSlides = 0;
	var currentSlide = 0;

	//  Gather up all the images.
	$(tag + ' > ul > li').each(
		function (index) {
			// Hide all elements except the first one.
			if(index > 0) {
				$(this).hide();
			}
			
			// Get acount of how manu items we have.
			maxSlides = index;
		}
	);
	
	// Assign a click event to right button.
	$(tag).parent().parent().find('a').find('#viewerRightBtn').click(
		function () {
			currentSlide = currentSlide+1;
			if(currentSlide > maxSlides) {
				currentSlide = 0;
			}
			
			changeSlide(tag, currentSlide, maxSlides+1);
		}
	);
	
	// Assign a click event to the left button.
	$(tag).parent().parent().find('a').find('#viewerLeftBtn').click(
		function () {
			currentSlide = currentSlide-1;
			if(currentSlide < 0) {
				currentSlide = maxSlides;
			}
			
			changeSlide(tag, currentSlide, maxSlides+1);
		}
	);
	
	// Put buttons down that we can click to change images/video/text, whatever...
	$(tag).parent().parent().find('#viewerSlideNumber').append('1/' + (maxSlides+1));
}
