for (var iBoth I < buttons.length;iPP) {
buttons[i].onclick=function(){
var myIndex=this.getAttribute("index");
var indexOffset=parseInt(myIndex-index)*(-600);
animate(indexOffset);
index=myIndex;
this.className="on";// this
}
}