﻿jQuery(function($){var init=function(){$(".i-package-news").each(function(){var $news=$(this);var data=null;try{data=eval("({"+$news.attr("data")+"})")}catch(exc){data=false}if(!data){return}var $pc=$(".i-pager-container",this);var go=function(){var item=$(this);var index=item.attr("index");if(item.is(".goto-button")){var value=parseInt(item.prev(".goto-value").val());if(value&&value>1){if(value>data.pagecount||value<1){alert($.format("请输入页码范围:{0}至{1}",1,data.pagecount));return false}else{index=value}}else{alert("请输入一个正整数");return false}}else{item.unbind("click",go)}data.pindex=index;$.get("desktopmodules/xmlpackage/xmlpackage.ashx",data,function(data,status){if(status=="success"){$news.replaceWith(data);init()}else{}});return false};$(".pre,.next,.pager-item,.last,.first,.goto-button",$pc).not(".pre-disable,.next-disable,.first-disable,.last-disable").bind("click",go);$(".goto-value",$pc).keypress(function(e){if(e.which==13){$(".goto-button",$pc).eq(0).triggerHandler("click");return false}})})};init()});
