
var offset=1 ;
var maxoff=pcount.value ;
var last=maxoff-3 ;
  // When the document loads do everything inside here ...
     $(document).ready(function(){
 

         $(' .arrow_right').click(function() { //start function when any link is clicked
		offset+=3 ;
		if (offset>last){
		 offset=last ;
		}
		
		 $('#aj').load("/blog/wp-content/themes/kk/kk-ajax.php?offset=" + offset );
	
			
				
	
				if (offset>=4)
		{  $(" .arrow_left").css("display","block");
		}
						if (offset==last)
		{  $(" .arrow_right").css("display","none");
		}

         }); //close click(

	
         $(' .arrow_left').click(function() { //start function when any link is clicked
	 	offset-=3 ;
		if (offset<=1){
		 offset=1 ;
		}
		 $('#aj').load("/blog/wp-content/themes/kk/kk-ajax.php?offset=" + offset );
	
		
					if (offset==1)
		{  $(" .arrow_left").css("display","none");
		}
						if (offset<last)
		{  $(" .arrow_right").css("display","block");
		}

         }); //close click(
	 }); //close $(