Element.prototype.matches=Element.prototype.matchesSelector=Element.prototype.mozMatchesSelector;!function(){function a(a){if(a.length){if(1===a.length)return a[0];var b,c,d=document.createDocumentFragment();for(b in arguments)c=arguments[b],d.appendChild("string"==typeof c?document.createTextNode(c):c);return d}throw new Error("DOM Exception 8")}Element.prototype.prepend=function(){this.insertBefore(a(arguments),this.firstChild)},Element.prototype.append=function(){this.appendChild(a(arguments))},Element.prototype.before=function(){this.parentNode&&this.parentNode.insertBefore(a(arguments),this)},Element.prototype.after=function(){this.parentNode&&this.parentNode.insertBefore(a(arguments),this.nextSibling)},Element.prototype.replace=function(){this.parentNode&&this.parentNode.replaceChild(a(arguments),this.nextSibling)},Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this.nextSibling)}}();