// Copyright (C) 2012 by Khoivietech. All rights reserved. /* * AllInOne Banner - Banner Rotator v3.0 * * Copyright 2012, LambertGroup * */ (function (c) { function G(a, b) { c(a.currentImg.attr("data-text-id")).css("display", "block"); var d = c(a.currentImg.attr("data-text-id")).children(), g = 0; currentText_arr = []; d.each(function () { currentText_arr[g] = c(this); var f = currentText_arr[g].attr("data-initial-left"), d = currentText_arr[g].attr("data-initial-top"); b.responsive && (f = parseInt(f / (b.origWidth / b.width), 10), d = parseInt(d / (b.origWidth / b.width), 10)); currentText_arr[g].css({ left: f + "px", top: d + "px", opacity: parseInt(currentText_arr[g].attr("data-fade-start"), 10) / 100 }); var m = currentText_arr[g]; setTimeout(function () { if (b.responsive) { newCss = ""; if (m.css("font-size").lastIndexOf("px") != -1) { fontSize = m.css("font-size").substr(0, m.css("font-size").lastIndexOf("px")); newCss = newCss + ("font-size:" + fontSize / (b.origWidth / b.width) + "px;") } else if (m.css("font-size").lastIndexOf("em") != -1) { fontSize = m.css("font-size").substr(0, m.css("font-size").lastIndexOf("em")); newCss = newCss + ("font-size:" + fontSize / (b.origWidth / b.width) + "em;") } if (m.css("line-height").lastIndexOf("px") != -1) { lineHeight = m.css("line-height").substr(0, m.css("line-height").lastIndexOf("px")); newCss = newCss + ("line-height:" + lineHeight / (b.origWidth / b.width) + "px;") } else if (m.css("line-height").lastIndexOf("em") != -1) { lineHeight = m.css("line-height").substr(0, m.css("line-height").lastIndexOf("em")); newCss = newCss + ("line-height:" + lineHeight / (b.origWidth / b.width) + "em;") } m.wrapInner('
') } var f = m.attr("data-final-left"), d = m.attr("data-final-top"); if (b.responsive) { f = parseInt(f / (b.origWidth / b.width), 10); d = parseInt(d / (b.origWidth / b.width), 10) } var g = 1; a.isVideoPlaying == true && (g = 0); m.animate({ opacity: g, left: f + "px", top: d + "px" }, m.attr("data-duration") * 1E3, function () { a.isVideoPlaying == true && c(a.currentImg.attr("data-text-id")).children().css("opacity", 0) }) }, 1E3 * currentText_arr[g].attr("data-delay")); g++ }) } function H(a, b) { nowx = (new Date).getTime(); !a.mouseOverBanner && (!a.effectIsRunning && b.showCircleTimer) && (a.ctx.clearRect(0, 0, a.canvas.width, a.canvas.height), a.ctx.beginPath(), a.ctx.globalAlpha = b.behindCircleAlpha / 100, a.ctx.arc(b.circleRadius + 2 * b.circleLineWidth, b.circleRadius + 2 * b.circleLineWidth, b.circleRadius, 0, 2 * Math.PI, !1), a.ctx.lineWidth = b.circleLineWidth + 2, a.ctx.strokeStyle = b.behindCircleColor, a.ctx.stroke(), a.ctx.beginPath(), a.ctx.globalAlpha = b.circleAlpha / 100, a.ctx.arc(b.circleRadius + 2 * b.circleLineWidth, b.circleRadius + 2 * b.circleLineWidth, b.circleRadius, 0, 2 * ((a.timeElapsed + nowx - a.arcInitialTime) / 1E3) / b.autoPlay * Math.PI, !1), a.ctx.lineWidth = b.circleLineWidth, a.ctx.strokeStyle = b.circleColor, a.ctx.stroke()) } function I(a, b, d) { c(".stripe", a).remove(); c(".block", a).remove(); y = x = Math.round(b.width / b.numberOfStripes); for (var g = !0, f = 0; f < b.numberOfStripes; f++) f == b.numberOfStripes - 1 && (y = a.width() - x * (b.numberOfStripes - 1)), !b.responsive || !c.browser.msie || c.browser.msie && 9 <= c.browser.version ? -1 != r.indexOf("ipad") || -1 != r.indexOf("iphone") || -1 != r.indexOf("ipod") || -1 != r.indexOf("webos") ? g = !1 : a.append(c('
').css({ opacity: "0", left: x * f + "px", width: y + "px", height: "0px", background: 'url("' + d.current_imgInside.attr("src") + '") ' + -1 * f * x + "px 0%" })) : g = !1, g || (mleft = -1 * x * f, a.append(c('
').css({ opacity: "0", left: x * f + "px", width: y + "px", height: "0px" }))); b.responsive && g && (!c.browser.msie || c.browser.msie && 9 <= c.browser.version) && c(".stripe", a).css({ "-webkit-background-size": b.width + "px " + b.height + "px", "-moz-background-size": b.width + "px " + b.height + "px", "-o-background-size": b.width + "px " + b.height + "px", "-ms-background-size": b.width + "px " + b.height + "px", "background-size": b.width + "px " + b.height + "px" }) } function F(a, b, c, g, f) { var h = a.width(), m = a.height(); a.css({ width: "0", height: "0" }); b == g.numberOfRows - 1 && c == g.numberOfColumns - 1 ? setTimeout(function () { a.animate({ opacity: "1.0", width: h, height: m }, 1E3 * g.effectDuration / 3, "", function () { f.trigger("effectComplete") }) }, n) : setTimeout(function () { a.animate({ opacity: "1.0", width: h, height: m }, 1E3 * g.effectDuration / 3) }, n); n += D } function A(a, b, d, g, f, h, m, C) { var p = !0; if (!b.loop && d.current_img_no + a >= g || !b.loop && 0 > d.current_img_no + a) p = !1; if (p) { c(".newFS", h).contents().unwrap(); b.showCircleTimer && (d.ctx.clearRect(0, 0, d.canvas.width, d.canvas.height), d.ctx.beginPath(), d.ctx.globalAlpha = b.behindCircleAlpha / 100, d.ctx.arc(b.circleRadius + 2 * b.circleLineWidth, b.circleRadius + 2 * b.circleLineWidth, b.circleRadius, 0, 2 * Math.PI, !1), d.ctx.lineWidth = b.circleLineWidth + 2, d.ctx.strokeStyle = b.behindCircleColor, d.ctx.stroke(), d.ctx.beginPath(), d.ctx.globalAlpha = b.circleAlpha / 100, d.ctx.arc(b.circleRadius + 2 * b.circleLineWidth, b.circleRadius + 2 * b.circleLineWidth, b.circleRadius, 0, 0, !1), d.ctx.lineWidth = b.circleLineWidth, d.ctx.strokeStyle = b.circleColor, d.ctx.stroke()); c(d.currentImg.attr("data-text-id")).css("display", "none"); c(m[d.current_img_no]).removeClass("bottomNavButtonON"); b.randomizeImages && !d.bottomNavClicked ? (a = Math.floor(Math.random() * g), d.current_img_no = d.current_img_no === a ? Math.floor(Math.random() * g) : a) : d.current_img_no = d.current_img_no + a >= g ? 0 : 0 > d.current_img_no + a ? g - 1 : d.current_img_no + a; d.bottomNavClicked = !1; c(m[d.current_img_no]).addClass("bottomNavButtonON"); d.currentImg = c(C[d.current_img_no]); d.current_imgInside = d.currentImg.find("img:first"); d.currentImg.attr("data-transition") ? (f = d.currentImg.attr("data-transition"), "random" == f && (f = E[Math.floor(Math.random() * E.length)])) : f = "random" != b.defaultEffect ? b.defaultEffect : E[Math.floor(Math.random() * E.length)]; d.effectIsRunning = !0; if ("fade" == f || "slideFromLeft" == f || "slideFromRight" == f || "slideFromTop" == f || "slideFromBottom" == f) if (I(h, b, d), g = c(".stripe:first", h), "fade" == f && (g.css({ top: "0px", height: "100%", width: h.width() + "px" }), g.animate({ opacity: "1.0" }, 2E3 * b.effectDuration, "", function () { h.trigger("effectComplete") })), "slideFromLeft" == f && (g.css({ top: "0px", height: "100%", width: "0" }), g.animate({ opacity: "1.0", width: h.width() + "px" }, 1E3 * b.effectDuration, "", function () { h.trigger("effectComplete") })), "slideFromRight" == f && (g.css({ top: "0px", height: "100%", width: "0", left: h.width() + 5 + "px" }), g.animate({ opacity: "1.0", left: "0", width: h.width() + "px" }, 1E3 * b.effectDuration, "", function () { h.trigger("effectComplete") })), "slideFromTop" == f && (g.css({ top: "0px", height: "0", width: h.width() + "px" }), g.animate({ opacity: "1.0", height: h.height() + "px" }, 1E3 * b.effectDuration, "", function () { h.trigger("effectComplete") })), "slideFromBottom" == f) g.css({ top: "0px", height: "0", width: h.width() + "px", top: h.height() + "px" }), g.animate({ opacity: "1.0", top: 0, height: h.height() + "px" }, 1E3 * b.effectDuration, "", function () { h.trigger("effectComplete") }); 0 <= f.indexOf("Stripes") && (I(h, b, d), g = 0 <= f.indexOf("Reverse") ? c(".stripe", h).myReverse() : c(".stripe", h), n = 100, i = 0, g.each(function () { var a = c(this); (f == "topBottomDroppingStripes" || f == "topBottomDroppingReverseStripes") && a.css({ top: "0px" }); (f == "bottomTopDroppingStripes" || f == "bottomTopDroppingReverseStripes") && a.css({ bottom: "0px" }); (f == "leftRightFadingStripes" || f == "leftRightFadingReverseStripes") && a.css({ top: "0px", height: "100%", width: "0" }); f == "asynchronousDroppingStripes" && (i % 2 ? a.css({ top: "0px" }) : a.css({ bottom: "0px" })); if (f == "leftRightFadingStripes" || f == "leftRightFadingReverseStripes") { var e = x; if (f == "leftRightFadingStripes" && i == b.numberOfStripes - 1 || f == "leftRightFadingReverseStripes" && i == 0) e = y; i == b.numberOfStripes - 1 ? setTimeout(function () { a.animate({ width: e + "px", opacity: "1.0" }, b.effectDuration * 800, "", function () { h.trigger("effectComplete") }) }, n) : setTimeout(function () { a.animate({ width: e + "px", opacity: "1.0" }, b.effectDuration * 800) }, n) } else i == b.numberOfStripes - 1 ? setTimeout(function () { a.animate({ height: "100%", opacity: "1.0" }, b.effectDuration * 1E3, "", function () { h.trigger("effectComplete") }) }, n) : setTimeout(function () { a.animate({ height: "100%", opacity: "1.0" }, b.effectDuration * 1E3) }, n); n = n + J; i++ })); if (0 <= f.indexOf("Blocks")) { c(".stripe", h).remove(); c(".block", h).remove(); for (var g = Math.round(b.width / b.numberOfColumns), m = Math.round(b.height / b.numberOfRows), C = g, a = m, l = p = 0, t = !0, w = 0; w < b.numberOfRows; w++) for (var z = 0; z < b.numberOfColumns; z++) p = g * z, l = m * w, C = z == b.numberOfColumns - 1 ? b.width - g * (b.numberOfColumns - 1) : g, a = w == b.numberOfRows - 1 ? b.height - m * (b.numberOfRows - 1) : m, !b.responsive || !c.browser.msie || c.browser.msie && 9 <= c.browser.version ? -1 != r.indexOf("ipad") || -1 != r.indexOf("iphone") || -1 != r.indexOf("ipod") || -1 != r.indexOf("webos") ? t = !1 : h.append(c('
').css({ opacity: "0", left: p + "px", top: l + "px", width: C + "px", height: a + "px", background: 'url("' + d.current_imgInside.attr("src") + '") -' + p + "px -" + l + "px" })) : t = !1, t || (mleft = -1 * p, mtop = -1 * l, h.append(c('
').css({ opacity: "0", left: p + "px", top: l + "px", width: C + "px", height: a + "px" }))); b.responsive && t && (!c.browser.msie || c.browser.msie && 9 <= c.browser.version) && c(".block", h).css({ "-webkit-background-size": b.width + "px " + b.height + "px", "-moz-background-size": b.width + "px " + b.height + "px", "-o-background-size": b.width + "px " + b.height + "px", "-ms-background-size": b.width + "px " + b.height + "px", "background-size": b.width + "px " + b.height + "px" }); if (0 <= f.indexOf("Reverse")) var q = c(".block", h).myReverse(); else if ("randomBlocks" == f) { for (var d = c(".block", h), s, g = d.length; g; q = parseInt(Math.random() * g, 10), s = d[--g], d[g] = d[q], d[q] = s); q = d } else q = c(".block", h); n = 100; if ("randomBlocks" == f) { i = 0; var e = b.numberOfRows * b.numberOfColumns; q.each(function () { var a = c(this), f = a.width(), d = a.height(); a.css({ width: "0", height: "0" }); i == e - 1 ? setTimeout(function () { a.animate({ opacity: "1.0", width: f, height: d }, b.effectDuration * 1E3 / 3, "", function () { h.trigger("effectComplete") }) }, n) : setTimeout(function () { a.animate({ opacity: "1.0", width: f, height: d }, b.effectDuration * 1E3 / 3) }, n); n = n + D; i++ }) } else { var k = 0, o = 0, u = []; u[k] = []; q.each(function () { u[k][o] = c(this); o++; if (o == b.numberOfColumns) { k++; o = 0; u[k] = [] } }); o = k = 0; n = 100; q = c(u[k][o]); for (F(q, 0, 0, b, h); k < b.numberOfRows - 1 || o < b.numberOfColumns - 1; ) { k < b.numberOfRows - 1 && k++; o < b.numberOfColumns - 1 && o++; i = k; o < k && b.numberOfRows > b.numberOfColumns && (i = k - o); j = 0; for (k < o && b.numberOfRows < b.numberOfColumns && (j = o - k); 0 <= i && j <= o; ) q = c(u[i--][j++]), F(q, i, j, b, h) } n = b.numberOfRows < b.numberOfColumns ? n - (b.numberOfRows - 1) * D : n - (b.numberOfColumns - 1) * D; limit_i = 0; for (limit_j = o - k; limit_i < k && limit_j < o; ) { i = k + 1; for (j = limit_j; i > limit_i && j < o; ) i -= 1, j += 1, q = c(u[i][j]), F(q, i, j, b, h); limit_i++; limit_j++ } } } } } var E = "fade slideFromLeft slideFromRight slideFromTop slideFromBottom topBottomDroppingStripes topBottomDroppingReverseStripes bottomTopDroppingStripes bottomTopDroppingReverseStripes asynchronousDroppingStripes leftRightFadingStripes leftRightFadingReverseStripes topBottomDiagonalBlocks topBottomDiagonalReverseBlocks randomBlocks".split(" "), x, y, n = 100, J = 50, D = 25, B = !1, r = navigator.userAgent.toLowerCase(); c.fn.allinone_bannerRotator = function (a) { a = c.extend({}, c.fn.allinone_bannerRotator.defaults, a); return this.each(function () { var b = c(this); responsiveWidth = b.parent().width(); responsiveHeight = b.parent().height(); a.responsiveRelativeToBrowser && (responsiveWidth = c(window).width(), responsiveHeight = c(window).height()); a.origWidth = a.width; a.width100Proc && (a.width = responsiveWidth); a.origHeight = a.height; a.height100Proc && (a.height = responsiveHeight); if (a.responsive && (a.origWidth != responsiveWidth || a.width100Proc)) a.width = a.origWidth > responsiveWidth || a.width100Proc ? responsiveWidth : a.origWidth, a.height100Proc || (a.height = a.width / (a.origWidth / a.origHeight)); a.width = parseInt(a.width, 10); a.height = parseInt(a.height, 10); a.enableTouchScreen && a.responsive && (a.width -= 1); b.css("display", "block"); var d = c("
").addClass("allinone_bannerRotator").addClass(a.skin), g = c('
'); b.wrap(d); b.after(g); var f = b.parent(".allinone_bannerRotator"), h = c(".bannerControls", f), d = c('
'), g = c('
'), m = c('
'); b.after(d); b.after(g); b.after(m); a.showAllControllers || h.css("display", "none"); var n = c(".leftNav", f), p = c(".rightNav", f); n.css("display", "none"); p.css("display", "none"); a.showNavArrows && a.showOnInitNavArrows && (n.css("display", "block"), p.css("display", "block")); var l = c(".bottomNav", f), t = c(".bottomNavLeft", f), w = c(".bottomNavRight", f), z; l.css("display", "block"); t.css("display", "block"); w.css("display", "block"); l.css("top", a.height + "px"); l.css({ bottom: a.thumbsWrapperMarginBottom + "px", top: "auto" }); t.css({ bottom: a.thumbsWrapperMarginBottom + "px", top: "auto" }); w.css({ bottom: a.thumbsWrapperMarginBottom + "px", top: "auto" }); a.showBottomNav || (l.css("display", "none"), t.css("display", "none"), w.css("display", "none")); a.showOnInitBottomNav || (l.css("left", "-5000px"), t.css("left", "-5000px"), w.css("left", "-5000px")); var q = a.defaultEffect, s = 0, e = { current_img_no: 0, currentImg: 0, current_imgInside: "", bottomNavClicked: !1, effectIsRunning: !1, mouseOverBanner: !1, rightVal: 0, isAttractiveResp: !1, timeoutID: "", intervalID: "", arcInitialTime: (new Date).getTime(), timeElapsed: 0, windowWidth: 0, canvas: "", ctx: "", bannerRatio: a.origWidth / a.origHeight }; e.canvas = c(".mycanvas", f)[0]; e.canvas.width = 2 * a.circleRadius + 4 * a.circleLineWidth; e.canvas.height = 2 * a.circleRadius + 4 * a.circleLineWidth; a.showCircleTimer && (c.browser.msie && 9 > parseInt(c.browser.version, 10) && (e.canvas = G_vmlCanvasManager.initElement(e.canvas), !a.showCircleTimerIE8IE7 && a.showCircleTimer && (a.showCircleTimer = !1)), e.ctx = e.canvas.getContext("2d")); f.width(a.width); f.height(a.height); h.css("margin-top", parseInt((a.height - n.height()) / 2, 10) + "px"); var k = b.find("ul:first").children(), o, u = 0, x = 0; k.each(function () { e.currentImg = c(this); if (!e.currentImg.is("li")) e.currentImg = e.currentImg.find("li:first"); if (e.currentImg.is("li")) { e.currentImg.css("display", "none"); s++; o = c('
'); l.append(o); u = u + (parseInt(o.css("padding-left").substring(0, o.css("padding-left").length - 2), 10) + o.width()); x = parseInt((l.height() - parseInt(o.css("height").substring(0, o.css("height").length - 2))) / 2, 10); o.css("margin-top", x + "px") } }); l.width(u); a.showOnInitBottomNav && (l.css("left", parseInt((f.width() - u) / 2, 10) + "px"), t.css("left", parseInt(l.css("left").substring(0, l.css("left").length - 2), 10) - t.width() + "px"), w.css("left", parseInt(l.css("left").substring(0, l.css("left").length - 2), 10) + l.width() + parseInt(o.css("padding-left").substring(0, o.css("padding-left").length - 2), 10) + "px")); e.current_img_no = a.firstImg; a.firstImg > s && (e.current_img_no = s); 0 > a.firstImg && (e.current_img_no = 0); a.randomizeImages && (e.current_img_no = Math.floor(Math.random() * s)); e.currentImg = c(k[e.current_img_no]); e.current_imgInside = e.currentImg.find("img:first"); -1 != r.indexOf("ipad") || -1 != r.indexOf("iphone") || -1 != r.indexOf("ipod") || -1 != r.indexOf("webos") || c.browser.msie && 7 >= c.browser.version ? f.append('') : (f.css("background", 'url("' + e.current_imgInside.attr("src") + '") no-repeat'), a.responsive && (!c.browser.msie || c.browser.msie && 9 <= c.browser.version ? f.css({ "-webkit-background-size": a.width + "px " + a.height + "px", "-moz-background-size": a.width + "px " + a.height + "px", "-o-background-size": a.width + "px " + a.height + "px", "-ms-background-size": a.width + "px " + a.height + "px", "background-size": a.width + "px " + a.height + "px" }) : 8 == c.browser.version && f.css({ filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + e.current_imgInside.attr("src") + "',sizingMethod='scale')" }))); a.enableTouchScreen && (d = Math.floor(1E5 * Math.random()), f.wrap('
'), c("#bannerRotatorParent_" + d).width(a.width + 1), c("#bannerRotatorParent_" + d).height(a.height), f.css({ cursor: "url(" + a.absUrl + "skins/hand.cur),url(" + a.absUrl + "skins/hand.cur),move", left: "0px", position: "absolute" }), a.rightVal = parseInt(p.css("right").substring(0, p.css("right").length - 2), 10), "attractive" == a.skin && a.width100Proc && p.css("right", a.rightVal - 1 + "px"), f.mousedown(function () { if (a.rightVal < 0 && !B) { p.css({ visibility: "hidden", right: "0" }); (a.skin == "attractive" && a.width100Proc || a.skin == "attractive" && a.isAttractiveResp) && p.css("right", a.rightVal - 1 + "px"); n.css("visibility", "hidden") } }), f.mouseup(function () { B = false; if (a.rightVal < 0) { p.css({ right: a.rightVal + "px", visibility: "visible" }); (a.skin == "attractive" && a.width100Proc || a.skin == "attractive" && a.isAttractiveResp) && p.css("right", a.rightVal - 1 + "px"); n.css("visibility", "visible") } }), f.draggable({ axis: "x", containment: "parent", start: function () { origLeft = c(this).css("left") }, stop: function () { if (!e.effectIsRunning) { finalLeft = c(this).css("left"); direction = 1; origLeft < finalLeft && (direction = -1); A(direction, a, e, s, q, f, v, k) } if (a.rightVal < 0) { p.css({ right: a.rightVal + "px", visibility: "visible" }); (a.skin == "attractive" && a.width100Proc || a.skin == "attractive" && a.isAttractiveResp) && p.css("right", a.rightVal - 1 + "px"); n.css("visibility", "visible") } c(this).css("left", "0px") } })); G(e, a, b, h); f.bind("effectComplete", function () { e.effectIsRunning = false; if (r.indexOf("ipad") != -1 || r.indexOf("iphone") != -1 || r.indexOf("ipod") != -1 || r.indexOf("webos") != -1 || c.browser.msie && c.browser.version <= 7) { c("#curBgImgIos", f).attr("src", e.current_imgInside.attr("src")); c("#curBgImgIos", f).width(a.width); c("#curBgImgIos", f).height(a.height) } else { f.css("background", 'url("' + e.current_imgInside.attr("src") + '") no-repeat'); a.responsive && (!c.browser.msie || c.browser.msie && c.browser.version >= 9 ? f.css({ "-webkit-background-size": a.width + "px " + a.height + "px", "-moz-background-size": a.width + "px " + a.height + "px", "-o-background-size": a.width + "px " + a.height + "px", "-ms-background-size": a.width + "px " + a.height + "px", "background-size": a.width + "px " + a.height + "px" }) : c.browser.version == 8 && f.css({ filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + e.current_imgInside.attr("src") + "',sizingMethod='scale')" })) } e.arcInitialTime = (new Date).getTime(); e.timeElapsed = 0; if (a.showCircleTimer) { clearInterval(e.intervalID); e.ctx.clearRect(0, 0, e.canvas.width, e.canvas.height); e.ctx.beginPath(); e.ctx.globalAlpha = a.behindCircleAlpha / 100; e.ctx.arc(a.circleRadius + 2 * a.circleLineWidth, a.circleRadius + 2 * a.circleLineWidth, a.circleRadius, 0, 2 * Math.PI, false); e.ctx.lineWidth = a.circleLineWidth + 2; e.ctx.strokeStyle = a.behindCircleColor; e.ctx.stroke(); e.ctx.beginPath(); e.ctx.globalAlpha = a.circleAlpha / 100; e.ctx.arc(a.circleRadius + 2 * a.circleLineWidth, a.circleRadius + 2 * a.circleLineWidth, a.circleRadius, 0, 0, false); e.ctx.lineWidth = a.circleLineWidth; e.ctx.strokeStyle = a.circleColor; e.ctx.stroke(); e.intervalID = setInterval(function () { H(e, a) }, 125) } G(e, a, b, h); if (a.autoPlay > 0 && s > 1 && !e.mouseOverBanner) { clearTimeout(e.timeoutID); e.timeoutID = setTimeout(function () { A(1, a, e, s, q, f, v, k) }, a.autoPlay * 1E3) } }); f.mouseenter(function () { e.mouseOverBanner = true; clearTimeout(e.timeoutID); nowx = (new Date).getTime(); e.timeElapsed = e.timeElapsed + (nowx - e.arcInitialTime); if (a.autoHideNavArrows && a.showNavArrows) { n.css("display", "block"); p.css("display", "block") } if (a.autoHideBottomNav && a.showBottomNav) { l.css({ display: "block", left: parseInt((f.width() - u) / 2, 10) + "px" }); t.css({ display: "block", left: parseInt(l.css("left").substring(0, l.css("left").length - 2), 10) - t.width() + "px" }); w.css({ display: "block", left: parseInt(l.css("left").substring(0, l.css("left").length - 2), 10) + l.width() + parseInt(o.css("padding-left").substring(0, o.css("padding-left").length - 2), 10) + "px" }) } }); f.mouseleave(function () { e.mouseOverBanner = false; nowx = (new Date).getTime(); if (a.autoHideNavArrows && a.showNavArrows) { n.css("display", "none"); p.css("display", "none") } if (a.autoHideBottomNav && a.showBottomNav) { l.css("display", "none"); t.css("display", "none"); w.css("display", "none") } if (a.autoPlay > 0 && s > 1) { clearTimeout(e.timeoutID); e.arcInitialTime = (new Date).getTime(); var b = parseInt(a.autoPlay * 1E3 - (e.timeElapsed + nowx - e.arcInitialTime), 10); e.timeoutID = setTimeout(function () { A(1, a, e, s, q, f, v, k) }, b) } }); f.click(function () { if (c(k[e.current_img_no]).attr("data-link") != void 0 && !e.effectIsRunning && c(k[e.current_img_no]).attr("data-link") != "") { var b = a.target; c(k[e.current_img_no]).attr("data-target") != void 0 && c(k[e.current_img_no]).attr("data-target") != "" && (b = c(k[e.current_img_no]).attr("data-target")); b == "_blank" ? window.open(c(k[e.current_img_no]).attr("data-link")) : window.location = c(k[e.current_img_no]).attr("data-link") } }); n.mousedown(function () { B = true; if (!e.effectIsRunning) { clearTimeout(e.timeoutID); A(-1, a, e, s, q, f, v, k) } }); n.mouseup(function () { B = false }); p.mousedown(function () { B = true; if (!e.effectIsRunning) { clearTimeout(e.timeoutID); A(1, a, e, s, q, f, v, k) } }); p.mouseup(function () { B = false }); var y = !1; c(window).resize(function () { doResizeNow = true; if (navigator.userAgent.indexOf("Android") != -1) { if (a.windowOrientationScreenSize0 == 0 && window.orientation == 0) a.windowOrientationScreenSize0 = c(window).width(); if (a.windowOrientationScreenSize90 == 0 && window.orientation == 90) a.windowOrientationScreenSize90 = c(window).height(); if (a.windowOrientationScreenSize_90 == 0 && window.orientation == -90) a.windowOrientationScreenSize_90 = c(window).height(); a.windowOrientationScreenSize0 && (window.orientation == 0 && c(window).width() > a.windowOrientationScreenSize0) && (doResizeNow = false); a.windowOrientationScreenSize90 && (window.orientation == 90 && c(window).height() > a.windowOrientationScreenSize90) && (doResizeNow = false); a.windowOrientationScreenSize_90 && (window.orientation == -90 && c(window).height() > a.windowOrientationScreenSize_90) && (doResizeNow = false); if (e.windowWidth == 0) { doResizeNow = false; e.windowWidth = c(window).width() } } c.browser.msie && (parseInt(c.browser.version, 10) == 9 && e.windowWidth == 0) && (doResizeNow = false); if (e.windowWidth == c(window).width()) { doResizeNow = false; if (a.windowCurOrientation != window.orientation && navigator.userAgent.indexOf("Android") != -1) { a.windowCurOrientation = window.orientation; doResizeNow = true } } else e.windowWidth = c(window).width(); if (a.responsive && doResizeNow) { y !== false && clearTimeout(y); y = setTimeout(function () { var d = a, g = s, m = v, u = o, x = c("body").css("overflow"); c("body").css("overflow", "hidden"); if (d.enableTouchScreen) { responsiveWidth = b.parent().parent().parent().width(); responsiveHeight = b.parent().parent().parent().height() } else { responsiveWidth = b.parent().parent().width(); responsiveHeight = b.parent().parent().height() } if (d.responsiveRelativeToBrowser) { responsiveWidth = c(window).width(); responsiveHeight = c(window).height() } if (d.width100Proc) d.width = responsiveWidth; if (d.height100Proc) d.height = responsiveHeight; if (d.skin == "attractive") { d.isAttractiveResp = false; p.css("right", d.rightVal + "px") } if (d.origWidth != responsiveWidth || d.width100Proc) { if (d.origWidth > responsiveWidth || d.width100Proc) { d.width = responsiveWidth; d.isAttractiveResp = true; d.skin == "attractive" && p.css("right", d.rightVal - 1 + "px") } else if (!d.width100Proc) d.width = d.origWidth; if (!d.height100Proc) d.height = d.width / e.bannerRatio; d.width = parseInt(d.width, 10); d.height = parseInt(d.height, 10); if (d.enableTouchScreen && d.responsive) d.width = d.width - 1; f.width(d.width); f.height(d.height); if (r.indexOf("ipad") != -1 || r.indexOf("iphone") != -1 || r.indexOf("ipod") != -1 || r.indexOf("webos") != -1 || c.browser.msie && c.browser.version <= 7) { c("#curBgImgIos", f).attr("src", e.current_imgInside.attr("src")); c("#curBgImgIos", f).width(d.width); c("#curBgImgIos", f).height(d.height) } else !c.browser.msie || c.browser.msie && c.browser.version >= 9 ? f.css({ "-webkit-background-size": d.width + "px " + d.height + "px", "-moz-background-size": d.width + "px " + d.height + "px", "-o-background-size": d.width + "px " + d.height + "px", "-ms-background-size": d.width + "px " + d.height + "px", "background-size": d.width + "px " + d.height + "px" }) : c.browser.version == 8 && f.css({ filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + e.current_imgInside.attr("src") + "',sizingMethod='scale')" }); if (d.enableTouchScreen) { f.parent().width(d.width + 1); f.parent().height(d.height) } h.css("margin-top", parseInt((d.height - n.height()) / 2, 10) + "px"); for (i = 0; i < g; i++) c(c(k[i]).attr("data-text-id")).css("width", b.width() + "px"); l.css("left", parseInt((f.width() - l.width()) / 2, 10) + "px"); t.css("left", parseInt(l.css("left").substring(0, l.css("left").length - 2), 10) - t.width() + "px"); w.css("left", parseInt(l.css("left").substring(0, l.css("left").length - 2), 10) + l.width() + parseInt(u.css("padding-left").substring(0, u.css("padding-left").length - 2), 10) + "px"); clearTimeout(e.timeoutID); A(1, d, e, g, q, f, m, k) } c("body").css("overflow", x) }, 300) } }); var v = c(".bottomNavButtonOFF", f); v.mousedown(function () { B = true; if (!e.effectIsRunning) { var b = c(this).attr("rel"); c(v[e.current_img_no]).removeClass("bottomNavButtonON"); e.bottomNavClicked = true; e.current_img_no = b - 1; A(1, a, e, s, q, f, v, k) } }); v.mouseup(function () { B = false }); v.mouseenter(function () { var b = c(this), d = b.attr("rel"); if (a.showPreviewThumbs) { z = c('
'); b.append(z); d = c(k[d]).attr("data-bottom-thumb"); z.html('') } b.addClass("bottomNavButtonON") }); v.mouseleave(function () { var b = c(this), d = b.attr("rel"); a.showPreviewThumbs && z.remove(); e.current_img_no != d && b.removeClass("bottomNavButtonON") }); c(v[e.current_img_no]).addClass("bottomNavButtonON"); 0 < a.autoPlay && 1 < s && (a.showCircleTimer && (e.intervalID = setInterval(function () { H(e, a) }, 125)), e.timeoutID = setTimeout(function () { A(1, a, e, s, q, f, v, k) }, 1E3 * a.autoPlay)) }) }; c.fn.myReverse = [].reverse; c.fn.allinone_bannerRotator.defaults = { skin: "classic", width: 960, height: 384, width100Proc: !1, height100Proc: !1, randomizeImages: !1, firstImg: 0, numberOfStripes: 20, numberOfRows: 5, numberOfColumns: 10, defaultEffect: "random", effectDuration: 0.5, autoPlay: 4, loop: !0, target: "_blank", showAllControllers: !0, showNavArrows: !0, showOnInitNavArrows: !0, autoHideNavArrows: !0, showBottomNav: !0, showOnInitBottomNav: !0, autoHideBottomNav: !0, showPreviewThumbs: !0, enableTouchScreen: !0, absUrl: "", showCircleTimer: !0, showCircleTimerIE8IE7: !1, circleRadius: 10, circleLineWidth: 4, circleColor: "#FF0000", circleAlpha: 100, behindCircleColor: "#000000", behindCircleAlpha: 50, responsive: !1, responsiveRelativeToBrowser: !0, origWidth: 0, origHeight: 0, thumbsWrapperMarginBottom: 0, windowOrientationScreenSize0: 0, windowOrientationScreenSize90: 0, windowOrientationScreenSize_90: 0, windowCurOrientation: 0} })(jQuery); /*! * jQuery blockUI plugin * Version 2.38 (29-MAR-2011) * @requires jQuery v1.2.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2010 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Thanks to Amir-Hossein Sobhi for some excellent contributions! */ ;(function($) { if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery); return; } $.fn._fadeIn = $.fn.fadeIn; var noOp = function() {}; // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle // retarded userAgent strings on Vista) var mode = document.documentMode || 0; var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8); var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode; // global $ methods for blocking/unblocking the entire page $.blockUI = function(opts) { install(window, opts); }; $.unblockUI = function(opts) { remove(window, opts); }; // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) $.growlUI = function(title, message, timeout, onClose) { var $m = $('
'); if (title) $m.append('

'+title+'

'); if (message) $m.append('

'+message+'

'); if (timeout == undefined) timeout = 3000; $.blockUI({ message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, timeout: timeout, showOverlay: false, onUnblock: onClose, css: $.blockUI.defaults.growlCSS }); }; // plugin method for blocking element content $.fn.block = function(opts) { return this.unblock({ fadeOut: 0 }).each(function() { if ($.css(this,'position') == 'static') this.style.position = 'relative'; if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' install(this, opts); }); }; // plugin method for unblocking element content $.fn.unblock = function(opts) { return this.each(function() { remove(this, opts); }); }; $.blockUI.version = 2.38; // 2nd generation blocking at no extra cost! // override these in your code to change the default behavior and style $.blockUI.defaults = { // message displayed when blocking (use null for no message) message: '

Please wait...

', title: null, // title string; only used when theme == true draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) theme: false, // set to true to use with jQuery UI themes // styles for the message when blocking; if you wish to disable // these and use an external stylesheet then do this in your code: // $.blockUI.defaults.css = {}; css: { padding: 0, margin: 0, width: '30%', top: '40%', left: '35%', textAlign: 'center', color: '#000', border: '3px solid #aaa', backgroundColor:'#fff', cursor: 'wait' }, // minimal style set used when themes are used themedCSS: { width: '30%', top: '40%', left: '35%' }, // styles for the overlay overlayCSS: { backgroundColor: '#000', opacity: 0.6, cursor: 'wait' }, // styles applied when using $.growlUI growlCSS: { width: '350px', top: '10px', left: '', right: '10px', border: 'none', padding: '5px', opacity: 0.6, cursor: 'default', color: '#fff', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', 'border-radius': '10px' }, // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w // (hat tip to Jorge H. N. de Vasconcelos) iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', // force usage of iframe in non-IE browsers (handy for blocking applets) forceIframe: false, // z-index for the blocking overlay baseZ: 1000, // set these to true to have the message automatically centered centerX: true, // <-- only effects element blocking (page block controlled via css above) centerY: true, // allow body element to be stetched in ie6; this makes blocking look better // on "short" pages. disable if you wish to prevent changes to the body height allowBodyStretch: true, // enable if you want key and mouse events to be disabled for content that is blocked bindEvents: true, // be default blockUI will supress tab navigation from leaving blocking content // (if bindEvents is true) constrainTabKey: true, // fadeIn time in millis; set to 0 to disable fadeIn on block fadeIn: 200, // fadeOut time in millis; set to 0 to disable fadeOut on unblock fadeOut: 400, // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock timeout: 0, // disable if you don't want to show the overlay showOverlay: true, // if true, focus will be placed in the first available input field when // page blocking focusInput: true, // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) applyPlatformOpacityRules: true, // callback method invoked when fadeIn has completed and blocking message is visible onBlock: null, // callback method invoked when unblocking has completed; the callback is // passed the element that has been unblocked (which is the window object for page // blocks) and the options that were passed to the unblock call: // onUnblock(element, options) onUnblock: null, // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 quirksmodeOffsetHack: 4, // class name of the message block blockMsgClass: 'blockMsg' }; // private data and functions follow... var pageBlock = null; var pageBlockEls = []; function install(el, opts) { var full = (el == window); var msg = opts && opts.message !== undefined ? opts.message : undefined; opts = $.extend({}, $.blockUI.defaults, opts || {}); opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); var css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); msg = msg === undefined ? opts.message : msg; // remove the current block (if there is one) if (full && pageBlock) remove(window, {fadeOut:0}); // if an existing element is being used as the blocking content then we capture // its current place in the DOM (and current display style) so we can restore // it when we unblock if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { var node = msg.jquery ? msg[0] : msg; var data = {}; $(el).data('blockUI.history', data); data.el = node; data.parent = node.parentNode; data.display = node.style.display; data.position = node.style.position; if (data.parent) data.parent.removeChild(node); } var z = opts.baseZ; // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; // layer1 is the iframe layer which is used to supress bleed through of underlying content // layer2 is the overlay layer which has opacity and a wait cursor (by default) // layer3 is the message content that is displayed while blocking var lyr1 = ($.browser.msie || opts.forceIframe) ? $('') : $(''); var lyr2 = opts.theme ? $('') : $(''); var lyr3, s; if (opts.theme && full) { s = ''; } else if (opts.theme) { s = ''; } else if (full) { s = ''; } else { s = ''; } lyr3 = $(s); // if we have a message, style it if (msg) { if (opts.theme) { lyr3.css(themedCSS); lyr3.addClass('ui-widget-content'); } else lyr3.css(css); } // style the overlay if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))) lyr2.css(opts.overlayCSS); lyr2.css('position', full ? 'fixed' : 'absolute'); // make iframe layer transparent in IE if ($.browser.msie || opts.forceIframe) lyr1.css('opacity',0.0); //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); $.each(layers, function() { this.appendTo($par); }); if (opts.theme && opts.draggable && $.fn.draggable) { lyr3.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }); } // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0); if (ie6 || expr) { // give body 100% height if (full && opts.allowBodyStretch && $.boxModel) $('html,body').css('height','100%'); // fix ie6 issue when blocked element has a border width if ((ie6 || !$.boxModel) && !full) { var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); var fixT = t ? '(0 - '+t+')' : 0; var fixL = l ? '(0 - '+l+')' : 0; } // simulate fixed position $.each([lyr1,lyr2,lyr3], function(i,o) { var s = o[0].style; s.position = 'absolute'; if (i < 2) { full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"') : s.setExpression('height','this.parentNode.offsetHeight + "px"'); full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : s.setExpression('width','this.parentNode.offsetWidth + "px"'); if (fixL) s.setExpression('left', fixL); if (fixT) s.setExpression('top', fixT); } else if (opts.centerY) { if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); s.marginTop = 0; } else if (!opts.centerY && full) { var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0; var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; s.setExpression('top',expression); } }); } // show the message if (msg) { if (opts.theme) lyr3.find('.ui-widget-content').append(msg); else lyr3.append(msg); if (msg.jquery || msg.nodeType) $(msg).show(); } if (($.browser.msie || opts.forceIframe) && opts.showOverlay) lyr1.show(); // opacity is zero if (opts.fadeIn) { var cb = opts.onBlock ? opts.onBlock : noOp; var cb1 = (opts.showOverlay && !msg) ? cb : noOp; var cb2 = msg ? cb : noOp; if (opts.showOverlay) lyr2._fadeIn(opts.fadeIn, cb1); if (msg) lyr3._fadeIn(opts.fadeIn, cb2); } else { if (opts.showOverlay) lyr2.show(); if (msg) lyr3.show(); if (opts.onBlock) opts.onBlock(); } // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; pageBlockEls = $(':input:enabled:visible',pageBlock); if (opts.focusInput) setTimeout(focus, 20); } else center(lyr3[0], opts.centerX, opts.centerY); if (opts.timeout) { // auto-unblock var to = setTimeout(function() { full ? $.unblockUI(opts) : $(el).unblock(opts); }, opts.timeout); $(el).data('blockUI.timeout', to); } }; // remove the block function remove(el, opts) { var full = (el == window); var $el = $(el); var data = $el.data('blockUI.history'); var to = $el.data('blockUI.timeout'); if (to) { clearTimeout(to); $el.removeData('blockUI.timeout'); } opts = $.extend({}, $.blockUI.defaults, opts || {}); bind(0, el, opts); // unbind events var els; if (full) // crazy selector to handle odd field errors in ie6/7 els = $('body').children().filter('.blockUI').add('body > .blockUI'); else els = $('.blockUI', el); if (full) pageBlock = pageBlockEls = null; if (opts.fadeOut) { els.fadeOut(opts.fadeOut); setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); } else reset(els, data, opts, el); }; // move blocking element back into the DOM where it started function reset(els,data,opts,el) { els.each(function(i,o) { // remove via DOM calls so we don't lose event handlers if (this.parentNode) this.parentNode.removeChild(this); }); if (data && data.el) { data.el.style.display = data.display; data.el.style.position = data.position; if (data.parent) data.parent.appendChild(data.el); $(el).removeData('blockUI.history'); } if (typeof opts.onUnblock == 'function') opts.onUnblock(el,opts); }; // bind/unbind the handler function bind(b, el, opts) { var full = el == window, $el = $(el); // don't bother unbinding if there is nothing to unbind if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) return; if (!full) $el.data('blockUI.isBlocked', b); // don't bind events when overlay is not in use or if bindEvents is false if (!opts.bindEvents || (b && !opts.showOverlay)) return; // bind anchors and inputs for mouse and key events var events = 'mousedown mouseup keydown keypress'; b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler); // former impl... // var $e = $('a,:input'); // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); }; // event handler to suppress keyboard/mouse events when blocking function handler(e) { // allow tab navigation (conditionally) if (e.keyCode && e.keyCode == 9) { if (pageBlock && e.data.constrainTabKey) { var els = pageBlockEls; var fwd = !e.shiftKey && e.target === els[els.length-1]; var back = e.shiftKey && e.target === els[0]; if (fwd || back) { setTimeout(function(){focus(back)},10); return false; } } } var opts = e.data; // allow events within the message content if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0) return true; // allow events for content that is not being blocked return $(e.target).parents().children().filter('div.blockUI').length == 0; }; function focus(back) { if (!pageBlockEls) return; var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; if (e) e.focus(); }; function center(el, x, y) { var p = el.parentNode, s = el.style; var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); if (x) s.left = l > 0 ? (l+'px') : '0'; if (y) s.top = t > 0 ? (t+'px') : '0'; }; function sz(el, p) { return parseInt($.css(el,p))||0; }; })(jQuery); /* * Superfish v1.4.8 - jQuery menu widget * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt */ ;(function($){ $.fn.superfish = function(op){ var sf = $.fn.superfish, c = sf.c, $arrow = $([' »'].join('')), over = function(){ var $$ = $(this), menu = getMenu($$); clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); }, out = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; clearTimeout(menu.sfTimer); menu.sfTimer=setTimeout(function(){ o.retainPath=($.inArray($$[0],o.$path)>-1); $$.hideSuperfishUl(); if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} },o.delay); }, getMenu = function($menu){ var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; sf.op = sf.o[menu.serial]; return menu; }, addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; return this.each(function() { var s = this.serial = sf.o.length; var o = $.extend({},sf.defaults,op); o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ $(this).addClass([o.hoverClass,c.bcClass].join(' ')) .filter('li:has(ul)').removeClass(o.pathClass); }); sf.o[s] = sf.op = o; $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { if (o.autoArrows) addArrow( $('>a:first-child',this) ); }) .not('.'+c.bcClass) .hideSuperfishUl(); var $a = $('a',this); $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); }); o.onInit.call(this); }).each(function() { var menuClasses = [c.menuClass]; if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); $(this).addClass(menuClasses.join(' ')); }); }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.IE7fix = function(){ var o = sf.op; if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) this.toggleClass(sf.c.shadowClass+'-off'); }; sf.c = { bcClass : 'sf-breadcrumb', menuClass : 'sf-js-enabled', anchorClass : 'sf-with-ul', arrowClass : 'sf-sub-indicator', shadowClass : 'sf-shadow' }; sf.defaults = { hoverClass : 'sfHover', pathClass : 'overideThisToUse', pathLevels : 1, delay : 800, animation : {opacity:'show'}, speed : 'normal', autoArrows : true, dropShadows : true, disableHI : false, // true disables hoverIntent detection onInit : function(){}, // callback functions onBeforeShow: function(){}, onShow : function(){}, onHide : function(){} }; $.fn.extend({ hideSuperfishUl : function(){ var o = sf.op, not = (o.retainPath===true) ? o.$path : ''; o.retainPath = false; var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) .find('>ul').hide().css('visibility','hidden'); o.onHide.call($ul); return this; }, showSuperfishUl : function(){ var o = sf.op, sh = sf.c.shadowClass+'-off', $ul = this.addClass(o.hoverClass) .find('>ul:hidden').css('visibility','visible'); sf.IE7fix.call($ul); o.onBeforeShow.call($ul); $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); return this; } }); })(jQuery); (function ($) { $.fn.lazyload = function (options) { var settings = { threshold: 0, failurelimit: 0, event: "scroll", effect: "show", container: window }; if (options) { $.extend(settings, options); } var elements = this; if ("scroll" == settings.event) { $(settings.container).bind("scroll", function (event) { var counter = 0; elements.each(function () { if ($.abovethetop(this, settings) || $.leftofbegin(this, settings)) { } else if (!$.belowthefold(this, settings) && !$.rightoffold(this, settings)) { $(this).trigger("appear"); } else { if (counter++ > settings.failurelimit) { return false; } } }); var temp = $.grep(elements, function (element) { return !element.loaded; }); elements = $(temp); }); } this.each(function () { var self = this; if (undefined == $(self).attr("original")) { $(self).attr("original", $(self).attr("src")); } if ("scroll" != settings.event || undefined == $(self).attr("src") || settings.placeholder == $(self).attr("src") || ($.abovethetop(self, settings) || $.leftofbegin(self, settings) || $.belowthefold(self, settings) || $.rightoffold(self, settings))) { if (settings.placeholder) { $(self).attr("src", settings.placeholder); } else { $(self).removeAttr("src"); } self.loaded = false; } else { self.loaded = true; } $(self).one("appear", function () { if (!this.loaded) { $("").bind("load", function () { $(self).hide().attr("src", $(self).attr("original")) [settings.effect](settings.effectspeed); self.loaded = true; }).attr("src", $(self).attr("original")); }; }); if ("scroll" != settings.event) { $(self).bind(settings.event, function (event) { if (!self.loaded) { $(self).trigger("appear"); } }); } }); $(settings.container).trigger(settings.event); return this; }; $.belowthefold = function (element, settings) { if (settings.container === undefined || settings.container === window) { var fold = $(window).height() + $(window).scrollTop(); } else { var fold = $(settings.container).offset().top + $(settings.container).height(); } return fold <= $(element).offset().top - settings.threshold; }; $.rightoffold = function (element, settings) { if (settings.container === undefined || settings.container === window) { var fold = $(window).width() + $(window).scrollLeft(); } else { var fold = $(settings.container).offset().left + $(settings.container).width(); } return fold <= $(element).offset().left - settings.threshold; }; $.abovethetop = function (element, settings) { if (settings.container === undefined || settings.container === window) { var fold = $(window).scrollTop(); } else { var fold = $(settings.container).offset().top; } return fold >= $(element).offset().top + settings.threshold + $(element).height(); }; $.leftofbegin = function (element, settings) { if (settings.container === undefined || settings.container === window) { var fold = $(window).scrollLeft(); } else { var fold = $(settings.container).offset().left; } return fold >= $(element).offset().left + settings.threshold + $(element).width(); }; $.extend($.expr[':'], { "below-the-fold": "$.belowthefold(a, {threshold : 0, container: window})", "above-the-fold": "!$.belowthefold(a, {threshold : 0, container: window})", "right-of-fold": "$.rightoffold(a, {threshold : 0, container: window})", "left-of-fold": "!$.rightoffold(a, {threshold : 0, container: window})" }); })(jQuery); /* |-------------------------------------------------------------------------- | UItoTop jQuery Plugin 1.1 | http://www.mattvarone.com/web-design/uitotop-jquery-plugin/ |-------------------------------------------------------------------------- */ (function ($) { $.fn.UItoTop = function (options) { var defaults = { text: 'To Top', min: 200, inDelay: 600, outDelay: 400, containerID: 'toTop', containerHoverID: 'toTopHover', scrollSpeed: 1200, easingType: 'linear' }; var settings = $.extend(defaults, options); var containerIDhash = '#' + settings.containerID; var containerHoverIDHash = '#' + settings.containerHoverID; $('body').append('' + settings.text + ''); $(containerIDhash).hide().click(function () { $('html, body').animate({ scrollTop: 0 }, settings.scrollSpeed, settings.easingType); $('#' + settings.containerHoverID, this).stop().animate({ 'opacity': 0 }, settings.inDelay, settings.easingType); return false; }) .prepend('') .hover(function () { $(containerHoverIDHash, this).stop().animate({ 'opacity': 1 }, 600, 'linear'); }, function () { $(containerHoverIDHash, this).stop().animate({ 'opacity': 0 }, 700, 'linear'); }); $(window).scroll(function () { var sd = $(window).scrollTop(); if (typeof document.body.style.maxHeight === "undefined") { $(containerIDhash).css({ 'position': 'absolute', 'top': $(window).scrollTop() + $(window).height() - 50 }); } if (sd > settings.min) $(containerIDhash).fadeIn(settings.inDelay); else $(containerIDhash).fadeOut(settings.Outdelay); }); }; })(jQuery); /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); /*! jQuery.kinetic v1.5 Dave Taylor http://the-taylors.org/jquery.kinetic The MIT License (MIT) Copyright (c) <2011> */ /*global define,require */ (function ($) { 'use strict'; var DEFAULT_SETTINGS = { decelerate: true , triggerHardware: false , y: true , x: true , slowdown: 0.9 , maxvelocity: 40 , throttleFPS: 60 , movingClass: { up: 'kinetic-moving-up' , down: 'kinetic-moving-down' , left: 'kinetic-moving-left' , right: 'kinetic-moving-right' } , deceleratingClass: { up: 'kinetic-decelerating-up' , down: 'kinetic-decelerating-down' , left: 'kinetic-decelerating-left' , right: 'kinetic-decelerating-right' } }, SETTINGS_KEY = 'kinetic-settings', ACTIVE_CLASS = 'kinetic-active'; /** * Provides requestAnimationFrame in a cross browser way. * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ */ if (!window.requestAnimationFrame) { window.requestAnimationFrame = (function () { return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function ( /* function FrameRequestCallback */callback, /* DOMElement Element */element) { window.setTimeout(callback, 1000 / 60); }; } ()); } // add touch checker to jQuery.support $.support = $.support || {}; $.extend($.support, { touch: "ontouchend" in document }); var selectStart = function () { return false; }; var decelerateVelocity = function (velocity, slowdown) { return Math.floor(Math.abs(velocity)) === 0 ? 0 // is velocity less than 1? : velocity * slowdown; // reduce slowdown }; var capVelocity = function (velocity, max) { var newVelocity = velocity; if (velocity > 0) { if (velocity > max) { newVelocity = max; } } else { if (velocity < (0 - max)) { newVelocity = (0 - max); } } return newVelocity; }; var setMoveClasses = function (settings, classes) { this.removeClass(settings.movingClass.up) .removeClass(settings.movingClass.down) .removeClass(settings.movingClass.left) .removeClass(settings.movingClass.right) .removeClass(settings.deceleratingClass.up) .removeClass(settings.deceleratingClass.down) .removeClass(settings.deceleratingClass.left) .removeClass(settings.deceleratingClass.right); if (settings.velocity > 0) { this.addClass(classes.right); } if (settings.velocity < 0) { this.addClass(classes.left); } if (settings.velocityY > 0) { this.addClass(classes.down); } if (settings.velocityY < 0) { this.addClass(classes.up); } }; var stop = function ($scroller, settings) { if (typeof settings.stopped === 'function') { settings.stopped.call($scroller, settings); } }; /** do the actual kinetic movement */ var move = function ($scroller, settings) { var scroller = $scroller[0]; // set scrollLeft if (settings.x && scroller.scrollWidth > 0) { scroller.scrollLeft = settings.scrollLeft = scroller.scrollLeft + settings.velocity; if (Math.abs(settings.velocity) > 0) { settings.velocity = settings.decelerate ? decelerateVelocity(settings.velocity, settings.slowdown) : settings.velocity; } } else { settings.velocity = 0; } // set scrollTop if (settings.y && scroller.scrollHeight > 0) { scroller.scrollTop = settings.scrollTop = scroller.scrollTop + settings.velocityY; if (Math.abs(settings.velocityY) > 0) { settings.velocityY = settings.decelerate ? decelerateVelocity(settings.velocityY, settings.slowdown) : settings.velocityY; } } else { settings.velocityY = 0; } setMoveClasses.call($scroller, settings, settings.deceleratingClass); if (typeof settings.moved === 'function') { settings.moved.call($scroller, settings); } if (Math.abs(settings.velocity) > 0 || Math.abs(settings.velocityY) > 0) { // tick for next movement window.requestAnimationFrame(function () { move($scroller, settings); }); } else { stop($scroller, settings); } }; var callOption = function (method, options) { var methodFn = $.kinetic.callMethods[method] , args = Array.prototype.slice.call(arguments) ; if (methodFn) { this.each(function () { var opts = args.slice(1), settings = $(this).data(SETTINGS_KEY); opts.unshift(settings); methodFn.apply(this, opts); }); } }; var attachListeners = function ($this, settings) { var element = $this[0]; if ($.support.touch) { element.addEventListener('touchstart', settings.events.touchStart, false); element.addEventListener('touchend', settings.events.inputEnd, false); element.addEventListener('touchmove', settings.events.touchMove, false); } else { $this .mousedown(settings.events.inputDown) .mouseup(settings.events.inputEnd) .mousemove(settings.events.inputMove); } $this.click(settings.events.inputClick) .bind("selectstart", selectStart); // prevent selection when dragging $this.bind('dragstart', settings.events.dragStart); }; var detachListeners = function ($this, settings) { var element = $this[0]; if ($.support.touch) { element.removeEventListener('touchstart', settings.events.touchStart, false); element.removeEventListener('touchend', settings.events.inputEnd, false); element.removeEventListener('touchmove', settings.events.touchMove, false); } else { $this .unbind('mousedown', settings.events.inputDown) .unbind('mouseup', settings.events.inputEnd) .unbind('mousemove', settings.events.inputMove); } $this.unbind('click', settings.events.inputClick) .unbind("selectstart", selectStart); // prevent selection when dragging $this.unbind('dragstart', settings.events.dragStart); }; var initElements = function (options) { this .addClass(ACTIVE_CLASS) .each(function () { var settings = $.extend({}, DEFAULT_SETTINGS, options); var self = this , $this = $(this) , xpos , prevXPos = false , ypos , prevYPos = false , mouseDown = false , scrollLeft , scrollTop , throttleTimeout = 1000 / settings.throttleFPS , lastMove , elementFocused ; settings.velocity = 0; settings.velocityY = 0; // make sure we reset everything when mouse up var resetMouse = function () { xpos = false; ypos = false; mouseDown = false; }; $(document).mouseup(resetMouse).click(resetMouse); var calculateVelocities = function () { settings.velocity = capVelocity(prevXPos - xpos, settings.maxvelocity); settings.velocityY = capVelocity(prevYPos - ypos, settings.maxvelocity); }; var useTarget = function (target) { if ($.isFunction(settings.filterTarget)) { return settings.filterTarget.call(self, target) !== false; } return true; }; var start = function (clientX, clientY) { mouseDown = true; settings.velocity = prevXPos = 0; settings.velocityY = prevYPos = 0; xpos = clientX; ypos = clientY; }; var end = function () { if (xpos && prevXPos && settings.decelerate === false) { settings.decelerate = true; calculateVelocities(); xpos = prevXPos = mouseDown = false; move($this, settings); } }; var inputmove = function (clientX, clientY) { if (!lastMove || new Date() > new Date(lastMove.getTime() + throttleTimeout)) { lastMove = new Date(); if (mouseDown && (xpos || ypos)) { if (elementFocused) { $(elementFocused).blur(); elementFocused = null; $this.focus(); } settings.decelerate = false; settings.velocity = settings.velocityY = 0; $this[0].scrollLeft = settings.scrollLeft = settings.x ? $this[0].scrollLeft - (clientX - xpos) : $this[0].scrollLeft; $this[0].scrollTop = settings.scrollTop = settings.y ? $this[0].scrollTop - (clientY - ypos) : $this[0].scrollTop; prevXPos = xpos; prevYPos = ypos; xpos = clientX; ypos = clientY; calculateVelocities(); setMoveClasses.call($this, settings, settings.movingClass); if (typeof settings.moved === 'function') { settings.moved.call($this, settings); } } } }; // Events settings.events = { touchStart: function (e) { if (useTarget(e.target)) { start(e.touches[0].clientX, e.touches[0].clientY); e.stopPropagation(); } }, touchMove: function (e) { if (mouseDown) { inputmove(e.touches[0].clientX, e.touches[0].clientY); if (e.preventDefault) { e.preventDefault(); } } }, inputDown: function (e) { if (useTarget(e.target)) { start(e.clientX, e.clientY); elementFocused = e.target; if (e.target.nodeName === 'IMG') { e.preventDefault(); } e.stopPropagation(); } }, inputEnd: function (e) { end(); elementFocused = null; if (e.preventDefault) { e.preventDefault(); } }, inputMove: function (e) { if (mouseDown) { inputmove(e.clientX, e.clientY); if (e.preventDefault) { e.preventDefault(); } } }, inputClick: function (e) { if (Math.abs(settings.velocity) > 0) { e.preventDefault(); return false; } }, // prevent drag and drop images in ie dragStart: function (e) { if (elementFocused) { return false; } } }; attachListeners($this, settings); $this.data(SETTINGS_KEY, settings).css("cursor", "move"); if (settings.triggerHardware) { $this.css('-webkit-transform', 'translate3d(0,0,0)'); } }); }; $.kinetic = { settingsKey: SETTINGS_KEY, callMethods: { start: function (settings, options) { var $this = $(this); settings = $.extend(settings, options); if (settings) { settings.decelerate = false; move($this, settings); } }, end: function (settings, options) { var $this = $(this); if (settings) { settings.decelerate = true; } }, stop: function (settings, options) { settings.velocity = 0; settings.velocityY = 0; settings.decelerate = true; }, detach: function (settings, options) { var $this = $(this); detachListeners($this, settings); $this .removeClass(ACTIVE_CLASS) .css("cursor", ""); }, attach: function (settings, options) { var $this = $(this); attachListeners($this, settings); $this .addClass(ACTIVE_CLASS) .css("cursor", "move"); } } }; $.fn.kinetic = function (options) { if (typeof options === 'string') { callOption.apply(this, arguments); } else { initElements.call(this, options); } return this; }; } (window.jQuery || window.Zepto)); (function($){$.widget("thomaskahn.smoothDivScroll",{options:{scrollingHotSpotLeftClass:"scrollingHotSpotLeft",scrollingHotSpotRightClass:"scrollingHotSpotRight",scrollableAreaClass:"scrollableArea",scrollWrapperClass:"scrollWrapper",hiddenOnStart:false,getContentOnLoad:{},countOnlyClass:"",startAtElementId:"",hotSpotScrolling:true,hotSpotScrollingStep:15,hotSpotScrollingInterval:10,hotSpotMouseDownSpeedBooster:3,visibleHotSpotBackgrounds:"hover",hotSpotsVisibleTime:5000,easingAfterHotSpotScrolling:true,easingAfterHotSpotScrollingDistance:10,easingAfterHotSpotScrollingDuration:300,easingAfterHotSpotScrollingFunction:"easeOutQuart",mousewheelScrolling:"",mousewheelScrollingStep:70,easingAfterMouseWheelScrolling:true,easingAfterMouseWheelScrollingDuration:300,easingAfterMouseWheelScrollingFunction:"easeOutQuart",manualContinuousScrolling:false,autoScrollingMode:"",autoScrollingDirection:"endlessLoopRight",autoScrollingStep:1,autoScrollingInterval:10,touchScrolling:false,scrollToAnimationDuration:1000,scrollToEasingFunction:"easeOutQuart"},_create:function(){var self=this,o=this.options,el=this.element;el.data("scrollWrapper",el.find("."+o.scrollWrapperClass));el.data("scrollingHotSpotRight",el.find("."+o.scrollingHotSpotRightClass));el.data("scrollingHotSpotLeft",el.find("."+o.scrollingHotSpotLeftClass));el.data("scrollableArea",el.find("."+o.scrollableAreaClass));if(el.data("scrollingHotSpotRight").length>0){el.data("scrollingHotSpotRight").detach()}if(el.data("scrollingHotSpotLeft").length>0){el.data("scrollingHotSpotLeft").detach()}if(el.data("scrollableArea").length===0&&el.data("scrollWrapper").length===0){el.wrapInner("
").wrapInner("
");el.data("scrollWrapper",el.find("."+o.scrollWrapperClass));el.data("scrollableArea",el.find("."+o.scrollableAreaClass))}else if(el.data("scrollWrapper").length===0){el.wrapInner("
");el.data("scrollWrapper",el.find("."+o.scrollWrapperClass))}else if(el.data("scrollableArea").length===0){el.data("scrollWrapper").wrapInner("
");el.data("scrollableArea",el.find("."+o.scrollableAreaClass))}if(el.data("scrollingHotSpotRight").length===0){el.prepend("
");el.data("scrollingHotSpotRight",el.find("."+o.scrollingHotSpotRightClass))}else{el.prepend(el.data("scrollingHotSpotRight"))}if(el.data("scrollingHotSpotLeft").length===0){el.prepend("
");el.data("scrollingHotSpotLeft",el.find("."+o.scrollingHotSpotLeftClass))}else{el.prepend(el.data("scrollingHotSpotLeft"))}el.data("speedBooster",1);el.data("scrollXPos",0);el.data("hotSpotWidth",el.data("scrollingHotSpotLeft").innerWidth());el.data("scrollableAreaWidth",0);el.data("startingPosition",0);el.data("rightScrollingInterval",null);el.data("leftScrollingInterval",null);el.data("autoScrollingInterval",null);el.data("hideHotSpotBackgroundsInterval",null);el.data("previousScrollLeft",0);el.data("pingPongDirection","right");el.data("getNextElementWidth",true);el.data("swapAt",null);el.data("startAtElementHasNotPassed",true);el.data("swappedElement",null);el.data("originalElements",el.data("scrollableArea").children(o.countOnlyClass));el.data("visible",true);el.data("enabled",true);el.data("scrollableAreaHeight",el.data("scrollableArea").height());el.data("scrollerOffset",el.offset());if(o.touchScrolling&&el.data("enabled")){el.data("scrollWrapper").kinetic({y:false,moved:function(settings){if(o.manualContinuousScrolling){if(el.data("scrollWrapper").scrollLeft()<=0){self._checkContinuousSwapLeft()}else{self._checkContinuousSwapRight()}}},stopped:function(settings){el.data("scrollWrapper").stop(true,false);self.stopAutoScrolling()}})}el.data("scrollingHotSpotRight").bind("mousemove",function(e){if(o.hotSpotScrolling){var x=e.pageX-(this.offsetLeft+el.data("scrollerOffset").left);el.data("scrollXPos",Math.round((x/el.data("hotSpotWidth"))*o.hotSpotScrollingStep));if(el.data("scrollXPos")===Infinity||el.data("scrollXPos")<1){el.data("scrollXPos",1)}}});el.data("scrollingHotSpotRight").bind("mouseover",function(){if(o.hotSpotScrolling){el.data("scrollWrapper").stop(true,false);self.stopAutoScrolling();el.data("rightScrollingInterval",setInterval(function(){if(el.data("scrollXPos")>0&&el.data("enabled")){el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+(el.data("scrollXPos")*el.data("speedBooster")));if(o.manualContinuousScrolling){self._checkContinuousSwapRight()}self._showHideHotSpots()}},o.hotSpotScrollingInterval));self._trigger("mouseOverRightHotSpot")}});el.data("scrollingHotSpotRight").bind("mouseout",function(){if(o.hotSpotScrolling){clearInterval(el.data("rightScrollingInterval"));el.data("scrollXPos",0);if(o.easingAfterHotSpotScrolling&&el.data("enabled")){el.data("scrollWrapper").animate({scrollLeft:el.data("scrollWrapper").scrollLeft()+o.easingAfterHotSpotScrollingDistance},{duration:o.easingAfterHotSpotScrollingDuration,easing:o.easingAfterHotSpotScrollingFunction})}}});el.data("scrollingHotSpotRight").bind("mousedown",function(){el.data("speedBooster",o.hotSpotMouseDownSpeedBooster)});$("body").bind("mouseup",function(){el.data("speedBooster",1)});el.data("scrollingHotSpotLeft").bind("mousemove",function(e){if(o.hotSpotScrolling){var x=((this.offsetLeft+el.data("scrollerOffset").left+el.data("hotSpotWidth"))-e.pageX);el.data("scrollXPos",Math.round((x/el.data("hotSpotWidth"))*o.hotSpotScrollingStep));if(el.data("scrollXPos")===Infinity||el.data("scrollXPos")<1){el.data("scrollXPos",1)}}});el.data("scrollingHotSpotLeft").bind("mouseover",function(){if(o.hotSpotScrolling){el.data("scrollWrapper").stop(true,false);self.stopAutoScrolling();el.data("leftScrollingInterval",setInterval(function(){if(el.data("scrollXPos")>0&&el.data("enabled")){el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-(el.data("scrollXPos")*el.data("speedBooster")));if(o.manualContinuousScrolling){self._checkContinuousSwapLeft()}self._showHideHotSpots()}},o.hotSpotScrollingInterval));self._trigger("mouseOverLeftHotSpot")}});el.data("scrollingHotSpotLeft").bind("mouseout",function(){if(o.hotSpotScrolling){clearInterval(el.data("leftScrollingInterval"));el.data("scrollXPos",0);if(o.easingAfterHotSpotScrolling&&el.data("enabled")){el.data("scrollWrapper").animate({scrollLeft:el.data("scrollWrapper").scrollLeft()-o.easingAfterHotSpotScrollingDistance},{duration:o.easingAfterHotSpotScrollingDuration,easing:o.easingAfterHotSpotScrollingFunction})}}});el.data("scrollingHotSpotLeft").bind("mousedown",function(){el.data("speedBooster",o.hotSpotMouseDownSpeedBooster)});el.data("scrollableArea").mousewheel(function(event,delta,deltaX,deltaY){if(el.data("enabled")&&o.mousewheelScrolling.length>0){var pixels;if(o.mousewheelScrolling==="vertical"&&deltaY!==0){self.stopAutoScrolling();event.preventDefault();pixels=Math.round((o.mousewheelScrollingStep*deltaY)*-1);self.move(pixels)}else if(o.mousewheelScrolling==="horizontal"&&deltaX!==0){self.stopAutoScrolling();event.preventDefault();pixels=Math.round((o.mousewheelScrollingStep*deltaX)*-1);self.move(pixels)}else if(o.mousewheelScrolling==="allDirections"){self.stopAutoScrolling();event.preventDefault();pixels=Math.round((o.mousewheelScrollingStep*delta)*-1);self.move(pixels)}}});if(o.mousewheelScrolling){el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).mousewheel(function(event){event.preventDefault()})}$(window).bind("resize",function(){self._showHideHotSpots();self._trigger("windowResized")});if(!(jQuery.isEmptyObject(o.getContentOnLoad))){self[o.getContentOnLoad.method](o.getContentOnLoad.content,o.getContentOnLoad.manipulationMethod,o.getContentOnLoad.addWhere,o.getContentOnLoad.filterTag)}if(o.hiddenOnStart){self.hide()}$(window).load(function(){if(!(o.hiddenOnStart)){self.recalculateScrollableArea()}if((o.autoScrollingMode.length>0)&&!(o.hiddenOnStart)){self.startAutoScrolling()}if(o.autoScrollingMode!=="always"){switch(o.visibleHotSpotBackgrounds){case"always":self.showHotSpotBackgrounds();break;case"onStart":self.showHotSpotBackgrounds();el.data("hideHotSpotBackgroundsInterval",setTimeout(function(){self.hideHotSpotBackgrounds(250)},o.hotSpotsVisibleTime));break;case"hover":el.mouseenter(function(event){if(o.hotSpotScrolling){event.stopPropagation();self.showHotSpotBackgrounds(250)}}).mouseleave(function(event){if(o.hotSpotScrolling){event.stopPropagation();self.hideHotSpotBackgrounds(250)}});break;default:break}}self._showHideHotSpots();self._trigger("setupComplete")})},_setOption:function(key,value){var self=this,o=this.options,el=this.element;o[key]=value;if(key==="hotSpotScrolling"){if(value===true){self._showHideHotSpots()}else{el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").hide()}}else if(key==="autoScrollingStep"||key==="easingAfterHotSpotScrollingDistance"||key==="easingAfterHotSpotScrollingDuration"||key==="easingAfterMouseWheelScrollingDuration"){o[key]=parseInt(value,10)}else if(key==="autoScrollingInterval"){o[key]=parseInt(value,10);self.startAutoScrolling()}},showHotSpotBackgrounds:function(fadeSpeed){var self=this,el=this.element,o=this.option;if(fadeSpeed!==undefined){el.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");el.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).fadeTo(fadeSpeed,0.35)}else{el.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");el.data("scrollingHotSpotLeft").removeAttr("style");el.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");el.data("scrollingHotSpotRight").removeAttr("style")}self._showHideHotSpots()},hideHotSpotBackgrounds:function(fadeSpeed){var el=this.element,o=this.option;if(fadeSpeed!==undefined){el.data("scrollingHotSpotLeft").fadeTo(fadeSpeed,0.0,function(){el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible")});el.data("scrollingHotSpotRight").fadeTo(fadeSpeed,0.0,function(){el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible")})}else{el.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible").removeAttr("style");el.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible").removeAttr("style")}},_showHideHotSpots:function(){var self=this,el=this.element,o=this.options;if(!(o.hotSpotScrolling)){el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").hide()}else{if(o.manualContinuousScrolling&&o.hotSpotScrolling&&o.autoScrollingMode!=="always"){el.data("scrollingHotSpotLeft").show();el.data("scrollingHotSpotRight").show()}else if(o.autoScrollingMode!=="always"&&o.hotSpotScrolling){if(el.data("scrollableAreaWidth")<=(el.data("scrollWrapper").innerWidth())){el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").hide()}else if(el.data("scrollWrapper").scrollLeft()===0){el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").show();self._trigger("scrollerLeftLimitReached");clearInterval(el.data("leftScrollingInterval"));el.data("leftScrollingInterval",null)}else if(el.data("scrollableAreaWidth")<=(el.data("scrollWrapper").innerWidth()+el.data("scrollWrapper").scrollLeft())){el.data("scrollingHotSpotLeft").show();el.data("scrollingHotSpotRight").hide();self._trigger("scrollerRightLimitReached");clearInterval(el.data("rightScrollingInterval"));el.data("rightScrollingInterval",null)}else{el.data("scrollingHotSpotLeft").show();el.data("scrollingHotSpotRight").show()}}else{el.data("scrollingHotSpotLeft").hide();el.data("scrollingHotSpotRight").hide()}}},_setElementScrollPosition:function(method,element){var el=this.element,o=this.options,tempScrollPosition=0;switch(method){case"first":el.data("scrollXPos",0);return true;case"start":if(o.startAtElementId!==""){if(el.data("scrollableArea").has("#"+o.startAtElementId)){tempScrollPosition=$("#"+o.startAtElementId).position().left;el.data("scrollXPos",tempScrollPosition);return true}}return false;case"last":el.data("scrollXPos",(el.data("scrollableAreaWidth")-el.data("scrollWrapper").innerWidth()));return true;case"number":if(!(isNaN(element))){tempScrollPosition=el.data("scrollableArea").children(o.countOnlyClass).eq(element-1).position().left;el.data("scrollXPos",tempScrollPosition);return true}return false;case"id":if(element.length>0){if(el.data("scrollableArea").has("#"+element)){tempScrollPosition=$("#"+element).position().left;el.data("scrollXPos",tempScrollPosition);return true}}return false;default:return false}},jumpToElement:function(jumpTo,element){var self=this,el=this.element;if(el.data("enabled")){if(self._setElementScrollPosition(jumpTo,element)){el.data("scrollWrapper").scrollLeft(el.data("scrollXPos"));self._showHideHotSpots();switch(jumpTo){case"first":self._trigger("jumpedToFirstElement");break;case"start":self._trigger("jumpedToStartElement");break;case"last":self._trigger("jumpedToLastElement");break;case"number":self._trigger("jumpedToElementNumber",null,{"elementNumber":element});break;case"id":self._trigger("jumpedToElementId",null,{"elementId":element});break;default:break}}}},scrollToElement:function(scrollTo,element){var self=this,el=this.element,o=this.options,autoscrollingWasRunning=false;if(el.data("enabled")){if(self._setElementScrollPosition(scrollTo,element)){if(el.data("autoScrollingInterval")!==null){self.stopAutoScrolling();autoscrollingWasRunning=true}el.data("scrollWrapper").stop(true,false);el.data("scrollWrapper").animate({scrollLeft:el.data("scrollXPos")},{duration:o.scrollToAnimationDuration,easing:o.scrollToEasingFunction,complete:function(){if(autoscrollingWasRunning){self.startAutoScrolling()}self._showHideHotSpots();switch(scrollTo){case"first":self._trigger("scrolledToFirstElement");break;case"start":self._trigger("scrolledToStartElement");break;case"last":self._trigger("scrolledToLastElement");break;case"number":self._trigger("scrolledToElementNumber",null,{"elementNumber":element});break;case"id":self._trigger("scrolledToElementId",null,{"elementId":element});break;default:break}}})}}},move:function(pixels){var self=this,el=this.element,o=this.options;el.data("scrollWrapper").stop(true,true);if((pixels<0&&el.data("scrollWrapper").scrollLeft()>0)||(pixels>0&&el.data("scrollableAreaWidth")>(el.data("scrollWrapper").innerWidth()+el.data("scrollWrapper").scrollLeft()))){if(o.easingAfterMouseWheelScrolling){el.data("scrollWrapper").animate({scrollLeft:el.data("scrollWrapper").scrollLeft()+pixels},{duration:o.easingAfterMouseWheelScrollingDuration,easing:o.easingAfterMouseWheelFunction,complete:function(){self._showHideHotSpots();if(o.manualContinuousScrolling){if(pixels>0){self._checkContinuousSwapRight()}else{self._checkContinuousSwapLeft()}}}})}else{el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+pixels);self._showHideHotSpots();if(o.manualContinuousScrolling){if(pixels>0){self._checkContinuousSwapRight()}else{self._checkContinuousSwapLeft()}}}}},getFlickrContent:function(content,manipulationMethod){var self=this,el=this.element;$.getJSON(content,function(data){var flickrImageSizes=[{size:"small square",pixels:75,letter:"_s"},{size:"thumbnail",pixels:100,letter:"_t"},{size:"small",pixels:240,letter:"_m"},{size:"medium",pixels:500,letter:""},{size:"medium 640",pixels:640,letter:"_z"},{size:"large",pixels:1024,letter:"_b"}];var loadedFlickrImages=[];var imageIdStringBuffer=[];var startingIndex;var numberOfFlickrItems=data.items.length;var loadedFlickrImagesCounter=0;if(el.data("scrollableAreaHeight")<=75){startingIndex=0}else if(el.data("scrollableAreaHeight")<=100){startingIndex=1}else if(el.data("scrollableAreaHeight")<=240){startingIndex=2}else if(el.data("scrollableAreaHeight")<=500){startingIndex=3}else if(el.data("scrollableAreaHeight")<=640){startingIndex=4}else{startingIndex=5}$.each(data.items,function(index,item){loadFlickrImage(item,startingIndex)});function loadFlickrImage(item,sizeIndex){var path=item.media.m;var imgSrc=path.replace("_m",flickrImageSizes[sizeIndex].letter);var tempImg=$("").attr("src",imgSrc);tempImg.load(function(){if(this.height0){filteredContent=$("
").html(data).find(filterTag)}else{filteredContent=content}}else{filteredContent=data}switch(manipulationMethod){case"addFirst":el.data("scrollableArea").children(":first").before(filteredContent);break;case"addLast":el.data("scrollableArea").children(":last").after(filteredContent);break;default:el.data("scrollableArea").html(filteredContent);break}self.recalculateScrollableArea();self._showHideHotSpots();self._trigger("addedAjaxContent")})},getHtmlContent:function(content,manipulationMethod,filterTag){var self=this,el=this.element;var filteredContent;if(filterTag!==undefined){if(filterTag.length>0){filteredContent=$("
").html(content).find(filterTag)}else{filteredContent=content}}else{filteredContent=content}switch(manipulationMethod){case"addFirst":el.data("scrollableArea").children(":first").before(filteredContent);break;case"addLast":el.data("scrollableArea").children(":last").after(filteredContent);break;default:el.data("scrollableArea").html(filteredContent);break}self.recalculateScrollableArea();self._showHideHotSpots();self._trigger("addedHtmlContent")},recalculateScrollableArea:function(){var tempScrollableAreaWidth=0,foundStartAtElement=false,o=this.options,el=this.element;el.data("scrollableArea").children(o.countOnlyClass).each(function(){if((o.startAtElementId.length>0)&&(($(this).attr("id"))===o.startAtElementId)){el.data("startingPosition",tempScrollableAreaWidth);foundStartAtElement=true}tempScrollableAreaWidth=tempScrollableAreaWidth+$(this).outerWidth(true)});if(!(foundStartAtElement)){el.data("startAtElementId","")}el.data("scrollableAreaWidth",tempScrollableAreaWidth);el.data("scrollableArea").width(el.data("scrollableAreaWidth"));el.data("scrollWrapper").scrollLeft(el.data("startingPosition"));el.data("scrollXPos",el.data("startingPosition"))},getScrollerOffset:function(){var el=this.element;return el.data("scrollWrapper").scrollLeft()},stopAutoScrolling:function(){var self=this,el=this.element;if(el.data("autoScrollingInterval")!==null){clearInterval(el.data("autoScrollingInterval"));el.data("autoScrollingInterval",null);self._showHideHotSpots();self._trigger("autoScrollingStopped")}},startAutoScrolling:function(){var self=this,el=this.element,o=this.options;if(el.data("enabled")){self._showHideHotSpots();clearInterval(el.data("autoScrollingInterval"));el.data("autoScrollingInterval",null);self._trigger("autoScrollingStarted");el.data("autoScrollingInterval",setInterval(function(){if(!(el.data("visible"))||(el.data("scrollableAreaWidth")<=(el.data("scrollWrapper").innerWidth()))){clearInterval(el.data("autoScrollingInterval"));el.data("autoScrollingInterval",null)}else{el.data("previousScrollLeft",el.data("scrollWrapper").scrollLeft());switch(o.autoScrollingDirection){case"right":el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+o.autoScrollingStep);if(el.data("previousScrollLeft")===el.data("scrollWrapper").scrollLeft()){self._trigger("autoScrollingRightLimitReached");clearInterval(el.data("autoScrollingInterval"));el.data("autoScrollingInterval",null);self._trigger("autoScrollingIntervalStopped")}break;case"left":el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-o.autoScrollingStep);if(el.data("previousScrollLeft")===el.data("scrollWrapper").scrollLeft()){self._trigger("autoScrollingLeftLimitReached");clearInterval(el.data("autoScrollingInterval"));el.data("autoScrollingInterval",null);self._trigger("autoScrollingIntervalStopped")}break;case"backAndForth":if(el.data("pingPongDirection")==="right"){el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+(o.autoScrollingStep))}else{el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-(o.autoScrollingStep))}if(el.data("previousScrollLeft")===el.data("scrollWrapper").scrollLeft()){if(el.data("pingPongDirection")==="right"){el.data("pingPongDirection","left");self._trigger("autoScrollingRightLimitReached")}else{el.data("pingPongDirection","right");self._trigger("autoScrollingLeftLimitReached")}}break;case"endlessLoopRight":el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+o.autoScrollingStep);self._checkContinuousSwapRight();break;case"endlessLoopLeft":el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()-o.autoScrollingStep);self._checkContinuousSwapLeft();break;default:break}}},o.autoScrollingInterval))}},_checkContinuousSwapRight:function(){var el=this.element,o=this.options;if(el.data("getNextElementWidth")){if((o.startAtElementId.length>0)&&(el.data("startAtElementHasNotPassed"))){el.data("swapAt",$("#"+o.startAtElementId).outerWidth(true));el.data("startAtElementHasNotPassed",false)}else{el.data("swapAt",el.data("scrollableArea").children(":first").outerWidth(true))}el.data("getNextElementWidth",false)}if(el.data("swapAt")<=el.data("scrollWrapper").scrollLeft()){el.data("swappedElement",el.data("scrollableArea").children(":first").detach());el.data("scrollableArea").append(el.data("swappedElement"));var wrapperLeft=el.data("scrollWrapper").scrollLeft();el.data("scrollWrapper").scrollLeft(wrapperLeft-el.data("swappedElement").outerWidth(true));el.data("getNextElementWidth",true)}},_checkContinuousSwapLeft:function(){var el=this.element,o=this.options;if(el.data("getNextElementWidth")){if((o.startAtElementId.length>0)&&(el.data("startAtElementHasNotPassed"))){el.data("swapAt",$("#"+o.startAtElementId).outerWidth(true));el.data("startAtElementHasNotPassed",false)}else{el.data("swapAt",el.data("scrollableArea").children(":first").outerWidth(true))}el.data("getNextElementWidth",false)}if(el.data("scrollWrapper").scrollLeft()===0){el.data("swappedElement",el.data("scrollableArea").children(":last").detach());el.data("scrollableArea").prepend(el.data("swappedElement"));el.data("scrollWrapper").scrollLeft(el.data("scrollWrapper").scrollLeft()+el.data("swappedElement").outerWidth(true));el.data("getNextElementWidth",true)}},restoreOriginalElements:function(){var self=this,el=this.element;el.data("scrollableArea").html(el.data("originalElements"));self.recalculateScrollableArea();self.jumpToElement("first")},show:function(){var el=this.element;el.data("visible",true);el.show()},hide:function(){var el=this.element;el.data("visible",false);el.hide()},enable:function(){var el=this.element;if(this.options.touchScrolling){el.data("scrollWrapper").kinetic('attach')}el.data("enabled",true)},disable:function(){var self=this,el=this.element;self.stopAutoScrolling();clearInterval(el.data("rightScrollingInterval"));clearInterval(el.data("leftScrollingInterval"));clearInterval(el.data("hideHotSpotBackgroundsInterval"));if(this.options.touchScrolling){el.data("scrollWrapper").kinetic('detach')}el.data("enabled",false)},destroy:function(){var self=this,el=this.element;self.stopAutoScrolling();clearInterval(el.data("rightScrollingInterval"));clearInterval(el.data("leftScrollingInterval"));clearInterval(el.data("hideHotSpotBackgroundsInterval"));el.data("scrollingHotSpotRight").unbind("mouseover");el.data("scrollingHotSpotRight").unbind("mouseout");el.data("scrollingHotSpotRight").unbind("mousedown");el.data("scrollingHotSpotLeft").unbind("mouseover");el.data("scrollingHotSpotLeft").unbind("mouseout");el.data("scrollingHotSpotLeft").unbind("mousedown");el.unbind("mousenter");el.unbind("mouseleave");el.data("scrollingHotSpotRight").remove();el.data("scrollingHotSpotLeft").remove();el.data("scrollableArea").remove();el.data("scrollWrapper").remove();el.html(el.data("originalElements"));$.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery); function URLDecode(encodedString) { var output = encodedString; var binVal, thisString; var myregexp = /(%[^%]{2})/; while (((match = myregexp.exec(output)) != null) && (match.length > 1) && (match[1] != '')) { binVal = parseInt(match[1].substr(1), 16); thisString = String.fromCharCode(binVal); output = output.replace(match[1], thisString); } return output; } function check_email(email) { filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (filter.test(email)) { return true; } else return false; } function checkValid(id, value, top) { if ($("#" + id).val() == value) { $("#" + id).css('border', '1px solid #ff0000'); //alert(msg); $("#" + id).focus(); if (top == true) { $('body,html').animate({ scrollTop: 0 }, 900); } return false; } else { $("#" + id).css('border', '1px solid #b9b9b9'); return true; } } function SearchText(url, id) { $("#" + id).autocomplete({ source: function (request, response) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: url + "ws.asmx/GetAutoCompleteData", data: "{'productname':'" + $("#" + id).val() + "'}", dataType: "json", success: function (data) { response(data.d); }, error: function (result) { alert("Error"); } }); } }); } function searchProduct(url) { var keyword = $("#term-search").val(); var isValid = true; isValid = checkValid("term-search", "", false); if (isValid == false) { alert("Bạn đã nhập từ khóa tìm kiếm?"); return false; } isValid = checkValid("term-search", "Từ khóa tìm kiếm", false); if (isValid == false) { alert("Bạn đã nhập từ khóa tìm kiếm?"); return false; } window.location = url + 'search.aspx?q=' + URLDecode(keyword); } function setLanguage(url, Id) { $.blockUI({ message: "", css: { border: 'none', padding: '15px', backgroundColor: '#fff', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .5, color: '#fff' }, onBlock: function () { var webMethod = url + "ws.asmx/setLanguage"; var parameters = "{'Id':'" + Id + "'}"; $.ajax({ type: "POST", url: webMethod, data: parameters, contentType: "application/json; charset=utf-8", dataType: "json", async: false, cache: false, success: function (msg) { location.reload(); }, error: function (e) { alert('Đã có lỗi'); } }); } }); return true; } $(document).ready(function () { $('#allinone_bannerRotator_classic').allinone_bannerRotator( { skin: 'classic', width: 980, height: 200, defaultEffect: 'random', enableTouchScreen: 1, showBottomNav: 0, showNavArrows: 0, effectDuration: 0.5, absUrl: url + "App_Themes/FrontEnd/" }); if (typeof $.fn.superfish == "function") { $("ul.sf-menu").superfish({ delay: 800, dropShadows: 1, speed: "fast" }) } SearchText(url, "term-search"); $("#term-search").keypress(function (event) { if (event.keyCode == 13) { $("#submitSearch").click(); event.preventDefault(); } }); var defaults = { containerID: 'toTop', // fading element id containerHoverClass: 'toTopHover', // fading element hover class scrollSpeed: 1200 }; jQuery().UItoTop(defaults); $("div#makeMeScrollable").smoothDivScroll({ autoScrollingMode: "always", autoScrollDirection: "backandforth", autoScrollStep: 1, autoScrollInterval: 24 }); $(".inner-productmain li").hover(function () { var $this = $(this); $(".inner-productmain li").css({ 'border': '2px solid #EDEDED' }); $(this).css({ 'border': '2px solid #04AEEF' }); }, function () { $(this).css({ 'border': '2px solid #EDEDED' }); }); });