(function(){$(function(){function f(){var h=$(".j_backTop");if(h.length>0){h.click(function(){window.scrollTo(0,0)})}}function c(h){if(typeof window.onscroll=="function"){var i=window.onscroll;window.onscroll=function(){i();h()}}else{window.onscroll=function(){h()}}}function b(i){var j=document.getElementsByTagName("head")[0],h=document.createElement("script");h.src=i;h.charset="utf-8";j.appendChild(h)}function g(h){var k=null,i=$("#"+h),m=i.children().eq(0).find("a").find("img"),o=m.length,l=i.children().eq(1).find("span"),o=m.length,j=o-2,n=1,p=0;k=new Swipe(document.getElementById(h),{startSlide:0,auto:4000,speed:300,callback:function(z,w){l.html(z+1);var v,s;if(z>p&&z>=1&&z<o-1){v=m.eq(z+1)}else{if(z<p&&z>=2){v=m.eq(z)}else{if(z==o-1&&p==0){v=m.eq(o-1)}else{p=z;return}}}p=z;if(v.length>0){s=v.parent().parent()}if(v.length>0&&s.attr("data-loaded")=="0"){var q=v.attr("data-src"),y=v.attr("alt"),u=new Image(),x=false,t=false,r=null;v.attr("alt","");s.addClass("loading");u.src=q;u.onload=function(){s.removeClass("loading");v.attr("src",q);v.attr("alt",y);s.attr("data-loaded","1")};u.onerror=function(){var B=new Image();r=setTimeout(function(){if(!x){t=true;s.removeClass("loading").addClass("timeout");v.attr("alt","")}},10000);var A=new Date().getTime();B.src=q+"?t="+A;B.onload=function(){x=true;clearTimeout(r);s.removeClass("loading");v.attr("src",q);v.attr("alt",y);s.attr("data-loaded","1")}}}}})}function a(){var k=$(".j_imgdelay"),h=k.length,j=0;if(h==0){return false}var i=document.documentElement.clientHeight;i=i*2;function m(){if(j>=h){return false}for(var o=0;o<h;o++){var p=k.eq(o);if(p.data("imgdelay")===1){continue}var t=document.body.scrollTop||document.documentElement.scrollTop,r=i+t;if(p.offset().top<r){var q=p.find("img"),s=q.length;for(var n=0;n<s;n++){var u=q.eq(n);u.attr("src",u.data("src"))}p.data("imgdelay","1");j=j+1}}}var l;c(function(){if(l){clearTimeout(l);l=null}l=setTimeout(m,200)})}function d(h){var i=null;i=function(r,m,n){var q=document.getElementById("marqueebox"),j=$(q).find("li");if(j.length<2){return false}var s=null,l=null,o=null,k=false;if(h&&h=="init"){q.innerHTML+=q.innerHTML}q.scrollTop=0;l=function(){s=setInterval(o,m);if(!k){q.scrollTop+=1}};o=function(){if(q.scrollTop%r!=0){q.scrollTop+=1;if(q.scrollTop>=q.scrollHeight/2){q.scrollTop=0}}else{if(s){clearInterval(s);s=null}setTimeout(l,n)}};setTimeout(l,n)};i(34,10,3000)}var e=false;window.onpageshow=function(){if(e){setTimeout(function(){d()},100)}};setTimeout(function(){g("imgSwipe");a();f();d("init");e=true},300)})})();