/*! HTML - v0.9.0 - 2013-07-25
* http://nbubna.github.io/HTML/
* Copyright (c) 2013 ESHA Research; Licensed MIT, GPL */
(function(a,b){var c=b.fn.add=function(d,e){var f=[];this.each(function(g){f=f.concat(c.all(g,d,e))});return b.list(f)};c.all=function(j,e,h){if(typeof e==="string"){return c.create(j,e,h)}if("length" in e){var f=[];for(var g=0,d=e.length;g<d;g++){f.push(c.all(j,e[g],h))}return f}c.insert(j,e,h);return e};c.create=function(f,d,e){return c.insert(f,a.createElement(d),e)};c.insert=function(f,g,e){var d=c.find(f,e);if(d){f.insertBefore(g,d)}else{f.appendChild(g)}b.updated(f);return g};c.find=function(e,d){switch(typeof d){case"string":return e[d+"Child"];case"number":return e.children[d];case"object":return d;case"function":return d.call(e,e)}};b.updated=function(d){d._internal=true;b.children(d)};b.fn.remove=function(d){var e=[];this.each(function(g){var f=g.parentNode;if(d&&e.indexOf(f)<0){e.push(f)}f.removeChild(g);b.updated(f)});return d?b.list(e):this}})(document,HTML._);