+ if (mode == "all") {
+ child.addClassName("Selected");
+ if (cb) cb.attr("checked", true);
+ } else if (mode == "unread") {
+ if (child.hasClassName("Unread")) {
+ child.addClassName("Selected");
+ if (cb) cb.attr("checked", true);
+ } else {
+ child.removeClassName("Selected");
+ if (cb) cb.attr("checked", false);
+ }
+ } else if (mode == "marked") {
+ if (child.hasClassName("marked")) {
+ child.addClassName("Selected");
+ if (cb) cb.attr("checked", true);
+ } else {
+ child.removeClassName("Selected");
+ if (cb) cb.attr("checked", false);
+ }
+ } else if (mode == "published") {
+ if (child.hasClassName("published")) {
+ child.addClassName("Selected");
+ if (cb) cb.attr("checked", true);
+ } else {
+ child.removeClassName("Selected");
+ if (cb) cb.attr("checked", false);
+ }
+
+ } else if (mode == "invert") {
+ if (child.hasClassName("Selected")) {
+ child.removeClassName("Selected");
+ if (cb) cb.attr("checked", false);
+ } else {
+ child.addClassName("Selected");
+ if (cb) cb.attr("checked", true);
+ }