
/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// resize fix for ns4
var origWidth2, origHeight2;
if (document.layers) {
	origWidth2 = window.innerWidth; origHeight2 = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth2 || window.innerHeight != origHeight2) history.go(0); }
}

// link style change
var cur_link2;
function doLinkClass2(lnk2) {
  if (lnk2 && lnk2.blur) lnk2.blur();	// remove marquee
  if (!lnk2 || cur_link2 == lnk2) return;
  if (cur_link2) cur_link2.className = "visited";
  lnk2.className = "currentpage";
  cur_link2 = lnk2;
}

var cur_lyr2;	// holds id of currently visible layer
function swapLayers2(lnk2,id) {
  doLinkClass2(lnk2);
  if (cur_lyr2) hideLayer2(cur_lyr2);
  showLayer2(id);
  cur_lyr2 = id;
}

function showLayer2(id) {
  var lyr2 = getElemRefs2(id);
  if (lyr2 && lyr2.css) lyr2.css.visibility = "visible";
}

function hideLayer2(id) {
  var lyr2 = getElemRefs2(id);
  if (lyr2 && lyr2.css) lyr2.css.visibility = "hidden";
}

function getElemRefs2(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getlyr2Ref(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getlyr2Ref(lyr2,doc) {
	if (document.layers) {
		var thelyr2;
		for (var i=0; i<doc.layers.length; i++) {
	  	thelyr2 = doc.layers[i];
			if (thelyr2.name == lyr2) return thelyr2;
			else if (thelyr2.document.layers.length > 0) 
	    	if ((thelyr2 = getlyr2Ref(lyr2,thelyr2.document)) != null)
					return thelyr2;
	  }
		return null;
  }
}

function init2(id,lyr2) {
  var lnk2 = getElemRefs2(id);
  swapLayers2(lnk2,lyr2);
}




