diaporama image
<p>i did this code:
<pre></p>

<code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
 &lt;head&gt;
 &lt;script src="http://code.jquery.com/jquery-1.8.2.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"&gt;&lt;/script&gt;


&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;/head&gt;
&lt;script&gt;
setInterval(function(){chrono('t');},1000);
&lt;/script&gt;
&lt;?php
include('function.php');
session_start();
global $list;
$list= captcha_list($_SESSION['id']);
global $i;
$i=0;
?&gt;

&lt;script&gt;
function chrono(id){
inte= parseInt(document.getElementById(id).innerHTML,10);

switch(inte)
{
case 0:
document.getElementById(id).innerHTML='7';


 break;
case 1:
document.getElementById(id).innerHTML='0';
document.getElementById('im').src="&lt;?php echo $list[$i]['captcha'];?&gt;" ;


    break;
  case 2:
document.getElementById(id).innerHTML='1';


    break;
  case 3:
document.getElementById(id).innerHTML='2';
   break;
  case 4:
document.getElementById(id).innerHTML='3';
  break;
  case 5:
document.getElementById(id).innerHTML='4';
   break;
  case 5:
document.getElementById(id).innerHTML='4';
    break;
  case 6:
document.getElementById(id).innerHTML='5';
  break;
  case 7:
document.getElementById(id).innerHTML='6';
&lt;?php $i++; ?&gt;

    break;
default:
    break;
}

};
&lt;/script&gt;
&lt;body style="background-image:url(paper_03.png)" &gt;

 &lt;form name="form_2"  style="background-image:url(paper_02.png);position: absolute; top:30px; left: 200px; width: 500px; height: 500px;" &gt;
                    &lt;CENTER&gt;
                        &lt;table style="position: relative; top:30px;" &gt;
                    &lt;tr&gt;&lt;td colspan=4&gt;&lt;label&gt;Image will be refresh in &lt;label id="t" name="t"&gt; 7 &lt;/label&gt;  seconds
                     &lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td height=200px &gt;&lt;label&gt;Image &lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td height=200px colspan=2&gt;&lt;input type="image" id="im" src="&lt;?php echo $list[$i]['captcha'];?&gt;" style=" height=150px" /&gt; &lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td height=200px&gt;&lt;label&gt;Text &lt;/label&gt;&lt;/td&gt;&lt;td colspan=3 height=200px&gt;&lt;input type="text" name="cap" style="width: 400px" /&gt; &lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="answer" value="SUBMIT ANSWER" style="height:200%;background-image:url(paper_03.png)"/&gt; &lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="know" value="DON'T KNOW" style="height:200%; background-image:url(paper_03.png)"/&gt; &lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="pause" value="SUBMIT AND PAUSE" style="height:200%;background-image:url(paper_03.png)"/&gt; &lt;/td&gt;
                    &lt;/tr&gt;


                &lt;/table&gt;

    &lt;/CENTER&gt;
&lt;/form&gt;     
&lt;/body&gt;
&lt;footer&gt;
&lt;?php 
include('header_footer/footer.php');
?&gt;
&lt;/footer&gt;
&lt;/html&gt;
</code></pre>

<p>the problem is the first image displayed is the second one in array and the third one is never displayed.the changes is when timer=7 and timer=0.</p>

<ul>
<li>where is the error?</li>
<li>what is it cause?</li>
<li>how can i fix it?</li>
</ul>
