docs: function are_equal(a1, a2)
  {
      if (typeof(a1) != typeof(a2))
          return false;
  
      switch(typeof(a1)) {
          case 'object':
              // arrays
              if (a1.length) {
                  if (a1.length != a2.length)
                      return false;
                  for (var i = 0; i < a1.length; ++i) {
                      if (!are_equal(a1[i], a2[i]))
                          return false
                  }
              }
              // associative arrays
              else {
                  var keys = {};
                  for (var key in a1) {
                      keys[key] = true;
                  }
                  for (var key in a2) {
                      keys[key] = true;
                  }
                  for (var key in keys) {
                      if (!are_equal(a1[key], a2[key]))
                          return false;
                  }
              }
              return true;
  
          default:
              return a1 == a2;
      }
  }