function slideSwitch() {
  var $active = $( '#slideshow img.active' );

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

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

  $active.addClass( 'last-active' );

  $next.css( { opacity: 0 } )
  .addClass( 'active' )
  .animate( { opacity: 1 }, 850, function() {
    $active.removeClass( 'active last-active' );
  });

/*  $next.css( { left: "789px" } )
  .addClass( 'active' )
  .animate( { left: 0 }, 600, 'swing', function() {
    $active.removeClass( 'active last-active' );
  }); */
}
    
$( function() {
	if ( $( '#slideshow img').length > 1 ) {
		setInterval( "slideSwitch()", 2800 );
	}
});
