/**********************/ /**********************/
// 2007-05-06: First release
// 2009-02-17: Revision to consolidate versions
/**********************/ /**********************/

// Popup window.
function openWindow(path, name, width, height){
	width = width == null ? 800 : width;
	height = height == null ? 600 : height;
	wleft = (screen.width - width) / 2;
	wtop = (screen.height - height) / 2;
	// IE5 and other old browsers might allow a window that is partially offscreen or wider than the screen. Fix that. (Newer browsers fix this for us, but let's be thorough.)
	if (wleft < 0) {
		width = screen.width;
		wleft = 20;
	}
	if (wtop < 0) {
		height = screen.height;
		wtop = 20;
	}
	var win = window.open(path, name, "width=" + width + ", height=" + height + ", " + "left=" + wleft + ", top=" + wtop + ", location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
	// Just in case 'width' and 'height' are ignored
	win.resizeTo(width, height);
	// Just in case 'left' and 'top' are ignored
	win.moveTo(wleft, wtop);
	win.focus();
}

// Template
function imageOn(imgName){
 eval('document.' + imgName + '.src = "media/' + imgName + '_on.png"');
}

function imageOff(imgName){
 eval('document.' + imgName + '.src = "media/' + imgName + '.png"');
}
