<?php global $qaleb; ?>
<script>
 var ajaxUrl = "<?php echo admin_url('admin-ajax.php')?>";
    var page = 1; // What page we are on.
    var ptpp = <?php echo $qaleb['home-tabe-count']; ?>; // Post per page
	
	$(document).ready(function() {
		$(".polist .tabs li:nth-child(1)").click();
    });
	
    $(".polist .tabs li").click(function(){ // When btn is pressed.
		var toshow= $(".polist .tabs li:nth-child(1)").attr("nslick");
	if(!$(this).children("a").hasClass("active")){
		$(".polist .tabs li").attr("disabled",true);
	var cat = $(this).attr("toShow");
	$(".polist .tabs li a").removeClass("active");
	$(this).children("a").addClass("active");

			$("#tc-content").empty();
	$("#tc_loading").fadeIn("fast");
        $.post(ajaxUrl, {
            action:"more_post_ajax",
            ppp: ptpp,
			cat: cat
        }).success(function(posts){
            page++;
			$("#tc_loading").hide();
			
    $('#tc-content').slick('unslick'); 
	 $("#tc-content article").remove();
            $("#tc-content").html(posts); // CHANGE THIS!
    $('#tc-content').slick(getSliderSettings()); /* Initialize the slick again */

		$(".polist .tabs li").attr("disabled",false);
        });
	}
		return false;
   });
   </script>