$(document).ready(function(){ 


	var imageCount = $('#slideshow img').length;
	if(imageCount==1){
		// if only 1 image
		$('#slide_nav').hide();
	}
	
	$('#slideshow').cycle({
		fx:'fade', 
		speed:'300', 
		timeout: 0, 
		next:'#next,#slideshow', prev:'#prev',
		after: onAfter,
	});

	
	
	function onAfter(curr,next,opts) {
		var caption = (opts.currSlide + 1) + '/' + opts.slideCount;
		$('#slide_count').html(caption);
		
		/*if((opts.currSlide +1)==opts.slideCount){ 
			$('#slideshow').cycle('toggle');
			$('#next').attr("href","http://songisabelhee.com");
		};*/
	};
	
	
	$('#info_detail').hide();
	$('#info_close').hide();
	$('#credits_detail').hide();
	$('#credits_close').hide();


	$('#info').click(function () {
		infoClick();
	});

	
	$('#info_close').click(function () {
		infoClose();
	});

	function infoClick() {
      $('#info_detail').show("fast");
      $('#info_close').show("fast");
      $('#info').hide("fast");
      return false;	
	};

	function infoClose() {
		$('#info_detail').hide("fast");
		$('#info_close').hide("fast");
		$('#info').show("fast");
		return false;	
	};

});



