<html>
<%@ page import="com.digi.connector.client.models.VendorID" %>
<%
	long vendorID = -1;
	String deviceID = request.getParameter("deviceID");
	String deviceName = request.getParameter("deviceName");
	String status = request.getParameter("status");
	boolean selected = Boolean.valueOf(request.getParameter("selected"));
	if (request.getParameter("vendorID") != null)
		vendorID = Long.valueOf(request.getParameter("vendorID"));
	VendorID vendor = VendorID.get(vendorID);
%>
<% 
	if (selected) {
%>
<div class="device-selected-saved">
<% 
	} else {
%>
<div class="device" id="<%= deviceID %>" onclick="selectDevice('<%= deviceID %>')">
<% 
	}
%>
	<div class="device-image">
		<%
			switch (vendor) {
				case NDS:
		%>
		<img src="images/devices/python.png" height="32px" width="32px">
		<%
					break;
				case X3:
		%>
		<img src="images/devices/digi.png" height="32px" width="32px">
		<%
					break;
				case SAROS:
		%>
		<img src="images/devices/digi.png" height="32px" width="32px">
		<%
					break;
				case ANDROID:
		%>
		<img src="images/devices/android.png" height="32px" width="32px">
		<%
					break;
				case NETOS:
		%>
		<img src="images/devices/netos.png" height="32px" width="32px">
		<%
					break;
				case RABBIT:
		%>
		<img src="images/devices/rabbit.png" height="32px" width="32px">
		<%
					break;
				case WINCE:
		%>
		<img src="images/devices/windows.png" height="32px" width="32px">
		<%
					break;
				case LINUX:
		%>
		<img src="images/devices/linux.png" height="32px" width="32px">
		<%
					break;
				default:
		%>
		<img src="images/devices/unknown.png" height="32px" width="32px">
		<%
			}
		%>
	</div>
	<% 
		if (!selected) {
	%>
	<div id="<%= deviceID %>-selection" class="device-selection">
	<%
		} else {
	%>
	<div class="device-selection">
	<%
		}
	%>
	</div>
	<div class="device-status">
		<%
			if (status!= null && status.equals("Online")) {
		%>
		<img src="images/online.png" align="left" width="16" height="16" style="margin-right:5px;">
		<%
			} else {
		%>
		<img src="images/offline.png" align="left" width="16" height="16" style="margin-right:5px;">
		<%
			}
		%>
	</div>
	<div class="device-name">
		<%= request.getParameter("name") %>
	</div>
	<div class="device-status-text">
		<i>(<%= request.getParameter("status") %>)</i>
	</div>
	<br>
	<div class="device-id">
		<%= request.getParameter("deviceID") %>
	</div>
</div>
</html>