function initData (installSql, url, locate){
    var queryParams = "";
    if(installSql != null) {
    	queryParams = installSql(queryParams);
    }
    $.ajax({
        type: "POST",
        dataType: "text",
        url: url,
        data:{'queryParams':queryParams},
        async: false,
        success : function(data){
            loadPaginator(eval("("+data+")").total, url, queryParams, locate);
        }
    });
}

function loadPaginator(totalInvest,url,queryParams,locate){
	//alert(totalInvest)
	if(totalInvest>0){
    $.jqPaginator('#pagination', {
        totalCounts:totalInvest,
        pageSize: 10,
        currentPage: 1,
        prev: '<li class="prev"><a href="javascript:;">上一页</a></li>',
        next: '<li class="next"><a href="javascript:;">下一页</a></li>',
        page: '<li class="page"><a href="javascript:;">{{page}}</a></li>',
        onPageChange: function (num, type ) {
            /*$.ajax({
                type: "POST",
                dataType: "text",
                url: url,
                data: {"pageSize":10, "page":num, 'queryParams':queryParams},
                success: function (data) {
                    $("#investCase").empty(); //清除div内容
                    if (data != null) {
                        data = eval("("+data+")").rows;;
                        $.each(data, function (index, investCase) {
                        		var name = investCase.noticeTitle==undefined ? investCase.title: investCase.noticeTitle;
                             $("#investCase").append("<tr><td style='vertical-align: middle;text-align:center;'>" + data[i].area +"</td><td style='vertical-align: middle;text-align:center;'>"+data[i].country+" </td><td style='vertical-align: middle;text-align:center;'>"+
         					data[i].taxNumber+"</td><td style='vertical-align: middle;text-align:center;'>"+data[i].goodsDesc+"</td></tr>")
                        });
                    }
                }
            });*/
        	var flag = checkInput();
        	var taxNumber  = document.getElementById("txtTaxId").value;
        	if(flag){
        		$.post("/front/queryTaxableGoods", {"pageSize":10, "page":num,"taxNumber": taxNumber}, function(data){
        			$("#investCase").empty(); //清除div内容
        			$("#divId").css("visibility", "visible");       			
        			for(var i=0;i<data.rows.length;i++) {
        			$(".costom_table_tbody").append("<tr><td style='vertical-align: middle;text-align:center;'>" + data.rows[i].area +"</td><td style='vertical-align: middle;text-align:center;'>"+data.rows[i].country+" </td><td style='vertical-align: middle;text-align:center;'>"+
        					data.rows[i].taxNumber+"</td><td style='vertical-align: middle;text-align:center;'>"+data.rows[i].goodsDesc+"</td></tr>");
        			
        			}
        		}, "json");
        	}
        }
    });
 }else{
		      $("#investCase").empty();
	}
}