var curPop = Array;
function rotatePop(inc,cat,count) {
	if (typeof(curPop[cat])=='undefined') curPop[cat]=0;
	next = curPop[cat];
	if (inc==-1 && next>0) {
		togglePop(next+3,false,cat);
		togglePop(next-1,true,cat);
		next--;
	} else if (inc==1 && next+4<count) {
		togglePop(next,false,cat);
		togglePop(next+4,true,cat);
		next++;
	}
	toggleArrow(false,next>0,cat);
	toggleArrow(true,next+4<count,cat);
	curPop[cat]=next;
}
function togglePop(num,on,cat) {
	document.getElementById("latpost-"+cat+"-"+num).style.display=on?"block":"none";
}
function toggleArrow(right,on,cat) {
	var el;
	if (right) el=document.getElementById("latright-"+cat);
	else el = document.getElementById("latleft-"+cat);
	el.style.display=on?"block":"none";
}