﻿$(function() {
	    $('#slideshow_content_2')
	    	//.after('<p id="counter">')
	    	.cycle({
				fx: 'fade',
			    next: '#next',  // id of element to use as click trigger for next slide 
			    prev: '#prev',  // id of element to use as click trigger for previous slide 
			    timeout: 0,  // milliseconds between slide transitions (0 to disable auto advance) 
			    speed: 500,  // speed of the transition (any valid fx speed value) 
			    pager:  '#slideshow_preview', 
				before:  function(idx, slide){
							var count = $('img',slide).attr('title'); 
							$('#counter').html( count ); 
							 
				}, 
				//after:   onBefore, 
			    // callback fn that creates a thumbnail to use as pager anchor 
			    pagerAnchorBuilder: function(idx, slide) {
		            // return sel string for existing anchor
		            return '#slideshow_preview li:eq(' + (idx) + ') a';
		        }
	    });
	    
	    $("#prev_preview").css({
			     'display':'none'
		});                  
	        
	});
