<!--
/*
This code is from Dynamic Web Coding 
at http://www.dyn-web.com/
Copyright 2001-2 by Sharon Paine 
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Permission granted to use this code 
as long as this entire notice is included.
*/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function loadLyr(lyr) {
	if (cur_lyr) {
		var curcss = get_lyr_css(cur_lyr);
		if (curcss) curcss.visibility="hidden";
	}
  cur_lyr = lyr;
	var curcss = get_lyr_css(cur_lyr);
	if (curcss) {
		curcss.visibility = "visible";
		curcss.zIndex = 1000;	// some browsers need z-index set
	}
}

// get reference
function get_lyr_css(id) {
	var lyr, lyrcss;
	lyr = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (lyr) lyrcss = (lyr.style)? lyr.style: lyr;
	return lyrcss;
}

// get reference to nested layer for ns4
// from old 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;
  }
}


//-->


var curx_lyrx;	// holds id of curxrently visible layer
function loadlyrx(lyrx) {
	if (curx_lyrx) {
		var curxcss = get_lyrx_css(curx_lyrx);
		if (curxcss) curxcss.visibility="hidden";
	}
  curx_lyrx = lyrx;
	var curxcss = get_lyrx_css(curx_lyrx);
	if (curxcss) {
		curxcss.visibility = "visible";
		curxcss.zIndex = 1000;	// some browsers need z-index set
	}
}

// get reference
function get_lyrx_css(id) {
	var lyrx, lyrxcss;
	lyrx = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getlyrxRef(id,document): null;
	if (lyrx) lyrxcss = (lyrx.style)? lyrx.style: lyrx;
	return lyrxcss;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getlyrxRef(lyrx,doc) {
	if (document.layers) {
		var thelyrx;
		for (var i=0; i<doc.layers.length; i++) {
	  	thelyrx = doc.layers[i];
			if (thelyrx.name == lyrx) return thelyrx;
			else if (thelyrx.document.layers.length > 0) 
	    	if ((thelyrx = getlyrxRef(lyrx,thelyrx.document)) != null)
					return thelyrx;
	  }
		return null;
  }
}



//-->

