function WM_imageSwap(daImage, daSrc){
	  var objStr,obj;
	
	  // Check to make sure that images are supported in the DOM.
	  if(document.images){
	    // Check to see whether you are using a name, number, or object
	    if (typeof(daImage) == 'string') {
	      // This whole objStr nonesense is here solely to gain compatability
	      // with ie3 for the mac.
	      objStr = 'document.' + daImage;
	      obj = eval(objStr);
	      obj.src = daSrc;
	    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
	      daImage.src = daSrc;
	    }
	  }
	}

function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

// 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 swapLayers(id) {
	  if (cur_lyr) hideLayer(cur_lyr);
	  showLayer(id);
	  cur_lyr = id;
	}
	
	function showLayer(id) {
	  var lyr = getElemRefs(id);
	  if (lyr && lyr.css) lyr.css.visibility = "visible";
	}
	
	function hideLayer(id) {
	  var lyr = getElemRefs(id);
	  if (lyr && lyr.css) lyr.css.visibility = "hidden";
	}
	
	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;
	}
	
	// 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;
	  }
	}
