var fadeTime = 1000;
var showTime = 5000;
function rotator() {
  $('.slideshow img').css({opacity: 0.0});
  $('.slideshow img:first').css({opacity:1.0}).addClass('show');
  setInterval('rotate()',showTime);
}
function rotate() {
  var current = ($('.slideshow img.show')? $('.slideshow img.show') : $('.slideshow img:first'));
  var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('.slideshow img:first') :current.next()) : $('.slideshow img:first'));
  next.css({opacity: 0.0}).addClass('show').animate({opacity:1.0},fadeTime);
  current.animate({opacity:0.0},fadeTime).removeClass('show');
};
$(document).ready(function() {
  rotator()
});
