var vtimer;

function slideSwitch() {
      var $active = $('#slideshow DIV.active');
  
      if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
  
      var $next =  $active.next().length ? $active.next()
          : $('#slideshow DIV:first');

      $active.addClass('last-active');
      
      $next.css({opacity: 0.0})
          .addClass('active')
          .animate({opacity: 1.0}, 2000, function() {
              $active.removeClass('active last-active');
          });

}

function onClickSlideSwitch(active, focus){
        var $active = $('#'+active);            
        var $next = $('#'+focus);
        $active.addClass('last-active');    
        $next.addClass('active');
        $active.removeClass('active last-active');
   
      window.clearInterval(vTimer);
      vTimer = setInterval( "slideSwitch()", 6000 );
    
}

$(function() {
    vTimer = setInterval( "slideSwitch()", 6000 );
});

