lib/abaaso.js
function ( type, args, target, pos ) {
		var svg  = false,
		    frag = false,
		    obj, uid, result;

		// Removing potential HTML template formatting
		type = type.replace( /\t|\n|\r/g, "" );

		if ( target !== undefined ) {
			svg = ( target.namespaceURI !== undefined && regex.svg.test( target.namespaceURI ) );
		}
		else {
			target = document.body;
		}
		
		if ( args instanceof Object && args.id !== undefined && utility.$( "#" + args.id ) === undefined ) {
			uid = args.id;
			delete args.id;
		}
		else if ( !svg ) {
			uid = utility.genId( undefined, true );
		}

		// String injection, create a frag and apply it
		if ( regex.html.test( type ) ) {
			frag   = true;
			obj    = element.frag( type );
			result = obj.childNodes.length === 1 ? obj.childNodes[0] : array.cast( obj.childNodes );
		}
		// Original syntax
		else {
			if ( !svg && !regex.svg.test( type ) ) {
				obj = document.createElement( type );
			}
			else {
				obj = document.createElementNS( "http://www.w3.org/2000/svg", type );
			}

			if ( uid !== undefined ) {
				obj.id = uid;
			}

			if ( args instanceof Object ) {
				element.update( obj, args );
			}
		}

		if ( pos === undefined || pos === "last" ) {
			target.appendChild( obj );
		}
		else if ( pos === "first" ) {
			element.prependChild( target, obj );
		}
		else if ( pos === "after" ) {
			pos = {};
			pos.after = target;
			target    = target.parentNode;
			target.insertBefore( obj, pos.after.nextSibling );
		}
		else if ( pos.after !== undefined ) {
			target.insertBefore( obj, pos.after.nextSibling );
		}
		else if ( pos === "before" ) {
			pos = {};
			pos.before = target;
			target     = target.parentNode;
			target.insertBefore( obj, pos.before );
		}
		else if ( pos.before !== undefined ) {
			target.insertBefore( obj, pos.before );
		}
		else {
			target.appendChild( obj );
		}

		return !frag ? obj : result;
	}
function ( type, args, target, pos ) {
		var svg  = false,
		    frag = false,
		    obj, uid, result;

		// Removing potential HTML template formatting
		type = type.replace( /\t|\n|\r/g, "" );

		if ( target !== undefined ) {
			svg = ( target.namespaceURI !== undefined && regex.svg.test( target.namespaceURI ) );
		}
		else {
			target = document.body;
		}
		
		if ( args instanceof Object && args.id !== undefined && utility.$( "#" + args.id ) === undefined ) {
			uid = args.id;
			delete args.id;
		}
		else if ( !svg ) {
			uid = utility.genId( undefined, true );
		}

		// String injection, create a frag and apply it
		if ( regex.html.test( type ) ) {
			frag   = true;
			obj    = element.frag( type );
			result = obj.childNodes.length === 1 ? obj.childNodes[0] : array.cast( obj.childNodes );
		}
		// Original syntax
		else {
			if ( !svg && !regex.svg.test( type ) ) {
				obj = document.createElement( type );
			}
			else {
				obj = document.createElementNS( "http://www.w3.org/2000/svg", type );
			}

			if ( uid !== undefined ) {
				obj.id = uid;
			}

			if ( args instanceof Object ) {
				element.update( obj, args );
			}
		}

		if ( pos === undefined || pos === "last" ) {
			target.appendChild( obj );
		}
		else if ( pos === "first" ) {
			element.prependChild( target, obj );
		}
		else if ( pos === "after" ) {
			pos = {};
			pos.after = target;
			target    = target.parentNode;
			target.insertBefore( obj, pos.after.nextSibling );
		}
		else if ( pos.after !== undefined ) {
			target.insertBefore( obj, pos.after.nextSibling );
		}
		else if ( pos === "before" ) {
			pos = {};
			pos.before = target;
			target     = target.parentNode;
			target.insertBefore( obj, pos.before );
		}
		else if ( pos.before !== undefined ) {
			target.insertBefore( obj, pos.before );
		}
		else {
			target.appendChild( obj );
		}

		return !frag ? obj : result;
	}
function ( type , args , target , pos ) { var svg = false , frag = false , obj , uid , result ; // Removing potential HTML template formatting type = type . replace ( / \t|\n|\r / g , "" ) ; if ( target !== undefined ) { svg = ( target . namespaceURI !== undefined && regex . svg . test ( target . namespaceURI ) ) ; } else { target = document . body ; } if ( args instanceof Object && args . id !== undefined && utility . $ ( "#" + args . id ) === undefined ) { uid = args . id ; delete args . id ; } else if ( ! svg ) { uid = utility . genId ( undefined , true ) ; } // String injection, create a frag and apply it if ( regex . html . test ( type ) ) { frag = true ; obj = element . frag ( type ) ; result = obj . childNodes . length === 1 ? obj . childNodes [ 0 ] : array . cast ( obj . childNodes ) ; } // Original syntax else { if ( ! svg && ! regex . svg . test ( type ) ) { obj = document . createElement ( type ) ; } else { obj = document . createElementNS ( "http://www.w3.org/2000/svg" , type ) ; } if ( uid !== undefined ) { obj . id = uid ; } if ( args instanceof Object ) { element . update ( obj , args ) ; } } if ( pos === undefined || pos === "last" ) { target . appendChild ( obj ) ; } else if ( pos === "first" ) { element . prependChild ( target , obj ) ; } else if ( pos === "after" ) { pos = { } ; pos . after = target ; target = target . parentNode ; target . insertBefore ( obj , pos . after . nextSibling ) ; } else if ( pos . after !== undefined ) { target . insertBefore ( obj , pos . after . nextSibling ) ; } else if ( pos === "before" ) { pos = { } ; pos . before = target ; target = target . parentNode ; target . insertBefore ( obj , pos . before ) ; } else if ( pos . before !== undefined ) { target . insertBefore ( obj , pos . before ) ; } else { target . appendChild ( obj ) ; } return ! frag ? obj : result ; }
Creates an Element in document.body or a target Element

An id is generated if not specified with args

@method create
@param  {String} type   Type of Element to create
@param  {Object} args   [Optional] Collection of properties to apply to the new element
@param  {Mixed}  target [Optional] Target Element
@param  {Mixed}  pos    [Optional] "first", "last" or Object describing how to add the new Element, e.g. {before: referenceElement}
@return {Mixed}         Element that was created, or an Array if `type` is a String of multiple Elements (frag)
Creates an Element in document . body or a target Element