$(function() {
var newsPanelForce=0;
var newsPanelNum=$("section").length;
$("section").css("display","none");
$("#slides").html($("section:first").html());
$("#circles a:first").attr("class","circleb");
$("#slides .panel").css("display","block");
function changePanel(){
$("#circles a").attr("class","circlea");
$("#circles a:eq("+newsPanelForce+")").attr("class","circleb");
$("#slides").html($("section:eq("+newsPanelForce+")").html());
$("#slides .panel").stop().fadeIn(1000,'easeOutCubic');
}
function autoScrollNewsPanel(){
	if(newsPanelForce<(newsPanelNum-1)){
	newsPanelForce++;
	changePanel();
	} else {
	newsPanelForce=0;
	changePanel();
	}
}
var newsPanelRollTimer=setInterval(autoScrollNewsPanel,5000);
$("#circles a").mouseover(function(event){
clearInterval(newsPanelRollTimer);
$("#circles a").attr("class","circlea");
$(event.target).attr("class","circleb");
newsPanelForce=$("#circles a").index($(event.target));
changePanel();
});
$("#circles a").mouseout(function(){
newsPanelRollTimer=setInterval(autoScrollNewsPanel,5000);
});
});
