function slideshow() {

    //fadeIn the img: done in custom.js after resize...
    //jQuery('#cycle img').fadeIn(300);
/*
    var actions = jQuery('#cycle div').not(':first').length;
    if (actions > 0) {jQuery('#loader').fadeIn();}

    //show its label
    if (jQuery('#cycle div:first').html().length != 0) {
        jQuery('#cycleCap').html(jQuery('#cycle div:first').html()).fadeIn(300);
    }

    //load all images
    jQuery('#cycle div').not(':first').each(function () {
        var img = new Image();
        var src = jQuery(this).attr('src');
        jQuery(img).load(next).attr('src', src);
    })
    
    function next() {
        if (--actions) return;
        //all loaded
        //startCarousel();
    }
    if (actions == 0) { jQuery('#cycleNav').hide().addClass('single') }
*/
  $('#cycle').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		transition: 0,
    next:   '#nxt',
    prev:   '#prv',
    speed:       2000,  // speed of the transition (any valid fx speed value)
    speedIn:     null,  // speed of the "in" transition
    speedOut:    null
	});

  setInterval(function(){
    resize();
  },50);
  

  
   //show cycleNav on mouse over the image
    jQuery('#cycle, #cycleNav').hover(function () {
        jQuery('#cycleNav').css({'visibility':'visible'})
    }, function () {
        jQuery('#cycleNav').css({'visibility':'hidden'})
    })
    
}
/*
var refreshIntervalId;
var interval = 5000;
function startCarousel() {

    jQuery('#loader:visible').fadeOut();
    jQuery('#cycleNav').not('.single').show()

    var cycleNav = jQuery('#cycleNav');
    //jQuery(cycleNav).fadeIn('fast', function () {
        refreshIntervalId = setInterval(function () { carousel('nxt', false); }, interval);
        jQuery('.cycleBtn').one('click', function () {
            clearInterval(refreshIntervalId)
            carousel(jQuery(this).attr('id'), true)
        });
   //});

   //show cycleNav on mouse over the image
    jQuery('#cycle img, #cycleNav').hover(function () {
        jQuery('#cycleNav').not('.single').show()
    }, function () {
        jQuery('#cycleNav').not('.single').hide()
    })

}

function carousel(direction, isButton) {
    
    //hide label
    jQuery('#cycleCap').empty().fadeOut(300);

    var $active = jQuery('#cycle div.active');
    var $next;
    if (direction == 'nxt') {
        $next = $active.next().length ? $active.next() : $('#cycle div:first');
    }
    if (direction == 'prv') {
        $next = $active.prev()
        if ($active.attr('src') == $('#cycle div:first').attr('src')) {
            $next = $('#cycle div:last');
        }
    }

    //get next img src attr
    var src = $next.attr('src');
    var $img = $('#cycle img');

    $img
    .animate({ opacity: 0.0 }, 300, function () {
        $(this).attr('src', src)
        .animate({ opacity: 1.0 }, 300, function () {

            //show its label
            if ($next.html().length != 0) {
                $('#cycleCap').html($next.html()).fadeIn(300);
            }
            
            //change active
            $active.removeClass('active');
            $next.addClass('active');
            if (isButton) {
                $('#' + direction).one('click', function () { carousel(direction, true) })
            }

        })
    })


}
*/
