var imageData = new Array();

function slideSwitch(image) {
    var imageCount = imageData[image][1];
    var holderName = imageData[image][0];
    
    if(imageCount > 1) {
        var $active = $(holderName +' img.active');


        if ( $active.length == 0 ) { $active = $(holderName +' img:last'); }

        var $next = $active.next().length == 1 ? $active.next() : $(holderName +' img:first');

        $active.addClass('last-active');

        $next.css({opacity: 0.0, 'z-index': '12'})
            .addClass('active')
            .animate({opacity: 1.0}, 1000, function() {
                $active.removeClass('active last-active')
                .animate({ opacity: 0.0 }, 100, function() { $active.css({'z-index': '9'}) })
            });
    }
}

$(document).ready(function() {
    /*imageCount = $('#imageRotator').children().length;
    $('#imageRotator img').css( { opacity: 0.0 } );
    $('#imageRotator img.active').css( {opacity: 1.0} );
    imageData[0] = ["#imageRotator", imageCount ];
    $(document).everyTime('5s', 'imageSwicth', function() { slideSwitch(0); } );*/
    $('#imageRotator').cycle({ fx: 'fade' }); 
});
