jQuery.extend(jQuery.easing,{easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a}});jQuery(document).ready(function($){var flag=$("#cate").attr('data-ajax');if(!flag){$("#pagenavi").css("display","none").before('<div id="ajax-loader"></div>')}var i="Loading",x=$("#ajax-loader").html(i),s=5,t,w=$(window),v=2,p=parseInt($("#post-count").text()),k=true,gz=$("#cate").attr('data-animate');gz=gz?false:true,$head=$('#header').clone();$head.css({position:'fixed',bottom:0,left:0,right:0,display:'none','border-bottom':'none','border-top':'1px solid #D9D9D9'});$head.appendTo('body');$(".post-thumbnail a.inimg").colorTip({});$("#ajax-loader").css({width:120,height:20,margin:"0px auto",display:"none"});$("#container").waterfall({isResizable:true,isAnimated:gz,Duration:500,Easing:'easeInOutBack'});w.scroll(function(){if(flag)return false;var d=w.scrollTop(),c=$("#footer").offset().top,a=w.height(),b=c-d-a;if(k!=false&&b<=0){r()}if(d>60){$head.slideDown()}else if(d<60){$head.slideUp()}});function q(){(s<0)?(s=5,x.html(i),q()):(x[0].innerHTML+="·",s--,t=setTimeout(q,200))}function r(){if(v<=p){var b=$("#cate").text(),a="?action=ajax_post&meta="+b+"&pag="+v;$.ajax({url:a,beforeSend:function(){k=false;x.fadeIn(200);q()},success:function(d){var c=$(d);c.find(".post-thumbnail a").colorTip({});$("#container").append(c).waterfall({isResizable:true,isAnimated:gz,Duration:800,Easing:'easeInOutBack',endFn:function(){k=true;x.fadeOut(500);clearTimeout(t);t=null;v++}})}})}else{x.css("width",180).fadeIn(200).html("亲~已经到底了哦！");setTimeout(function(){x.fadeOut(500,function(){k=false})},5000);return false}}});