	var currentRef = "";

	function onAfter(curr, next, opts) {
		//show the caption by making the li selector display inline
	    var index = opts.currSlide;

	    var str = "";
	    for(props in opts){
		str = str + props + "\\n";
		}

	   opts.containerResize = 0;

	    $("#captionInfo>li").css("display","none");
	    $("#captionInfo>li:eq("+index+")").css("display","inline");
	}


	$(document).ready(function(){
		currentRef = "fullimg_0";
		catchclick(0, 0);
		$('#nav .thumb').click(
			function() {
			var test = ($(this).attr('id'));
			test = test.split("img_")[1]
			catchclick(test*1, 0);
		});
		$('.slideImg ').click(
			function() {
			var test = ($(this).attr('id'));
			test = test.split("fullimg_")[1];
			catchclick(test*1, 1);
	  	});
	  });

	function catchclick(arg, adv) {
		arg +=adv;
		if (arg >= totalSlides) arg = 0;
		var ref  = "fullimg_" + arg;
		var thumbRef = '#'+ 'img_' + arg;
		$(".thumb>a").css("border","1px solid #ccc");
		$(thumbRef + ">a").css("border","1px solid #FFCC00");
		document.getElementById(currentRef).style.display = "none";
		document.getElementById(ref).style.display = "inline";
		$('#'+ref).css("disply","inline");
		$("#captionInfo>li").css("display","none");
	    $("#captionInfo>li:eq("+arg+")").css("display","inline");
		currentRef = ref;
	}
	
	$.fn.cycle.defaults.timeout = 4000;
	$(function() {
		$('#imageHolder').css("display","inline");

		$('#imageHolder').cycle({
		speed:   2000,
		timeout: 1000,
		next:   '#imageHolder',
		height:'auto',
		fit:1,
		pause:   1
		});
	});
	//(300 - w) / 2