$(function(){

	var recordcount = $("#__recordcount").val();
	var initLoad = true;
	
	function pageselectCallback(page_index,jq){
		if(!initLoad){
			//保存当前浏览页
			$("#__page_current_index").val(page_index);
			LoadData(page_index);
		}else{
			initLoad = false;
		}
	}
	
	function LoadData(page_index, reload){
		page_index = parseInt(page_index) + 1;

		$.ajax({
			url:"/news_list_ajax.php",
			type:"post",
			data:{pageindex:page_index, pagesize:20},
			success:function(data){
				$("#tbl_list").html(data);
			}
		});
	}
	
	$("#Pagination").pagination(recordcount, {callback: pageselectCallback, current_page:0, items_per_page:20});
	
});