var flashing_post_delay = 7000;
var flashing_post_fade_time = 2000;
var top_flashing_post = null;
var next_flashing_post = null;

function activate_flashing_posts() {

var c = jQuery('.flashing-post').length;
var r = Math.ceil(Math.random() * c);
	
	next_flashing_post = jQuery('.flashing-posts').children(':nth-child(' + r + ')');
	next_flashing_post.show();
	setTimeout('change_flashing_posts()',flashing_post_delay);
}

function change_flashing_posts() {
	top_flashing_post = next_flashing_post;
	next_flashing_post = top_flashing_post.next();
	if(next_flashing_post.html() == null) {
		next_flashing_post = jQuery('.flashing-post:first');
		next_flashing_post.show();
		top_flashing_post.fadeOut(flashing_post_fade_time);
	} else {
		next_flashing_post.fadeIn(flashing_post_fade_time,function(){top_flashing_post.hide();});
	}
	setTimeout('change_flashing_posts()',flashing_post_delay);
}