/* Basic functions. */

function m_preloadImages(tgtstr, vals) {
  if (document.images) {
    if (document.preImgs == null) {
      document.preImgs = new Array();
    }
    with (document) {
      document.preImgs[tgtstr] = new Array();
      for (var j = 0; j < vals.length; j++) {
        preImgs[tgtstr][j] = new Image();
        preImgs[tgtstr][j].src = vals[j];
      }
    }
  }
}

// swap tgt's src to preloaded images
function m_swap2 (tgt, state) {
  eval ("document." + tgt + ".src = \""
    + document.preImgs["document."+tgt][state].src + "\";");
}

