
$(document).ready(function(){$("#category_all").addClass("act");$("#year_all").addClass("act");var ajax_news_url="/ajax/ajax_news.php";$("#category_ul").children().children().click(function(){var year=$("#year_ul").children().children(".act").attr("href");var category=$(this).attr("href");var page=parseInt($("#current_page").html());$("#category_ul").children().children().removeClass("act");$(this).addClass("act");if(year=='0')
{$("#yearandcategory").html($(this).html());}else{$("#yearandcategory").html(year+"年 "+$(this).html());}
$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);$("#total_page").html(temp[0]);$("#current_page").html("1");var total=parseInt(temp[0]);for(var i=1;i<=10;i++){$(".p"+i).hide();$(".p"+i).html(i);$(".p"+i).attr("href",i);$(".p"+i).removeClass("p_act");}
$(".pmore").attr("href",11);if(total>10)
{for(var i=1;i<=10;i++){$(".p"+i).show();}
$(".p1").addClass("p_act");$(".pmore").show();}else{for(var i=1;i<=total;i++){$(".p"+i).show();}
$(".p1").addClass("p_act");}
$(".pageup").hide();if(parseInt(temp[0])>1)
{$(".pagedown").show();$(".pagedown").attr("href",2);}else{$(".pagedown").hide();}}});return false;});$("#year_ul").children().children().click(function(){var year=$(this).attr("href");var category=$("#category_ul").children().children(".act").attr("href");var page=parseInt($("#current_page").html());$("#year_ul").children().children().removeClass("act");$(this).addClass("act");if(year=='0')
{$("#yearandcategory").html($("#category_ul").children().children(".act").html());}else{$("#yearandcategory").html(year+"年 "+$("#category_ul").children().children(".act").html());}
$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");var total=parseInt(temp[0]);for(var i=1;i<=10;i++){$(".p"+i).hide();$(".p"+i).html(i);$(".p"+i).attr("href",i);$(".p"+i).removeClass("p_act");}
$(".pmore").attr("href",11);if(total>10)
{for(var i=1;i<=10;i++){$(".p"+i).show();}
$(".p1").addClass("p_act");$(".pmore").show();}else{for(var i=1;i<=total;i++){$(".p"+i).show();}
$(".p1").addClass("p_act");}
$("#article_infos").html(temp[1]);$("#total_page").html(temp[0]);$("#current_page").html("1");}});return false;});$(".p1").click(function(){var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(".p1").addClass("p_act");if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));$(".pagedown").show();}else{$(".pagedown").hide();}
$("#current_page").html(page);if($(".p1").attr("href")==1)
{$(".pageup").hide();}}});return false;});$(".p2").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".pageup").hide();$(".pagedown").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);var duan=Math.ceil(page/10);if(page==duan*10-10+1)
{var min=duan*10-10;var max=0;if(total<duan*10)
{max=total;for(var i=1;i<=(max-min);i++){$(".p"+i).show();$(".p"+i).html(i+min);$(".p"+i).attr("href",i+min);}
$(".pmore").hide();$(".p1").addClass("p_act");}else{max=duan*10;for(var i=1;i<=10;i++)
{$(".p"+i).show();$(".p"+i).html(i+min);$(".p"+i).attr("href",i+min);}
$(".p1").addClass("p_act");$(".pmore").show();$(".pmore").attr("href",duan*10+1);}}else if(page<=10){$(".p"+page).addClass("p_act");}else if(page%10==0){$(".p10").addClass("p_act");;}else{$(".p"+(page%10)).addClass("p_act");}
if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".pageup").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);var duan=Math.ceil(page/10);if(page==duan*10)
{var min=duan*10-10;var max=0;if(total<duan*10)
{max=total;for(var i=1;i<=(max-min);i++){$(".p"+i).show();$(".p"+i).html(i+min);$(".p"+i).attr("href",i+min);}
$(".pmore").hide();$(".p10").addClass("p_act");}else{max=duan*10;for(var i=1;i<=10;i++)
{$(".p"+i).show();$(".p"+i).html(i+min);$(".p"+i).attr("href",i+min);}
$(".p10").addClass("p_act");$(".pmore").show();$(".pmore").attr("href",duan*10+1);}}else if(page<=10){$(".p"+page).addClass("p_act");}else if(page%10==0){$(".p10").addClass("p_act");;}else{$(".p"+(page%10)).addClass("p_act");}
if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));$(".pagedown").show();}else{$(".pagedown").hide();}
$("#current_page").html(page);if(parseInt(page)>1)
{$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}else{$(".pageup").hide();}}});return false;});$(".p3").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p4").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p5").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p6").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p7").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p8").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p9").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".p10").click(function(){for(var i=1;i<=10;i++){$(".p"+i).removeClass("p_act");}
$(this).addClass("p_act");var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});$(".pmore").click(function(){for(var i=1;i<=10;i++){$(".p"+i).hide();$(".p"+i).removeClass("p_act");}
var page=$(this).attr("href");var year=$("#year_ul").children().children(".act").attr("href");var category=$("#category_ul").children().children(".act").attr("href");$.ajax({type:"GET",url:ajax_news_url+"?r="+new Date(),data:"category="+category+"&year="+year+"&page="+page,success:function(msg){var temp=msg.split("||");$("#article_infos").html(temp[1]);var total=parseInt(temp[0]);var duan=Math.ceil(page/10);var min=duan*10-10;var max=0;if(total<duan*10)
{max=total;for(var i=1;i<=(max-min);i++){$(".p"+i).show();$(".p"+i).html(i+min);$(".p"+i).attr("href",i+min);}
$(".pmore").hide();$(".p1").addClass("p_act");}else{max=duan*10;for(var i=1;i<=10;i++)
{$(".p"+i).show();$(".p"+i).html(i+min);$(".p"+i).attr("href",i+min);}
$(".p1").addClass("p_act");$(".pmore").show();$(".pmore").attr("href",duan*10+1);}
if((parseInt(page))<parseInt($("#total_page").html()))
{$(".pagedown").attr("href",(parseInt(page)+1));}else{$(".pagedown").hide();}
$("#current_page").html(page);$(".pageup").attr("href",parseInt(page)-1);$(".pageup").show();}});return false;});});