I've a problem with the setTimeout function. This is the code:
1 var urlArray = ["pic1.gif"; "pic2.gif"]
2 function changeBackground(elementId, backgroundImage){
3 document.getElementById(elementId).style.background="url("+backgroundImage+")";
4 }
5 function mouseover_1(elementId){
6 changeBackground(elementId,urlArray[0]);
7 setTimeout("changeBackground(elementId,urlArray[1])",300);
8 }
And in the body:
<area shape="rect" coords="0,0,95,91" onMouseOver="mouseover_1('navigator_1')">
Now, line 6 in the Javascript code works like a charm (the picture changes!), but line 7 doesn't work (no picture change). This is the error from debugging in Firefox:
elementId is not defined line: 7
But since line 6 works, I really don't know what the problem could be. Do you have any suggestions?