//on ready
jQuery(document).ready(function(){

//the beginning of time
function f_beginTime (time, functionName) {
	$.timer(time, function (timer) {
		functionName();
	  	timer.stop();
	});
}

//and time was with god
function f_initTime () {
	f_beginTime (12000, f_fadePart1);
}

//and god saw that it was good and he set the world in motion
f_initTime();

function f_fadePart1 () {
	f_loadNewFaktaboxItem();
}

function f_fadePart2 (html) {
	f_changeFaktaboxItem (html, 1500, 500);
}

//and god collected information from the vast space of the universe
function f_loadNewFaktaboxItem() {
	//alert ('love');
	f_nextId = parseInt($('#faktaboxContainer h2').attr('faktaboxId'))+1;
	$.ajax({
				type: "POST",
				url: "modules/mod_faktabox.php",
				data: "faktaboxId="+f_nextId,
				success: function(html) {
					f_fadePart2 (html);
				}
 	});
}

//and displayed it for the world to see
function f_changeFaktaboxItem (html, upTime, downTime) {
	$('#faktaboxContainer').slideUp (upTime ,function () {
			$(this).html (html);
			$(this).slideDown (downTime,function () {
				$('#rightModuleBox #faktaboxContainer').biggerlink();
				f_initTime();
			});
	});
}

//end on ready
});