$(document).ready(function() {
    $('.rotator').cycle({
        fx: 'fade',
        timeout: 0,
        next: '#next',
        prev: '#prev',
        after: function(curr, next, opts) {
            var caption = (opts.currSlide + 1) + '/' + opts.slideCount;
            $('#LabelCount').html(caption);
            
        },
        before: function() {
            if ($(this).attr('nodeName') !== 'IMG') {

                $('span#imgText').html($(this).find('img').attr("Alt"));

                var _imgHeight = $(this).find('img').attr('height') + 13;


                if (_imgHeight > 0) {
                    _imgHeight = _imgHeight + 'px';
                    $('.rotator').css('height', _imgHeight);

                }
                
            }
            else {
                $('span#imgText').html($(this).attr("Alt"));


                var _imgHeight = $(this).attr('height') + 13;


                if (_imgHeight > 0) {
                    _imgHeight = _imgHeight + 'px';
                    $('.rotator').css('height', _imgHeight);
                }
                
            }



        }
    });
});
$(function() {
    $('.preview').lightBox();
});

