
function DOMBuilder(container){this.container=container;}
DOMBuilder.prototype={nodes:[],cache:false,constructor:DOMBuilder,toString:function(){return"DOMBuilder";},setAttribute:function(node,attr){for(var a in attr){node.setAttribute(this.getAttribute(a),attr[a]);}},getAttribute:function(a){var attr=this.constructor.ATTRIBUTES;return attr.hasOwnProperty(a)?attr[a]:a;},render:function(container){if(!this.container){this.container=(container||document.body);}
this.container.appendChild(this.cache);}};DOMBuilder.NODE=function(){arguments.shift=Array.prototype.shift;var o=document.createElement(arguments.shift());for(var i=0,n;n=arguments[i];i++){if(n.nodeType){this.nodes[this.nodes.length]=o.appendChild(n);}
else if(typeof(n)=="string"){o.appendChild(document.createTextNode(n))}
else if(n instanceof Object){this.setAttribute(o,n);}}
return this.cache=o;}
DOMBuilder.SYNTAX=["A","ABBR","ACRONYM","ADDRESS","BLOCKQUOTE","BR","BUTTON","CITE","CODE","DD","DEL","DFN","DIV","DL","DT","EM","FIELDSET","FORM","H1","H2","H3","H4","H5","H6","HR","IFRAME","IMG","INPUT","INS","LABEL","LEGEND","LI","OL","OPTION","P","PRE","SELECT","SPAN","STRONG","SUB","SUP","TABLE","TBODY","TD","TEXTAREA","TFOOT","TH","THEAD","TR","UL"];DOMBuilder.INIT=function(){for(var i=0,e;e=this.SYNTAX[i];i++){this.prototype[e]=function(){arguments.unshift=Array.prototype.unshift;arguments.unshift(arguments.callee.nodeName);return this.constructor.NODE.apply(this,arguments);}
this.prototype[e].nodeName=e.toLowerCase();}
return true;}
if(window.attachEvent){DOMBuilder.ATTRIBUTES={"class":"className","for":"htmlFor","style":"cssText"};}else{DOMBuilder.ATTRIBUTES={};}
DOMBuilder.INIT();