(function () {

    // Add behaviour for option buttons
    app(function (api) {

        var resetbtn = document.querySelector("#resetbtn");

        resetbtn.addEventListener("click", function () {
            api.reset();
            api.args.searchinput.value = "";
            api.args.searchinput.focus();
        }, false);

    });
})();

@@ -91,73 +91,757 @@
 var 
-resetbtn = document.querySelector(%22#resetbtn%22);%0A%0A        resetbtn
+topnav = document.querySelector(api.args.topnav),%0A            bottomnav = document.querySelector(api.args.bottomnav);%0A%0A        /**%0A         * Actions to perform when reset button is clicked%0A         */%0A        var resetbtn_action = function () %7B%0A            var searchinput = document.querySelector(api.args.searchinput);%0A            api.reset();%0A            searchinput.value = %22%22;%0A            searchinput.focus();%0A        %7D;%0A%0A        /**%0A         * Actions to perform when search button is clicked%0A         */%0A        var searchbtn_action = function () %7B%0A            api.search(document.querySelector(api.args.searchinput).value.trim());%0A        %7D;%0A%0A        /**%0A         * Bind delegated listeners for elements in topnav%0A         */%0A        topnav
 .add
@@ -865,36 +865,38 @@
 ick%22, function (
+e
 ) %7B%0A
+%0A
             api.
@@ -887,36 +887,101 @@
             
-api.reset();
+if (e.target && e.target.id) %7B%0A%0A                switch (%22#%22 + e.target.id) %7B%0A
 %0A           
@@ -973,32 +973,41 @@
  %7B%0A%0A            
+    case 
 api.args.searchi
@@ -1005,34 +1005,383 @@
 s.search
-input.value = %22%22;%0A
+btn:%0A                    searchbtn_action();%0A                    break;%0A%0A                %7D;%0A            %7D%0A%0A        %7D, false);%0A%0A        /**%0A         * Bind delegated listeners for elements in bottomnav%0A         */%0A        bottomnav.addEventListener(%22click%22, function (e) %7B%0A%0A            if (e.target && e.target.id) %7B%0A%0A                switch (%22#%22 + e.target.id) %7B%0A%0A    
         
@@ -1380,24 +1380,29 @@
             
+case 
 api.args.sea
@@ -1398,36 +1398,126 @@
 pi.args.
-searchinput.focus();
+resetbtn:%0A                    resetbtn_action();%0A                    break;%0A%0A                %7D;%0A            %7D%0A
 %0A       

Add delegated listeners to topnav and bottomnav for actions