tradeDetails.js 34.7 KB
/*! dili 2016-01-06 */
!function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;return d&&E(a)&&(e*=b.getViewport()[d]/100),Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="关闭" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){return a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0))?(f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var g,h,j,m,l,k={};"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,c.metadata())):k=c),g=d.href||k.href||(q(c)?c:null),h=d.title!==v?d.title:k.title||"",m=(j=d.content||k.content)?"html":d.type||k.type,!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null)),q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift())),j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&!g&&k.isDom&&(m="inline",j=c)),f.extend(k,{href:g,type:m,content:j,title:h,selector:l}),a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)):void 0},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||b._afterZoomOut(a))},close:function(a){b.cancel(),!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d(),b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d(),p.unbind(".player"),b.player.isActive=!1,b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index<b.group.length-1)&&(b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")):c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var k,e=b.current,c=e?e.wrap:null;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null),b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading"),f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading(),a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body"),p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())}),b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:.5*d.h+d.y,left:.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),y:n.scrollTop()};return a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height()),d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb"),p.unbind(".fb"),n.unbind(".fb")},bindEvents:function(){var d,a=b.current;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;return 27===c&&b.coming?!1:void(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]"))&&f.each(d,function(d,k){return 1<a.group.length&&k[c]!==v?(b[d](k[c]),e.preventDefault(),!1):-1<f.inArray(c,k)?(b[d](),e.preventDefault(),!1):void 0}))}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!j&&1<b.group.length&&!a.canShrink&&(g>0||k>0?b.prev(g>0?"down":"left"):(0>g||0>k)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){if(f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1))),!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){e&&b.helpers[d]&&f.isFunction(b.helpers[d][a])&&b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)}),p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var e,c,d={};if(a=l(a),e=b.group[a]||null,!e)return!1;if(d=f.extend(!0,{},b.opts,e),e=d.margin,c=d.padding,"number"===f.type(e)&&(d.margin=[e,e,e,e]),"number"===f.type(c)&&(d.padding=[c,c,c,c]),d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),d.autoSize&&(d.autoWidth=d.autoHeight=!0),"auto"===d.width&&(d.autoWidth=!0),"auto"===d.height&&(d.autoHeight=!0),d.group=b.group,d.index=a,b.coming=d,!1===b.trigger("beforeLoad"))b.coming=null;else{if(c=d.type,e=d.href,!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;if(b.isActive=!0,("image"===c||"swf"===c)&&(d.autoHeight=d.autoWidth=!1,d.scrolling="visible"),"image"===c&&(d.aspectRatio=!0),"iframe"===c&&s&&(d.scrolling="scroll"),d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body"),f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)}),f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))}),b.trigger("onReady"),"inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error}),b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null,b.coming.width=this.width/b.opts.pixelRatio,b.coming.height=this.height/b.opts.pixelRatio,b._afterLoad()},a.onerror=function(){this.onload=this.onerror=null,b._error("image")},a.src=b.coming.href,!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading(),b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}}),a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1),s||f(this).bind("load.fb",b.update),f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),b._afterLoad()})),a.content=d.appendTo(a.inner),a.iframe.preload||b._afterLoad()},_preloadImages:function(){var f,g,a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0;for(g=1;c>=g;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var e,c,k,g,h,a=b.coming,d=b.current;if(b.hideLoading(),a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{switch(d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),b.unbindEvents(),e=a.content,c=a.type,k=a.scrolling,f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d}),g=a.href,c){case"inline":case"ajax":case"html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":e=a.tpl.image.replace("{href}",g);break;case"swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>',h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e),b.trigger("beforeShow"),a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k),b._setDimension(),b.reposition(),b.isOpen=!1,b.coming=null,b.bindEvents(),b.isOpened?d.prevMethod&&b.transitions[d.prevMethod]():f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove(),b.transitions[b.isOpened?a.nextMethod:a.openMethod](),b._preloadImages()}},_setDimension:function(){var v,z,t,C,A,F,B,D,H,a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]);if(e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp"),x=l(k.outerWidth(!0)-k.width()),v=l(k.outerHeight(!0)-k.height()),z=y+x,t=r+v,C=E(c)?(a.w-z)*l(c)/100:c,A=E(j)?(a.h-t)*l(j)/100:j,"iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else(h.autoWidth||h.autoHeight)&&(g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp"));if(c=l(C),j=l(A),D=C/A,m=l(E(m)?l(m,"w")-z:m),n=l(E(n)?l(n,"w")-z:n),u=l(E(u)?l(u,"h")-t:u),p=l(E(p)?l(p,"h")-t:p),F=n,B=p,h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p)),z=a.w-y,r=a.h-r,h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),m>c&&(c=m,j=l(c/D)),u>j&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p))),h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&c>m&&j>u&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),m>c&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&"auto"===s&&A>j&&z>c+x+q&&(c+=q),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),e=(a>z||y>r)&&c>m&&j>u,c=h.aspectRatio?F>c&&B>j&&C>c&&A>j:(F>c||B>j)&&(C>c||A>j),f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j}),!H&&h.autoHeight&&j>u&&p>j&&!c&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};return d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x),c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio)),c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio)),c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault(),b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),a.loop||a.index!==a.group.length-1?b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()):b.play(!1))},_afterZoomOut:function(a){a=a||b.current,f(".fancybox-wrap").trigger("onReset").remove(),f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),b.trigger("afterClose",a)}}),b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();return!e&&a.isDom&&d.is(":visible")&&(e=d.find("img:first"),e.length||(e=d)),t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio),("fixed"===b.wrap.css("position")||a.locked)&&(c.top-=m.y,c.left-=m.x),c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;("width"===f||"height"===f)&&(e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===f?c:c-g*e-h*e)))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position,c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=.1)):"fade"===e&&(d.opacity=.1),b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=.1)),b.wrap.animate(c,{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var g,a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction;e.opacity=.1,"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px")),"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,d=a.prevEffect,e={opacity:.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px"),a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}},b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a),this.overlay&&this.close(),this.overlay=f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent),this.fixed=!1,a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a),this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update()),a.closeClick&&this.overlay.bind("click.overlay",function(a){return f(a.target).hasClass("fancybox-overlay")?(b.isActive?b.close():d.close(),!1):void 0}),this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b)),f(".fancybox-overlay").remove().hide(),f.extend(this,{overlay:null,fixed:!1})},update:function(){var b,a="100%";this.overlay.width(a).height("100%"),I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width()),this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0),e||this.create(a),a.locked&&this.fixed&&b.fixed&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1),!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c)),this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}},b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;if(f.isFunction(e)&&(e=e.call(d.element,d)),q(e)&&""!==f.trim(e)){switch(d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>"),c){case"inside":c=b.skin;break;case"outside":c=b.wrap;break;case"over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}},f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var k,l,h=f(this).blur(),j=d;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&""!==l&&"nofollow"!==l&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};return a=a||{},d=a.index||0,c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k):e.unbind("click.fb-start").bind("click.fb-start",k),this.filter("[data-fancybox-start=1]").trigger("click"),this},p.ready(function(){var a,d;if(f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();return a.remove(),b}),f.support.fixedPosition===v){a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove(),a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")}),a=f(r).width(),J.addClass("fancybox-lock-test"),d=f(r).width(),J.removeClass("fancybox-lock-test"),f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})}(window,document,jQuery),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(function(require,exports,module){require("tools");require("fancybox"),$(function(){$(".fancyimg").fancybox({padding:0,maxHeight:800,maxWidth:800,openEffect:"none",closeEffect:"none"}),$(".call-now").fancybox({padding:0}),$(".often-select").change(function(){$(".often-words").val($(this).val())})})});