 
 (def app-model
   (atom {:current-slide 0
-         :slides [{:title "Introduction"
-                   :text "This is the introduction"
-                   :visible true}
-                  {:title "Slide 1"
-                   :text "Here is the first slide"
-                   :visible false}
-                  {:title "Slide 2"
-                   :visible false}
-                  {:title "Slide 3"
-                   :visible false}]}))
-
+         :slides
+         [{:title "core.async"
+           :visible true}
+          {:title "Why?"
+           :text "Here is the first slide"
+           :background "/static/cspdiag.jpg"
+           :visible false}
+          {:title "What?"
+           :visible false}
+          {:title "When?"
+           :visible false}]}))
 
 (defn slide [data owner current]
   (reify

    (render [_]
      (html
       (if (:visible data)
         [:div
          [:h2 {:style {:color "green"}} (:title data)]
          [:p (:text data)]]
         [:div {:style {:display :none}}]
         )))))


  (reify
    om/IWillMount
    (will-mount [_]
      (goog.events.listen
       js/document "keydown"
       (fn [e]
         (cond
          (= (.-keyCode e) kc/PAGE_UP)
          (when (pos? (:current-slide @app))
            (om/update! app [:slides (:current-slide @app) :visible] false)
            (om/transact! app :current-slide dec)
            (om/update! app [:slides (:current-slide @app) :visible] true))
          (= (.-keyCode e) kc/PAGE_DOWN)
          (when (get-in @app [:slides (inc (:current-slide @app))])
            (om/update! app [:slides (:current-slide @app) :visible] false)
            (om/transact! app :current-slide inc)
            (om/update! app [:slides (:current-slide @app) :visible] true)
            )))))
    om/IRender
    (render [_]
      (html
       [:div
        [:p (str "Current slide is " (inc (:current-slide app)) "/" (count (:slides app)))]
        (om/build-all slide
                      (:slides app)
                      {:key :title :init-state chans :opts (:current-slide app)})]))))
