/*JS for Featured articles*/

$(document).ready(function(){
	//hide em all to start
	$(".view-id-featured_articles .view-content .views-row").hide();
	//show the first one
	$(".view-id-featured_articles .view-content .views-row-1").show();
	
	//start the rotating
	setTimeout('fadeEngine(1)',6000);
});

function fadeEngine(x) {

	var total_divs=$(".view-id-featured_articles .view-content").children().size();

	var y=x;

	if(x==total_divs) y=1; else y++;
		$(".view-id-featured_articles .view-content .views-row-"+x).fadeOut(1000,function(){
			$(".view-id-featured_articles .view-content .views-row-"+y).fadeIn(1000);
	});

	setTimeout('fadeEngine('+y+')',6000); //modify 3000 to set the time in miliseconds for a div to be shown
}
