topMenu = new Menus(new Menu('quicklinks-menu'),
new Menu('search-menu'),
new Menu('resources-menu'),
new Menu('about-menu'),
new Menu('academics-menu'),
new Menu('admissions-menu'),
new Menu('alumni-menu'),
new Menu('athletics-menu'),
new Menu('parents-menu'),
new Menu('churches-menu'),
new Menu('news-menu'),
new Menu('offices-menu'),
new Menu('schools-menu'));
topMenu.name = 'topMenu';

sidenav = new SideNav();

// an object to hold the captured event
var eventObject;

// Attach the listener to the search box
if(window.addEventListener)
{
    window.addEventListener("load",searchBoxListener,true);
}
else
{
    window.attachEvent("onload",searchBoxListener);
}

// Add the onfocus and onblur elements for the search box
function searchBoxListener()
{
  var inputElement = document.getElementById("q");
  inputElement.onfocus = clearBox;
  inputElement.onblur = checkBoxClear;
}

// Clear out any text the search box may have
function clearBox(){
  var query = document.getElementById("q");
  if(query.value.toString() == "Search George Fox") {
    query.value = "";
  }

}

// Check to see if "Search George Fox" should be added back to the search box
function checkBoxClear(){
  var query = document.getElementById("q");

  if(query.value.toString() == "") {
    query.value = "Search George Fox";
  }
}

function randomPhotos(max, count, path, prefix, ext, w, h) {
   var photos = new Array();
   var i = 0;
   while (i < count) {
      var photoid = Math.round(Math.random()*(max-1))+1;
      var found = false;
      for (var j=0;j < photos.length;j++) {
         if (photos[j] == photoid) {
            found = true;
         }
      }
      if (!found) {
         photos[i] = photoid;
         i++;
      }
   }

   for (var i=0;i < photos.length;i++) {
       if (i == 0) {
          document.writeln('<img src="'+path+'/'+prefix+ photos[i]+'.'+ext+'" width="'+w+'" height="'+h+'" border="0" vspace="10" alt="" />');
       }
       if (i == 1) {
          document.writeln('<img src="'+path+'/'+prefix+ photos[i]+'.'+ext+'" width="'+w+'" height="'+h+'" border="0" alt="" />');
       }
       if (i == 2) {
          document.writeln('<img src="'+path+'/'+prefix+ photos[i]+'.'+ext+'" width="'+w+'" height="'+h+'" border="0" vspace="15" alt="" />');
       }
   }

}