 +  '<p id="itemStatus">&nbsp;</p>'+
 +  '</div>'+
 +  '<div id="writeRFIDButtons">'+
-+  '<a href="#" id="writeButton" class="hidden btn btn-small" onclick="return writeItem();">Preg brikker</a></div>'+
-+  '<a href="#" class="btn btn-small" onclick="return lookupItem();">Søk opp bok</a>'+
-+  '<a href="#" class="btn btn-small" onclick="return deactivateWrite();">Avslutt</a></div>');
-+}
-+
-+function lookupItem() {
++  '<a href="#" id="writeButton" class="hidden btn btn-small" onclick="return writeItem(ws);">Preg brikker</a></div>'+
++  '<a href="#" class="btn btn-small" onclick="return lookupItem(ws);">Søk opp bok</a>'+
++  '<a href="#" class="btn btn-small" onclick="return deactivateWrite(ws);">Avslutt</a></div>');
++}
++
++function lookupItem(ws) {
 +  // Request item info
 +  ws.send(JSON.stringify({Action: "ITEM-INFO", Item: { Barcode: $('#barcodeInput').val() } }));
 +  return true;
 +}
 +
-+function writeItem() {
++function writeItem(ws) {
 +  var msg = JSON.stringify({Action: "WRITE", Item: { Barcode: $('#barcodeInput').val(), NumTags: parseInt($('#itemTags').val()) } });
 +  console.log(msg);
 +  ws.send(msg);

+ * creates <div> with <table>
+ * inserts table to #patronlists and adds highlighted items as they arrive from websocket
+ */
+$(document).ready(function() {
+  ws=new WebSocket(rfidhuburl);
+  branch = document.getElementById("logged-in-branch-code") ? document.getElementById("logged-in-branch-code").innerHTML : "ukjent";
+  state = $("body").attr("id");
+  // activate RFID Modal
+  $("div.gradient").append('<div id="RFIDStatus"><a href="#" class="btn btn-small" onclick="reconnectHUB();">RFID</a><span id="RFIDStatusMessage"></span><button id="RFIDPreg" onclick="activateWrite();">Preg brikker</button></div>');
+  ws.onopen = function() {
+    console.log("connected");
+
+    ws.onmessage = function(resp) {
+      var data = JSON.parse(resp.data);

+    row.children('td').css("backgroundColor", "pink");
+  } else if(msg.Item.AlarmOnFailed || msg.Item.AlarmOffFailed) {
+    row.children('td').css("backgroundColor", "pink");
+    row.append('<td><a href="#" class="btn btn-small" onclick="return retryAlarm(ws);">Retry</a></td>');
+  } else {
+    row.children('td').effect("highlight", {color: "lightgreen"}, 3000);
+  }
