/*************************************************************************
  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 origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getMenuRef(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 getMenuRef(menu,doc) {
	if (document.layers) {
		var theMenu;
		for (var i=0; i<doc.layers.length; i++) {
	  	theMenu = doc.layers[i];
			if (theMenu.name == menu) return theMenu;
			else if (theMenu.document.layers.length > 0) 
	    	if ((theMenu = getMenuRef(menu,theMenu.document)) != null)
					return theMenu;
	  }
		return null;
  }
}
