IE = 0;
NS4 = 0;
NS6 = 0;
sSDWindowCount = 0  // For SSD Display - John

if (document.layers)
	NS4 = 1;
if ((document.getElementById) && (document.all))
	IE = 1;
if ((document.getElementById) && (!(document.all)))
	NS6 = 1;

previousLayer = "";
mouseOnLayer = false;

function showLayer(layerName) {

	if (IE) {
		if ((layerName != previousLayer) && (previousLayer != "")) {
			tempOld = eval(previousLayer);
			tempOld.style.visibility = "hidden";
		}
		tempLayer = eval(layerName);
		if (tempLayer.style.visibility != "visible") {
			tempLayer.style.visibility = "visible";
			//alert("Layer height for " + layerName + " = " + tempLayer.style.height);
			previousLayer = layerName;
		}
	}
	if (NS4) {
		tempLayer = eval(layerName);
		if (document.layers[0].visibility != "show")
			document.layers[0] = "show";
	}
	if (NS6) {
		tempLayer = document.getElementById(layerName);
		if (tempLayer.style.visibility != "visible")
			tempLayer.style.visibility = "visible";
	}
}

function hideLayer(layerName) {

	if (IE) {
		setTimeout('makeLayerGoAway('+layerName+')', 2000);
	}
	if (NS4) {
		tempLayer = eval(layerName);
		tempLayer.visibility = "hide";
	}
	if (NS6) {
		tempLayer = document.getElementById(layerName);
		tempLayer.style.visibility = "hidden";
	}

}

function makeLayerGoAway(layerName) {

		//alert("in makeLayerGoAway - mouseOnLayer = " + mouseOnLayer);
	
		if (!(mouseOnLayer)) {
			tempLayer = eval(layerName);
			tempLayer.style.visibility = "hidden";
		}
}

function onLayer(layerName) {

	alert("onLayer activated!");

	if (IE) {
		tempLayer = eval(layerName);
		if (tempLayer.style.visibility == "visible") {
				mouseOnLayer = true;
		}
	}
	if (NS4) {
		tempLayer = eval(layerName);
		if (document.layers[0].visibility != "show")
			document.layers[0] = "show";
	}
	if (NS6) {
		tempLayer = document.getElementById(layerName);
		if (tempLayer.style.visibility == "visible")
			mouseOnLayer = true;
	}
}


function displaySSD(unitName) {

//	var ssdSRC = unitName+".gif"
	sSDWindowCount++
	var wName = "ssd"+parseInt(sSDWindowCount)

	mapWindow = window.open("", wName, "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no, width = 950, height = 750")
	mapWindow.document.write('<img border="0" name="ship" src="'+unitName+'">')
	mapWindow.document.close();
	document.close();
}
