
var cur_thmb;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_thmb) hideLayer(cur_thmb);
  showLayer(id);
  cur_thmb = id;
}

function showLayer(id) {
  var thmb = getElemRefs(id);
  if (thmb && thmb.css) thmb.css.visibility = "visible";
}

function hideLayer(id) {
  var thmb = getElemRefs(id);
  if (thmb && thmb.css) thmb.css.visibility = "hidden";
}

function getElemRefs(id) {
	var debs = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (debs) debs.css = (debs.style)? debs.style: debs;
	return debs;
}