$(document).ready(function() {
 $(".cycle li").hide();
      $(".cycle li:first-child").show();
      var total = $(".cycle li").size() + 1;
      var count = 1;
	  var navEnabled = 1;
      $(".next a").click( function() {
		if (navEnabled == 1) {
		clearInterval(autoScroll);
        $(".cycle li:nth-child("+count+")").fadeOut();
		navEnabled = 0;
        count++;
        if (count == total) {
          count = 1;
        }
		nextFadeIn = setInterval(function() {
        	$(".cycle li:nth-child("+count+")").fadeIn( function() { navEnabled = 1 } );
			clearInterval(nextFadeIn);
		}, 500);
        return false;
		}
      });
      $(".previous a").click( function() {
		if (navEnabled == 1) {
		clearInterval(autoScroll);
        $(".cycle li:nth-child("+count+")").fadeOut();
		navEnabled = 0;
        count--;
        if (count == 0) {
          count = total - 1;
        }
		nextFadeIn = setInterval(function() {
        	$(".cycle li:nth-child("+count+")").fadeIn( function() { navEnabled = 1 } );
			clearInterval(nextFadeIn);
		}, 500);
        return false;
		}
      });
	  
autoScroll = setInterval(function() {
		if (navEnabled == 1) {
        $(".cycle li:nth-child("+count+")").fadeOut();
		navEnabled = 0;
        count++;
        if (count == total) {
          count = 1;
        }
		nextFadeIn = setInterval(function() {
        	$(".cycle li:nth-child("+count+")").fadeIn( function() { navEnabled = 1 } );
			clearInterval(nextFadeIn);
		}, 500);
        return false;
		}
}, 5000); 
	 
});
