// Simple utility methods for working with the DOM DOM = {}; // DOMBuilder for prototype DOM.Builder = { tagFunc : function(tag) { return function() { var attrs, children; if (arguments.length>0) { if (arguments[0].constructor == Object) { attrs = arguments[0]; children = Array.prototype.slice.call(arguments, 1); } else { children = arguments; }; children = $A(children).flatten() } return DOM.Builder.create(tag, attrs, children); }; }, create : function(tag, attrs, children) { attrs = attrs || {}; children = children || []; tag = tag.toLowerCase(); var el = new Element(tag, attrs); for (var i=0; i