// Baby pages script
// Keith Wansbrough 2004-10-14,2007-03-14

function ri(e,s) {  /* replace image; for mouseover effects */
  document.getElementById(e).setAttribute("src",e+s+".png");
}

function ri2(e,s) {  /* replace image; for mouseover effects */
  document.getElementById(e).setAttribute("src",s);
}

function preloadImages(imgs) {  /* set with = new Array("foo","bar",...) */
  for (var i=0; i<imgs.length; i++) {
    var img = new Image();
    img.src = imgs[i];
  }
}

function rio(s) {  /* replace overlay image; for toys page */
  document.getElementById('overlay').setAttribute("src","toys-montage-003xas-i-"+s+".png");
}

function setvis(id,v) {
  document.getElementById(id).style.visibility = (v ? "visible" : "hidden");
}
function getvis(id) {
  return (document.getElementById(id).style.visibility == "visible");
}
function lbv(s,v) {
  setvis(s+"-on",v)
  if (s == "stairL" || s == "stairR") {
    setvis("stair-light",getvis("stairL-on") != getvis("stairR-on"));
  } else {
    setvis(s+"-light",v);
  }
}

function lbt(s) {
  lbv(s,!(getvis(s+"-on")));
}
