refresh image with jquery asynch
<p>I use the script beneath to refresh a webcam image. It refreshes every 18 seconds and after 8 refresh it stops refreshing. I have a feeling it does not cancel it correctly. Because after some time I see the loading sign going haywire. Is there something wrong with my script?</p>

<pre><code>var count = 0;
function CamRefresh() {
    count++;
    if(count &gt; 8) clearInterval(timeout);
    updatecam();
}
var timeout = setInterval(CamRefresh, 18000);

});

function updatecam() {
$('#loading').show('fast');
$('#activecam').attr('src', 'http://weeg.binaer.no/weeg_com/nesjordet.jpg?time='+Date());
$('#loading').hide('slow');
$('#currentswitch').hide(1500);
$('#dayswitch').show();
}
</code></pre>
