();
    if(!isValid) {
      for(var i = 0; i < form.elements.length; ++i) {
        var input = form.elements[i];
        if(input.className.indexOf("required") >= 0) {
          input.onchange = validate;
        }
      }
      return false;
    }

    setTimeout(function() {
      for(var i = 0; i < form.getElementsByTagName("input").length; ++i) {
        var input = form.getElementsByTagName("input")[i];
        if(input.getAttribute("type") == "text") {
          input.value = "";
        }
        i