//---------------------------------------------------
// general form validation
// contact us, suggestion form
function sendForm() {
	return confirm("Is all the information correct?\n Hit OK to submit or CANCEL to make changes.");
}

//---------------------------------------------------
// pumpkin head signup form validation
function sendSForm(form) {
	form.ok_url.value = "http://oldbarnselfstoragepumpkinpatch.com/index.php?pg=pumpkin_head_signup_success&name=" + form.name.value;
	return confirm("Is all the information correct?\n Hit OK to submit or CANCEL to make changes.");
}
//----------------------------------------------------


function sendDonation(theForm)
{

  if (theForm.price.value == "")
  {
    alert("Please enter an amount for the \"donation\".");
    theForm.price.focus();
    return (false);
  }

  var checkOK = "0123456789-,";
  var checkStr = theForm.price.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters for the \"donation amount\".");
    theForm.price.focus();
    return (false);
  }
  return (true);
}
//---------------------------------------------------------------------
// tell a friend form
function checkForm(theForm)
{

  if (theForm.send_name.value == "")
  {
    alert("Please enter Your Name.");
    theForm.send_name.focus();
    return (false);
  }

  if (theForm.send_email.value == "")
  {
    alert("Please enter Your Email.");
    theForm.send_email.focus();
    return (false);
  }

  if (theForm.recipname_1.value == "")
  {
    alert("Please enter your Friend's Name");
    theForm.recipname_1.focus();
    return (false);
  }

  if (theForm.recipemail_1.value == "")
  {
    alert("Please enter your Friend's Email");
    theForm.recipemail_1.focus();
    return (false);
  }
  
  if (theForm.message.value == "")
  {
    if (confirm("You didn't include a message!\n\nDo you want to send the link without a message?")) {
    	return (true); 
	} else {
		theForm.message.focus();
    	return (false);
	}
  }
  
  return (true);
}
//---------------------------------------------------------------