var t;
var best=1;
var but=0;

function start_switcher() {
    var buts=document.getElementById('buttony').getElementsByTagName('a');
    but = buts.length;
    best_switcher();
   
}
function stop_switcher() {
    clearTimeout(window.t);
}
function best_switcher() {
    //alert('best_switcher 6 sec.');
    clearTimeout(window.t);
    window.t = setTimeout("switch_best(best)",6000); 
}
function long_switch(b) {
    if(but!=0){
    best=b; switch_(b);
    clearTimeout(window.t);
    //alert('long_switch 20 sec.');
    window.t = setTimeout("switch_best(best)",20000); 
    }
}
function switch_best(b) {
    switch_(b);
    best_switcher();
}
function switch_(b) {
    for(i=1;i<=but;++i) {
        document.getElementById('best_handler_'+i).style.display='none';
        document.getElementById('best_button_'+i).className='main_best_button';
    }
    document.getElementById('best_handler_'+b).style.display='block';
    document.getElementById('best_button_'+b).className='main_best_button current';
    
    best=((best % but)+1);
}