nction logSubmitEvent($e) {
        var text; 

        $e && $e.preventDefault(); 

        text = JSON.stringify($(this).serializeArray()); 
        writeToTextarea('submit', text);
      }

      function logTypeaheadEvent($e) {
        var args, type, text;

        args = [].slice.call(arguments, 1);
        type = $e.type;
        text = window.JSON ? JSON.stringify(args) : '';

        writeToTextarea(type, text);
      }

      function writeToTextarea(/* lines */) {
        var $textarea, val, text