jQuery(document).ready(function(){
	showing = jQuery('#streamer_jquery div.streamer_jquery_item:first'); // Initiate the 'showing' variable as the first rotating_item

	showing.siblings('div.streamer_jquery_item').hide(); // Hide all other rotating_items

	$('#streamer_jquery').bind("click" ,function (e){show_next_rotating_item(showing);})
	setTimeout("show_next_rotating_item(showing)", 5000); // Set the rotate time to 5 seconds

});

// Below is the code that picks an item at random to display
jQuery.jQueryRandom = 0;
jQuery.extend(jQuery.expr[":"],
{
    random: function(a, i, m, r) {
        if (i == 0) {
            jQuery.jQueryRandom = Math.floor(Math.random() * r.length);
        };
        return i == jQuery.jQueryRandom;
    }
});

// The below function repeatedly gets called, to do the rotating
function show_next_rotating_item(t){
	jQuery(t).fadeOut('slow');

	var next_rotating_item = jQuery(t).siblings('#streamer_jquery div.streamer_jquery_item:random');
	if(!next_rotating_item.attr('class')){
		next_rotating_item = jQuery('#streamer_jquery div.streamer_jquery_item:first');
	}
	next_rotating_item.fadeIn(1600);

	showing = next_rotating_item;
	setTimeout("show_next_rotating_item(showing)", 5000); // Set the rotate time to 5 seconds
}