
//alert("MRF.JS LOADED");

// function that displays status bar message
function dmsg(msgStr) {
  document.returnValue = false;
  if (document.images) { 
     window.status = msgStr;
     document.returnValue = true;
  }
}

// popup function for help screens...
function popup(url,ht,wd) {
	if (!ht) { ht = 500	}
	if (!wd) { wd = 550  } 
	//ht = 500
	//wd = 550
	cfg_str = "status=0,height="+ht+",width="+wd+",resizable=1,scrollbars=1,location=0";
	//alert(cfg_str);
	myPopup=window.open( url, "popwindow",cfg_str );
	if (window.focus) {myPopup.focus()};

}
 function popclose() {
 	window.close();
}

//2) Display countdown with a stylish LCD look, and display an alert on target date/time
function formatresults2(){
	if (this.timesup==false) { //if target date/time not yet met
		//var displaystring="<span class='lcdstyle'>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hrs</sup> "+arguments[2]+" <sup>min</sup> "+arguments[3]+" <sup>sec</sup></span>"
		var displaystring="<TABLE BORDER=0 class='lcdstyle' CELLPADDING=2 CELLSPACING=0 WIDTH=80 HEIGHT=50><TR class='lcdstylehdr'><TD COLSPAN=3>TIME UNTIL ALERT</TD></TR><TR class='lcdstylehdr'><TD>HRS</TD><TD>MIN</TD><TD>SEC</TD></TR><TR><TD>"+arguments[1]+"</TD><TD>"+arguments[2]+"</TD><TD><sup>"+arguments[3]+"</sup></TD></TR></TABLE>\n"
	}
	else if (this.alertsent==true) { // 2 minutes have past since alert time
		//var displaystring="" //Don't display any text
		var displaystring="<TABLE BORDER=0 class='lcdstylehdr' CELLPADDING=2 CELLSPACING=0 WIDTH=80 HEIGHT=50><TR><TD>SARWATCH ALERT TIME HAS PASSED.<BR>CANCEL ALERT IF YOU ARE OK.</TD></TR></TABLE>\n"
	}
	else {
		var displaystring="<TABLE BORDER=0 class='lcdstylehdr' CELLPADDING=2 CELLSPACING=0 WIDTH=80 HEIGHT=50><TR><TD>SARWATCH ALERT ACTIVATION!!!<BR>PREPARING TO SEND MESSAGES...</TD></TR></TABLE>\n"
		alert("SARWATCH ALERT TIME!\nAlert Messages are about to be sent.\nClick DISARM NOW to prevent this.\n") //Instead, perform a custom alert
	// Reload current page to update status...
	}
	return displaystring
}


