(function (a) { a.fn.caseStudiesSlider = function (s) { var g = { items: 6, speed: 400, btnPrevID: "btnPrev", btnNextID: "btnNext", height: 82, width: 137 }; var s = a.extend(g, s); var n = a(this); var d = a("li", n); var m = s.items; var e = s.speed; var r = d.length; var c = n.width(); var l = s.width; var j = l * r; var k = 0; var q = a("#" + s.btnPrevID); var b = a("#" + s.btnNextID); function o() { n.css("overflow", "hidden").css("position", "relative"); a("ul", n).width(j).css("position", "absolute").css("left", 0).css("top", 0); a("li", n).css("display", "block").css("float", "left"); n.css("height", s.height); q.click(f).addClass("inactive"); b.click(i); if (r <= m) { b.addClass("inactive") } } function i() { if (++k > r - m) { k = r - m; return } h() } function f() { if (--k < 0) { k = 0; return } h() } function h() { a("ul", n).clearQueue().animate({ left: k * l * -1 }, e); if (k == r - m) { b.addClass("inactive") } else { b.removeClass("inactive") } if (k == 0) { q.addClass("inactive") } else { q.removeClass("inactive") } } o() } })(jQuery); (function (a) { a.fn.easySlider = function (b) { var c = { prevId: "btn-prev", prevText: "Previous", nextId: "btn-next", nextText: "Next", controlsShow: true, controlsBefore: "", controlsAfter: "", controlsFade: true, firstId: "firstBtn", firstText: "First", firstShow: false, lastId: "lastBtn", lastText: "Last", lastShow: false, vertical: false, speed: 400, auto: false, pause: 2000, continuous: false, speedLimit: false, forceSkip: false }; var b = a.extend(c, b); a("#prevBtn").css("visibility", "visible"); a("#nextBtn").css("visibility", "visible"); this.each(function () { var e = a(this); var m = a("li", e).length; var k = a("li", e).width(); var f = a("li", e).height(); e.width(k); e.height(f); e.css("overflow", "hidden"); var i = m - 1; var l = 0; a("ul", e).css("width", m * k); if (!b.vertical) { a("li", e).css("float", "left") } if (b.controlsShow) { var g = b.controlsBefore; if (b.firstShow) { g += '<span id="' + b.firstId + '"><a href="javascript:void(0);">' + b.firstText + "</a></span>" } if (b.lastShow) { g += ' <span id="' + b.lastId + '"><a href="javascript:void(0);">' + b.lastText + "</a></span>" } g += b.controlsAfter; a(e).after(g) } a("a", "#" + b.nextId).click(function () { d("next", true); selectDesign(l) }); a("a", "#" + b.prevId).click(function () { d("prev", true); selectDesign(l) }); a("a", "#" + b.firstId).click(function () { d("first", true); selectDesign(l) }); a("a", "#" + b.lastId).click(function () { d("last", true); selectDesign(l) }); animateFn = d = function d(h, o, n, t) { var q = l; switch (h) { case "next": l = (q >= i) ? (b.continuous ? 0 : i) : l + 1; break; case "prev": l = (l <= 0) ? (b.continuous ? i : 0) : l - 1; break; case "first": l = 0; break; case "last": l = i; break; default: if (n != null) { l = n } break } var s = Math.abs(q - l); if (t) { var r = 0 } else { var r = (b.speedLimit ? 1 : s) * b.speed } if (!b.vertical) { p = (l * k * -1); if (b.forceSkip) { a("ul", e).clearQueue() } a("ul", e).animate({ marginLeft: p }, r) } else { p = (l * f * -1); if (b.forceSkip) { a("ul", e).clearQueue() } a("ul", e).animate({ marginTop: p }, r) } if (!b.continuous) { if (l == i && b.controlsFade) { a("a", "#" + b.nextId).hide(); a("a", "#" + b.lastId).hide() } else { a("a", "#" + b.nextId).show(); a("a", "#" + b.lastId).show() } if (l == 0 && b.controlsFade) { a("a", "#" + b.prevId).hide(); a("a", "#" + b.firstId).hide() } else { a("a", "#" + b.prevId).show(); a("a", "#" + b.firstId).show() } } if (o) { clearTimeout(j) } if (b.auto && h == "next" && !o) { j = setTimeout(function () { d("next", false) }, (b.speedLimit ? 1 : s) * b.speed + b.pause) } }; var j; if (b.auto) { j = setTimeout(function () { d("next", false) }, b.pause) } if (!b.continuous && b.controlsFade) { a("a", "#" + b.prevId).hide(); a("a", "#" + b.firstId).hide() } }) } })(jQuery); $(function () { new CSSMenu("mainNav"); if ($("#splash").length) { var a = new BackgroundFader(); $("#splash").jshowoff({ autoPlay: true, links: true, controls: true, speed: 10000, hoverPause: false, callback: a.update, passIDToSideLink: true }) } }); function BackgroundFader() { var a; var d = 600; function e(f) { var g; switch (f) { case 0: g = "bg_web"; break; case 1: g = "bg_ecommerce"; break; case 2: g = "bg_maintenance"; break; case 3: g = "bg_hosting"; break; default: return } $(".bgOverlay").remove(); $("body").prepend('<div class="bgOverlay" id="' + g + '"></div>'); $(".bgOverlay").fadeIn(d, c); b(); if (a) { clearInterval(a) } a = setInterval(b, 100) } function c() { clearInterval(a); $("body").attr("id", $(this).attr("id")); $(this).remove() } function b() { if ($(".bgOverlay").length) { $(".bgOverlay").css("height", $(document).height() - 20).css("width", $("body").width()) } } $('<img src="/images/bg-ecommerce.jpg" /><img src="/images/bg-maintenance.jpg" /><img src="/images/bg-hosting.jpg" />'); return { update: function (f) { e(f) } } } function CSSMenu(a) { var c; var f = 300; var b = 150; var e; var g = $("#" + a); var i = 6; $("> ul > li", g).each(function (k) { $("> ul > li:last", $(this)).addClass("last"); var j = $("> ul > li", $(this)).length; if (j > i) { $("> ul", $(this)).addClass("split"); if (j % 2 == 0) { $("> ul > li:eq(" + (j - 2) + ")", $(this)).addClass("last") } } }); $("> ul > li", g).hover(function (j) { if ($("ul", $(this)).length) { $("> ul > li", g).removeClass("hover"); $(this).addClass("hover"); $("a", g).removeClass("active"); $("> a", $(this)).addClass("active"); e = $(this); h() } else { $("> ul > li", g).removeClass("hover"); $("ul ul", g).hide() } }, function (j) { clearTimeout(c); c = setTimeout(d, f) }); function h() { clearTimeout(c); $("ul ul", g).hide(); $("ul", e).show() } function d() { $("> ul > li", g).removeClass("hover"); $("a", g).removeClass("active"); $("ul ul", g).hide() } } (function (a) { a.fn.jshowoff = function (c) { var b = { animatePause: true, autoPlay: true, changeSpeed: 600, controls: true, controlText: { play: "Play", pause: "Pause", next: "Next", previous: "Previous" }, effect: "fade", hoverPause: true, links: true, speed: 3000, loop: true, randomStart: false, continuous: false, passIDToSideLink: false, callback: null }; if (c) { a.extend(true, b, c) } if (b.speed < (b.changeSpeed + 20)) { alert("jShowOff: Make speed at least 20ms longer than changeSpeed; the fades aren't always right on time."); return this } this.each(function (w) { var m = a(this); var d = a(this).children().remove(); var s = ""; var r = 0; var e = false; var v = []; var k = a(".jshowoff").length + 1; var n = "jshowoff-" + k; var q = b.cssClass != undefined ? b.cssClass : ""; m.css("position", "relative").wrap('<div class="jshowoff ' + n + '" />'); var t = a("." + n); t.css("position", "relative").addClass(q); a(d[0]).clone().appendTo(m); l(); if (b.controls) { y(); if (b.autoPlay == false) { a("." + n + "-play").addClass(n + "-paused jshowoff-paused").text(b.controlText.play) } } if (b.links) { x(); a("." + n + "-slidelinks a").eq(0).addClass(n + "-active jshowoff-active"); if (b.passIDToSideLink) { a("." + n + "-slidelinks a").eq(0).addClass("jshowoff-active-" + m.children().eq(0).attr("id")) } } if (b.hoverPause) { m.hover(function () { if (h()) { j("hover") } }, function () { if (h()) { A("hover") } }) } if (b.autoPlay && d.length > 1) { s = setInterval(function () { A() }, b.speed) } if (d.length < 1) { a("." + n).append("<p>For jShowOff to work, the container element must have child elements.</p>") } if (b.randomStart) { var o = Math.floor(Math.random() * d.length); f(d, o, "none") } function f(C, E) { var i = r; if ((r >= C.length) || (E >= C.length)) { r = 0; var G = true } else { if ((r < 0) || (E < 0)) { r = C.length - 1; var D = true } else { r = E } } if (b.callback) { b.callback(r) } if (b.effect == "slideLeft") { var H, I; function F(J) { H = J == "right" ? "left" : "right"; I = J == "left" ? "left" : "right" } if (b.continuous && r < i && i != 1 && r == 0) { F("left") } else { if (b.continuous && r > i && r != 1 && i == 0) { F("right") } else { r >= i ? F("left") : F("right") } } a(C[r]).clone().appendTo(m).slideIt({ direction: H, changeSpeed: b.changeSpeed }); if (m.children().length > 1) { m.children().eq(0).css("position", "absolute").slideIt({ direction: I, showHide: "hide", changeSpeed: b.changeSpeed }, function () { a(this).remove() }) } } else { if (b.effect == "fade") { a(C[r]).clone().appendTo(m).hide().fadeIn(b.changeSpeed, function () { if (a.browser.msie) { this.style.removeAttribute("filter") } }); if (m.children().length > 1) { m.children().eq(0).css("position", "absolute").fadeOut(b.changeSpeed, function () { a(this).remove() }) } } else { if (b.effect == "none") { a(C[r]).clone().appendTo(m); if (m.children().length > 1) { m.children().eq(0).css("position", "absolute").remove() } } } } if (b.links) { a("." + n + "-active").removeClass(n + "-active jshowoff-active").removeClass("jshowoff-active-" + m.children().eq(0).attr("id")); a("." + n + "-slidelinks a").eq(r).addClass(n + "-active jshowoff-active"); if (b.passIDToSideLink) { a("." + n + "-slidelinks a").eq(r).addClass("jshowoff-active-" + m.children().eq(1).attr("id")) } } a("." + n + "-controls .jshowoff-next, ." + n + "-controls .jshowoff-prev").removeClass("jshowoff-disabled"); if (!b.loop && r == 0) { a("." + n + "-controls .jshowoff-prev").addClass("jshowoff-disabled") } if (!b.loop && r == C.length - 1) { a("." + n + "-controls .jshowoff-next").addClass("jshowoff-disabled") } } function h() { return a("." + n + "-play").hasClass("jshowoff-paused") ? false : true } function A(i) { if (!B()) { r++; f(d, r); if (i == "hover" || !h()) { s = setInterval(function () { A() }, b.speed) } if (!h()) { a("." + n + "-play").text(b.controlText.pause).removeClass("jshowoff-paused " + n + "-paused") } } } function j(i) { clearInterval(s); if (!i || i == "playBtn") { a("." + n + "-play").text(b.controlText.play).addClass("jshowoff-paused " + n + "-paused") } if (b.animatePause && i == "playBtn") { a('<p class="' + n + '-pausetext jshowoff-pausetext">' + b.controlText.pause + "</p>").css({ fontSize: "62%", textAlign: "center", position: "absolute", top: "40%", lineHeight: "100%", width: "100%" }).appendTo(t).addClass(n + "pauseText").animate({ fontSize: "600%", top: "30%", opacity: 0 }, { duration: 500, complete: function () { a(this).remove() } }) } } function u() { z(r + 1) } function g() { z(r - 1) } function B() { return m.children().length > 1 ? true : false } function z(i) { m.children().stop(true, true); if ((r != i) || ((r == i) && B())) { if (!b.loop && (i < 0 || i >= d.length)) { return } if (B()) { m.children().eq(0).remove() } f(d, i); j() } } function l() { a(d).each(function (C) { a(this).find("img").each(function (D) { v[D] = a("<img>").attr("src", a(this).attr("src")) }) }) } function y() { t.append('<p class="jshowoff-controls ' + n + '-controls"><a class="jshowoff-play ' + n + '-play" href="#null">' + b.controlText.pause + '</a> <a class="jshowoff-prev ' + n + '-prev" href="#null">' + b.controlText.previous + '</a> <a class="jshowoff-next ' + n + '-next" href="#null">' + b.controlText.next + "</a></p>"); a("." + n + "-controls a").each(function () { if (a(this).hasClass("jshowoff-play")) { a(this).click(function () { h() ? j("playBtn") : A(); return false }) } if (a(this).hasClass("jshowoff-prev")) { a(this).click(function () { g(); return false }) } if (a(this).hasClass("jshowoff-next")) { a(this).click(function () { u(); return false }) } }); if (!b.loop) { a("." + n + "-controls .jshowoff-prev").addClass("jshowoff-disabled") } } function x() { t.append('<p class="jshowoff-slidelinks ' + n + '-slidelinks"></p>'); a.each(d, function (C, E) { var D = a(this).attr("title") != "" ? a(this).attr("title") : C + 1; a('<a id="" class="jshowoff-slidelink-' + C + " " + n + "-slidelink-" + C + '" href="#null">' + D + "</a>").bind("click", { index: C }, function (i) { z(i.data.index); return false }).appendTo("." + n + "-slidelinks") }) } }); return this } })(jQuery); (function (a) { a.fn.slideIt = function (c, d) { var b = { direction: "left", showHide: "show", changeSpeed: 600 }; if (c) { a.extend(b, c) } this.each(function (f) { a(this).css({ left: "auto", right: "auto", top: "auto", bottom: "auto" }); var g = (b.direction == "left") || (b.direction == "right") ? a(this).outerWidth() : a(this).outerHeight(); var e = {}; e.position = a(this).css("position") == "static" ? "relative" : a(this).css("position"); e[b.direction] = (b.showHide == "show") ? "-" + g + "px" : 0; var h = {}; h[b.direction] = b.showHide == "show" ? 0 : "-" + g + "px"; a(this).css(e).animate(h, b.changeSpeed, d) }); return this } })(jQuery); (function (a) { a.fn.loadMore = function (j) { var e = { items: 10, speed: 1000, delay: 100, buttonClass: "btnLoadMore", buttonText: "Load More Testimonials" }; var j = a.extend(e, j); var d = 0; var h = a(this); var b = a(this).children(); var g = j.items; var c = j.speed; var i = b.length; function f() { var k = d + j.items; var l = 0; a(b).each(function (m) { var n = a(this); if (m >= d && m < k) { setTimeout(function () { n.fadeIn(c) }, l * j.delay); l += 1 } }); d = k; if (d >= i) { a("." + j.buttonClass, h).hide() } return false } a(b).hide(); f(); a('<a class="' + j.buttonClass + '" href="javascript:void(0)">' + j.buttonText + "</a>").appendTo(a(this)).click(f) } })(jQuery); (function (C) { var M, U, R, N, d, m, K, B, P, A, D = 0, I = {}, j = [], e = 0, H = {}, z = [], f = null, o = new Image(), i = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, k = /[^\.]\.(swf)\s*$/i, q, O = 1, h = 0, u = "", b, c, Q = false, t = C.extend(C("<div/>")[0], { prop: 0 }), T = C.browser.msie && C.browser.version < 7 && !window.XMLHttpRequest, s = function () { U.hide(); o.onerror = o.onload = null; if (f) { f.abort() } M.empty() }, y = function () { if (false === I.onError(j, D, I)) { U.hide(); Q = false; return } I.titleShow = false; I.width = "auto"; I.height = "auto"; M.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'); n() }, x = function () { var aa = j[D], X, Z, ac, ab, W, Y; s(); I = C.extend({}, C.fn.fancybox.defaults, (typeof C(aa).data("fancybox") == "undefined" ? I : C(aa).data("fancybox"))); Y = I.onStart(j, D, I); if (Y === false) { Q = false; return } else { if (typeof Y == "object") { I = C.extend(I, Y) } } ac = I.title || (aa.nodeName ? C(aa).attr("title") : aa.title) || ""; if (aa.nodeName && !I.orig) { I.orig = C(aa).children("img:first").length ? C(aa).children("img:first") : C(aa) } if (ac === "" && I.orig && I.titleFromAlt) { ac = I.orig.attr("alt") } X = I.href || (aa.nodeName ? C(aa).attr("href") : aa.href) || null; if ((/^(?:javascript)/i).test(X) || X == "#") { X = null } if (I.type) { Z = I.type; if (!X) { X = I.content } } else { if (I.content) { Z = "html" } else { if (X) { if (X.match(i)) { Z = "image" } else { if (X.match(k)) { Z = "swf" } else { if (C(aa).hasClass("iframe")) { Z = "iframe" } else { if (X.indexOf("#") === 0) { Z = "inline" } else { Z = "ajax" } } } } } } } if (!Z) { y(); return } if (Z == "inline") { aa = X.substr(X.indexOf("#")); Z = C(aa).length > 0 ? "inline" : "ajax" } I.type = Z; I.href = X; I.title = ac; if (I.autoDimensions) { if (I.type == "html" || I.type == "inline" || I.type == "ajax") { I.width = "auto"; I.height = "auto" } else { I.autoDimensions = false } } if (I.modal) { I.overlayShow = true; I.hideOnOverlayClick = false; I.hideOnContentClick = false; I.enableEscapeButton = false; I.showCloseButton = false } I.padding = parseInt(I.padding, 10); I.margin = parseInt(I.margin, 10); M.css("padding", (I.padding + I.margin)); C(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change", function () { C(this).replaceWith(m.children()) }); switch (Z) { case "html": M.html(I.content); n(); break; case "inline": if (C(aa).parent().is("#fancybox-content") === true) { Q = false; return } C('<div class="fancybox-inline-tmp" />').hide().insertBefore(C(aa)).bind("fancybox-cleanup", function () { C(this).replaceWith(m.children()) }).bind("fancybox-cancel", function () { C(this).replaceWith(M.children()) }); C(aa).appendTo(M); n(); break; case "image": Q = false; C.fancybox.showActivity(); o = new Image(); o.onerror = function () { y() }; o.onload = function () { Q = true; o.onerror = o.onload = null; G() }; o.src = X; break; case "swf": I.scrolling = "no"; ab = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + I.width + '" height="' + I.height + '"><param name="movie" value="' + X + '"></param>'; W = ""; C.each(I.swf, function (ad, ae) { ab += '<param name="' + ad + '" value="' + ae + '"></param>'; W += " " + ad + '="' + ae + '"' }); ab += '<embed src="' + X + '" type="application/x-shockwave-flash" width="' + I.width + '" height="' + I.height + '"' + W + "></embed></object>"; M.html(ab); n(); break; case "ajax": Q = false; C.fancybox.showActivity(); I.ajax.win = I.ajax.success; f = C.ajax(C.extend({}, I.ajax, { url: X, data: I.ajax.data || {}, error: function (ad, af, ae) { if (ad.status > 0) { y() } }, success: function (ae, ag, ad) { var af = typeof ad == "object" ? ad : f; if (af.status == 200) { if (typeof I.ajax.win == "function") { Y = I.ajax.win(X, ae, ag, ad); if (Y === false) { U.hide(); return } else { if (typeof Y == "string" || typeof Y == "object") { ae = Y } } } M.html(ae); n() } } })); break; case "iframe": F(); break } }, n = function () { var W = I.width, X = I.height; if (W.toString().indexOf("%") > -1) { W = parseInt((C(window).width() - (I.margin * 2)) * parseFloat(W) / 100, 10) + "px" } else { W = W == "auto" ? "auto" : W + "px" } if (X.toString().indexOf("%") > -1) { X = parseInt((C(window).height() - (I.margin * 2)) * parseFloat(X) / 100, 10) + "px" } else { X = X == "auto" ? "auto" : X + "px" } M.wrapInner('<div style="width:' + W + ";height:" + X + ";overflow: " + (I.scrolling == "auto" ? "auto" : (I.scrolling == "yes" ? "scroll" : "hidden")) + ';position:relative;"></div>'); I.width = M.width(); I.height = M.height(); F() }, G = function () { I.width = o.width; I.height = o.height; C("<img />").attr({ id: "fancybox-img", src: o.src, alt: I.title }).appendTo(M); F() }, F = function () { var X, W; U.hide(); if (N.is(":visible") && false === H.onCleanup(z, e, H)) { C.event.trigger("fancybox-cancel"); Q = false; return } Q = true; C(m.add(R)).unbind(); C(window).unbind("resize.fb scroll.fb"); C(document).unbind("keydown.fb"); if (N.is(":visible") && H.titlePosition !== "outside") { N.css("height", N.height()) } z = j; e = D; H = I; if (H.overlayShow) { R.css({ "background-color": H.overlayColor, opacity: H.overlayOpacity, cursor: H.hideOnOverlayClick ? "pointer" : "auto", height: C(document).height() }); if (!R.is(":visible")) { if (T) { C("select:not(#fancybox-tmp select)").filter(function () { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one("fancybox-cleanup", function () { this.style.visibility = "inherit" }) } R.show() } } else { R.hide() } c = S(); l(); if (N.is(":visible")) { C(K.add(P).add(A)).hide(); X = N.position(), b = { top: X.top, left: X.left, width: N.width(), height: N.height() }; W = (b.width == c.width && b.height == c.height); m.fadeTo(H.changeFade, 0.3, function () { var Y = function () { m.html(M.contents()).fadeTo(H.changeFade, 1, w) }; C.event.trigger("fancybox-change"); m.empty().removeAttr("filter").css({ "border-width": H.padding, width: c.width - H.padding * 2, height: I.autoDimensions ? "auto" : c.height - h - H.padding * 2 }); if (W) { Y() } else { t.prop = 0; C(t).animate({ prop: 1 }, { duration: H.changeSpeed, easing: H.easingChange, step: V, complete: Y }) } }); return } N.removeAttr("style"); m.css("border-width", H.padding); if (H.transitionIn == "elastic") { b = J(); m.html(M.contents()); N.show(); if (H.opacity) { c.opacity = 0 } t.prop = 0; C(t).animate({ prop: 1 }, { duration: H.speedIn, easing: H.easingIn, step: V, complete: w }); return } if (H.titlePosition == "inside" && h > 0) { B.show() } m.css({ width: c.width - H.padding * 2, height: I.autoDimensions ? "auto" : c.height - h - H.padding * 2 }).html(M.contents()); N.css(c).fadeIn(H.transitionIn == "none" ? 0 : H.speedIn, w) }, E = function (W) { if (W && W.length) { if (H.titlePosition == "float") { return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + W + '</td><td id="fancybox-title-float-right"></td></tr></table>' } return '<div id="fancybox-title-' + H.titlePosition + '">' + W + "</div>" } return false }, l = function () { u = H.title || ""; h = 0; B.empty().removeAttr("style").removeClass(); if (H.titleShow === false) { B.hide(); return } u = C.isFunction(H.titleFormat) ? H.titleFormat(u, z, e, H) : E(u); if (!u || u === "") { B.hide(); return } B.addClass("fancybox-title-" + H.titlePosition).html(u).appendTo("body").show(); switch (H.titlePosition) { case "inside": B.css({ width: c.width - (H.padding * 2), marginLeft: H.padding, marginRight: H.padding }); h = B.outerHeight(true); B.appendTo(d); c.height += h; break; case "over": B.css({ marginLeft: H.padding, width: c.width - (H.padding * 2), bottom: H.padding }).appendTo(d); break; case "float": B.css("left", parseInt((B.width() - c.width - 40) / 2, 10) * -1).appendTo(N); break; default: B.css({ width: c.width - (H.padding * 2), paddingLeft: H.padding, paddingRight: H.padding }).appendTo(N); break } B.hide() }, g = function () { if (H.enableEscapeButton || H.enableKeyboardNav) { C(document).bind("keydown.fb", function (W) { if (W.keyCode == 27 && H.enableEscapeButton) { W.preventDefault(); C.fancybox.close() } else { if ((W.keyCode == 37 || W.keyCode == 39) && H.enableKeyboardNav && W.target.tagName !== "INPUT" && W.target.tagName !== "TEXTAREA" && W.target.tagName !== "SELECT") { W.preventDefault(); C.fancybox[W.keyCode == 37 ? "prev" : "next"]() } } }) } if (!H.showNavArrows) { P.hide(); A.hide(); return } if ((H.cyclic && z.length > 1) || e !== 0) { P.show() } if ((H.cyclic && z.length > 1) || e != (z.length - 1)) { A.show() } }, w = function () { if (!C.support.opacity) { m.get(0).style.removeAttribute("filter"); N.get(0).style.removeAttribute("filter") } if (I.autoDimensions) { m.css("height", "auto") } N.css("height", "auto"); if (u && u.length) { B.show() } if (H.showCloseButton) { K.show() } g(); if (H.hideOnContentClick) { m.bind("click", C.fancybox.close) } if (H.hideOnOverlayClick) { R.bind("click", C.fancybox.close) } C(window).bind("resize.fb", C.fancybox.resize); if (H.centerOnScroll) { C(window).bind("scroll.fb", C.fancybox.center) } if (H.type == "iframe") { C('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + (C.browser.msie ? 'allowtransparency="true""' : "") + ' scrolling="' + I.scrolling + '" src="' + H.href + '"></iframe>').appendTo(m) } N.show(); Q = false; C.fancybox.center(); H.onComplete(z, e, H); L() }, L = function () { var W, X; if ((z.length - 1) > e) { W = z[e + 1].href; if (typeof W !== "undefined" && W.match(i)) { X = new Image(); X.src = W } } if (e > 0) { W = z[e - 1].href; if (typeof W !== "undefined" && W.match(i)) { X = new Image(); X.src = W } } }, V = function (X) { var W = { width: parseInt(b.width + (c.width - b.width) * X, 10), height: parseInt(b.height + (c.height - b.height) * X, 10), top: parseInt(b.top + (c.top - b.top) * X, 10), left: parseInt(b.left + (c.left - b.left) * X, 10) }; if (typeof c.opacity !== "undefined") { W.opacity = X < 0.5 ? 0.5 : X } N.css(W); m.css({ width: W.width - H.padding * 2, height: W.height - (h * X) - H.padding * 2 }) }, v = function () { return [C(window).width() - (H.margin * 2), C(window).height() - (H.margin * 2), C(document).scrollLeft() + H.margin, C(document).scrollTop() + H.margin] }, S = function () { var W = v(), aa = {}, X = H.autoScale, Y = H.padding * 2, Z; if (H.width.toString().indexOf("%") > -1) { aa.width = parseInt((W[0] * parseFloat(H.width)) / 100, 10) } else { aa.width = H.width + Y } if (H.height.toString().indexOf("%") > -1) { aa.height = parseInt((W[1] * parseFloat(H.height)) / 100, 10) } else { aa.height = H.height + Y } if (X && (aa.width > W[0] || aa.height > W[1])) { if (I.type == "image" || I.type == "swf") { Z = (H.width) / (H.height); if ((aa.width) > W[0]) { aa.width = W[0]; aa.height = parseInt(((aa.width - Y) / Z) + Y, 10) } if ((aa.height) > W[1]) { aa.height = W[1]; aa.width = parseInt(((aa.height - Y) * Z) + Y, 10) } } else { aa.width = Math.min(aa.width, W[0]); aa.height = Math.min(aa.height, W[1]) } } aa.top = parseInt(Math.max(W[3] - 20, W[3] + ((W[1] - aa.height - 40) * 0.5)), 10); aa.left = parseInt(Math.max(W[2] - 20, W[2] + ((W[0] - aa.width - 40) * 0.5)), 10); return aa }, r = function (W) { var X = W.offset(); X.top += parseInt(W.css("paddingTop"), 10) || 0; X.left += parseInt(W.css("paddingLeft"), 10) || 0; X.top += parseInt(W.css("border-top-width"), 10) || 0; X.left += parseInt(W.css("border-left-width"), 10) || 0; X.width = W.width(); X.height = W.height(); return X }, J = function () { var Z = I.orig ? C(I.orig) : false, Y = {}, X, W; if (Z && Z.length) { X = r(Z); Y = { width: X.width + (H.padding * 2), height: X.height + (H.padding * 2), top: X.top - H.padding - 20, left: X.left - H.padding - 20} } else { W = v(); Y = { width: H.padding * 2, height: H.padding * 2, top: parseInt(W[3] + W[1] * 0.5, 10), left: parseInt(W[2] + W[0] * 0.5, 10)} } return Y }, a = function () { if (!U.is(":visible")) { clearInterval(q); return } C("div", U).css("top", (O * -40) + "px"); O = (O + 1) % 12 }; C.fn.fancybox = function (W) { if (!C(this).length) { return this } C(this).data("fancybox", C.extend({}, W, (C.metadata ? C(this).metadata() : {}))).unbind("click.fb").bind("click.fb", function (Y) { Y.preventDefault(); if (Q) { return } Q = true; C(this).blur(); j = []; D = 0; var X = C(this).attr("rel") || ""; if (!X || X == "" || X === "nofollow") { j.push(this) } else { j = C("a[rel=" + X + "], area[rel=" + X + "]"); D = j.index(this) } x(); return }); return this }; C.fancybox = function (Z) { var Y; if (Q) { return } Q = true; Y = typeof arguments[1] !== "undefined" ? arguments[1] : {}; j = []; D = parseInt(Y.index, 10) || 0; if (C.isArray(Z)) { for (var X = 0, W = Z.length; X < W; X++) { if (typeof Z[X] == "object") { C(Z[X]).data("fancybox", C.extend({}, Y, Z[X])) } else { Z[X] = C({}).data("fancybox", C.extend({ content: Z[X] }, Y)) } } j = jQuery.merge(j, Z) } else { if (typeof Z == "object") { C(Z).data("fancybox", C.extend({}, Y, Z)) } else { Z = C({}).data("fancybox", C.extend({ content: Z }, Y)) } j.push(Z) } if (D > j.length || D < 0) { D = 0 } x() }; C.fancybox.showActivity = function () { clearInterval(q); U.show(); q = setInterval(a, 66) }; C.fancybox.hideActivity = function () { U.hide() }; C.fancybox.next = function () { return C.fancybox.pos(e + 1) }; C.fancybox.prev = function () { return C.fancybox.pos(e - 1) }; C.fancybox.pos = function (W) { if (Q) { return } W = parseInt(W); j = z; if (W > -1 && W < z.length) { D = W; x() } else { if (H.cyclic && z.length > 1) { D = W >= z.length ? 0 : z.length - 1; x() } } return }; C.fancybox.cancel = function () { if (Q) { return } Q = true; C.event.trigger("fancybox-cancel"); s(); I.onCancel(j, D, I); Q = false }; C.fancybox.close = function () { if (Q || N.is(":hidden")) { return } Q = true; if (H && false === H.onCleanup(z, e, H)) { Q = false; return } s(); C(K.add(P).add(A)).hide(); C(m.add(R)).unbind(); C(window).unbind("resize.fb scroll.fb"); C(document).unbind("keydown.fb"); m.find("iframe").attr("src", T && /^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank"); if (H.titlePosition !== "inside") { B.empty() } N.stop(); function W() { R.fadeOut("fast"); B.empty().hide(); N.hide(); C.event.trigger("fancybox-cleanup"); m.empty(); H.onClosed(z, e, H); z = I = []; e = D = 0; H = I = {}; Q = false } if (H.transitionOut == "elastic") { b = J(); var X = N.position(); c = { top: X.top, left: X.left, width: N.width(), height: N.height() }; if (H.opacity) { c.opacity = 1 } B.empty().hide(); t.prop = 1; C(t).animate({ prop: 0 }, { duration: H.speedOut, easing: H.easingOut, step: V, complete: W }) } else { N.fadeOut(H.transitionOut == "none" ? 0 : H.speedOut, W) } }; C.fancybox.resize = function () { if (R.is(":visible")) { R.css("height", C(document).height()) } C.fancybox.center(true) }; C.fancybox.center = function () { var W, X; if (Q) { return } X = arguments[0] === true ? 1 : 0; W = v(); if (!X && (N.width() > W[0] || N.height() > W[1])) { return } N.stop().animate({ top: parseInt(Math.max(W[3] - 20, W[3] + ((W[1] - m.height() - 40) * 0.5) - H.padding)), left: parseInt(Math.max(W[2] - 20, W[2] + ((W[0] - m.width() - 40) * 0.5) - H.padding)) }, typeof arguments[0] == "number" ? arguments[0] : 200) }; C.fancybox.init = function () { if (C("#fancybox-wrap").length) { return } C("body").append(M = C('<div id="fancybox-tmp"></div>'), U = C('<div id="fancybox-loading"><div></div></div>'), R = C('<div id="fancybox-overlay"></div>'), N = C('<div id="fancybox-wrap"></div>')); d = C('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(N); d.append(m = C('<div id="fancybox-content"></div>'), K = C('<a id="fancybox-close" title="Close"></a>'), B = C('<div id="fancybox-title"></div>'), P = C('<a href="javascript:;" id="fancybox-left" title="Previous"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), A = C('<a href="javascript:;" id="fancybox-right" title="Next"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')); K.click(C.fancybox.close); U.click(C.fancybox.cancel); P.click(function (W) { W.preventDefault(); C.fancybox.prev() }); A.click(function (W) { W.preventDefault(); C.fancybox.next() }); if (C.fn.mousewheel) { N.bind("mousewheel.fb", function (W, X) { if (Q) { W.preventDefault() } else { if (C(W.target).get(0).clientHeight == 0 || C(W.target).get(0).scrollHeight === C(W.target).get(0).clientHeight) { W.preventDefault(); C.fancybox[X > 0 ? "prev" : "next"]() } } }) } if (!C.support.opacity) { N.addClass("fancybox-ie") } if (T) { U.addClass("fancybox-ie6"); N.addClass("fancybox-ie6"); C('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank") + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(d) } }; C.fn.fancybox.defaults = { padding: 10, margin: 40, opacity: false, modal: false, cyclic: false, scrolling: "auto", width: 560, height: 340, autoScale: true, autoDimensions: true, centerOnScroll: false, ajax: {}, swf: { wmode: "transparent" }, hideOnOverlayClick: true, hideOnContentClick: false, overlayShow: true, overlayOpacity: 0.7, overlayColor: "#777", titleShow: true, titlePosition: "float", titleFormat: null, titleFromAlt: false, transitionIn: "fade", transitionOut: "fade", speedIn: 300, speedOut: 300, changeSpeed: 300, changeFade: "fast", easingIn: "swing", easingOut: "swing", showCloseButton: true, showNavArrows: true, enableEscapeButton: true, enableKeyboardNav: true, onStart: function () { }, onCancel: function () { }, onComplete: function () { }, onCleanup: function () { }, onClosed: function () { }, onError: function () { } }; C(document).ready(function () { C.fancybox.init() }) })(jQuery);
