// Settings for the image rotation and navigation between slides below. Note the commented out code was from a request that they had to make the slides random. To be deleted at a later time.
$(function() {

	/*$('.pics a').css({
        opacity: 0
    });
setTimeout(function() {
*/
    $('#s4 p').cycle({
        fx:      'fade',
		/*delay: -1000,*/
        speed:  1000,
        timeout: 4000,
		/*random: 1,*/
        prev:    '#prev',
        next:    '#next',
        pager:   '#numbers',
        pagerAnchorBuilder: pagerFactory,
		pauseOnPagerHover: true,
		before:onLink
    });

    function pagerFactory(idx, slide) {
        var s = idx > 4 ? ' style="display:none"' : '';
		var n = idx > 4 ? document.getElementById('next').style.display='block': document.getElementById('next').style.display='none';
        return '<li'+s+'><a href="#">'+(idx+1)+'</a></li>';
    };
	
	/*$('.pics a').css({
	        opacity: 0
	    });
	
}, 500);*/
	function onLink() { 
    $('#over-link').attr('href',this.href);  
	};
    
});
