// you merge all the contents into a single file
// then instead of having setting the window.load attribute twice,
// you set it only once to a function called myInit, but you could call it
// anything you want, and in this function you call initAll and choosePic

window.onload = myInit;

function myInit()
{
    initAll();
    choosePic();
}

// these are the contents of menu.js
// don't want to set this anymore, setting it twice gives problems
// window.onload = initAll;

function initAll() {
var allLinks = document.getElementsByTagName("a");

for (var i=0;i<allLinks.length;i++) {
    if (allLinks[i].className.indexOf("menulink") > -1) {
        allLinks[i].onclick = toggleMenu;
	}
  }
}

function toggleMenu() {
   var startMenu = this.href.lastIndexOf("/")+1;
   var stopMenu = this.href.lastIndexOf(".");
   var thisMenuName = this.href.substring(startMenu,stopMenu);

   var thisMenu = document.getElementById(thisMenuName).style;
   if (thisMenu.display == "block") {
       thisMenu.display = "none";
   }
   else {
       thisMenu.display = "block";
   }

   return false;
}

// these are the contents of random.js
// don't want to set this anymore, setting it twice gives problems
// window.onload = choosePic;

var myPix = new
Array("images/volunteers.jpg","images/valley.jpg","images/JobsRiver.jpg","images/MoveRock.jpg","images/pinenuts.jpg","images/GirlScouts.jpg");

function choosePic() {
 randomNum=Math.floor((Math.random() * myPix.length));
 document.getElementById("BannerPhotos").src = myPix[randomNum];
}
