Index: branches/realtime_VDS/cptms/js/vdsLayer.js
===================================================================
--- branches/realtime_VDS/cptms/js/vdsLayer.js	(revision 584)
+++ branches/realtime_VDS/cptms/js/vdsLayer.js	(revision 585)
@@ -160,2 +160,66 @@
 }
 
+//initialize live indicator icon
+function initLiveIcon(success) {
+    //create new img tags for live and not-live indicators
+    var live = document.createElement('img');
+    var notLive = document.createElement('img');
+    live.src ="images/live.svg";
+    live.width = 50 ;
+    live.height= 40 ;
+    notLive.src ="images/fetchError.jpg";
+    notLive.width = 50 ;
+    notLive.height= 50 ;
+    // if fetch is a success, display live img
+    if (success) {
+        console.log(live);
+        if (map.controls[google.maps.ControlPosition.TOP_RIGHT].getLength() > 0)
+            map.controls[google.maps.ControlPosition.TOP_RIGHT].pop();
+        map.controls[google.maps.ControlPosition.TOP_RIGHT].push(live);
+    }
+    // if error, display sad smiley image
+    else {
+        console.log(notLive);
+        if (map.controls[google.maps.ControlPosition.TOP_RIGHT].getLength() > 0)
+            map.controls[google.maps.ControlPosition.TOP_RIGHT].pop();
+        map.controls[google.maps.ControlPosition.TOP_RIGHT].push(notLive);
+    }
+}
+
+//reads first line on last fetch file and checks if its less than 15 minutes old
+function checkLastFetch()
+{
+    var rawFile = new XMLHttpRequest();
+    rawFile.open("GET", lastFetchFile, false);
+    rawFile.onreadystatechange = function ()
+    {
+        if(rawFile.readyState === 4)
+        {
+            if(rawFile.status === 200 || rawFile.status == 0)
+            {
+                var text = rawFile.responseText;
+                // get last fetch time from file
+                var lastFetch = new Date(text);
+                // get current date time
+                var now = new Date();
+                // calculate time difference
+                var msec = now - lastFetch;
+                var days = Math.floor(msec / 1000 / 60 / (60 * 24));
+                msec -= days * 1000 * 60 * 60 * 24
+                var hh = Math.floor(msec / 1000 / 60 / 60);
+                msec -= hh * 1000 * 60 * 60;
+                var mm = Math.floor(msec / 1000 / 60);
+                msec -= mm * 1000 * 60;
+                var ss = Math.floor(msec / 1000);
+                msec -= ss * 1000;
+                // display icon if less than 15 
+               if (days === 0 && hh === 0 && mm < fetchInterval)
+                    initLiveIcon(1)
+                else 
+                    initLiveIcon(0)
+                //console.log(days + " Days "+ hh + " Hours " + mm + " Minutes " + ss + " Seconds");
+            }
+        }
+    }
+    rawFile.send(null);
+}
