var oldbox=1;
var lastbox = 5;
var circle = true;

function ShowBox(id){

$("div#box" + oldbox).fadeOut("slow",function (){
	$("div#boxes > div").each(
		function(){			
			this.style.background = "#aaa";
		}
	);
	document.getElementById('box_l_' + id).style.background = "#777";
	$("div#box" + id).fadeIn("slow");
});

oldbox = id;

//circle = false;

}

function ClickBox(id){

$("div#box" + oldbox).fadeOut("slow",function (){
	$("div#boxes > div").each(
		function(){			
			this.style.background = "#aaa";
		}
	);
	document.getElementById('box_l_' + id).style.background = "#777";
	$("div#box" + id).fadeIn("slow");
});

oldbox = id;

circle = false;

}

function StartShowbox(){
if(circle == true){
	//alert();
	if(oldbox != lastbox){
		id = oldbox+1;
	}
	else{
		id = 1;
	}
	ShowBox(id);
	setTimeout("StartShowbox()", 5000);
}
}

function setbg(t,color){

t.style.background = "#" + color;

}
