index.js 27 KB
/*! dili 2016-01-06 */
define("droll",function(require,exports,module){var droll=function(target,options){this.autoTimer=null,this.target=target,this.opt={step:null,moveNum:null,Media:!1,eventType:"click",isHori:!0,index:0,auto:!1,effect:"1",autoDelay:5e3,speed:500,fadeSpeed:400,dirButton:!0,indexButton:!1,showNum:!0,isCycle:!0,relaBtns:null,listCurClass:"pdo-droll_list_current",ibtnCurClass:"pdo-droll_btn_current",lockedClass:"pdo-droll_btn_locked",prevHtml:"&lt;",nextHtml:"&gt;",loop:!0,outerSelector:"ul",itemsSelector:"li",btnHoverActive:!1,onFinished:function(target,inview_elems){},onBeforeInView:function(target,inview_elems){},layoutWidth:null,layoutHeight:null},$.extend(this.opt,options),this.LENGTH=0,this.LOCKED=!1,this.I=this.opt.index,this.PREVI=this.opt.index,this.init()};return droll.prototype={init:function(){var _this=this;if(this.LENGTH=$(this.target).find(this.opt.outerSelector).find(this.opt.itemsSelector).length,this.LENGTH<=this.opt.moveNum&&(this.opt.loop=!1),this.printWrapper(),this.setParams(),this.bindEvents(),this.setListState(),this.setDirBtnState(),this.setIndexBtnState(this.opt.index),this.LENGTH<=this.opt.moveNum&&!this.opt.Media)return void this.opt.onBeforeInView.call(this.target,$(this.target).find(this.opt.outerSelector).find(this.opt.itemsSelector));if(0!==this.opt.index?this.move():this.opt.onBeforeInView.call(this.target,this.getInViewList()),2==this.opt.effect&&($(this.target).find(this.opt.itemsSelector).each(function(){$(this).css({left:0,top:0,position:"absolute"}).hide()}),this.move()),this.opt.auto&&(this.auto(),$(this.target).hover(function(){clearTimeout(_this.autoTimer)},function(){_this.auto()})),this.opt.Media){var _itemsSelector=$(_this.target).find(_this.opt.outerSelector).find(_this.opt.itemsSelector),_ml=parseFloat($(_itemsSelector).css("marginLeft")),_mr=parseFloat($(_itemsSelector).css("marginRight"));$(window).resize(function(){_this.opt.step=parseFloat($(_itemsSelector).outerWidth())+_ml+_mr,$(_this.target).find(".pdo-droll_layout , .pdo-droll").css({width:_this.opt.step*_this.opt.moveNum}),_this.setParams(),_this.move(1*_this.opt.moveNum)})}},printWrapper:function(){var numlists="",elem=$(this.target),style=this.opt.isHori?"width: "+(this.opt.layoutWidth||this.opt.step*this.opt.moveNum)+"px; height: "+(this.opt.layoutHeight||$(this.target).outerHeight())+"px;":"height: "+(this.opt.layoutHeight||this.opt.step*this.opt.moveNum)+"px; width: "+(this.opt.layoutWidth||$(this.target).outerWidth())+"px;";2==this.opt.effect&&(style="width:100%;height:100%;");for(var i=0;i<this.LENGTH/this.opt.moveNum;i++){var _i=this.opt.showNum?i+1:"&nbsp;";numlists+='<a href="javascript:void(0);">'+_i+"</a>"}elem.find(this.opt.outerSelector).wrap('<div style="'+style+'z-index:1;" class="pdo-droll"></div>'),elem.find(".pdo-droll").wrap('<div style="'+style+'" class="pdo-droll_layout"></div>'),this.LENGTH>this.opt.moveNum&&elem.find(".pdo-droll_layout").append('                        <div class="pdo-droll_dirbutton" style="display:none;">                            <a class="pdo-droll_prev" href="javascript:void(0);"><span><span></a>                            <a class="pdo-droll_next" href="javascript:void(0);"><span><span></a>                        </div>                        <div class="pdo-droll_numbutton" style="display:none;">'+numlists+"</div>                    ")},setParams:function(){var elem=$(this.target);this.ELEM={outer:elem.find("pdo-droll"),cont:elem.find(this.opt.outerSelector),dirbtn:elem.find("div.pdo-droll_dirbutton"),numbtn:elem.find("div.pdo-droll_numbutton"),prev:elem.find("a.pdo-droll_prev"),next:elem.find("a.pdo-droll_next")},this.opt.dirButton&&!this.opt.btnHoverActive&&this.ELEM.dirbtn.fadeIn(200),this.opt.indexButton&&this.LENGTH>this.opt.moveNum&&this.ELEM.numbtn.fadeIn(200);var size=this.opt.step*this.ELEM.cont.find(this.opt.itemsSelector).length;2==this.opt.effect&&(size="100%"),this.ELEM.cont[this.opt.isHori?"width":"height"](size).css("position","absolute")},bindEvents:function(){var _this=this;this.ELEM.prev.click(function(){_this.move(-1*_this.opt.moveNum)}),this.ELEM.next.click(function(){_this.move(1*_this.opt.moveNum)}),this.opt.btnHoverActive&&(this.target.ha_stimer=null,this.target.ha_htimer=null,$(this.target).hover(function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer),_this.target.ha_stimer=setTimeout(function(){_this.ELEM.dirbtn.fadeIn(120)},100)},function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer),_this.target.ha_htimer=setTimeout(function(){_this.ELEM.dirbtn.fadeOut(120)},100)}),this.ELEM.dirbtn.mouseover(function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer)})),this.ELEM.numbtn.find("a")[this.opt.eventType](function(){_this.move($(this).index()*_this.opt.moveNum-_this.I)}),this.opt.relaBtns&&this.opt.relaBtns[this.opt.eventType](function(){var orgBtns=_this.ELEM.numbtn.find("a").eq($(this).index());orgBtns.triggerHandler(_this.opt.eventType)})},move:function(move_num,cur_ibtn_index){if(!(this.LENGTH<=this.opt.moveNum||1==this.opt.effect&&this.LOCKED)){this.LOCKED=!0;var _this=this,gs=this.getStep(move_num,cur_ibtn_index),step=1==this.opt.effect?gs.step:gs.toindex;if(1==this.opt.effect&&null===gs.step)return void(this.LOCKED=!1);if(this.opt.onBeforeInView.call(this.target,this.getInViewList()),this.setListState(),this.setDirBtnState(),this.setIndexBtnState(Math.abs(gs.toindex)),1==this.opt.effect){var move_config={};move_config[this.opt.isHori?"left":"top"]=step,this.ELEM.cont.animate(move_config,this.opt.speed,function(){_this.LOCKED=!1,_this.opt.onFinished.call(_this.target,_this.getInViewList())})}if(2==this.opt.effect){var items=$(this.target).find(this.opt.itemsSelector);items.eq(gs.toindex).siblings().fadeOut(100),items.eq(gs.toindex).fadeIn(this.opt.fadeSpeed,function(){_this.opt.onFinished.call(_this.target,_this.getInViewList())})}}},getStep:function(move_num){var cycle=this.opt.isCycle;if(void 0==move_num)return this.I=0,{toindex:0,step:null};var range=[0,this.LENGTH-this.opt.moveNum],to_index=move_num+this.I;return to_index>range[1]&&(to_index=this.opt.loop?to_index<this.LENGTH?range[1]:cycle?0:range[1]:range[1]),to_index<range[0]&&(this.opt.loop?to_index+this.LENGTH>range[1]?to_index=0:cycle?to_index+=this.LENGTH:to_index=0:to_index=0),this.I=to_index,{toindex:to_index,step:to_index*this.opt.step*-1}},auto:function(){clearTimeout(this.autoTimer);var _this=this;this.autoTimer=setTimeout(function(){_this.move(1*_this.opt.moveNum),_this.auto()},this.opt.autoDelay)},getInViewList:function(){for(var arr=[],i=this.I;i<this.I+this.opt.moveNum;i++)arr.push(this.ELEM.cont.find(this.opt.itemsSelector).eq(i)[0]);return arr},setListState:function(){},setDirBtnState:function(){this.opt.loop||(this.ELEM.prev.removeClass(this.opt.lockedClass),this.ELEM.next.removeClass(this.opt.lockedClass),this.I<=0&&this.ELEM.prev.addClass(this.opt.lockedClass),this.I>=this.LENGTH-this.opt.moveNum&&this.ELEM.next.addClass(this.opt.lockedClass))},setIndexBtnState:function(index){this.opt.loop;var realIndex=Math.round(index/this.opt.moveNum),orgBtns=this.ELEM.numbtn.find("a");orgBtns.removeClass(this.opt.ibtnCurClass),orgBtns.eq(realIndex).addClass(this.opt.ibtnCurClass),this.opt.relaBtns&&(this.opt.relaBtns.removeClass(this.opt.ibtnCurClass),this.opt.relaBtns.eq(realIndex).addClass(this.opt.ibtnCurClass))}},droll}),define("tools",function(require,exports){var Tools;return Tools=function(){var self=this;return this.setSelected=function(obj){var Selected=function(data){var $container,$tags,config={type:"click",container:"",tags:"",selected:"act",disabledClass:"disabled",cllback:function(){}},methods={setIndex:function(is){return is.hasClass(config.disabledClass)||is.hasClass(config.selected)?!1:($container.find(config.tags).removeClass(config.selected),is.addClass(config.selected),void("undefined"!=typeof is.index()&&config.cllback(is.index(),is)))}};return $.extend(config,data),$container=$(config.container),$tags=$container.find(config.tags),$tags.on(config.type,function(event){$tags.is("a")&&event&&event.preventDefault&&event.preventDefault(),$(this).hasClass(config.disabledClass)||methods.setIndex($(this))}),this.setIndex=function(index){$tags.eq(index)&&methods.setIndex($tags.eq(index))},this};return new Selected(obj)},this.numberChange=function(){var list=[],subscript=0,NumberChange=function(v,index){var config={view:$(v),addView:$(v).find(".up")?$(v).find(".up"):null,reduceView:$(v).find(".down")?$(v).find(".down"):null,changeView:$(v).find("input")?$(v).find("input"):null,index:index,maxnum:$(v).find("input").attr("maxmun")?parseInt($(v).find("input").attr("maxmun")):9999,minmun:$(v).find("input").attr("minmun")?parseInt($(v).find("input").attr("minmun")):1,value:1},methods={update:function(){config.changeView.val(config.value),self.radio.numCallback(config.value,config.view)},tip:function(key){if(self.radio&&self.radio.num){var text="";text+=key?"่ฏฅๅ•†ๅ“ๆœ€ๅคง่ดญไนฐๆ•ฐไธบ"+config.maxnum:"่ฏฅๅ•†ๅ“ๆœ€ๅฐ่ดญไนฐๆ•ฐไธบ"+config.minmun,self.radio.num(text,config.view)}},interval:function(){config.maxnum=$(v).find("input").attr("maxmun"),config.minmun=$(v).find("input").attr("minmun")}};return config.view.hasClass("disabled")?(config.changeView.attr("disabled",!0),!1):(config.addView&&config.addView.click(function(){methods.interval(),config.value<config.maxnum?(config.value+=1,methods.update()):methods.tip(1)}),config.changeView&&(config.value=parseInt(config.changeView.val()),config.changeView.change(function(){methods.interval();var value=parseInt($(this).val())>=0?parseInt($(this).val()):config.value;value<config.minmun?methods.tip(0):value>config.maxnum?methods.tip(1):config.value=value,methods.update()})),config.reduceView&&config.reduceView.click(function(){methods.interval(),config.value>config.minmun?(config.value-=1,methods.update()):methods.tip(0)}),config.view.parent().bind("selectstart",function(){return!1}),this)};return $(".counter").each(function(){var nc=new NumberChange(this,subscript);subscript+=1,list.push(nc)}),list},this.sollView=function(obj){function SollView(){var config={leftBtn:null,rightBtn:null,sollView:null,view:null,index:0,width:0,maxPage:0,sollWidth:0,leftWidth:28,hoverView:null,isasingle:!1,callBack:function(){}},methods={animation:function(){config.sollView.stop().animate({left:config.index*config.width+"px"}),config.callBack(config.index,config.maxPage)},upadte:function(){if(config.isasingle)maxPage=config.sollView.find("li").length;else{var maxPage=parseInt(config.sollView.find("li").length/4);config.sollView.find("li").length%4&&(maxPage+=1)}try{config.leftWidth=config.sollView.find("li").eq(0).css("marginRight").replace("px",""),config.leftWidth=parseInt(config.leftWidth)}catch(error){}config.maxPage=maxPage,config.isasingle?config.width=config.sollView.find("li").width():config.width=4*config.sollView.find("li").width()+4*config.leftWidth+8,config.sollView.width(config.view.width()*maxPage)}};return config=$.extend(config,obj),methods.upadte(),config.leftBtn&&config.rightBtn?(config.leftBtn.click(function(){config.index<0&&(config.index+=1,methods.animation(config.index))}),config.rightBtn.click(function(){-config.index<config.maxPage-1&&(config.index-=1,methods.animation(config.index))})):config.hoverView&&config.hoverView.find("li").bind("mouseover",function(){config.index=0-$(this).index(),methods.animation(config.index)}),$(window).resize(function(){config.index=0,methods.upadte(),config.sollView.css({left:0}),config.callBack(config.index,config.maxPage)}),config.callBack(config.index,config.maxPage),this.updateInfo=function(data){config=$.extend(config,data),methods.upadte(),config.sollView.css({left:0}),config.callBack(config.index,config.maxPage)},this}return new SollView},this.request=function(paras,_url){var url="";url=_url?_url:location.href;for(var paraString=url.substring(url.indexOf("?")+1,url.length).split("&"),paraObj={},i=0;j=paraString[i];i++)paraObj[j.substring(0,j.indexOf("=")).toLowerCase()]=j.substring(j.indexOf("=")+1,j.length);var returnValue=paraObj[paras.toLowerCase()];return"undefined"==typeof returnValue?"":returnValue},this.cookie=function(){function getsec(str){var str1=1*str.substring(1,str.length),str2=str.substring(0,1);return"s"==str2?1e3*str1:"h"==str2?60*str1*60*1e3:"d"==str2?24*str1*60*60*1e3:void 0}function getcookie(name){var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(arr=document.cookie.match(reg))?arr[2]:null}return{set:function(name,value,time){var strsec=getsec(time),exp=new Date;exp.setTime(exp.getTime()+1*strsec),document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString()},get:function(name){return getcookie(name)},remove:function(name){var exp=new Date;exp.setTime(exp.getTime()-1);var cval=getcookie(name);null!=cval&&(document.cookie=name+"="+cval+";expires="+exp.toGMTString())}}}(),this.addValue=function(_view){function AddValue(){var _p_view=$(_view);return this.setData=function(data){_p_view.html("");for(var _show_view="",_aData=[],i=0;i<data.length;i++)_show_view+='<div class="a-v-view"><p>'+data[i].txt+'</p><span class="a-v-view-d" inx="'+i+'">ร—</span></div>',_aData.push(data[i].val);_show_view+='<input type="hidden" class="a-v-hidden" value="'+_aData+'" name="'+_p_view.attr("data-name")+'" />',_p_view.html(_show_view),$(".a-v-view-d").click(function(){var _index=$(this).attr("inx");_index=parseInt(_index),_aData.splice(_index,1),$(this).parent().remove(),_p_view.find(".a-v-hidden").remove();var _h_view='<input type="hidden" class="a-v-hidden" value="'+_aData+'" name="'+_p_view.attr("data-name")+'" />';_p_view.append(_h_view)})},this}return new AddValue},this.shoppingMsg=function(_v){var _view=$(".q-message"),_top=0,_time=null;return _v&&(_view=$("."+_v)),$(".q-close").click(function(){_view.hide(),_time&&(clearTimeout(_time),_time=null)}),{load:function(_this){_time&&(clearTimeout(_time),_time=null),_view.find(".load").show(),_view.find(".text").hide();var top=$(_this).parent().offset().top,left=$(_this).parent().offset().left;_top=top-55,_view.css({top:_top,left:left-40}).css({height:"50px"}),_view.show(),self.amAdd("q-message","fadeInDown")},show:function(text){_time=setTimeout(function(){_view.hide(),_time&&(clearTimeout(_time),_time=null)},3e3),_view.animate({height:"75px",top:_top-30},function(){_view.find(".load").hide(),_view.find(".text").show(),_view.find(".text").find("p").css("line-height","30px"),"string"==typeof text?(_view.find(".text").find("p").eq(0).show(),_view.find(".text").find("p").eq(1).html('ๅฐ่ฎก้‡‘้ข๏ผš<b class="q-total">'+text+"</b>")):(_view.find(".text").find("p").eq(0).hide(),_view.find(".text").find("p").eq(1).html(text.msg).css("line-height","80px"))})}}},this.randomize=function(b,e){return!b&&0!=b||!e?"?":Math.floor(Math.random()*e+b)},this.DiliRaty=function(_view,_xv){var _xing=8;_xv&&(_xing=_xv),$("."+_view).find("span").width(10*_xing),$("."+_view).next().html(_xing/2),$("."+_view).mousemove(function(e){var xx=e.originalEvent.layerX||e.originalEvent.x||0;if(xx&&(xx=e.clientX-$(this).offset().left),1>xx)return!1;xx+="";var pageX=0;pageX=parseInt(xx.substring(1,0)),pageX%2!=0&&(pageX+=1),$(this).find("span").width(10*pageX),$(this).next().html(+pageX/2)})},this.getPageCoord=function(_view){function getOffset(e){var target=e.target;void 0==target.offsetLeft&&(target=target.parentNode);var pageCoord=getPageCoord(target),eventCoord={x:window.pageXOffset+e.clientX,y:window.pageYOffset+e.clientY},offset={offsetX:eventCoord.x-pageCoord.x,offsetY:eventCoord.y-pageCoord.y};return offset}function getPageCoord(element){for(var coord={x:0,y:0};element;)coord.x+=element.offsetLeft,coord.y+=element.offsetTop,element=element.offsetParent;return coord}$(_view).hover(function(e){var _this=$(this),_desc=_this.find(".end").stop(!0,!0),width=103,height=103,left=void 0==e.offsetX?getOffset(e).offsetX:e.offsetX,top=void 0==e.offsetY?getOffset(e).offsetY:e.offsetY,right=width-left,bottom=height-top,rect={},_min=Math.min(left,top,right,bottom),_out="mouseleave"==e.type,spos={};rect[left]=function(epos){spos={left:-width,top:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[top]=function(epos){spos={top:-height,left:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[right]=function(epos){spos={left:left,top:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[bottom]=function(epos){spos={top:height,left:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[_min]({left:0,top:0})})},this.tabRolling=function(_obj){var config={rollview:"u-buoy",view:"u-list li",offset:20,istxtwidth:!1,bias:2};config=$.extend(config,_obj);var width=0,left=0;$("."+config.view).hover(function(e){left=$(this).position().left,width=$(this).width()+config.offset,config.istxtwidth&&(width=$(this).find("a").width(),left=left+($(this).width()-$(this).find("a").width())/2+config.offset/2+config.bias),$("."+config.rollview).stop().animate({left:left,width:width},300)})},this.securitycode=function(view){var time=60,btn=$(view);btn.addClass("gray-btn");var date=setInterval(function(){return 0>=time?(clearInterval(date),btn.html("่Žทๅ–้ชŒ่ฏ็ "),time=60,btn.removeClass("gray-btn"),!1):(btn.html(time+"s้‡ๆ–ฐ่Žทๅ–"),void time--)},1e3)},this.radio={num:function(){},numCallback:function(){}},this}(),function($){$.fn.dilislider=function(options){function slide(){switch(index>=$contents.length&&(index=0),$stag.removeClass(settings.current).eq(index).addClass(settings.current),settings.affect){case"scrollx":$conbox.width($contents.length*$contents.width()),$conbox.stop().animate({left:-$contents.width()*index},settings.speed);break;case"scrolly":$contents.css({display:"block"}),$conbox.stop().animate({top:-$contents.height()*index+"px"},settings.speed);break;case"fade":$contents.eq(last_index).stop().animate({opacity:0},settings.speed/2).css("z-index",1).end().eq(index).css("z-index",9).stop().animate({opacity:1},settings.speed/2);break;case"none":$contents.hide().eq(index).show()}last_index=index,index++}function _pause(){clearInterval(Timer)}function _continue(){settings.auto&&(Timer=setInterval(slide,settings.space))}var settings={affect:"scrollx",speed:500,space:6e3,auto:!0,trigger:"mouseover",conbox:"ul",ctag:"li",switcher:".tab-a",stag:"a",current:"on",rand:!1};options.point&&(options.switcher=options.point.split(" ")[0],options.stag=options.point.split(" ")[1]),settings=$.extend({},settings,options);var index=1,last_index=0,$conbox=$(this).find(settings.conbox),$contents=$conbox.find(settings.ctag),$switcher=$(settings.switcher),$stag=$switcher.find(settings.stag);if(settings.rand&&(index=Math.floor(Math.random()*$contents.length),slide()),"fade"==settings.affect&&$.each($contents,function(k,v){0===k?$(this).css({position:"absolute","z-index":9}):$(this).css({position:"absolute","z-index":1,opacity:0})}),settings.auto)var Timer=setInterval(slide,settings.space);$stag.bind(settings.trigger,function(){_pause(),index=$(this).index(),slide(),_continue()}),$conbox.hover(_pause,_continue)},$.fn.dhover=function(_fun,_sfun){var trigger=null;$($(this).selector).hover(function(e){var thishover=this;this.ufun=_fun,trigger=setTimeout(function(){thishover.ufun(e)},200)},function(e){this.sfun=_sfun,clearTimeout(trigger),this.sfun(e)})}}(jQuery),function($){$.fn.dhover=function(_fun,_sfun){var trigger=null;$($(this).selector).hover(function(e){var thishover=this;this.ufun=_fun,trigger=setTimeout(function(){thishover.ufun(e)},200)},function(e){this.sfun=_sfun,clearTimeout(trigger),this.sfun(e)})}}(jQuery),Tools}),define("event",function(require,exports){function transit(target,options){this.target=target,this.opt={pauseGroup:null,onOver:function(){},onOut:function(){}},$.extend(this.opt,options),this.init()}var events={x:function(ev){return ev.pageX||ev.clientX+$(document).scrollLeft()},y:function(ev){return ev.pageY||ev.clientY+$(document).scrollTop()}};events.transit=function(target,options){$(target).each(function(){new transit(this,options)})};var transit_tick_timer=null,transit_timers=[];return transit.prototype={init:function(){var _this=this,target=this.target;target.onTrigger=function(){clearInterval(this.timer),clearTimeout(this.outTimer),this._triggered=!0,this._onOver.call(_this,this)},this.bind()},bind:function(){var _this=this;$(this.target).bind("mouseover.transit",function(event){_this.onStart(this,event)}),$(this.target).bind("mousemove.transit",function(event){_this.onProcess(event)}),$(this.target).bind("mouseout.transit",function(event){_this.onStop()})},bindGroup:function(target){var _this=this,group=this.opt.pauseGroup;group&&group.length&&(group.unbind("mouseover.transit").bind("mouseover.transit",function(event){clearTimeout(_this.current.outTimer)}),group.unbind("mouseout.transit").bind("mouseout.transit",function(event){_this.onStop()}))},onStart:function(target,event){var _this=this;target._onOver=this.opt.onOver,target._onOut=this.opt.onOut,this.current=target,this.coorArr=[.123456,.654321],this.clear(),this.tick(),clearTimeout(_this.current.outTimer),this.bindGroup(target),transit_timers.push(this.current),this.current.timer=setInterval(function(){_this.coorArr.push(_this.coor),_this.compareCoor()},23)},onProcess:function(event){this.coor=[event.pageX,event.pageY]},onStop:function(){var _this=this;return this.clear(),this.current&&$(this.current).length?(clearTimeout(this.current.outTimer),void(this.current.outTimer=setTimeout(function(){_this.current._triggered&&(_this.current._onOut.call(_this,_this.current),_this.current._triggered=!1)},24))):!1},compareCoor:function(){var arr=this.coorArr,len=arr.length,lastCoor=arr[len-1],prevCoor=arr[len-2];lastCoor[0]==prevCoor[0]&&lastCoor[1]==prevCoor[1]&&this.current.onTrigger()},clear:function(){for(var i=0;i<transit_timers.length;i++){var target=transit_timers[i];target===this.current&&(clearInterval(this.current.timer),transit_timers.splice(i,1))}},tick:function(){clearTimeout(transit_tick_timer),transit_tick_timer=setTimeout(function(){if(transit_timers.length)for(var i=0;i<transit_timers.length;i++){var target=transit_timers[i];clearInterval(target.timer),transit_timers.splice(i,1)}},3e3)}},events}),define("base",function(require,exports){exports.now=function(){return(new Date).getTime()},exports.uid=function(start,len){for(var str="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"+(new Date).getTime(),len=len||12,temp=[],i=0;len>i;i++)temp.push(str.charAt(Math.floor(Math.random()*str.length)));return(void 0!==start?start+"-":"")+temp.join("")},exports.listen={_t:null,resize:function(callback){clearTimeout(this._t),this._t=setTimeout(function(){$(window).resize(function(){callback()})},79)}},exports.page={screen:{width:function(){return $(window).width()+$(window).scrollLeft()},height:function(){return $(window).height()+$(window).scrollTop()}}},exports.chars={toJson:function(str){str=str.replace(/^[\s\xA0{]+/,"").replace(/[\s\xA0}]+/,"");for(var json={},arr=str.split(/[,;]/),i=0;i<arr.length;i++){var item=arr[i].split(":");json[item[0]]=item[1].replace(/^[\s\xA0\'\"]+/,"").replace(/[\s\xA0\'\"}]+/,"")}return json},toStr:function(json,s1,s2){var arr=[];for(var key in json)arr.push(key+(s1||":")+json[key]);return arr.join(s2||";")},strcut:function(str,num,dir){if(str.length<=num)return[str];for(var temp=[],arr=[],index=0,i=0;i<str.length;i++)temp.push(str.charAt(i));-1===dir&&temp.reverse();for(var i=0;i<temp.length;i++){if(0!==i&&i%num==0&&(-1===dir&&arr[index].reverse(),arr[index]=arr[index].join(""),index++),arr[index]||(arr[index]=[]),i===temp.length-1){arr[index].push(temp[i]),-1===dir&&arr[index].reverse(),arr[index]=arr[index].join("");break}arr[index].push(temp[i])}return-1===dir?arr.reverse():arr}},exports.math={rand:function(end,start){var num=Math.floor(Math.random()*end);return(start||0)+num},"float":function(num,pos){var mynum="number"==typeof num?num:parseFloat(num),mypos=pos||2;return isNaN(mynum)?null:Math.round(mynum*Math.pow(10,mypos))/Math.pow(10,mypos)}},exports.browser={ishtml5:function(){return void 0!==typeof Worker?!0:!1}},exports.imgLoader=function(param,callback){var data={};$.isPlainObject(param)?data=param:$.isArray(param)||"object"===$.type(param)&&!$.isPlainObject(param)?$.each(param,function(){data[$(this).attr("src")]=this}):"string"==typeof param&&(data[param]=[]);for(var key in data){var url=key,img=new Image;if(img.src=url,img._callback=callback,img._orgi=data[key],img.complete)return void img._callback.call(img._orgi.length?img._orgi:img,!0);$(img).load(function(){this._callback.call(this._orgi.length?this._orgi:this,!1)})}},exports.handLazy=function(list){$(list).find("img").each(function(){var _image=$(this),o=_image.attr("src1")||_image.attr("original")||_image.attr("data-original"),s=_image.attr("src");o&&""!=o&&!_image.hasClass("load-img")&&(_image.attr("src",o).removeAttr("src1").removeAttr("original").removeAttr("data-original"),_image.bind("error",function(){$(this).attr("src",s).removeAttr("original").removeAttr("data-original").addClass("load-img")}))})},exports.lazyload=function(target,beginDis){function pageTop(){return(document.body.clientHeight<document.documentElement.clientHeight?document.body.clientHeight:document.documentElement.clientHeight)+Math.max(document.documentElement.scrollTop,document.body.scrollTop)}function imgLoad(){lazyArray.each(function(){var oft=$(this).offset();if(oft&&void 0!==this.nodeType&&oft.top<=pageTop()+(beginDis||0)){var original=$(this).attr("original")||$(this).attr("data-original"),_src=$(this).attr("src");original&&!$(this).hasClass("load-img")&&(murl=$(this).attr("src"),$(this).attr("src",original).removeAttr("original").removeAttr("data-original"),$(this).attr("isOriginal",!0),$(this).bind("error",function(){$(this).attr("src",_src).removeAttr("original").removeAttr("data-original").addClass("load-img")}))}})}var lazyArray=$(target),murl=null;imgLoad(),$(window).bind("scroll",function(){imgLoad()})},exports["goto"]=function(options){var timerId=null;clearTimeout(timerId);var opt={elem:null,duration:400,yOffset:0};$.extend(opt,options),opt.elem=$.isPlainObject(options)?$(opt.elem):$(options);var endpos=0,st=$(window).scrollTop(),start=(new Date).getTime(),toElem=null!==opt.elem&&opt.elem.length,easeout=function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b};return opt.elem&&opt.elem.length?(toElem&&(endpos=Math.round(opt.elem.offset().top)),endpos+opt.yOffset==st?!1:(endpos=Math.floor(endpos+opt.yOffset),void(timerId=setInterval(function(){var t=(new Date).getTime()-start,state=t/opt.duration,ratio=easeout(state,t,0,1,opt.duration);if((new Date).getTime()>start+opt.duration)clearInterval(timerId),timerId=null,$(window).scrollTop(endpos);else{var step=(toElem?ratio:1-ratio)*(endpos-st);$(window).scrollTop(st+step)}},17)))):!1}}),define(function(require,exports,module){var Tools=require("tools"),_Droll=require("droll"),_Base=(require("event"),require("base"));require("ntab");$(function(){new _Droll($(".bannerwrap"),{step:$(".bannerwrap").width(),moveNum:1,indexButton:!0,btnHoverActive:!0,auto:!0,Media:!0,onBeforeInView:function(list){_Base.handLazy(list)}});"true"==Tools.cookie.get("appbar")?$(".app-bar").slideUp():$(".app-bar").slideDown(),$(".icon-app-close").click(function(){$(".app-bar").slideUp(),Tools.cookie.set("appbar","true","h2")}),$(".info-tab").length>0&&$(".info-tab").each(function(){var dt=$(this).find("dt"),dd=$(this).find("dd"),key="on";dt.on({mouseenter:function(){dt.removeClass(key),$(this).addClass(key),dd.removeClass(key),dd.eq($(this).index()).addClass(key)}})})})});