// Custom tooltip function for NetDMR reporting status by state.
// Uses the Tip() function from wz_tooltip.js by Walter Zorn

var EPAExitDisclaimer = '&nbsp;<!-- #BeginLibraryItem "/Library/Exit EPA.lbi" --><a href="http://www.epa.gov/epahome/exitepa.htm"><img src="http://www.epa.gov/epafiles/images/epafiles_misc_exitepadisc.gif" alt="Exit EPA Disclaimer" width="87" height="13" style="vertical-align: bottom;"></a><!-- #EndLibraryItem -->';
var rxEpaDotGov = /^https?:\/\/(\w+\.)*epa\.gov(\/|$)/i;

function NetDMRTip (stabbr)
{
	var stdata = window.NetDMR_state[stabbr];
	var text = stdata.system;

	if (stdata.system != 'Unknown' && stdata.deploymt) {
		text += '&nbsp;&ndash;&nbsp;' + stdata.deploymt;
	}
	if (stdata.text) {
		text += '<br><span class="statetext">' + stdata.text + '</span>';
	}
	if (stdata.info) {
		text += '<br><a href="' + stdata.info + '">Info</a>';
		if (stdata.info.search(rxEpaDotGov) == -1) text += EPAExitDisclaimer;
	}
	if (stdata.login) {
		text += '<br><a href="' + stdata.login + '">Log In</a>';
		if (stdata.login.search(rxEpaDotGov) == -1) text += EPAExitDisclaimer;
	}

	Tip(text, TITLE, stdata.name);
}
