/**
 * Javascript functions for the wamsb.org website.
 * Author: Seth Davenport
 * Date: 2003-05-13.
 */

// Opens a window customized for the viewing of member accoun reports.
function reportWindow(URL) {
	windowHandle = window.open(URL, 'title', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1');
	if (windowHandle.focus)
		windowHandle.focus();

	// Ensure that the child window has a reference to its parent.
	if(windowHandle.opener == null)
		windowHandle.opener = self;
}

// Trick to pre-load all map images for smoother operation.
function preloadMap() {
	var mapImages = new Array(6);
	var preloadCells = new Array(6);

	mapImages[0] = "pics/north_america.gif";
	mapImages[1] = "pics/south_america.gif";
	mapImages[2] = "pics/africa.gif";
	mapImages[3] = "pics/asia.gif";
	mapImages[4] = "pics/europe.gif";
	mapImages[5] = "pics/international.gif";

	for (i=0; i<preloadCells.length; i++) {
		preloadCells[i] = new Image();
		preloadCells[i].src = mapImages[i];
	}
	return false;
}

// Tells the 'name' image element to display the image at 'newPath'.
function imageSwap(name, newPath) {
	document[name].src=newPath;
	return false;
}
