agent = navigator.userAgent

browserVer = DetectBrowser();

// preload universal images:
if (browserVer >= 3) {
spbook = new Image(72,80);
spbook.src = "../images/spic_book_dim.gif";
spbook_lit = new Image(72,80);
spbook_lit.src = "../images/spic_book_lit.gif";
spaccs = new Image(69,80);
spaccs.src = "../images/spic_accs_dim.gif";
spaccs_lit = new Image(69,80);
spaccs_lit.src = "../images/spic_accs_lit.gif";
spcoin = new Image(67,80);
spcoin.src = "../images/spic_coin_dim.gif";
spcoin_lit = new Image(67,80);
spcoin_lit.src = "../images/spic_coin_lit.gif";
spacad = new Image(71,80);
spacad.src = "../images/spic_acad_dim.gif";
spacad_lit = new Image(71,80);
spacad_lit.src = "../images/spic_acad_lit.gif";
spadrs = new Image(89,30);
spadrs.src = "../images/spic_adrs_dim.gif";
spadrs_lit = new Image(89,30);
spadrs_lit.src = "../images/spic_adrs_lit.gif";
splink = new Image(88,30);
splink.src = "../images/spic_link_dim.gif";
splink_lit = new Image(88,30);
splink_lit.src = "../images/spic_link_lit.gif";
}

function DetectBrowser()
{
  var version = 0;
  
  if (navigator.userAgent.indexOf("Mozilla/4.6") != -1) version = 4;
  else if (navigator.userAgent.indexOf("Mozilla/4.5") != -1) version = 4;
  else if (navigator.userAgent.indexOf("Mozilla/4.0") != -1) version = 4;
  else if (navigator.userAgent.indexOf("Mozilla/3.0") != -1) version = 3;
  else if (navigator.userAgent.indexOf("Mozilla/2.0") != -1) version = 2;
  else if (navigator.userAgent.indexOf("MSIE") != -1) version = 1;
  else if (document.images != -1) version = 4;
  else version = 0;
  return version;
}

function PutImg(imgDocID,imgObjName) {
//   imgDocID - the name or number of the document image to be replaced
//   imgObjName - the name of the image object to be swapped in

 if (browserVer >= 3) {
  document.images[imgDocID].src = eval(imgObjName + ".src")
 }
}
