var cur_lyr;	// holds id of currently visible layer

function test() {
  alert("this js file is working");
}

function swapshowLayer(id, id2, id3) {
	hideLayer(id);
	showLayer(id2);
	showLayer(id3);
}

function swaphideLayer(id, id2, id3) {
	hideLayer(id);
	showLayer(id2);
	hideLayer(id3);
}

function swapLayer(id, id2) {
	hideLayer(id);
	showLayer(id2);
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
  	lyr.css.position = "relative";
  	lyr.css.visibility = "visible";
  	lyr.css.top = 0;
  	
  }
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) 
  {
  	lyr.css.position = "absolute";
  	lyr.css.visibility = "hidden";
  	lyr.css.top = 850;
  }
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}