var TagCollection = Class.create(); TagCollection.prototype = { initialize: function(name){ this.name = name; this.groups = []; this.detection; this.postFunction = empty;}, Add: function(group, tag){ if (!this.groups[group]){ this.groups[group] = new Array(); this.groups.push(group);} if (!this.groups[group].include(tag)){ this.groups[group].push(tag);}}, SetDetector: function(func){ this.detection = func;}, SetPostFunction: function(func){ this.postFunction = func;}}; var TagDetector = Class.create(); TagDetector.prototype = { initialize: function(){ this.collections = [];}, Add: function(collection){ this.collections.push(collection);}, Run: function(){ var th = this; var t = ''; var i = 0; var els = $$('*[rel]'); els.each(function(node){ this.collections.each(function(c){ c.detection(node);});}.bind(this) ); this.collections.each(function(collect){ collect.postFunction();});}}; function getGroup(tag){ rel = tag.getAttribute("rel"); var i = rel.indexOf('['); if (i != -1) group = rel.substring(i+1, rel.length-1); return group;} var TagDetect = new TagDetector();