Ok so I have this script:

Code:
<script type="text/javascript">

			window.onload = (function()
			{
				var numberOfBackGroundImages = 5;
				return function()
				{
					document.getElementsByTagName('body')[0].style.backgroundImage = 'url(images/background/0' + Math.ceil(Math.random() * numberOfBackGroundImages) + '.jpg)';
				};
			}());

		</script>
And its a in-page javascript for loading a random background image when the page first loads.

Try as I might I'm looking for a VERY SIMPLE tutorial on how to take this script and put it in a external javascript file and then load it when the page first loads.
And then call it into the HTML page first thing, like right after the body tag opens.

Now I really don't know much about javascript and there in lies the problem with many of the tutorals that I'm trying to read, they have a lot of extra info and background stuff, and to be really honest I just don't want to learn all that stuff at this point.

So I guess my question is how to I take the above script change it enough so its in and exteral JS file and then load it into the HTML page and then call the function into the body section of HTML page first thing.

Thanks for the help,

John