//Rotating current work
function bannerRotate(){
    var reset = function(looping){
        if (!looping){
            //first time
            //show first banner
            $('.holder:first').show();
            //$('.item:first').show();
        } else {
        //looped reset
            $('.holder').hide();
            //$('.item:first').show('slide', { direction: 'down' }, 600, function(){});
            //$('.item:first').fadeIn(fadeDelay);
            $('.holder:last, .holder:first').show();
            $('.holder:last, .item:last').fadeOut(fadeDelay);
        }
        rotate();
    };
    var rotate = function(){
        $(destinationDiv).everyTime(9000,'rotating', function(icount) {
            lastCount = icount-1;
            //$('.holder:eq('+icount+')').show('slide', { direction: 'down' }, 600, function(){});
            $('.holder:eq('+icount+')').fadeIn(fadeDelay);
			//$('.holder:eq('+ lastCount+')').hide('slide', { direction: 'up' }, 600, function(){});
            //$('.item:eq('+ icount+')').fadeIn(fadeDelay);
            //$('.item:eq('+ icount+')').show('slide', { direction: 'down' }, 600, function(){});
            //$('.item:eq('+ lastCount+')').hide('slide', { direction: 'up' }, 600, function(){});
            //$('.item:eq('+ lastCount+')').fadeOut(fadeDelay);
            if (icount == totalItems){
                reset(true);
            }
        }, totalItems);
    };
    //----  initialise ----------------
    var sourceDiv = '#contentBox';
    var item = '.banner';
    var wrappedSet = sourceDiv+' '+item;
    var destinationDiv = '#showBox';
    //var totalItems = $('#showBox .item').size();
    var totalItems = $(wrappedSet).size();
    var imgSrc = new Array();
    var fadeDelay = 2500;
	//var shotPos = (($(window).width())/2)-515;
    if (totalItems>1){
        //SETUP: make holders & text panels
        $(wrappedSet).each(function(i){
                imgSrc[i] = $(this).children('img:first').attr('src');
                $(destinationDiv).prepend('<div class="holder" style="background-image: url('+imgSrc[i]+')"></div>');
				
        });
		//screenshot click
		/*$('.holder').each(function(h){
			var shotLink = $('.item:eq('+h+')').children('ul.description').children('li').children('a.shotLink').attr('href');				   
			$(this).append('<a class="shotLink" href="'+shotLink+'"></a>');
	   });
		$('.shotLink').each(function(){
			var picSrc = $(this).attr('href');
			$(this).attr('href','#').click(function(){
				$('#bigShot').append('<div id="closeTop" class="closeBtn"></div>');
				$('#fadeOut').css('opacity',0).show().animate({opacity: 0.6}, 2000);
				$('.closeBtn').click(function(){
					$('#fadeOut').next().fadeOut(750, function(){$(this).empty();}).end().fadeOut(750);
				});
				$('#bigShot').css('left',shotPos).append('<img src="'+picSrc+'" />').fadeIn();
		   });
	   });*/
        reset();
    } else {
        imgSrc[0] = $(wrappedSet).children('img:first').attr('src');
        $(destinationDiv).prepend('<div class="holder" style="background-image: url('+imgSrc[0]+')"></div>');
    }
    //--------------------------------- 
}

