+function say(message) {
+ $("#message").text(message).removeClass("fade");
+ setTimeout(function() { $("#message").addClass("fade"); }, 1);
+}
+
+function toggle_zoom() {
+ if (zoom) {
+ zoom = "";
+ } else {
+ zoom = "sm/";
+ }
+ setpic();
+}
+
+function move_by_filter(direction, filter) {
+ // Keep moving in direction until filter is satisfied
+ do {
+ input_index += direction;
+ } while (!filter());
+ say(input_index + " " + (picinfo[files[input_index]].name || ""));
+ setpic();
+}
+function move(direction) {
+ move_by_filter(direction, function() { return true; });
+}
+function move_to_nondeleted(direction) {
+ move_by_filter(direction, function() {
+ return !("deleted" in picinfo[files[input_index]]); });
+}
+function move_to_unnamed(direction) {
+ move_by_filter(direction, function() {
+ return !("deleted" in picinfo[files[input_index]]) &&
+ !("name" in picinfo[files[input_index]]); });
+}
+
+function mark_deleted() {
+ picinfo[files[input_index]].deleted = 1;
+ save_picinfo();
+ say("Deleted");
+}
+
+function mark_not_deleted() {
+ delete picinfo[files[input_index]].deleted;
+ save_picinfo();
+ say("Undeleted");
+}
+
+function change_exposure(amount) {
+ if (!endsWith(files[input_index], ".NEF")) {
+ say("Exposure adjustment not available");
+ return;
+ }
+ exposure += amount;
+ picinfo[files[input_index]].exposure = exposure;
+ save_picinfo();