Replace your code with this and change the div class to ID = slideshow But focus on SA comment too.
<script type="text/javascript">
$(function() {
$("#slideshow > div:gt(0)").hide();
setInterval(function() {
$('#slideshow > div:first')
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo('#slideshow');
}, 3000);
});
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http:
<!-- Begin
var theImages = new Array()
theImages[0] = 'http://farm9.staticflickr.com/8359/8450229021_9d660578b4_n.jpg'
theImages[1] = 'http://farm9.staticflickr.com/8510/8452880627_0e673b24d8_n.jpg'
theImages[2] = 'http://farm9.staticflickr.com/8108/8456552856_a843b7a5e1_n.jpg'
theImages[3] = 'http://farm9.staticflickr.com/8230/8457936603_f2c8f48691_n.jpg'
theImages[4] = 'http://farm9.staticflickr.com/8329/8447290659_02c4765928_n.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
</script>