Hello everyone! I need help with my code, I want to alternate more than just 2 images using a function and setInterval. Here is my code, can anyone tell me what's wrong with it?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">

<title>Banner Advertising</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<style type="text/css">
body { font-family: "Trebuchet MS" }

<script type="text/javascript">
/* <![CDATA[ */

var intImage = 2;
function concerts(){
	switch (intImage){
		case 1:
			document.images[0].src = "concert1.gif";
			intImage = 2;
		case 2:
			document.images[0].src = "concert2.gif";
			intImage = 1;
		case 3:
			document.image[0].src = "concert3.gif";
			intImage = 4;
		case 4:
			document.image[0].src = "concert4.gif";
			intImage = 5;

		case 5:
			document.image[0].src = "concert5.gif";
			intImage = 1;

/* ]]> */

<body onload="var begin=setInterval('concerts()',5000);">
<p><img src="concert1.gif" alt="Changing concert advert images" /></p>


I also tried using if... else but I'm not cracking it. :?:

Those images won't work by changing only image URL source because they are not loaded onto the page. JavaScript is not Ajax that sends request to the server to return the image. You need to load all images and hide those you don't want to be displayed. Then use Javascript to set/change the style in order to display what you want. You can look at http://www.daniweb.com/forums/thread272711.html as an example. There are many ways to do it too.