var dBuild = {
	build : function(tag_name, params, children, flags){
		var el = document.createElement(tag_name);
		if (typeof params == "object" && params != null){
			for (key in params){
				if (!Object.prototype[key]){
					if (key == '_attrib'){
						for (attrib in params[key]){
							el.setAttribute(attrib,params[key][attrib]);
						}
					}else{
						this.setAttribute(el, key, params[key]);
					}
				}
			}
		}
		if (typeof children != "undefined"){
			if (typeof children == "string" || typeof children == "number"){
				try{
					el.innerHTML = children || "";
				}catch(e){}
			}else if (children && children.length){
				for (var i=0; i<children.length; i++){
					if (typeof children[i][0] == "string"){
						child = this.build(children[i][0], children[i][1] || "", children[i][2] || "", children[i][3] || "");
						el.appendChild(child);
					}
				}
			}
		}
		return el;
	},
	setAttribute : function(obj, atr, val, last_obj){
		if (typeof last_obj == "undefined") var last_obj = true;
		if (typeof val != "undefined" && typeof atr == "string"){
			if (typeof val == "object" && val != null){
				if (typeof obj[atr] == "undefined" || obj[atr] == null){
					obj[atr] = {};
				}else if (typeof obj != "object" && typeof obj != "function"){
					return;
				}
				for (key in val){
					if (!Object.prototype[key]){
						this.setAttribute(obj[atr], key, val[key], false);
					}
				}
			}else{
				obj[atr] = val;
			}
		}
	}
}