<!--<div class="feedFacebookWall clearfix img-rounded">
  <h4 class="img-rounded">What's New on<a href='<?php echo FACEBOOK_URL;?>'><img src='/Kickstrap/img/FacebookLogos.png' width='65' style='margin:-6px 0 0 10px; display: inline-block;' alt="Facebook Logo"/></a></h4>
  <a class="fb-control left" href="#" data-slide="prev">&lsaquo;</a>
  <a class="fb-control right" href="#" data-slide="next">&rsaquo;</a>
  <div id="facebookWall">
  </div>
</div>-->

<script src="https://afsshareportal.com/js/moment.min.js"></script>
<script src="/js/jquery.neosmart.fb.wall.js" type="text/javascript"></script>
<?php
  $allFBTokens = json_decode(file_get_contents('https://afsshareportal.com/inc/usableFBTokens.php'));
  $feedID = "petersonsmarket";
	$feedToken = isset($allFBTokens->{$feedID}->token) ? $feedToken = $allFBTokens->{$feedID}->token : "";
	//$feedToken = "EAAHmc8D5C74BAC33NxQUpO4ef6xzZB0u0wmS7vBPQGc1g2f995j6HcJ9gcFNBWTxd3otE4OMIqC1NNTKuKAMQOwNBFMQpL0aLleqnXokbm1dIqhbx7AtdaUvTdaTFoGi4aMAMTAgVbURgomhmKGbHA4i5S9UZD" ;
?>
<script>
  $(document).ready(function(e) {
	var myInterval = setInterval(function(){
	  $(".fb-content-hide").unbind().bind("click", function(e){
		  e.preventDefault();
		  var $this =	$(this);
		  var theContent = $this.siblings(".fb-wall-data, .fb-wall-media").toggleClass("hideObject");
		  var theText = $this.text() == "Hide this post" ? "View this post" : "Hide this post";
		  $this.text(theText);
	  });
	  
	  if($(".fb-wall-box").length < 1){
		$(".fb-control").addClass("hideObject");
	  }else{
		$(".fb-control.left").removeClass("hideObject");
		$(".fb-control.right").addClass("hideObject");
	  }
	  //setColWidth();
	}, 1000);
	
	$('.fb-control').on("click", function(e){
	  e.preventDefault();
	  var $thePosts = $(this).siblings("#facebookWall");
	  var theIndex = $thePosts.children().not(".hideObject").index();
	  var total = $thePosts.children().length;
	  
	  
	  if($(this).is(".left")){
		var shouldHide = (theIndex + 2) < total ? false : true;
		if(shouldHide){
		  $(".fb-control.left").addClass("hideObject");
		}else{
		  $(".fb-control.right").removeClass("hideObject");
		}
		var next = (theIndex + 1) < total ? theIndex + 1 : theIndex;
	  }else{
		var shouldHide = (theIndex - 2) < 0 ? true : false;
		if(shouldHide){
		  $(".fb-control.right").addClass("hideObject");
		}else{
		  $(".fb-control.left").removeClass("hideObject");
		}
		var next = (theIndex - 1) >= 0 ? theIndex - 1 : theIndex;
	  }
	  
	  $thePosts.children().eq(theIndex).addClass("hideObject");
	  $thePosts.children().eq(next).removeClass('hideObject');
	  
	  //console.log("shouldHide: " + shouldHide + "\ntotal: " + total + "\nthe index is: " + theIndex + "\nnext: " + next);
	});
	
	setTimeout(function(){
		clearInterval(myInterval);
	}, 7000);
  });
	
  $(function(){
	  $('#facebookWall').fbWall({ id:'<?php echo $feedID ?>',accessToken:'<?php echo $feedToken ?>'});
  });
    
</script>
