var preloadFlag = false;

if (document.images)
{
  var onImgArray = new Array();
  onImgArray['home'] = new Image();
  onImgArray['about'] = new Image();
  onImgArray['team'] = new Image();
  onImgArray['projects'] = new Image();
  onImgArray['marketing'] = new Image();
  onImgArray['pr'] = new Image();
  onImgArray['creative'] = new Image();
  onImgArray['film'] = new Image();
  onImgArray['graphic'] = new Image();
  onImgArray['web'] = new Image();
  onImgArray['home'].src = 'images/home_active.gif';
  onImgArray['about'].src = 'images/about_active.gif';
  onImgArray['team'].src = 'images/team_active.gif';
  onImgArray['projects'].src = 'images/projects_active.gif';
  onImgArray['marketing'].src = 'images/marketing_active.gif';
  onImgArray['pr'].src = 'images/pr_active.gif';
  onImgArray['creative'].src = 'images/creative_active.gif';
  onImgArray['film'].src = 'images/film_active.gif';
  onImgArray['graphic'].src = 'images/graphic_active.gif';
  onImgArray['web'].src = 'images/web_active.gif';

  var offImgArray = new Array();
  offImgArray['home'] = new Image();
  offImgArray['about'] = new Image();
  offImgArray['team'] = new Image();
  offImgArray['projects'] = new Image();
  offImgArray['marketing'] = new Image();
  offImgArray['pr'] = new Image();
  offImgArray['creative'] = new Image();
  offImgArray['film'] = new Image();
  offImgArray['graphic'] = new Image();
  offImgArray['web'] = new Image();
  offImgArray['home'].src = 'images/home.gif';
  offImgArray['about'].src = 'images/about.gif';
  offImgArray['team'].src = 'images/team.gif';
  offImgArray['projects'].src = 'images/projects.gif';
  offImgArray['marketing'].src = 'images/marketing.gif';
  offImgArray['pr'].src = 'images/pr.gif';
  offImgArray['creative'].src = 'images/creative.gif';
  offImgArray['film'].src = 'images/film.gif';
  offImgArray['graphic'].src = 'images/graphic.gif';
  offImgArray['web'].src = 'images/web.gif';

  preloadFlag = true;
}

function imageOn(imgName)
{
    if (preloadFlag) {
        document.images[imgName].src = onImgArray[imgName].src;
    }
}

function imageOff(imgName)
{
    if (preloadFlag) {
        document.images[imgName].src = offImgArray[imgName].src;
    }
}