/* Simple version detection */
var oldNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion, 10) < 5);
var newNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion, 10) >= 5);

var hilitedZoom = "none";

function nothing() {}


/* Show an object  */
function showObject(object)
	{
	var toshow, changeVis;
	if (newNS === true)
		{
		toshow = document.getElementById(object);
		toshow.style.visibility = "visible";
    }
	else {
		changeVis = ((oldNS === true) ? "document." + object + ".visibility = 'show';" : "document.all." + object + ".style.visibility = 'visible';");
		eval(changeVis);
	}
}

/* Hide an object */
function hideObject(object)
	{
	var toshow, changeVis;
	if (newNS === true) {
		toshow = document.getElementById(object);
		toshow.style.visibility = "hidden";
	}
	else {
		changeVis = ((oldNS === true) ? "document." + object + ".visibility = 'hide';" : "document.all." + object + ".style.visibility = 'hidden';");
		eval(changeVis);
	}
}


/* Hide message about incident */
function showIncidentMessage(message)
{
	if (oldNS === true)
	{
		var changeVis;
		changeVis = ((oldNS === true) ? "document.IncidentMessage.innerHTML = '" + message + "'": 
			"document.IncidentMessage.innerHTML = '" + message + "'");
		eval(changeVis);
    }
	else 
	{
		document.getElementById("IncidentMessage").innerHTML = message;
	}
}

/* Show message about incident */
function hideIncidentMessage()
{
	showIncidentMessage("Hover over icon for information");
}



function hiliteZoom(objName) {
	if (hilitedZoom != ("none")) {
		if (hilitedZoom != objName) {
			hideObject(hilitedZoom);
	    }
	}
	if (objName != "none") { 
	    showObject(objName); 
	}
	hilitedZoom = objName;
}


/*function changeDisp(url,target) {
	if (target == "self") {
		window.location.href = url + "&view=" + strView;
	} else if (target == "js") {
		navArgs = url.split(",");
		newURL = (navArgs[0].indexOf("http://") == -1 && navArgs[0].indexOf("HTTP://") == -1) ? strRelativeRoot + navArgs[0] : navArgs[0];
		popWin2(newURL,navArgs[1],navArgs[2]);
	} else {
		if (url.indexOf("http://") == -1 && url.indexOf("HTTP://") == -1) url = strRelativeRoot + url;
		dispWin = window.open(url,"dispWin");
		dispWin.focus();
	}
}*/


/*  Pop Up Window */
function popWindow(url)
	{
	var intWinTop, intWinLeft, strWindowOptions, popWin; 
	intWinTop = ((oldNS === true || newNS === true) ? 160 : window.screenTop + 50);
	intWinLeft = ((oldNS === true || newNS === true) ? 160 : window.screenLeft + 150);
	strWindowOptions = ((oldNS === true) ? "menubar=0,scrollbars=1,width=410,height=220,top=" + intWinTop + ",left=" + intWinLeft : "menubar=0,scrollbars=1,width=410,height=220,top=" + intWinTop + ",left=" + intWinLeft);
	popWin = window.open(url, "popWin", strWindowOptions, 1);	
	popWin.focus();
}

/*  Pop Up Window from Parent Coords */
function popWindowParent(url) {
	var intWinTop, intWinLeft, strWindowOptions, popWin;
	intWinTop = ((oldNS === true || newNS === true) ? 160 : window.parent.screenTop + 50);
	intWinLeft = ((oldNS === true || newNS === true) ? 160 : window.parent.screenLeft + 150);
	strWindowOptions = ((oldNS === true) ? "menubar=0,scrollbars=1,width=410,height=220,top=" + intWinTop + ",left=" + intWinLeft : "menubar=0,scrollbars=1,width=410,height=220,top=" + intWinTop + ",left=" + intWinLeft);
	popWin = window.open(url, "popWin", strWindowOptions, 1);	
	popWin.focus();
}


/*  Pop Up Legend */
function popLegend(url, dimY) {
	var intWinTop, intWinLeft, strWindowOptions, popLgnd;
	intWinTop = ((oldNS === true || newNS === true) ? 168 : window.screenTop + 78);
	intWinLeft = ((oldNS === true || newNS === true) ? 10 : window.screenLeft);
	strWindowOptions = "menubar=0,scrollbars=1,width=136,height=" + dimY + ",top=" + intWinTop + ",left=" + intWinLeft;
	popLgnd = window.open(url, "popLgnd", strWindowOptions, 1);
	popLgnd.focus();	
}


/*  Pop Up NWS Window */
function popPavement(url) {
	var intWinTop, intWinLeft, strWindowOptions, popNWSWin;
	intWinTop = ((oldNS === true || newNS === true) ? 160 : window.screenTop + 50);
	intWinLeft = ((oldNS === true || newNS === true) ? 160 : window.screenLeft + 150);
	strWindowOptions = "menubar=0,scrollbars=1,width=600,height=300,top=" + intWinTop + ",left=" + intWinLeft;
	popNWSWin = window.open(url, "popNWSWin", strWindowOptions, 1);	
	popNWSWin.focus();
}

/*  Pop Up NWS Window */
function popPavementParent(url) {
	var intWinTop, intWinLeft, strWindowOptions, popNWSWin;
	intWinTop = ((oldNS === true || newNS === true) ? 160 : window.parent.screenTop + 50);
	intWinLeft = ((oldNS === true || newNS === true) ? 160 : window.parent.screenLeft + 150);
	strWindowOptions = "menubar=0,scrollbars=1,width=600,height=300,top=" + intWinTop + ",left=" + intWinLeft;
	popNWSWin = window.open(url, "popNWSWin", strWindowOptions, 1);	
	popNWSWin.focus();
}

	
function popWin2(url, winHeight, winWidth)
	{
	var intWinTop, intWinLeft, strWindowOptions, popFaxWin;
	intWinTop = ((oldNS === true || newNS === true) ? 160 : window.screenTop + 50);
	intWinLeft = ((oldNS === true || newNS === true) ? 160 : window.screenLeft + 150);
	strWindowOptions = "toolbars=0,width=" + winWidth + ",height=" + winHeight + ",top=" + intWinTop + ",left=" + intWinLeft;
	popFaxWin = window.open(url, "popFaxWin", strWindowOptions, 1);
	popFaxWin.focus();
}


function popCamera(page) {
	var intWinTop = 90, intWinLeft = 90, strWindowOptions, cameraWin;
	strWindowOptions = "menubar=0,scrollbars=1,width=670,height=550,top=" + intWinTop + ",left=" + intWinLeft;
	cameraWin = window.open(page, "cameraWin", strWindowOptions, 1);
	cameraWin.focus();
}


/*  Move To New Page (Pass Args) */
function navWithArgs()
	{
	var strNewLoc, idx = 0, arrArgs;
	arrArgs = navWithArgs.arguments;
	strNewLoc = "/default.asp?";
	for (idx = 0; idx < arrArgs.length; idx++) {
		if (idx > 0) { 
		    strNewLoc += "&"; 
		}
		strNewLoc += arrArgs[idx];
		strNewLoc += "=" + arrArgs[++idx];
	}
	document.location.href = strNewLoc;
}


/*  Move To New Page (Pass Args) */
function navTextOnlyWithArgs()
	{
	var strNewLoc, idx, arrArgs, strRelativeRoot= "";
	arrArgs = navTextOnlyWithArgs.arguments;
	strNewLoc = strRelativeRoot + "defaultTextOnly.asp?";
	for (idx = 0; idx < arrArgs.length; idx++) {
		if (idx > 0) {
		    strNewLoc += "&"; 
		}
		strNewLoc += arrArgs[idx];
		strNewLoc += "=" + arrArgs[++idx];
	}
	document.location.href = strNewLoc;
}
	
// popup window 
function showPopup(theURL)
	{
	var popupfeatures, winName;
	if (typeof tool == "undefined") {	
		winName = "imagewindow";
		popupfeatures = "width=365,height=325,top=240,left=120,scrollbars=no,resizable=yes,toolbar=no";
	} else {
		winName = "imagewindow";
		popupfeatures = "width=365,height=325,top=240,left=120,location,scrollbars=no,resizable=yes,toolbar=no";
	}  

	if (typeof win != "undefined") {
		if (win && win.open && !win.closed) { 
		    win.close(); 
		}
	} 

	win = window.open(theURL, winName, popupfeatures);
}
