         [:td (build-decrement-btn "decrement-minute")]
         (build-nbsp-cell)
         [:td (build-decrement-btn "toggle-meridian")]]]]])
+
+(defn pad [num]
+  "zero pad timepicker digits"
+  (format "%02d" num))
+
+;;------------------------------------------------------------------------------
+;; Watchers
+;;------------------------------------------------------------------------------
+
+(defn on-snapshot-index-change [_ _ _ new-index]
+  (let [snapshot (@snapshot-list new-index)
+        time (Date. (:time snapshot))
+        image (:image snapshot)
+        time-display (str (.toDateString time) " " (.toLocaleTimeString time))]
+    (attr ($ "#currentSnapshot") "src" image)
+    (text ($ "#imageDateTime") time-display)
+    (prop ($ "#earlier") "disabled" (= (inc new-index) (count @snapshot-list)))
+    (prop ($ "#later") "disabled" (zero? new-index))))
+
+(add-watch snapshot-index :_ on-snapshot-index-change)
+
+(defn on-selected-time-change [_ _ _ new-time]
+  (let [hour (.getHours new-time)
+        meridian (if (> 11 hour) "PM" "AM")
+        hour (if (> 12 hour) (- hour 12) hour)]
+    (val ($ "#hour") (pad hour))
+    (val ($ "#minute") (pad (.getMinutes new-time)))
+    (val ($ "#meridian") meridian)
+    (.datepicker ($ "#datepicker") "update" new-time)))
+
+(add-watch timestamp :_ on-selected-time-change)
 
 ;;------------------------------------------------------------------------------
 ;; Events

      (js->clj)
      (clojure.walk/keywordize-keys)))))

(defn init-current-index []
  (let [image (attr ($ "#currentSnapshot") "src")
        starting-index (first (keep-indexed #(if (= image %2) %1) @snapshot-list))]
    (swap! current-index #(if (pos? starting-index)
                                starting-index
                                0))))


;;------------------------------------------------------------------------------

(def snapshot-list (atom nil))
(def snapshot-index (atom nil)) ; can this be derived from current time, quickly?
(def selected-time (atom nil))
(def url-update-timout (atom nil)) ; This probably doesn't need to be atom, maybe be clojure feature that handles this

;;------------------------------------------------------------------------------
