﻿// JScript File
function customvalidate()
{
if (Ektron.FormBlock.validate(document.getElementById('aspnetForm')))
{
   if ( (document.getElementById('aspnetForm').Email.value.length == 0) &&  (document.getElementById('aspnetForm').PhoneNumber.value.length == 0) )   
   {
    alert('Please enter Email Address or Phone Number');
    return false;
   }
   
   if ( (document.getElementById('aspnetForm').Email.value != document.getElementById('aspnetForm').EmailConfirmation.value) )   
   {
    alert('Email Address and Confirm Email must match');
    return false;
   }
   
   if (document.getElementById('aspnetForm').ConductedFundraiser_in_thePast[0].checked)
   {
    if (document.getElementById('aspnetForm').CookieDoughBrand.value.length == 0)
    {
        alert('Please enter Cookie Dough Brand');
        return false;
    }
    
    if (document.getElementById('aspnetForm').MoneyFundraiserMade.value.length == 0)
    {
        alert('Please enter How Much Money Did Your Cookie Dough Fundraiser Make');
        return false;
    }
   }
   
   Ektron.FormBlock.setTargetAction("postback");
   Ektron.FormBlock.setState("__ekFormState", "in");
   document.getElementById('aspnetForm').submit();
}   
}
