<script src="/admin/js/blogJS.js"></script>
<script src="//afsshareportal.com/js/moment.min.js"></script>

<div id="blogPosts" class="clearfix hideObject">
  <h2>Latest News &amp; Events <span class='pull-right'><a href='/posts' class='btn'>View older posts</a></span></h2>
</div>



<script>
  getCategoryID(blogSlug, 1, "home", false, 4, "posts");
  var blogInterval = null;
  var timesRun = 0;
  
  blogInterval = setInterval(checkBlogPosts,500);
  
  function checkBlogPosts(){
	timesRun++;
	
	if($("#blogPosts .onePost").length > 0){
	  $("#blogPosts").removeClass("hideObject");
	  clearInterval(blogInterval);
	}
	
	if(timesRun === 20){
      clearInterval(blogInterval);
    }
  }
</script>
