summaryrefslogtreecommitdiffstats
path: root/data/mnet/GP10/Host/ViperWatch/js/common.js
blob: 41f1f91133271a01cb2166d7aa332b384a9d01b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function printOnOffMode(theValue)
{
	var textValue = "";
	switch (theValue)
	{
		case "0": 
			textValue = "Off";
			break;
		case "1": 
			textValue = "On";
			break;
		default:
			textValue = "Undefined"
			break;
	}
	document.write(textValue);
}

var index = 1;
function displayIndex()
{
	document.write(" " + index++ + " ");
}

function displayTime(utctime)
{
	var gmtDate = new Date(utctime*1000);
	document.write(gmtDate.toLocaleString());
}

function cvtTicks2Sec(ticks)
{
	var secTime = parseFloat(ticks)/ parseFloat("60.0");
	var secStr = secTime.toString();
	var i = secStr.indexOf(".");
	document.write(secStr.substr(0, i+4) + " (sec)");
}