I am having trouble with a javascript script that rotates clickable banners. In Opera 9.5, I get an error
___________
JavaScript - http://.../sections/tools/emp/snarecruit.shtml
Timeout thread: delay 5000 ms
Error:
name: TypeError
message: Statement on line 13: Cannot convert undefined or null to Object
Backtrace:
Line 13 of linked script http://.../files/js/bannerup.js: In function cycle
document.banner1.src = image;
Line 1 of unknown script
cycle();
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
____________

In Firefox, I get the message that the banner1 is undefined. Do I need to create a variable showing that banner1 is equal to the image src?

Here is the javascript code:

var image = "";
var banners = 0;

function cycle() {
if (++ banners > 3) banners = 1;
loadbanners();
document.banner1.src = image;


window.setTimeout( 'cycle();' , 5000 );
}


function loadbanners() {
if (banners==1)
{
image="/files/banners/studysmart.jpg";
}
if (banners==2)
{
image="/files/banners/icnm.jpg";
}
if (banners==3)
{
image="/files/banners/2009-Springer-banner.jpg";
}
}


var link = "https://www.cgfnsstore.org/index.php?main_page=product_info&products_id=207"

function urlswitch() {
if (banners==1)
{
link = "https://www.cgfnsstore.org/index.php?main_page=product_info&products_id=207";
}
if (banners==2)
{
link = "http://www.intlnursemigration.org";
}
if (banners==3)
{
link = "http://www.springerpub.com/cgfns-nurses";
}
return link;
}

____

I have had two classes in javascript and it's still quite muddy to me. I am a quick study and learned html and css very quickly, don't know why this is so unclear to me....

cheers
Nancy