<!-- 

  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 CheckContact( )
  {
    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.txtComments.value == "" )
    {
      alert("You must enter a comment."); 
      return false;
    }
    return true;
  }


  function CheckMailingList( )
  {
    if( !CheckValidEmail( document.contactform.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }
    
    if( document.contactform.strZIP.value != "" )
    {
      if( !CheckZipCode(document.contactform.strZIP.value) )
        return false;
    }
    
    if( !document.contactform.bOptIn.checked )
    {
      alert("You must check the box labeled 'Please send me news and promotions...'");
      return false;
    }    
    
    var strMobile1 = new String(document.contactform.strMobile1.value);
    var strMobile2 = new String(document.contactform.strMobile2.value);  
    if( document.contactform.bMobileOptIn.checked )
    {   
      if( !IsNumeric(strMobile1) || !IsNumeric(strMobile2) )
      {
        alert("You must enter a complete, valid mobile number.");
        return false;
      }
      if( strMobile1.length != 3 || strMobile2.length < 7 )
      {
        alert("You must enter your complete mobile number.");
        return false;
      }
      if( strMobile2.indexOf("-") != -1  && strMobile2.length == 7 )
      {
          alert("You must enter your complete mobile number.");
          return false;    
      }          
    }  

    return true;
  }
  
  
  function CheckAccount( )
  {
    if( !CheckValidEmail( document.account.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }
	if( document.account.strPassword.value == "" )
    {
      alert("You must enter a password."); 
	  document.account.strPassword.focus;
	  document.account.strPassword.select;
      return false;
    }
    if( document.account.strConfirmPassword.value == "" )
    {
      alert("You must enter a confirmation password."); 
	  document.account.strConfirmPassword.focus;
	  document.account.strConfirmPassword.select;
      return false;
    }
	if (document.account.strPassword.value != document.account.strConfirmPassword.value) 
	{
		alert("The Password and the confirmation Password do not match.  Please correct your passwords.");
		document.account.strPassword.focus;
		document.account.strPassword.select;
		return false;
	}

    return true;
  }
  


  function CheckDontation( )
  {
    if( !CheckValidEmail( document.donation.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }
    if( document.donation.strCompany.value == "" ) 
    {
      alert("You must enter your company or organization's name."); 
      return false;
    }
    if( document.donation.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.donation.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.donation.strAddress1.value == "" ) 
    {
      alert("You must enter your street address."); 
      return false;
    }
    if( document.donation.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.donation.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    }     
    if( document.donation.strZIP.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( document.donation.strPhone.value == "" ) 
    {
      alert("You must enter a daytime phone number."); 
      return false;
    }
    if( document.donation.strEventDate.value == "" ) 
    {
      alert("You must enter an event date."); 
      return false;
    }
    if( document.donation.strEventLoc.value == "" ) 
    {
      alert("You must enter an event location."); 
      return false;
    }
    if( document.donation.txtEventDesc.value == "" ) 
    {
      alert("You must enter an event description."); 
      return false;
    }
    if( document.donation.txtDonatDesc.value == "" ) 
    {
      alert("You must enter a donation description."); 
      return false;
    }
    if( document.donation.strAmtNeeded.value == "" ) 
    {
      alert("You must enter the amount of donation needed."); 
      return false;
    }
    return true;
  }



  function CheckRequestHilda( )
  {
    if( !CheckValidEmail( document.request_hilda.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }
    if( document.request_hilda.strCompany.value == "" ) 
    {
      alert("You must enter your company or organization's name."); 
      return false;
    }
    if( document.request_hilda.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.request_hilda.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.request_hilda.strAddress1.value == "" ) 
    {
      alert("You must enter your street address."); 
      return false;
    }
    if( document.request_hilda.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.request_hilda.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    }     
    if( document.request_hilda.strZIP.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( document.request_hilda.strPhone.value == "" ) 
    {
      alert("You must enter a daytime phone number."); 
      return false;
    }
    if( document.request_hilda.strEventDate.value == "" ) 
    {
      alert("You must enter an event date."); 
      return false;
    }
    if( document.request_hilda.strEventLoc.value == "" ) 
    {
      alert("You must enter an event location."); 
      return false;
    }
    if( document.request_hilda.txtEventDesc.value == "" ) 
    {
      alert("You must enter an event description."); 
      return false;
    }
    return true;
  }




  function CheckStoreLocator( )
  {
    if( document.contactform.city.value != "" )
    {
      document.cityform.strCity.value = document.contactform.city.value;
      document.cityform.submit();
      return false;
    }
    else
    {
      if( document.contactform.strZIP.value == "" || document.contactform.strZIP.value.length < 5 )
      {
        alert("You must enter a ZIP/Postal code.");
        return false;
      }
      CheckZipCode( document.contactform.strZIP.value );
      if( document.contactform.intDist.value == "" )
      {
        alert("You must enter the distance you are willing to travel.");
        return false; 
      }
    }
    return true;
  } 



  function CheckGrandOpening( )
  {
    if( document.grandopening.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.grandopening.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.grandopening.strAddress1.value == "" ) 
    {
      alert("You must enter your street address."); 
      return false;
    }
    if( document.grandopening.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.grandopening.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    }     
    if( document.grandopening.strZip.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( !CheckValidEmail( document.grandopening.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }
    return true;
  }




  function CheckCoffee( )
  { 
    if( document.coffee.strCode ) 
    {
      if( document.coffee.strCode.value == "" ) 
      {
        alert("You must enter your Passport Card #."); 
        return false;
      }  
    }
    if( document.coffee.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.coffee.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.coffee.strAddress1.value == "" ) 
    {
      alert("You must enter your street address."); 
      return false;
    }
    if( document.coffee.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.coffee.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    }     
    if( document.coffee.strZip.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( document.coffee.strPhone.value == "" ) 
    {
      alert("You must enter your phone number."); 
      return false;
    }    
    if( !CheckValidEmail( document.coffee.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }
    return true;
  }


  function CheckStory( )
  {
    if( document.coffee.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.coffee.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.coffee.intStoreID.value == "0" )
    {
      alert("You must select a store.");
      return false;
    }
    if( document.coffee.strPosition.value == "" ) 
    {
      alert("You must enter your position/title."); 
      return false;
    }
    if( document.coffee.strTimeEmp.value == "" ) 
    {
      alert("You must specify your time employed by Turkey Hill Minit Markets."); 
      return false;
    }    
    if( document.coffee.txtStory.value == "" ) 
    {
      alert("You must enter your story."); 
      return false;
    }
  
    return true;
  }


  function ContestLogin( )
  {
	  if( document.login.strUsername.value == "" )
    {
      alert("You must enter your username.");
      return false;
    }	  
	  if( document.login.strPassword.value == "" )
    {
      alert("You must enter your password.");
      return false;
    }
    return true;
  }


  function CheckMyStory( )
  {
    if( document.mystory.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.mystory.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.mystory.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }    
    if( document.mystory.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }           
    if( document.mystory.strState.value == "" )
    {
      alert("You must select your state.");
      return false;
    }
    if( document.mystory.strZIP.value == "" ) 
    {
      alert("You must enter your ZIP/postal code."); 
      return false;
    }     
    
    if( document.mystory.strPhone.value == "" ) 
    {
      alert("You must enter your phone number."); 
      return false;
    }    
    if( !CheckValidEmail( document.mystory.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }    
    
    if( document.mystory.strBirthMM.value == "" || document.mystory.strBirthDD.value == "" || document.mystory.strBirthYY.value == "" )
    {
      alert("You must enter your birth date.");
      return false;
    }    
    if( document.mystory.txtStory.value == "" ) 
    {
      alert("You must enter your story."); 
      return false;
    }  
    return true;
  }
  
  
  function CheckHildaForm( )
  {
    if( document.hilda.strFname.value == "" ) 
    {
      alert("You must enter your first name."); 
      return false;
    }
    if( document.hilda.strLname.value == "" ) 
    {
      alert("You must enter your last name."); 
      return false;
    }
    if( document.hilda.strAddress1.value == "" ) 
    {
      alert("You must enter your street address."); 
      return false;
    }
    if( document.hilda.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.hilda.strState.value == "" ) 
    {
      alert("You must enter your state."); 
      return false;
    }     
    if( document.hilda.strZip.value == "" ) 
    {
      alert("You must enter your ZIP/Postal code."); 
      return false;
    }
    if( !CheckValidEmail( document.hilda.strEmail.value ) ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }   
    return true;
  }
  
  
  function HildaVote( intVote )
  {
 /*   switch( intVote )
    {
      case 1, 2, 3: */
        document.hilda_vote.intVote.value = intVote;
        document.hilda_vote.submit();
//        break;
//    }
    return true;
  }
  
// -->
