function shiftPainel(num) {
  if (num != atual) {
    atual = num;
    counter = num;
    $$('.big').each(function(v){v.hide();});
    $('big'+num.toString()).appear({duration: 0.5});

    $$('.small').each(function(v){v.setStyle({ width: '194px', backgroundColor: '#fff', backgroundImage: 'url(../images/small_bg2.gif)'})});
    $('small'+num.toString()).setStyle({ width: '205px', backgroundColor: '#fffaaf', backgroundImage: 'url(../images/small_bg.gif)'});
  }
}

function rollPainel() {
  counter = counter >= 7 ? 1 : counter + 1;
  shiftPainel(counter);
}

function smallOver(num) {
  pe.currentlyExecuting = true; 
  to=setTimeout("shiftPainel(" + num.toString() + ")", 300);
}

function smallOut() {
  pe.currentlyExecuting = false;
  clearTimeout(to);
}

var pe = new PeriodicalExecuter(rollPainel, 6);
var counter = 1;
var to;
var atual;
