<html>

<head>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv=Refresh content=2;url=realtimestate.htm>
<script language="JavaScript">
<!--
	var IsConnect=<%VARIsConnect%>;
	var UPStype =<%VARUPStype%>; // 0 ONLINE 1 OFFLINE 		
	var Utility = <%VARUtility%>; // &#22833;&#21435;&#24066;&#38651;  0 &#27491;&#24120; 1 &#22833;&#21435;
 	var Bypass = <%VARBypass%>; //&#26159;&#21542;&#28858;PASS&#27169;&#24335;
	var BatLow = <%VARBatLow%>;
	var UPSFailed = <%VARUPSFailed%>;
	var TestProgress = <%VARTestProgress%>;
	var ShutdownActive = <%VARShutdownActive%>;
	var Beeper = <%VARBeeper%>;

	var BATVOLTAHE	=  <%GETBATVOLTAHE%>;
	var VarLoad = <%GETVarLoad%>;



	function isconnmsg()
	{
		if (IsConnect == 1)
		{
			document.write("Connect UPS");
			table1.bgColor = "#33CCFF";
		}else{
			document.write("Disconnect UPS");
			table1.bgColor = "#FF0000";
		}  
	}

	function healthmsg()
	{

		if (IsConnect == 1)
		{
			if (VarLoad >100)
			{
				document.write("Over Load");
				table1.bgColor = "#FF0000";
			}
			else if(Utility ==1 || BatLow==1 || TestProgress ==1 )
			{
				document.write("Emily");
				table1.bgColor = "#33CCFF";

			}
			else{
				if (BATVOLTAHE <100) 
				{
					document.write("Battery Charging");
					table1.bgColor = "#FFFF00";
					
				}else
				{
					document.write("Emily");
					table1.bgColor = "#33CCFF";
				}
			}
		}else{
			document.write("Disconnect UPS");
			table1.bgColor = "#FF0000";
		}  
	}



	function Utilitymsg()
	{
		if (Utility == 0)
		{
			document.write("Power Normal");
			table2.bgColor = "#33CCFF";
		}else{
			document.write("Power Failure");
			table2.bgColor = "#FF0000";
		}  
	}
	function BatLowmsg()
	{
		if (BatLow == 0)
		{
			document.write("Battery Capacity Normal");
			table3.bgColor = "#33CCFF";
		}else{
			document.write("Battery Low");
			table3.bgColor = "#FF0000";
		}  
	}
	function UPSFailedmsg()
	{
		if (UPSFailed == 0)
		{
			if (TestProgress == 0)
			{
				document.write("Normal Test");
				table4.bgColor = "#33CCFF";
			}else{
				document.write("Under Test");
				table4.bgColor = "#FF0000";
			}  
		}else{
			document.write("Battery Weak");
			table4.bgColor = "#FF0000";
		}  
	}
	function UPStypemsg()
	{	
		if (UPStype == 0)
		{
			if (Bypass==1){
				document.write("ByPass Mode");
				table5.bgColor = "#FFFF00";
			}else{
				document.write("On-Line Mode");
				table5.bgColor = "#33CCFF";
			
			}
		}else{
			if (Bypass==1){
				document.write("AVR Mode");
				table5.bgColor = "#FFFF00";
			}else{
				document.write("Off-Line Mode");
				table5.bgColor = "#33CCFF";
			
			}
		}  
		if (Utility == 0)
		{
			table5.style.visibility = "visible";
		}else
		{
			table5.style.visibility = "hidden";
		}	
	}

	function ShutdownActivemsg()
	{
		if (ShutdownActive == 0)
		{
			document.write("Normal Shutdown");
			table7.bgColor = "#33CCFF";
		}else{
			document.write("Shutdowning");
			table7.bgColor = "#FF0000";
		}  
	}
	function Beepermsg()
	{
		if (Beeper == 0)
		{
			document.write("Buzzer On");
			table8.bgColor = "#33CCFF";
		}else{
			document.write("UBuzzer Off");
			table8.bgColor = "#FF0000";
		}  
	}
	
//-->
</script>

</head>
<body>
<p align="center">&#12288;
<table border="1" width="100%" id="table1">
	<tr>
		<td>
		<p align="center"><script language="JavaScript">healthmsg();</script></td>
	</tr>
</table>
<hr>
<table border="1" width="100%" id="table2">
	<tr>
		<td>
		<p align="center"><script language="JavaScript">Utilitymsg();</script></td>
	</tr>
</table>
<hr>
<table border="1" width="100%" id="table3" >
	<tr>
		<td>
		<p align="center"><script language="JavaScript">BatLowmsg();</script></td>
	</tr>
</table>
<hr>
<table border="1" width="100%" id="table4" >
	<tr>
		<td>
		<p align="center"><script language="JavaScript">UPSFailedmsg();</script></td>
	</tr>
</table>
<hr>
<table border="1" width="100%" id="table5" style="visibility: hidden" >
	<tr>
		<td>
		<p align="center"><script language="JavaScript">UPStypemsg();</script></td>
	</tr>
</table>
<hr>


</body></html>