////////////////////////////////////////////////////////////////////////
// * Timer

function Timer(time_start,time_curent,time_end,link)
{
    counter=time_curent-time_start;
    document.trivia.timer.value='' + counter + '';
    STOP=window.setTimeout(' Timer('+time_start+','+(time_curent+1)+','+time_end+',"'+link+'");',1000);

    if (counter >= time_end )
    {
        counter=0;
        window.clearTimeout(STOP);

        totalPunctaj=document.trivia.totalPunctaj.value;
        punctajMaxim=document.trivia.punctajMaxim.value;

        open( '?module=trivia&totalPunctaj=' + totalPunctaj + '&punctajMaxim=' + punctajMaxim , '_tops' );
    }
}

function TimerTeste(time_start,time_curent,time_end,id)
{
    counter=time_curent-time_start;
    document.getElementById('timer').value='' + counter + '';
    STOP=window.setTimeout(' TimerTeste('+time_start+','+(time_curent+1)+','+time_end+', ' + id + ');',1000);

    if (counter >= time_end )
    {
        counter=0;
        window.clearTimeout(STOP);

        open( 'index.php?module=teste_profi&action=test&idTest='+id+'&rezultat=1' , '_tops' );
    }
}
