<!-- 




  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.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;    
      }  

      if( strMobile2.indexOf("-") == -1  && strMobile2.length == 8 )
      {
          alert("You must enter your complete mobile number.");
          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 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 NavigateSite( intSite )
  {
    var strURL = "";
    switch( intSite )
    {
      case 1:
         strURL = "http://www.kwikshop.com";
        break;
      case 2:
        strURL = "http://www.quikstop.com";
        break;
      case 3:
       strURL = "http://www.tomt.com";
        break;
      case 4:
        strURL = "http://www.turkeyhillstores.com";
        break;
      case 5:
        strURL = "http://www.kroger.com/company_information/Pages/default.aspx";
        break;                                        
    }
    var w = 800;
    var h = 600;
    var options = "width=" + w + ",height=" + h + ",";
    options += "resizable=yes,scrollbars=yes,status=yes,";
    options += "menubar=yes,titlebar=yes,toolbar=yes,left=0,top=0";
    var newWin = window.open(strURL, 'newWin', options);
    newWin.focus();
    
  }





// -->