function getMonth(m,e){ var m = m||0, e = e||en; var ems = ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]; var cms = ["一","二","三","四","五","六","七","八","九","十","十一","十二"]; if(e=="en"){ return ems[m]; } if(e=="cn"){ return cms[m]+"月"; } if(e=="num"){ m++; if(t&&m<10){ m = "0"+m; } return m+"月"; } } var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?5af3d83904225de9cd113a2121f0e220"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); $(function(){ $("#keyword").css({"width":0,"overflow":"hidden"}); $(".wp_search").hover(function(){ $(".keyword", this).addClass("keyword-focus").stop().animate({"width":140}); var key = $.trim($(".keyword", this).val()); if(key==""){ $(".keyword", this).val("搜索"); } },function(){ var key = $.trim($(".keyword", this).val()); if(key=="搜索"){ $(".keyword", this).val(""); } if($(".keyword", this).val()==""){ $(".keyword", this).removeClass("keyword-focus").stop().animate({"width":0}); }else{ $(".keyword", this).addClass("keyword-focus"); } $(".keyword", this).trigger("blur"); }); $("#keyword").click(function(){ var key = $.trim($(this).val()); if(key=="搜索"){ $(this).val(""); } }); function transdate(endTime){ var date=new Date(); date.setFullYear(endTime.substring(0,4)); date.setMonth(endTime.substring(5,7)-1); date.setDate(endTime.substring(8,10)); date.setHours(endTime.substring(11,13)); date.setMinutes(endTime.substring(14,16)); date.setSeconds(endTime.substring(17,19)); return Date.parse(date)/1000; } Date.prototype.Format = function(fmt) { //author: meizz var o = { "M+" : this.getMonth()+1, //月份 "d+" : this.getDate(), //日 "h+" : this.getHours(), //小时 "m+" : this.getMinutes(), //分 "s+" : this.getSeconds(), //秒 "q+" : Math.floor((this.getMonth()+3)/3), //季度 "S" : this.getMilliseconds() //毫秒 }; if(/(y+)/.test(fmt)) fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); for(var k in o) if(new RegExp("("+ k +")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); return fmt; } $(".calendar_news").find("[data-time]").each(function(){ var date = $(this).attr("data-pubdate").split("-"); var datetime = $(this).attr("data-time"); var dates = datetime.match(/\d{4,4}-\d{1,2}-\d{1,2}/); if(dates!==null){ date = dates[0].split('-'); } $(".day",this).html(date[2]); var month = parseInt(date[1],10); if(month>0){ $(".month",this).html(getMonth(month-1,"en")); } }); $("#top .r .wp_nav a").removeAttr("title"); var num = $(".calendar_news").find(".topic-news").length; var datas = [],datas1 = [],datas2 = []; $(".calendar_news").find(".topic-news").each(function(index){ var title = $(this).find(".title").eq(0).text(); var titles = $(this).find(".title").eq(1).text(); var add = $(this).find(".news_summary").text(); var day = $(this).find(".day").text(); var month = $(this).find(".month").text(); var url = $(this).find(".news-con").children("a").attr("href"); var times = $(this).children(".news_time").attr("data-time"); var timeh = transdate(times)+index; datas.push({"timeh":timeh,"title":title,"titles":titles,"add":add,"day":day,"month":month,"url":url}); datas1.push(timeh); datas2.push(timeh); }); var newtime = transdate((new Date()).Format("yyyy-MM-dd hh:mm:ss")); var i,j; datas1.sort(function(a,b){return a - b}); for(j in datas1 ){ for(i in datas ){ if(newtime
'+datas[i].day+'
'+datas[i].month+'
'+datas[i].title+''+datas[i].titles+'

'+datas[i].add+'

'); } } } } datas2.sort(function(a,b){return b - a}); for(j in datas2 ){ for(i in datas ){ if(newtime>datas[i].timeh){ if(datas2[j]==datas[i].timeh){ $(".calendar_news").find(".topic-news").parent().append('
  • '+datas[i].day+'
    '+datas[i].month+'
  • '); } } } } }); // Tabs function tab(m,n){ var tli=document.getElementById("tabmenu"+m).getElementsByTagName("span"); var lli=document.getElementById("tablist"+m).getElementsByTagName("li"); var oli=document.getElementById("tabmore"+m).getElementsByTagName("span"); for(i=0;i50){ $("#back-top").show(); }else{ $("#back-top").hide(); } });