Random image in javascript problem

before i ask this question i would like to preface it by saying that i can’t use php because doteasy’s $0 web hosting doesn’t support it unless you pay them extra money (which i don’t have)

so here we go…

in the header to my website i have a picture that is loaded at random every time the site is loaded. i would like to have it load only once and be the same throughout the many pages of my site but as far as i know, that is only possible with php. so i found a javascript code that will load a different picture everytime the page is loaded. it works fine but every once in awhile i get “undefined” where the picture should be. i checked all of my numbers and image names and everything but i can’t get it to go away. as of now, only the main page has the random images.

so what should i do?

my site is at www.davekoen.com/version2 for now. when i get this working i am going to switch it to my main page.

thanks for your help.