 (defn select-all []
   (mass-selections "data-id" 0 < true))
 
-(defn select-below-iv-perfect [percentage]
+(defn select-below-iv-threshold [percentage]
   (mass-selections "data-iv-perfect" percentage > true))
 
+(defn select-below-cp-threshold [percentage]
+  (mass-selections "data-cp" percentage > true))
 
 ;;;; Views
-(defui IVPercentage
+(defui CPThreshold
+  Object
+  (render [this]
+    (let [percentage (om/get-state this :percentage)]
+      (dom/div #js {:className "form-group"}
+               (dom/label #js {:className "control-label"} "Select all below CP Threshold")
+               (dom/div #js {:className "input-group"}
+                        (dom/input #js {:type        "text"
+                                        :className   "form-control"
+                                        :onChange    #(vlib/commit-component-state this :percentage %)
+                                        :value       percentage
+                                        :placeholder "in whole numbers"})
+                        (dom/span #js {:className "input-group-addon"} "CP")
+                        (dom/span #js {:className "input-group-btn"}
+                                  (vlib/button-default #(select-below-cp-threshold percentage) (not (js/isNaN (js/parseFloat percentage))) "Select")))))))
+(def cp-threshold (om/factory CPThreshold))
+
+(defui IVThreshold
   Object
   (render [this]
     (let [percentage (om/get-state this :percentage)]

                                        :className   "form-control"
                                        :onChange    #(vlib/commit-component-state this :percentage %)
                                        :value       percentage
                                        :placeholder "42"})
                        (dom/span #js {:className "input-group-addon"} "%")
                        (dom/span #js {:className "input-group-btn"}
                                  (vlib/button-default #(select-below-iv-perfect percentage) (not (js/isNaN (js/parseFloat percentage))) "Select")))))))
(def iv-percentage (om/factory IVPercentage))

(defui SelectionButtons
  Object

  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom :include-macros true]
            [goog.dom :as gdom]
            [cruncher.utils.views :as vlib]
            [cruncher.utils.lib :as lib]))

(defn mass-selections
  "Function for mass selections of pokemon depending on a predicate.
