<script type="text/javascript">
function counter() {
var first;
var number;
if (first == ""){
var first = 42;
var number = 0;
}else{
var number = number++;
}
var full = 7;
var length = strlen(number);
var full = full - length;
for (i=0;i<full;i++){
document.getElementById('counter').innerHTML = document.write('<img src="images/0.gif" border="0">');
}
for (i=0;i<length;i++){
document.getElementById('counter').innerHTML = document.getElementById('counter').innerHTML + document.write('<img src="images/'.number.substring(i,1).'.gif" border="0">);
}
}
var stop = setInterval("counter()",1000);
</script>
<span class="counter"></span>
What the code should do is show an image counter that increases by one every second and always shows 7 digits. Yet when the page loads nothing is shown, any ideas why?