// JavaScript Document
function checkFields(formObj) {

formObj.paymentAmount.value = formObj.paymentAmount.value.replace('$','');

missinginfo = "";
if (formObj.firstname.value == "") {
missinginfo += "\n     -  First Name";
}
if (formObj.lastname.value == "") {
missinginfo += "\n     -  Last Name";
}
if (formObj.paymentAmount.value == "") {
missinginfo += "\n     -  Amount";
}
if ((formObj.email.value == "") || 
(formObj.email.value.indexOf('@') == -1) || 
(formObj.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  Email address not correctly formatted";
}

formObj.paymentAmount.value = formObj.paymentAmount.value.replace('$','');

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
