<!-- 

  function CheckValidEmail( strEmail )
  {  
    if( strEmail == "" || strEmail.search("@") == -1  || strEmail.indexOf(".") == -1 ) 
      return false;
    else
      return true;
  }  


  function IsNumeric( strIn )
  {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   strString = new String(strIn);

   if (strString.length == 0) return false;
   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
   {
     strChar = strString.charAt(i);
     if (strValidChars.indexOf(strChar) == -1)
     { 
       blnResult = false;
     }
   }
   return blnResult;
  }


  function getRadioValue( radio )
  {
   for (var i = 0; i < radio.length; i++)
    {   
      if (radio[i].checked) { break }
    }
    if( i == radio.length )
      return -1;
    else
      return radio[i].value;
  }


  function openWindow(url, w, h) 
  {
    var options = "width=" + w + ",height=" + h + ",";
    options += "resizable=yes,scrollbars=yes,status=no,";
    options += "menubar=no,toolbar=no,left=0,top=0,directories=no";
    var newWin = window.open(url, 'newWin', options);
    newWin.focus();
  }


  function ConfirmDelete( )
  {
    if( confirm("Are you sure that you wish to delete this item?") ) 
      return true;
    else 
      return false;
  }


  function CheckZipCode( strZip )
  {
    if( strZip == ""  ||  !IsNumeric( strZip ) ||  strZip.length != 5  ) 
    {
      alert("You have entered an invalid U.S. ZIP/Postal code.");
      return false;
    }
    return true;
  }

  function CheckCreditCardExp( )
  {
    var bValid  = 0;
    var dtToday = new Date();
    var nMonth  = document.contactform.intExpMonth.value;
    var nYear   = document.contactform.intExpYear.value;

    if( nYear < dtToday.getFullYear() )
     bValid = 0;
    else
    {
     if( nMonth >= (dtToday.getMonth()+1)  &&  nYear >= dtToday.getFullYear() )
       bValid = 1;
     else
       if( nMonth <= (dtToday.getMonth()+1)  &&  nYear > dtToday.getFullYear() )
         bValid = 1;
       else
         bValid = 0;
    }

    if( bValid )
    {
      return true;
    }
    else
    {
      alert( "Your credit card has expired." );
      return false;
    }
  }



  function CheckGift( )
  {
    if( document.contactform.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.contactform.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.contactform.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }
    if( document.contactform.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.contactform.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    } 
    if( document.contactform.strZip.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( document.contactform.strDphone.value == "" ) 
    {
      alert("You must enter a daytime phone number."); 
      return false;
    }
    if( document.contactform.strEmail.value == "" || document.contactform.strEmail.value.search("@") == -1  || document.contactform.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a valid e-mail address."); 
      return false;
    }
    if( document.contactform.strEmail2.value == "" || document.contactform.strEmail2.value.search("@") == -1  || document.contactform.strEmail2.value.indexOf(".") == -1 ) 
    {
      alert("You must confirm a valid e-mail address."); 
      return false;
    }    
    if( document.contactform.strEmail.value != document.contactform.strEmail2.value )
    {
      alert("Your email addresses do not match."); 
      return false;    
    }

    var i = document.contactform.intCardType.selectedIndex; 
    if( document.contactform.intCardType.options[i].value == 0 )
    {
      alert("You must choose a credit card type.");
      return false;
    }
    if( document.contactform.strCardnum.value == "" )
    {
      alert("You must enter a valid credit card number.");
      return false;
    }
    if( document.contactform.strCardnum.value.search("-") != -1 || document.contactform.strCardnum.value.search(" ") != -1 ) 
    {
      alert("You must enter your credit card number without blank spaces or dashes.");
      return false;
    } 

    if( i == 3 ) // Amex requires 15 digits
    {
      if( document.contactform.strCardnum.value.length != 15 )
      {
        alert("You must enter a valid 15-digit credit card number.");
        return false;
      }
      if( document.contactform.strCVV2.value == "" || document.contactform.strCVV2.value.length != 4  ||  !IsNumeric(document.contactform.strCVV2.value) )
      {
        alert("You must enter your Customer Verification Number.\n\nClick the \"What\'s This\" link for details.");
        return false;
      }
    }
    if( i < 3 ) // VISA and MASTERCARD
    {
      if( document.contactform.strCardnum.value.length != 16 )
      {
        alert("You must enter a valid 16-digit credit card number.");
        return false;
      }
      if( document.contactform.strCVV2.value == "" || document.contactform.strCVV2.value.length != 3  ||  !IsNumeric(document.contactform.strCVV2.value) )
      {
        alert("You must enter your Customer Verification Number.\n\nClick the \"What\'s This\" link for details.");
        return false;
      }
    }

    var j = document.contactform.intExpMonth.selectedIndex;
    if( document.contactform.intExpMonth.options[j].value == 0 )
    {
      alert("You must enter the expiration month of your credit card.");
      return false;
    }

    var k = document.contactform.intExpYear.selectedIndex; 
    if( document.contactform.intExpYear.options[k].value == 0 )
    {
      alert("You must enter the expiration year of your credit card.");
      return false;
    } 
    if( !CheckCreditCardExp() ) 
      return false;

    if( document.contactform.fAmount.value == "" ) 
    {
      alert("You must enter the amount of the gift."); 
      return false;
    }

    if( !IsNumeric(document.contactform.fAmount.value) ) 
    {
      alert("You must enter a numeric gift amount."); 
      return false;
    }

    return true;
  }


  function CheckContact( )
  {
    if( document.gift.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.gift.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.gift.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }
    if( document.gift.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.gift.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    } 
    if( document.gift.strZip.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( document.gift.strDphone.value == "" ) 
    {
      alert("You must enter a daytime phone number."); 
      return false;
    }
    if( document.gift.strEmail.value != "" ) 
    {
      if( document.gift.strEmail.value != document.gift.strEmail2.value )
      {
          alert("Your email addresses do not match."); 
          return false;
      }
    }    
    return true;
  }


  function ExplainGift( intGift )
  {
    var strURL = "./explain.asp?intGift=" + intGift;
    openWindow(strURL, 645, 400);      
  }



  function ClearFund( ) 
  {
    for (var i = 0; i < document.gift.intFund.length; i++) 
      document.gift.intFund[i].checked = false;
  }
  
  
  function ClearTribute( ) 
  {
    for (var i = 0; i < document.gift.intMemHon.length; i++) 
      document.gift.intMemHon[i].checked = false;
  }  

// -->