var actI=2;
function slideSwitch() {

    var $active = $('#imgList li.active');

    if ( $active.length == 0 ) $active = $('#imgList li:last');

    var $next =  $active.next().length ? $active.next()
        : $('#imgList li:first');
         
    if ( $active.next().length == 0 ) {
      getEl('imp'+eval(actI-1)).src = '/site/img/im_unact.gif';
    	actI=1;
    }

    getEl('imp'+actI).src = '/site/img/im_act.gif';
    getEl('imp'+eval(actI-1)).src = '/site/img/im_unact.gif';
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1500, function() {
            $active.removeClass('active last-active');
        actI = actI+1;
        });
}

$(function() {
    getEl('imp1').src = '/site/img/im_act.gif';
    setInterval( "slideSwitch()", 3000 );
});
