<?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() {
		$(".main-tb .tabs li:nth-child(1)").click();
    });
	
    $(".main-tb .tabs li").click(function(){ // When btn is pressed.
		var toshow= $(".main-tb .tabs li:nth-child(1)").attr("nslick");
	if(!$(this).children("a").hasClass("active")){
		$(".main-tb .tabs li").attr("disabled",true);
	var cat = $(this).attr("toShow");
	$(".main-tb .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 */

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