function Init() {
	if (DOMFL.GetElm("form")) DOMFL.SetEvent(DOMFL.GetElm("form"), "submit", ValidateFields);
}

function ValidateFields(e) {

  var form = document.createElement("div");

  var amount = DOMFL.GetElm("amount");
	
	if (amount.value.length == 0) {
    DOMFL.StopEvent(e);
	  form.appendChild(CustomMessage("You must provide the amount that you would like to donate to Olancho Aid."));
	  form.appendChild(CustomTextField(amount));
    DOMFL.ShowModalWindow(CustomForm(form, false, SetTextField));
    return;
  } else if (isNaN((amount.value).replace("$", ""))) {
    DOMFL.StopEvent(e);
	  form.appendChild(CustomMessage("You must provide a valid amount in US dollars that is greater than zero."));
	  form.appendChild(CustomTextField(amount));
    DOMFL.ShowModalWindow(CustomForm(form, false, SetTextField));
    return;
  } else if (parseInt((amount.value).replace("$", ""), 10) <= 0) {
    DOMFL.StopEvent(e);
	  form.appendChild(CustomMessage("You must provide a valid amount in US dollars that is greater than zero."));
	  form.appendChild(CustomTextField(amount));
    DOMFL.ShowModalWindow(CustomForm(form, false, SetTextField));
    return;
  }

}

DOMFL.RunWhenReady(Init);