/* jQuery Switchable v2.0 | switchable.mrzhang.me | MIT Licensed */ (function(a) { function b(e, o, c) { var d = this, f = a(this), g = "beforeSwitch", h = "onSwitch"; a.isFunction(o[g]) && f.bind(g, o[g]), a.isFunction(o[h]) && f.bind(h, o[h]), a.extend(d, { _initPlugins: function() { var k = a.switchable.Plugins, i = k.length, j = 0; for (; j < i; j++) { k[j].init && k[j].init(d); } }, _init: function() { d.container = e, d.config = o, !o.panels || !o.panels.jquery && a.type(o.panels) !== "string" ? d.panels = e.children() : d.panels = e.find(o.panels), d.length = Math.ceil(d.panels.length / o.steps); if (d.length < 1) { window.console && console.warn("No panel in " + c); return; } d.index = o.initIndex === null ? undefined : o.initIndex + (o.initIndex < 0 ? d.length : 0), o.effect === "none" && d.panels.slice(d.index * o.steps, (d.index + 1) * o.steps).show(); if (!!o.triggers) { var k, l, j, i = []; for (l = 1; l <= d.length; l++) { i.push('' + l + ""); } if (o.triggers.jquery) { if (o.triggers.length > 1) { d.triggers = o.triggers.slice(0, d.length); } else { o.triggers.html('
' + i.join("") + "
"); d.triggers = o.triggers.find("a"); } } else { d.triggers = a("
", { "class": o.triggersWrapCls, html: i.join("") })[o.putTriggers](e).find("a"); } d.triggers.eq(d.index).addClass(o.currentTriggerCls); for (l = 0; l < d.length; l++) { k = d.triggers.eq(l), k.click({ index: l }, function(m) { j = m.data.index; if (!d._triggerIsValid(j)) { return; } d._cancelDelayTimer(), d.switchTo(j); }), o.triggerType === "mouse" && k.mouseenter({ index: l }, function(m) { j = m.data.index; if (!d._triggerIsValid(j)) { return; } d._delayTimer = setTimeout(function() { d.switchTo(j); }, o.delay * 1000); }).mouseleave(function() { d._cancelDelayTimer(); }); } } }, _triggerIsValid: function(i) { return d.index !== i; }, _cancelDelayTimer: function() { d._delayTimer && (clearTimeout(d._delayTimer), d._delayTimer = undefined); }, _switchTrigger: function(i, j) { d.triggers.eq(i).removeClass(o.currentTriggerCls).end().eq(j).addClass(o.currentTriggerCls); }, _switchPanels: function(k, i, j) { a.switchable.Effects[o.effect].call(d, k, i, j); }, willTo: function(i) { return i ? d.index > 0 ? d.index - 1 : o.loop ? d.length - 1 : !1 : d.index < d.length - 1 ? d.index + 1 : o.loop ? 0 : !1; }, switchTo: function(k, i) { var j = a.Event(g); f.trigger(j, [k]); if (j.isDefaultPrevented()) { return; } return d._switchPanels(d.index, k, i), !o.triggers || d._switchTrigger(d.index, k), d.index = k, j.type = h, f.trigger(j, [k]), d; } }), d._init(), d._initPlugins(); } a.switchable = { Config: { triggers: !0, putTriggers: "insertAfter", triggersWrapCls: "triggers", currentTriggerCls: "current", panels: null, steps: 1, triggerType: "mouse", delay: 0.1, initIndex: 0, effect: "none", easing: "ease", duration: 0.5, loop: !0, beforeSwitch: null, onSwitch: null, api: !1 }, Effects: { none: function(i, j) { var c = this, d = c.config; c.panels.slice(i * d.steps, (i + 1) * d.steps).hide().end().slice(j * d.steps, (j + 1) * d.steps).show(); } }, Plugins: [] }, a.fn.switchable = function(e) { var f = a(this), g = f.length, h = f.selector, c = [], d; e = a.extend({}, a.switchable.Config, e), e.effect = e.effect.toLowerCase(); for (d = 0; d < g; d++) { c[d] = new b(f.eq(d), e, h + "[" + d + "]"); } return e.api ? c[0] : f; }; })(jQuery), function(a) { function b() { var k = document.documentElement, l = ["Webkit", "Moz"], c = "transition", d = "", e; if (k.style[c] !== undefined) { d = c; } else { for (e = 0; e < 2; e++) { if (k.style[c = l[e] + "Transition"] !== undefined) { d = c; break; } } } return d; } a.switchable.Anim = function(k, l, c, d, e, f) { var g = this, h = {}, i, j; a.switchable.Transition === undefined && (a.switchable.Transition = b()), i = a.switchable.Transition, a.extend(g, { isAnimated: !1, run: function() { if (g.isAnimated) { return; } c = c * 1000; if (i) { h[i + "Property"] = f || "all", h[i + "Duration"] = c + "ms", h[i + "TimingFunction"] = d, k.css(a.extend(l, h)), j = setTimeout(function() { g._clearCss(), g._complete(); }, c); } else { var n = /cubic-bezier\(([\s\d.,]+)\)/, m = d.match(n), o = a.switchable.TimingFn[d]; if (o || m) { d = a.switchable.Easing(m ? m[1] : o.match(n)[1]); } k.animate(l, c, d, function() { g._complete(); }); } return g.isAnimated = !0, g; }, stop: function(m) { if (!g.isAnimated) { return; } return i ? (clearTimeout(j), j = undefined) : k.stop(!1, m), g.isAnimated = !1, g; }, _complete: function() { e && e(); }, _clearCss: function() { h[i + "Property"] = "none", k.css(h); } }); }; }(jQuery), function(c) { function d(e) { return "cubic-bezier(" + e + ")"; } function a(g) { var h = [], e = 101, f; for (f = 0; f <= e; f++) { h[f] = g.call(null, f / e); } return function(j) { if (j === 1) { return h[e]; } var k = e * j, p = Math.floor(k), i = h[p], l = h[p + 1]; return i + (l - i) * (k - p); }; } function b(j, k, l, m, A, B) { function D(n) { return ((C * n + bx) * n + cx) * n; } function e(n) { return ((ay * n + by) * n + cy) * n; } function f(n) { return (3 * C * n + 2 * bx) * n + cx; } function g(n) { return 1 / (200 * n); } function h(n, o) { return e(i(n, o)); } function i(u, v) { function t(w) { return w >= 0 ? w : 0 - w; } var n, o, p, q, r, s; for (p = u, s = 0; s < 8; s++) { q = D(p) - u; if (t(q) < v) { return p; } r = f(p); if (t(r) < 0.000001) { break; } p = p - q / r; } n = 0, o = 1, p = u; if (p < n) { return n; } if (p > o) { return o; } while (n < o) { q = D(p); if (t(q - u) < v) { return p; } u > q ? n = p : o = p, p = (o - n) * 0.5 + n; } return p; } var C = bx = cx = ay = by = cy = 0; return cx = 3 * k, bx = 3 * (m - k) - cx, C = 1 - cx - bx, cy = 3 * l, by = 3 * (A - l) - cy, ay = 1 - cy - by, h(j, g(B)); } c.switchable.TimingFn = { ease: d(".25, .1, .25, 1"), linear: d("0, 0, 1, 1"), "ease-in": d(".42, 0, 1, 1"), "ease-out": d("0, 0, .58, 1"), "ease-in-out": d(".42, 0, .58, 1") }, c.switchable.Easing = function(g) { var h, i, e = 0; g = g.split(","), i = g.length; for (; e < i; e++) { g[e] = parseFloat(g[e]); } if (i !== 4) { window.console && console.warn(d(g.join(", ")) + " missing argument."); } else { h = "cubic-bezier-" + g.join("-"); if (!c.easing[h]) { var f = a(function(j) { return b(j, g[0], g[1], g[2], g[3], 5); }); c.easing[h] = function(o, p, j, n) { return f.call(null, o); }; } } return h; }; }(jQuery), function(a) { a.extend(a.switchable.Config, { autoplay: !1, interval: 3, pauseOnHover: !0 }), a.switchable.Plugins.push({ name: "autoplay", init: function(d) { function e() { c = d.willTo(d.isBackward); if (c === !1) { d._cancelTimers(); return; } d.switchTo(c, d.isBackward ? "backward" : "forward"); } function f() { b = setInterval(function() { e(); }, (g.interval + g.duration) * 1000); } var g = d.config, h = !1, i, b, c; if (!g.autoplay || d.length <= 1) { return; } g.pauseOnHover && d.panels.add(d.triggers).hover(function() { d._pause(); }, function() { h || d._play(); }), a.extend(d, { _play: function() { d._cancelTimers(), d.paused = !1, i = setTimeout(function() { e(), f(); }, g.interval * 1000); }, _pause: function() { d._cancelTimers(), d.paused = !0; }, _cancelTimers: function() { i && (clearTimeout(i), i = undefined), b && (clearInterval(b), b = undefined); }, play: function() { return d._play(), h = !1, d; }, pause: function() { return d._pause(), h = !0, d; } }), d._play(); } }); }(jQuery), function(a) { a.extend(a.switchable.Config, { prev: null, next: null }), a.switchable.Plugins.push({ name: "carousel", init: function(d) { var g = d.config, h = ["backward", "forward"], i = ["prev", "next"], b, c, e, f = 0; if (!g.prev && !g.next) { return; } for (; f < 2; f++) { b = i[f], c = g[b], c && (e = d[b + "Btn"] = c.jquery ? c : a(c), e.click({ direction: h[f] }, function(l) { l.preventDefault(); if (!d.anim) { var j = l.data.direction, k = d.willTo(j === h[0]); k !== !1 && d.switchTo(k, j); } })); } } }); }(jQuery), function(a) { a.switchable.Effects.fade = function(d, h) { var b = this, c = b.config, e = b.panels, f = e.eq(d), g = e.eq(h); b.anim && (b.anim.stop(), e.eq(b.anim.to).css({ zIndex: b.length }).end().eq(b.anim.from).css({ opacity: 0, zIndex: 1 })), g.css({ opacity: 1 }), b.anim = (new a.switchable.Anim(f, { opacity: 0 }, c.duration, c.easing, function() { g.css({ zIndex: b.length }), f.css({ zIndex: 1 }), b.anim = undefined; }, "opacity")).run(), b.anim.from = d, b.anim.to = h; }, a.switchable.Plugins.push({ name: "fade effect", init: function(c) { var g = c.config, b = c.panels.eq(c.index); if (g.effect !== "fade" || g.steps !== 1) { return; } c.panels.not(b).css({ opacity: 0, zIndex: 1 }), b.css({ opacity: 1, zIndex: c.length }); } }); }(jQuery), function(e) { var f = ["scrollleft", "scrollright", "scrollup", "scrolldown"], a = "position", b = "absolute", c = "relative"; e.extend(e.switchable.Config, { end2end: !1, groupSize: [], visible: null, clonedCls: "switchable-cloned" }); for (var d = 0; d < 4; d++) { e.switchable.Effects[f[d]] = function(v, w, g) { var h = this, i = h.config, j = h.length - 1, k = g === "backward", l = i.end2end && (k && v === 0 && w === j || g === "forward" && v === j && w === 0), u = {}; u[h.isHoriz ? "left" : "top"] = l ? h._adjustPosition(k) : -h.groupSize[h.isHoriz ? 0 : 1] * w, h.anim && h.anim.stop(), h.anim = (new e.switchable.Anim(h.panels.parent(), u, i.duration, i.easing, function() { l && h._resetPosition(k), h.anim = undefined; })).run(); }; } e.switchable.Plugins.push({ name: "scroll effect", init: function(g) { var h = g.config, j = h.steps, l = g.panels, m = l.parent(), n = e.inArray(h.effect, f), o = n === 0 || n === 1, p = l.eq(0).outerWidth(!0), q = l.eq(0).outerHeight(!0), r = o ? 0 : 1, s = g.length - 1, t = o ? "left" : "top", i = {}; if (n === -1) { return; } g.groupSize = [h.groupSize[0] || p * j, h.groupSize[1] || q * j]; if (h.end2end) { var k = l.length, u = !o && h.groupSize[0] ? g.groupSize[r] * g.length : (o ? p : q) * k, v = k - s * j, w = (o ? p : q) * v, x = !o && h.groupSize[0] ? g.groupSize[r] : w, M; h.loop = !0, h.visible && h.visible < k && h.visible > v && l.slice(0, h.visible).clone(!0).addClass(h.clonedCls).appendTo(m).click(function(y) { y.preventDefault(), l.eq(e(this).index() - k).click(); }), e.extend(g, { _adjustPosition: function(y) { return M = y ? s : 0, i[a] = c, i[t] = (y ? -1 : 1) * u, l.slice(M * j, (M + 1) * j).css(i), y ? x : -u; }, _resetPosition: function(y) { M = y ? s : 0, i[a] = "", i[t] = "", l.slice(M * j, (M + 1) * j).css(i), i[a] = undefined, i[t] = y ? -g.groupSize[r] * s : 0, m.css(i); } }); } g.container.css(a) == "static" && g.container.css(a, c), i[a] = b, i[t] = -g.groupSize[r] * g.index, m.css(i).css("width", o ? 2 * g.groupSize[r] * g.length : h.groupSize[0] ? h.groupSize[0] : undefined), g.isHoriz = o, g.isBackward = n === 1 || n === 3; } }); }(jQuery), function(c) { var d = ["accordion", "horizaccordion"], a = [ ["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth"] ]; c.extend(c.switchable.Config, { multiple: !1, customProps: {} }); for (var b = 0; b < 2; b++) { c.switchable.Effects[d[b]] = function(f, e) { var g = this, h = g.config, m = f !== e; g.anim && g.anim.stop(m), g.anim = (new c.switchable.Anim(g.panels.eq(e), g.triggers.eq(e).hasClass(h.currentTriggerCls) ? g.collapseProps : g.expandProps[e], h.duration, h.easing, function() { g.anim = undefined; })).run(), !h.multiple && f !== undefined && m && (g.anim2 && g.anim2.stop(m), g.anim2 = (new c.switchable.Anim(g.panels.eq(f), g.collapseProps, h.duration, h.easing, function() { g.anim2 = undefined; })).run()); }; } c.switchable.Plugins.push({ name: "accordion effect", init: function(e) { var f = e.config, g = c.inArray(f.effect, d); if (g === -1 || f.steps !== 1) { return; } window.console && console.info("Remember to set the border-width for the accordion's panels, even without border."), c.extend(e, { _triggerIsValid: function(m) { return !0; }, _switchTrigger: function(o, p) { var m = e.triggers, n = f.currentTriggerCls; m.eq(p).toggleClass(n), !f.multiple && o !== undefined && o !== p && m.eq(o).removeClass(n); } }), e.expandProps = [], e.collapseProps = {}; var h = a[g].length, i = {}, j, k, l; for (l = 0; l < h; l++) { e.collapseProps[a[g][l]] = 0; } c.extend(e.collapseProps, f.customProps); for (l = 0; l < e.length; l++) { j = e.panels.eq(l); for (var s = 0; s < h; s++) { k = a[g][s], i[k] = j.css(k); } e.expandProps.push(c.extend({}, i)), j.css(c.extend({ overflow: "hidden" }, l === e.index ? i : e.collapseProps)); } } }); }(jQuery);; jQuery.extend(jQuery.easing, { def: "easeOutQuad", swing: function(e, f, a, h, g) { return jQuery.easing[jQuery.easing.def](e, f, a, h, g); }, easeInQuad: function(e, f, a, h, g) { return h * (f /= g) * f + a; }, easeOutQuad: function(e, f, a, h, g) { return -h * (f /= g) * (f - 2) + a; }, easeInExpo: function(e, f, a, h, g) { return (f == 0) ? a : h * Math.pow(2, 10 * (f / g - 1)) + a; }, easeOutExpo: function(e, f, a, h, g) { return (f == g) ? a + h : h * (-Math.pow(2, -10 * f / g) + 1) + a; }, easeInBack: function(e, f, a, i, h, g) { if (g == undefined) { g = 1.70158; } return i * (f /= h) * f * ((g + 1) * f - g) + a; }, easeOutBack: function(e, f, a, i, h, g) { if (g == undefined) { g = 1.70158; } return i * ((f = f / h - 1) * f * ((g + 1) * f + g) + 1) + a; }, 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; }, easeOutBounce: function(j, i, b, c, d) { if ((i /= d) < (1 / 2.75)) { return c * (7.5625 * i * i) + b; } else { if (i < (2 / 2.75)) { return c * (7.5625 * (i -= (1.5 / 2.75)) * i + 0.75) + b; } else { if (i < (2.5 / 2.75)) { return c * (7.5625 * (i -= (2.25 / 2.75)) * i + 0.9375) + b; } else { return c * (7.5625 * (i -= (2.625 / 2.75)) * i + 0.984375) + b; } } } } }); (function(a) { a.fn.menuAim = function(c) { this.each(function() { b.call(this, c); }); return this; }; function b(c) { var d = a(this), q = null, g = [], r = null, p = null, s = a.extend({ rowSelector: "> li", submenuSelector: "*", submenuDirection: "right", tolerance: 75, enter: a.noop, exit: a.noop, activate: a.noop, deactivate: a.noop, exitMenu: a.noop }, c); var j = 3, f = 300; var e = function(t) { g.push({ x: t.pageX, y: t.pageY }); if (g.length > j) { g.shift(); } }; var o = function() { if (p) { clearTimeout(p); } if (s.exitMenu(this)) { if (q) { s.deactivate(q); } q = null; } }; var l = function() { if (p) { clearTimeout(p); } s.enter(this); h(this); }, k = function() { s.exit(this); }; var m = function() { i(this); }; var i = function(t) { if (t.className.toLowerCase() == "current") { return; } if (q) { s.deactivate(q); } s.activate(t); q = t; }; var h = function(u) { var t = n(); if (t) { p = setTimeout(function() { h(u); }, t); } else { i(u); } }; var n = function() { if (!q || !a(q).is(s.submenuSelector)) { return 0; } var x = d.offset(), t = { x: x.left, y: x.top - s.tolerance }, E = { x: x.left + d.outerWidth(), y: t.y }, G = { x: x.left, y: x.top + d.outerHeight() + s.tolerance }, y = { x: x.left + d.outerWidth(), y: G.y }, z = g[g.length - 1], D = g[0]; if (!z) { return 0; } if (!D) { D = z; } if (D.x < x.left || D.x > y.x || D.y < x.top || D.y > y.y) { return 0; } if (r && z.x == r.x && z.y == r.y) { return 0; } function A(I, H) { return (H.y - I.y) / (H.x - I.x); } var C = E, u = y; if (s.submenuDirection == "left") { C = G; u = t; } else { if (s.submenuDirection == "below") { C = y; u = G; } else { if (s.submenuDirection == "above") { C = t; u = E; } } } var v = A(z, C), B = A(z, u), F = A(D, C), w = A(D, u); if (v < F && B > w) { r = z; return f; } r = null; return 0; }; d.mouseleave(o).find(s.rowSelector).mouseenter(l).mouseleave(k).click(m); a(document).mousemove(e); } })(jQuery); var $window = $(window); var NALA = NALA || {}; (function(a) { NALA.check = { stopStr: /找小妹|找小姐|找学生|整形|学生妹|人流|不孕不育|[发發髮]\s*票|[发發髮]\S+票/g, isPhone: function() { var b = navigator.userAgent.toLowerCase(), c = /iPhone|iPad|Android|ucweb|windows\s+mobile|Windows\s+Phone/i; return c.test(b); }, isIE6: window.VBArray && !window.XMLHttpRequest, isNick: function(c) { var b = /^[\u4e00-\u9fa5A-Za-z0-9-_]+$/; return b.test(c); }, isEmail: function(c) { var b = /^[a-z0-9][\w\.]*@([a-z0-9][a-z0-9-]*\.)+[a-z]{2,5}$/i; return b.test(c); }, isMobile: function(c) { var b = /^1[345678][0-9]{9}$/; return b.test(c); }, isTelephone: function(c) { var b = /^0\d{2,3}-\d{5,9}$/; return b.test(c); }, isUrl: function(c) { var b = /^http:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?$/; return b.test(c); }, isNum: function(c) { var b = /^[0-9]\d*$/; return b.test(c); } }; if (NALA.check.isPhone()) { a("html").addClass("isPhone"); NALA.isPhone = true; } else { if ($window.width() < 1400) { a("html").addClass("is1280"); } } NALA.userInfo = { login: 0 }; NALA.common = { ajaxUrl: { userinfo: "/user/loginAuth3", cartData: "/cart/listJson", search: "/item/associateSearch" }, cmsContentAjax: function(b, c) { a.ajax({ url: "/common/ajaxCmsContent", cache: false, data: { mark: b }, dataType: "html", success: function(d) { c(d); } }); }, searchBar: function() { var g = this, i = a("#search_fm"), f = i.find("input.sea_input"), b = {}, j = null, e = -1; _offset = null, $result = null; i.submit(function() { if (a.trim(f.val()) == "请输入產品或品牌" || a.trim(f.val()) == "") { location.href = "/item/newsearch"; return false; } }); if (NALA.isPhone) { return; } $result = a('
').appendTo("#header"); f.attr("autocomplete", "off").on("focus", function() { var k = a.trim(f.val()); _offset = f.offset(); c(); if (k == "") { return false; } if (k == "请输入產品或品牌") { f.val(""); } else { if (b[k] != undefined) { d(k); } else { h(k); } } return false; }).on("keyup", function(k) { if (k.keyCode != 40 && k.keyCode != 38 && k.keyCode != 13) { clearTimeout(j); j = setTimeout(function() { var l = a.trim(f.val()); if (b[l] != undefined) { d(l); } else { h(l); } }, 300); } }).blur(function() { if (a.trim(f.val()) == "") { f.val("请输入產品或品牌"); } }).on("keydown", function(n) { var k = $result.find("li"), l = k.length, m = ""; if (l > 0) { switch (n.keyCode) { case 40: e++; if (e > l - 1) { e = 0; } k.removeClass("on").eq(e).addClass("on"); f.val(k.eq(e).text()); break; case 38: e--; if (e < 0) { e = l - 1; } k.removeClass("on").eq(e).addClass("on"); f.val(k.eq(e).text()); break; } } }); function h(k) { a.ajax({ url: g.ajaxUrl.search, type: "post", data: { q: k }, success: function(l) { b[k] = l; d(k); } }); } function d(l) { var k = "