$.fn.isnot=function(f,i,d){return this.each(function(j){(typeof f=="function"?f.call(this):$.multiFilter(f,[this]).length>0)?i&&i.apply(this,[j]):d&&d.apply(this,[j])})};
(function(){var f,i,d,j,k,v,w,n,r,o,s,t,p,l,u,x,y=function(){var a=[];f&&a.push("channel="+f);i&&a.push("model="+i);d&&a.push("date="+encodeURIComponent(d));j&&a.push("size="+j);k&&a.push("page="+k);return a.join("&")},e={init:function(){f=parseInt((/[#&]channel=(\d*)/i.exec(location.hash)||{1:0})[1]);i=parseInt((/[#&]model=(\d*)/i.exec(location.hash)||{1:0})[1]);d=(/[#&]date=([\d\-]*)/i.exec(location.hash)||{1:""})[1];j=parseInt((/[#&]size=(\d*)/i.exec(location.hash)||{1:30})[1]);k=parseInt((/[#&]page=(\d*)/i.exec(location.hash)||
{1:1})[1]);v=$("#cond-channel>li").each(function(){var b=$("a",this),c=b[0].getAttribute("href",2);f==c&&$.className.add(this,"on");b.click(function(g){g.preventDefault();e._channel!=c&&e.channel(c)})});n=$("#cond-date");var a;if(d){a=d.split("-");n.text(a[0]+"\u5e74"+a[1]+"\u6708"+a[2]+"\u65e5")}else{a=/(\d+)\u5e74(\d+)\u6708(\d+)\u65e5/.exec(n.text());a.shift();d=a.join("-")}$("#datepicker").click(function(b){b.preventDefault();WdatePicker({el:"cond-date",dateFmt:"yyyy\u5e74M\u6708d\u65e5",onpicked:function(c){e.date(c.cal.getNewDateStr("yyyy-M-d"))}})});
w=$("#cond-model>li").each(function(){var b=$("a",this),c=b[0].getAttribute("href",2);i==c&&b.addClass("on");b.click(function(g){g.preventDefault();e._model!=c&&e.model(c)})});$("#hand").click(function(){e.query()});r=$("#auto").click(function(){e.auto(this.checked)});o=$("#auto-on");l=180;t=o.find("b");s=$("#auto-off");this.auto(true);pageOption={callback:function(b){e.page(b+1)},current_page:k,items_per_page:j,num_display_entries:10,num_edge_entries:2,prev_text:"\u4e0a\u4e00\u9875",next_text:"\u4e0b\u4e00\u9875"};
u=$("#pagination");x=$("#data-container");this.query()},query:function(){l=180;var a=y();location.hash=a;$.getJSON("?do=query&callback=?",a,function(b){pageOption.current_page=b.page-1;pageOption.items_per_page=b.size;k=b.page;j=b.size;location.hash=y();b.total>b.size?u.pagination(b.total,pageOption):u.empty();var c=b.data;b=[];var g=0;b[g]=["<ul>"];for(var h=b[g],q=0,z=c.length;q<z;q++){var m=c[q];h.push('<li><span class="date">'+m.date+'</span><span class="tabs-name"><a target="_blank" href="'+
m.caturl+'">['+m.catname+']</a></span><span class="cont-list02"><a target="_blank" href="'+m.url+'">'+m.title+"</a></span></li>");if((q+1)%5==0){h.push("</ul>");b[++g]=["<ul>"];h=b[g]}}h.push("</ul>");c="";for(h=0;h<=g;h++)if(b[h].length>2)c+=b[h].join("")+'<div class="hr-dotted hr-h12 mar-tb-6 clear"></div>';x.html(c)})},channel:function(a){v.isnot(function(){return $("a",this)[0].getAttribute("href",2)==a},function(){$.className.add(this,"on")},function(){$.className.remove(this,"on")});f=a;this.query()},
model:function(a){w.isnot(function(){return $("a",this)[0].getAttribute("href",2)==a},function(){$("a",this).addClass("on")},function(){$("a",this).removeClass("on")});i=a;this.query()},date:function(a){var b=a.split("-");n.text(b[0]+"\u5e74"+b[1]+"\u6708"+b[2]+"\u65e5");d=a;this.query()},page:function(a){k=a;this.query()},auto:function(a){if(!a!=!p)if(a){o.show();t.text(l);s.hide();r[0].checked=true;p=setInterval(function(){t.text(--l);l<1&&e.query()},1E3)}else{o.hide();s.show();r[0].checked=false;
clearInterval(p);l=180;p=null}}};window.APP=e})();
