function hideImg(elem){
  elem.fadeOut(2000,function(){
    if ( $(this).prev().length ) {
	  hideImg($(this).prev());
	} else {
	  showImg($(this));
	}
  })
}

function showImg(elem){
  elem.fadeIn(2000,function(){
    if ( $(this).next().length ) {
	  showImg($(this).next());
	} else {
	  hideImg($(this));
	}
  })
}
