//very simple add to dom function
jQuery.fn.addElement = function(tagName, attribs) {
	return this.each(function() {
		var
			el = document.createElement(tagName),
			separator, suffix, prefix, i, m, s, item;

		if (attribs) {
			for (i in attribs) {
				if (typeof(attribs[i]) == "object") {
					separator = "; ";
					if (i == "className") separator = ", ";
					
					if (attribs[i].suffix) {
						suffix = attribs[i].suffix;
						delete attribs[i].suffix;
					}
					
					if (attribs[i].prefix) {
						prefix = attribs[i].prefix;
						delete attribs[i].prefix;
					}
					
					
					if (i == "style") {//iterate through style
						for (m in attribs[i]) {
							item = attribs[i][m];
							if ((typeof(item) == "number") && (suffix || prefix)) {
								if (suffix) item = item + suffix;
								if (prefix) item = prefix + item;
							}
							el.style[m] = item;
						}
					} else if (i == "className") {//flatten className arrays
						s = attribs[i];
						el.className = $.isArray(attribs[i]) ?
							s = s.toString().replace(/,/g," ") : s;
					}
				} else {//not on object type
					el[i] = attribs[i];
				}
			}
		}
		
		var x = this.appendChild(el);
	});
}
