<div class="feedFacebookWall clearfix img-rounded">
  <h4 class="img-rounded">What's New on<a href='https://www.facebook.com/pages/Farmers-Market-of-LaVerkin/189550406692'><img src='/Kickstrap/img/FacebookLogos.png' width='65' style='margin:-6px 0 0 10px; display: inline-block;' /></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="/js/jquery.neosmart.fb.wall.js" type="text/javascript"></script>
<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);
  });
	
	
    
</script>
