(function() {
    function addScript(url,on) {
        var script = document.createElement('script');
        script.setAttribute('src',url);
        script.addEventListener('load', function(e) { on(); });
        document.head.appendChild(script);
    }
    // button waves effect
    addScript('https://rawgit.com/fians/Waves/master/src/js/waves.js', function() {
        Waves.attach('.btn');
        Waves.attach('.menu a');
        Waves.init();
    });
    // add each to array
    HTMLCollection.prototype.each = function(f) {
        for (var i = 0; i < this.length; i++) {
            f(i, this[i]);
        }
    }
    // add overlay div
    document.body.innerHTML += "<div id='overlay'></div>";
    // slide out navbar
    var a = document.getElementById("side-nav") || document.createElement('div');
    if (a.className === "pull-out") {
        document.getElementsByClassName("sidenavcontrol")[0].addEventListener('click', function(e) {
            var f = function() {
                var b = window.getComputedStyle(a, null).getPropertyValue("left");
                var l = parseInt(b.substring(0,b.length-2));
                a.style.left = (l+30) + "px";
                if (l < 240) {
                    requestAnimationFrame(f);
                }
                else {
                    a.style.left = "240px";
                }
            };
            document.getElementById('overlay').style.display = "block";
            f();
        });
        document.getElementsByTagName("body")[0].addEventListener('click', function(e) {
            if (window.getComputedStyle(a, null).getPropertyValue("left") === "240px") {
                if (e.pageX > 240) {
                    var f = function() {
                        var b = window.getComputedStyle(a, null).getPropertyValue("left");
                        var l = parseInt(b.substring(0,b.length-2));
                        a.style.left = (l-30) + "px";
                        if (l > 0) {
                            requestAnimationFrame(f);
                        }
                        else {
                            a.style.left = "0px";
                        }
                    };
                    document.getElementById('overlay').style.display = "none";
                    f();
                }
            }
        });
        document.getElementsByClassName("menu").each(function(i, v) {
            v.addEventListener("click", function(e) {
                var el = e.target.parentElement;
                var open = el.getAttribute('aria-expanded') === "true";
                el.setAttribute('aria-expanded', open ? "false" : "true");
            });
        });
    }
    // autosize textarea
    // courtesy http://codepen.io/vsync/pen/czgrf (MIT)
    var textarea = document.querySelector('textarea');
    textarea.addEventListener('keydown', autosize);
    function autosize(e){
        var el = this;
        setTimeout(function(){
            el.style.cssText = 'height:auto; padding:0';
            el.style.cssText = 'height:' + el.scrollHeight + 'px';
        },0);
    }
})();

@@ -2719,15 +2719,18 @@
  // 
-courtes
+inspired b
 y ht
@@ -2775,22 +2775,21 @@
     
-var textarea =
+try %7B%0A       
  doc
@@ -2823,22 +2823,8 @@
 ea')
-;%0A    textarea
 .add
@@ -2852,45 +2852,26 @@
 n', 
-autosize);%0A    function autosize
+function
 (e)
+ 
 %7B%0A
+    
     
@@ -2897,16 +2897,20 @@
         
+ 
+   
 setTimeo
@@ -2924,16 +2924,20 @@
 tion()%7B%0A
+    
         
@@ -2989,32 +2989,36 @@
 0';%0A            
+ 
+   
 el.style.cssText
@@ -3056,16 +3056,20 @@
 + 'px';%0A
+    
         
@@ -3074,16 +3074,17 @@
   %7D,
+ 
 0);%0A    
 %7D%0A%7D)
@@ -3079,16 +3079,45 @@
 0);%0A    
+    %7D);%0A    %7D%0A    catch (x) %7B
 %7D%0A%7D)();%0A

fix error when no textarea tags exist on page