It seems like I followed the directions completely in my assignment powerpoint, I checked if I was using each function right, tripple checked my spelling, and I have no idea why it wont work, I'm very new to javascript, I tried debugging it from top to bottom, however it seems something is making my script not work, or I am doing something wrong all together. What am I doing wrong with my code?
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>Rollover Banner </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- VARIABLE DECLARATION -->
if (document.images)
{
var photos = new Array (“images1/nj1.jpg”,”images1/nj2.jpg”,”images1/dice1.jpg”);
var photoURLs = new Array (“msn.com”,”imdb.com”,”tv.com”);
}
var i = 0;
function newLocation()
{
document.location.href="http://www." + photoURLs[i];
}
function rotate()
{
i = Math.floor(Math.random()*3);
document.banner.src = photos[i];
document.write(i); //doesnt do anything
setTimeout("rotate()", 1000);
}
</SCRIPT>
</HEAD>
<BODY >
<a href="javascript:newLocation()"> <!--doesnt direct to anything -->
<img src="images1/nj2.jpg" name="banner"> <!--loads -->
</a>
<SCRIPT language="Javascript">
rotate();
</SCRIPT>
</BODY>
</HTML>