<?php
  include_once($_SERVER['DOCUMENT_ROOT'] . "/admin/inc/sessionStartGeneral.php");
?>
<?php
  $pageTitle = "Ask An Expert";
  $pageDescription = "We care about your thoughts. Ask anything to any of our department managers!";
  $pageKeywords = "contact us, feedback";
?>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/common/header.php") ?>
<script src="/Kickstrap/js/jquery.h5validate.js" type="text/javascript"></script>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/common/mainNav.php")?>
    
    
    
    <section class="container">
      <div id="blankBuffer" class="carousel-buffer"></div>
      
      <section class="container" id="mainContent">
        <article class="row">
          <div class="span12" id="contactContainer">
            <h1><img src="/Kickstrap/img/askExpert.png" alt="Ask an Expert"><span class="hideObject">Ask an Expert</span></h1>
            <p>Have a question about your favorite cut of meat, or how to pick the perfect Watermelon?  Never fear our experts are here.  We've got you covered with experts in produce, meat, bakery, deli, general merchandise and center store.   Just send us your question and we'll get back to you with an answer quickly.</p><br><br>
            <div class="offsetPadLeft">
              <form action="/formmail.php" name="contactForm" method="post">
                <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
                <input type="hidden" name="recipients" value="petersons@afsshareportal.com" />
                <input type="hidden" name="required" value="email:Your email address,name:Your name" />
                <input type="hidden" name="subject" value="Ask an Expert Form Submission From Your Website" />
                <input type="hidden" name="good_url" value="<?php echo DOC_ROOT; ?>thanks.php">
                
                <?php include("https://afsshareportal.com/common/contactForm.php"); ?>
              </form>
            </div>
          </div>
        </article>
        
      </section>
    </section>
      
    
    
    
    <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/common/footer.php"); ?>
  <script>
   
    function getStoreLocations(){
        $.ajax({
            type: "POST",
            url: "/admin/lookUp.php",
            data: "action=getStoreLocations",
            dataType: "json",
            success: function(theResponse){
                var theHTML = "";
                //console.log("num locations: " + theResponse.length);
                if(theResponse.length > 1){
                  $.each(theResponse, function(){
                    theHTML += "<option>" + this.store_name + "</option>";
                  });
                  
                  $("#location").append(theHTML);
                }else{
                  $("#location").closest("div").remove();
                }
            }
        });
    }
    
    getStoreLocations();
   
    $('#contactForm').h5Validate();
			
    $("#contactForm").submit(function(event){
        event.preventDefault();
        
        var myResult = validateForm("contactForm");
        
        var theLocation = $("#location").val();
        
        if(myResult == true)
        {
            var self = $(this);	
            self.unbind('submit').submit()
        }
    });
   
   ks.ready(function() {
      // JavaScript placed here will run only once Kickstrap has loaded successfully.
   });
  </script>
  
</body>
</html>
