<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>

<style>
@media only screen and (max-width: 768px) {
    /*#blogPosts {
        display: -webkit-flex;
        display: -moz-flex;
        display: -ms-flex;
        display: o-flex;
        display: flex;
        flex-wrap: wrap;
    flex-direction: row;
    align-content: flex-start;*/


    /*    align-items: center;
        justify-content: center;
        flex-flow: column wrap;
        align-content: center;

    }

    #blogposts h4 {
      display:inline-block !important;
    }

    #blogposts p {
      display: flex;    
        flex-direction: row;
    }

    #blogposts img {
      align-content:flex-start;
      flex-direction: row;
      flex-basis: 100%;
    }*/

    #blogposts {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
    }

    .blogTitle {

        text-align: left !important;
    }

    .blogDate {

        text-align: left !important;
    }

    p img {
        float: none !important;
    }

    .blogDescr {

        text-align: left !important;
        height: auto !important;
    }

    .blogUrl {

        text-align: left !important;
    }

    .floatLeftImg {
        float: none !important;
    }

    body #bodyPadding #mainContent #blogPosts .onePost.half {
        overflow: hidden !important;
        height: auto !important;
    }

}
</style>

<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>
