
utils.jsLoader.load(["js/notify.js"]);

ShowIf = function() {
}

ShowIf.onload = function() {
    var nodes = cssQuery("*[showif]");
    var oThis = this;
    var n = Notifier.getInstance();

    forEach(nodes, function(node) {
	  
      // Listen only to messages on this element
      var target = $(node.getAttribute("showif"));
      if(target.checked == true) {
		utils.addClass(node, "shown");	
	  }
	  
      n.setListener(node, "sel", function(obj, comment, msg, notif) {
         //debug("Selected " + notif.id);
         utils.addClass(obj, "shown");         
      }, target);
	  
      n.setListener(node, "desel", function(obj, comment, msg, notif) {
         //debug("Deselected " + notif.id);
         utils.removeClass(obj, "shown");
      }, target);

    });
    
}

utils.addEvent(window, "load", ShowIf.onload, false);
