// JavaScript Document
$(document).ready(function(){
	$('.jquery-backup img:not(":first"), #image-rotation .image-slide:not(":first"), #news-image-rotation .news-image-slide:not(":first")').hide();
    var count=0;
    var countImages = $('.jquery-backup img, #image-rotation .image-slide, #news-image-rotation .news-image-slide:not(":first")').size();

    if(countImages>1){
        setInterval(nextImage,4000);
    }

    function nextImage() {
        $('.jquery-backup img:eq('+count+'), #image-rotation .image-slide:eq('+count+'), #news-image-rotation .news-image-slide:eq('+count+')').fadeOut(1500);
        if(count<countImages-1){
            count++;
        } else {
            count=0;
        }
       $('.jquery-backup img:eq('+count+'), #image-rotation .image-slide:eq('+count+'), #news-image-rotation .news-image-slide:eq('+count+')').fadeIn(1500);
    }

});
