/**************************************
* Autore:  Roberto Bellingeri         *
* e-mail:  bellingeri[at]netguru.it   *
* Licenza: GPL                        *
**************************************/

function headerfade()
{
    var $active=$('#testa_immagine img.testa_immagine_attiva');

    if ($active.length==0) $active=$('#testa_immagine img:last');

    var $next=$active.next().length ? $active.next() : $('#testa_immagine img:first');

    $active.addClass('testa_immagine_precedente');

    $next.css({opacity: 0.0}).addClass('testa_immagine_attiva').animate({opacity: 1.0}, 1000, function()
    {
            $active.removeClass('testa_immagine_attiva testa_immagine_precedente');
    });
}

$(document).ready(function() { setInterval('headerfade()',5000); });
