function popupImage(imageSRC, imageWidth, imageHeight, imageAlt, windowName) {
	winHeight = imageHeight+ 5;
	winWidth = imageWidth+ 5;
	popupWin = window.open("", windowName, "width=" +  winWidth + ",height=" +  winHeight + ",status=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
	popupWin.document.open();
	popupWin.document.write("<html><head>");
	popupWin.document.write("<title>" + imageAlt + "</title>");
	popupWin.document.write('</head><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
	popupWin.document.write('<style type="text/css">body {text-align: center; vertical-align: middle; height: 100%;} html {height: 100%;}</style>');
	popupWin.document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center" valign="center"><img src="' + imageSRC + '" width="' + imageWidth + '" height="' + imageHeight + '" alt="' + imageAlt + '" /></td></tr></table>');
	popupWin.document.write("</body></html>");
	popupWin.document.close();
	popupWin.focus()
}


function showLayer(sLayerName) {
	labelMouseOver (sLayerName);
	for (var i=0; i < aLabels.length; i++) {
		if (aLabels[i].id == sLayerName && sSelectedLayerName != sLayerName) {
			document.getElementById(sLayerName + 'Body').className = 'layerVisible';
		} else {
			if (document.getElementById(aLabels[i].id + 'Body')) {
				document.getElementById(aLabels[i].id + 'Body').className = 'layer';
			}
		}
	}
	sSelectedLayerName == sLayerName ? sSelectedLayerName = 'none' : sSelectedLayerName = sLayerName;
	setTopMargin ();
}

function labelMouseOver (sLayerID) {
	for (var i=0; i < aLabels.length; i++) {
		aLabels[i].id == sLayerID ? aLabels[i].className = 'selected' : aLabels[i].className = '';
	}
}

function labelMouseOut () {
	for (var i=0; i < aLabels.length; i++) {
		aLabels[i].className = '';
	}
	labelMouseOver (sSelectedLayerName);
}

function setTopMargin () {
	document.getElementById('bottomLayers').style.marginTop = '-' + document.getElementById('bottomLayers').offsetHeight + 'px';
}


