/* This Script is used to control the layers for the listings display. */

var doc_loaded = false;	// set true onload
window.onload = function () {
	doc_loaded = true;	// ready for layers to be shown
// If you want a layer to be visible when the document is loaded,
// put its id below.
loadLyr('lyr01') ;
// other onload function calls can go here

}

var cur_lyr;
function loadLyr(lyr) {
	if (!doc_loaded) return;
	if (cur_lyr) hide_lyr(cur_lyr);
  cur_lyr = lyr;
	show_lyr(cur_lyr);
}


function show_lyr(lyr) {
	var theLyr = (document.layers)? getLyrRef(lyr,document) : (document.all)? document.all[lyr].style : (document.getElementById)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.zIndex=1000;
	theLyr.visibility = "visible";
}

function hide_lyr(lyr) {
	var theLyr = (document.layers)? getLyrRef(lyr,document) : (document.all)? document.all[lyr].style : (document.getElementById)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.zIndex=1;
	theLyr.visibility = "hidden";
}

// get reference to nested layer for ns4
// from dhtmllib.js by Mike Hall of www.brainjar.com
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;
  }
}