/** XHForms - Submits forms via XMLHTTP. - brad@xkr.us - v0.2 - 2004-10-20   **
    Code licensed under Creative Commons Attribution-ShareAlike License
 ** http://creativecommons.org/licenses/by-sa/2.0/                           **/

/* This is where you put the code to run after the form has been submitted. */
function fnAfterSubmit(oResponse)
{
  clearTimeout(tError); // successful, so stop timeout error

  /*...*/
  document.getElementById("out").innerHTML = oResponse.responseText;
}

/* (Optional) Put code here that will execute before the submission */
function fnBeforeSubmit() {}

/* Put error-handling code here (if the connection times out). */
function fnOnError(oForm)
{
  if (confirm("An error occured. Try traditional form submission?"))
  {
    oForm.onsubmit = null; // remove the XHForm handler
    oForm.submit(); // submit the form normally
  }
}

/* include necessary library functions (do not edit) */
include("http://xkr.us/code/javascript/FormCollect/FormCollect.js");
include("http://xkr.us/code/javascript/XHConn/XHConn.js");
include("http://xkr.us/code/javascript/XHForms/XHForms-core.js");
