<!--
/* PAGE ONLOAD EVENTS */

window.onload = function() {
  createMouseovers();
  };

/* MOUSEOVER FUNCTION */

function createMouseovers() {
  var overExt = "ON";
  if (document.getElementsByTagName) {
    var imgs = document.getElementsByTagName("IMG")
    var i, dotAt, imgFile, imgExt, preloads = new Array(imgs.length);
    for (i = 0; i < imgs.length; i++) {
      if (imgs[i].className && imgs[i].className == "mouseover") {
        dotAt  = imgs[i].src.lastIndexOf(".");
        if (dotAt > 0) {
          imgFile = imgs[i].src.substr(0,dotAt);
          imgExt  = imgs[i].src.substr(dotAt+1);
          if (imgFile.lastIndexOf(overExt) == imgFile.length - overExt.length) {
            // do nothing; image is already on
            }
          else {
            eval("imgs[i].onmouseover = function () {this.src = '" + imgFile + overExt + "." + imgExt + "'};");
            eval("imgs[i].onmouseout = function () {this.src = '" + imgFile + "." + imgExt + "'};");
            preloads[i]     = new Image;
            preloads[i].src = imgFile + overExt+ "." + imgExt;
            }
          }
        }
      }
    }
  }

/* SEARCH FUNCTIONS */

function checkSearch(searchString) {
  if (searchString.value == "") {
    alert("Please enter a word or phrase to search for");
    searchString.focus();
    return false;
    }
  else {
    return true;
    }
  }

function doSiteSearch(searchString,whichSite) {
  if (checkSearch(searchString)) {
    if (whichSite == "national") {
      document.location = "http://www.sierraclub.org/search.asp?searchString=" + searchString.value;
      }
    else {
      document.location = "http://search.atomz.com/search/?sp-a=sp10020341&sp-f=iso-8859-1&sp-q=" + searchString.value;
      }
    }
  }

/* FRAMEBUSTER FUNCTION */

if (top.location != self.location) {
  top.location = self.location;
  }
//-->
