$(function(){function imgSlideInit(sId){var oSlider=$(sId),nav=oSlider.next(),id=sId.substr(1),count=1;id=new Swipe(document.getElementById(id),{startSlide:0,auto:4000,speed:400,callback:function(event,index,elem){var oImg=oSlider.find('img'),len=oImg.length,maxCount=len-2;$("#currimg").html(index+1);nav.find('.i_point').removeClass('active');nav.find('.i_point').eq(index).addClass('active');if(count<=maxCount){if(index>=1&&index<=maxCount){var currImg=oImg.eq(index+1);var pathImg=oImg.eq(index);path=pathImg.attr('name');$("#imgpage a").attr('href',"http://image11.m1905.cn/uploadfile/"+path);src=currImg.attr('data-src');currImg.attr('src',src)}count++}}})}function tabSlideInit(sId){var oSlider=$(sId),nav=oSlider.prev(),id=sId.substr(1),obj=sId.substr(1);obj=new Swipe(document.getElementById(id),{startSlide:0,speed:200,callback:function(event,index,elem){var oLi=nav.find('li');if(oLi.length>1){nav.find('li.on').removeClass('on');oLi.eq(index).addClass('on')}}});nav.find('li').click(function(){var i=nav.find('li').index(this);obj.slide(i,200)})}function SSEchange(){var list=$('.stockBox').find('.stock_text'),len=list.length;if(len<2)return;if(SSEtimer)clearInterval(SSEtimer);SSEtimer=setInterval(function(){list.addClass("hidden").eq(iNow).removeClass("hidden");iNow++;if(iNow==len){iNow=0}},3000)}function addOnscroll(fn){if(typeof window.onscroll=='function'){var tempFn=window.onscroll;window.onscroll=function(){tempFn();fn()}}else{window.onscroll=function(){fn()}}}function imgLoading(){addOnscroll(function(){var b=$(".nav_content_item[data-role=lazy]");$.each(b,function(l,j){var c=$(j).index();var d=$(j).parents(".nav_content_list").eq(0).prev();var f=d.find(".on");var o=(f.size()>0)?f.index():0;if(c!=o&&d.find("li").length>1){return}var h=document.documentElement.scrollTop||document.body.scrollTop;var g=document.documentElement.clientHeight;var e=j.getBoundingClientRect().top;var k=e-h;if(e<0||(e>0&&k<=1.5*g)){var m=$(j).find("img");if(!j.getAttribute("data-unload")){$.each(m,function(i,n){var q=n.getAttribute("data-src");n.src=q});j.setAttribute("data-unload",0)}}})})}function TabBindEvent(index){setTimeout(function(){var id='#floor'+index;tabSlideInit(id);index=parseInt(index)+1;var nextId='#floor'+index;if(index<=13&&$(nextId).length>0){TabBindEvent(index)}},200)}setTimeout(function(){imgLoading();SSEchange()},300);setTimeout(function(){imgSlideInit('#imgSlide');TabBindEvent(1)},600)})