 + * creates <div> with <table>
 + * inserts table to #patronlists and adds highlighted items as they arrive from websocket
 + */
++
 +var windowInFocus = true;
 +var wasOnceConnected = false;
++var isConnected = false;
++var TIMEOUT = 10000; // 10s
++var timer;
++
 +$(document).ready(function() {
 +  connect();
 +
 +  window.onfocus = function() {
 +    windowInFocus = true;
-+    if (wasOnceConnected) {
++    if (!isConnected && wasOnceConnected) {
 +      connect();
 +    }
 +  }

+  ws=new WebSocket(rfidhuburl);
+  window.onblur = function() {
+    windowInFocus = false;
+    ws.close();
+  }
+  branch = document.getElementById("logged-in-branch-code") ? document.getElementById("logged-in-branch-code").innerHTML : "ukjent";
+  state = $("body").attr("id");

     <table id="checkedintable">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/rfidhub.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/rfidhub.inc
new file mode 100644
index e69de29..1257d23
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/rfidhub.inc
@@ -0,0 +1,334 @@
+[% USE Koha %]
+<style type="text/css">
+/*
