function notice(page){
	$.get("Notice.php",{page:page,rtype:"notice"},
		function(data){
			var retData = eval('(' + data + ')');
			var lpag,rpage;
			var retMsg = '<ul>';
			var pagemsg='';
			if(retData.Total==0){
				$("#pageMsg").html('');
				$("#st-accordion").html('No Data');
			}else{
			//处理Page
			if (page=="1"){
				pagemsg='<li><a href="javascript:void(0);" onclick="notice(1)"">Prev</a></li>';
			}else{
				pagemsg='<li><a href="javascript:void(0);" onclick="notice('+(page-1)+')">Prev</a></li>';	
			}
			if(page>3){lpage=(page-3)}else{lpage=1}
			if(page>(retData.TotalPage-3)){rpage=retData.TotalPage}else{rpage=(page+3)}
			for (var i=lpage;i<=rpage;i++){
				if (page==i){
					pagemsg+='<li class="active"><a href="javascript:void(0);" onclick="notice('+i+')">'+i+'</a></li>';
					}else{
					pagemsg+='<li><a href="javascript:void(0);" onclick="notice('+i+')">'+i+'</a></li>';
				}
			}
			if (page==retData.TotalPage){
				pagemsg += '<li><a href="javascript:void(0);" onclick="notice('+retData.TotalPage+')">Next</a></li>';
			}else{
				pagemsg += '<li><a href="javascript:void(0);" onclick="notice('+(page+1)+')">Next</a></li>';	
			}

			for (var j=0;j<retData.noticeGroup.length;j++){
			retMsg+='<li onclick="fff('+retData.noticeGroup[j].news_id+');" class="last-child"><a href="#">'+retData.noticeGroup[j].news_title+'<span class="st-arrow">Open or Close</span></a>';
			if (j==0){
				retMsg+='<div class="st-content" id="c'+retData.noticeGroup[j].news_id+'" style="display:block;">';
			}else{
				retMsg+='<div class="st-content" id="c'+retData.noticeGroup[j].news_id+'" style="display:none;">';
			}
			retMsg+='<p class="an_a1">'+retData.noticeGroup[j].news_content+'</p>';
			retMsg+='<span class="an_a2">'+retData.noticeGroup[j].news_date+'</span>';
			retMsg+='</div></li>';
			}
			retMsg+='</ul>';
			//alert(retMsg);
			$("#st-accordion").html(retMsg);
			$("#pageMsg").html(pagemsg);
			}
	});
}


function fff(uid){
var x=$("#c"+uid).css("display");
	$(".st-content").slideUp("slow");
	if (x=="block"){
		$("#c"+uid).slideUp("slow");
	}else{
		$("#c"+uid).slideDown(500);$("#c"+uid).css("display","block");$("#c"+uid).prev("li").addClass("first-child");
	}
}

$(document).ready(function(){
notice(1);
});