jQuery.easing.jswing = jQuery.easing.swing; jQuery.extend(jQuery.easing, { def: "easeOutQuad", swing: function(e, f, a, h, g) { return jQuery.easing[jQuery.easing.def](e, f, a, h, g) }, easeInQuad: function(e, f, a, h, g) { return h * (f /= g) * f + a }, easeOutQuad: function(e, f, a, h, g) { return -h * (f /= g) * (f - 2) + a }, easeInOutQuad: function(e, f, a, h, g) { if ((f /= g / 2) < 1) { return h / 2 * f * f + a } return -h / 2 * ((--f) * (f - 2) - 1) + a }, easeInCubic: function(e, f, a, h, g) { return h * (f /= g) * f * f + a }, easeOutCubic: function(e, f, a, h, g) { return h * ((f = f / g - 1) * f * f + 1) + a }, easeInOutCubic: function(e, f, a, h, g) { if ((f /= g / 2) < 1) { return h / 2 * f * f * f + a } return h / 2 * ((f -= 2) * f * f + 2) + a }, easeInQuart: function(e, f, a, h, g) { return h * (f /= g) * f * f * f + a }, easeOutQuart: function(e, f, a, h, g) { return -h * ((f = f / g - 1) * f * f * f - 1) + a }, easeInOutQuart: function(e, f, a, h, g) { if ((f /= g / 2) < 1) { return h / 2 * f * f * f * f + a } return -h / 2 * ((f -= 2) * f * f * f - 2) + a }, easeInQuint: function(e, f, a, h, g) { return h * (f /= g) * f * f * f * f + a }, easeOutQuint: function(e, f, a, h, g) { return h * ((f = f / g - 1) * f * f * f * f + 1) + a }, easeInOutQuint: function(e, f, a, h, g) { if ((f /= g / 2) < 1) { return h / 2 * f * f * f * f * f + a } return h / 2 * ((f -= 2) * f * f * f * f + 2) + a }, easeInSine: function(e, f, a, h, g) { return -h * Math.cos(f / g * (Math.PI / 2)) + h + a }, easeOutSine: function(e, f, a, h, g) { return h * Math.sin(f / g * (Math.PI / 2)) + a }, easeInOutSine: function(e, f, a, h, g) { return -h / 2 * (Math.cos(Math.PI * f / g) - 1) + a }, easeInExpo: function(e, f, a, h, g) { return (f == 0) ? a : h * Math.pow(2, 10 * (f / g - 1)) + a }, easeOutExpo: function(e, f, a, h, g) { return (f == g) ? a + h : h * (-Math.pow(2, -10 * f / g) + 1) + a }, easeInOutExpo: function(e, f, a, h, g) { if (f == 0) { return a } if (f == g) { return a + h } if ((f /= g / 2) < 1) { return h / 2 * Math.pow(2, 10 * (f - 1)) + a } return h / 2 * (-Math.pow(2, -10 * --f) + 2) + a }, easeInCirc: function(e, f, a, h, g) { return -h * (Math.sqrt(1 - (f /= g) * f) - 1) + a }, easeOutCirc: function(e, f, a, h, g) { return h * Math.sqrt(1 - (f = f / g - 1) * f) + a }, easeInOutCirc: function(e, f, a, h, g) { if ((f /= g / 2) < 1) { return -h / 2 * (Math.sqrt(1 - f * f) - 1) + a } return h / 2 * (Math.sqrt(1 - (f -= 2) * f) + 1) + a }, easeInElastic: function(f, h, e, m, l) { var j = 1.70158; var k = 0; var g = m; if (h == 0) { return e } if ((h /= l) == 1) { return e + m } if (!k) { k = l * 0.3 } if (g < Math.abs(m)) { g = m; var j = k / 4 } else { var j = k / (2 * Math.PI) * Math.asin(m / g) } return -(g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * l - j) * (2 * Math.PI) / k)) + e }, easeOutElastic: function(f, h, e, m, l) { var j = 1.70158; var k = 0; var g = m; if (h == 0) { return e } if ((h /= l) == 1) { return e + m } if (!k) { k = l * 0.3 } if (g < Math.abs(m)) { g = m; var j = k / 4 } else { var j = k / (2 * Math.PI) * Math.asin(m / g) } return g * Math.pow(2, -10 * h) * Math.sin((h * l - j) * (2 * Math.PI) / k) + m + e }, easeInOutElastic: function(f, h, e, m, l) { var j = 1.70158; var k = 0; var g = m; if (h == 0) { return e } if ((h /= l / 2) == 2) { return e + m } if (!k) { k = l * (0.3 * 1.5) } if (g < Math.abs(m)) { g = m; var j = k / 4 } else { var j = k / (2 * Math.PI) * Math.asin(m / g) } if (h < 1) { return -0.5 * (g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * l - j) * (2 * Math.PI) / k)) + e } return g * Math.pow(2, -10 * (h -= 1)) * Math.sin((h * l - j) * (2 * Math.PI) / k) * 0.5 + m + e }, easeInBack: function(e, f, a, j, h, g) { if (g == undefined) { g = 1.70158 } return j * (f /= h) * f * ((g + 1) * f - g) + a }, easeOutBack: function(e, f, a, j, h, g) { if (g == undefined) { g = 1.70158 } return j * ((f = f / h - 1) * f * ((g + 1) * f + g) + 1) + a }, easeInOutBack: function(e, f, a, j, h, g) { if (g == undefined) { g = 1.70158 } if ((f /= h / 2) < 1) { return j / 2 * (f * f * (((g *= (1.525)) + 1) * f - g)) + a } return j / 2 * ((f -= 2) * f * (((g *= (1.525)) + 1) * f + g) + 2) + a }, easeInBounce: function(e, f, a, h, g) { return h - jQuery.easing.easeOutBounce(e, g - f, 0, h, g) + a }, easeOutBounce: function(e, f, a, h, g) { if ((f /= g) < (1 / 2.75)) { return h * (7.5625 * f * f) + a } else { if (f < (2 / 2.75)) { return h * (7.5625 * (f -= (1.5 / 2.75)) * f + 0.75) + a } else { if (f < (2.5 / 2.75)) { return h * (7.5625 * (f -= (2.25 / 2.75)) * f + 0.9375) + a } else { return h * (7.5625 * (f -= (2.625 / 2.75)) * f + 0.984375) + a } } } }, easeInOutBounce: function(e, f, a, h, g) { if (f < g / 2) { return jQuery.easing.easeInBounce(e, f * 2, 0, h, g) * 0.5 + a } return jQuery.easing.easeOutBounce(e, f * 2 - g, 0, h, g) * 0.5 + h * 0.5 + a } }); jQuery.fn.extend({ everyTime: function(b, c, d, e, a) { return this.each(function() { jQuery.timer.add(this, b, c, d, e, a) }) }, oneTime: function(a, b, c) { return this.each(function() { jQuery.timer.add(this, a, b, c, 1) }) }, stopTime: function(a, b) { return this.each(function() { jQuery.timer.remove(this, a, b) }) } }); jQuery.event.special; jQuery.extend({ timer: { global: [], guid: 1, dataKey: "jQuery.timer", regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, powers: { ms: 1, cs: 10, ds: 100, s: 1000, das: 10000, hs: 100000, ks: 1000000 }, timeParse: function(c) { if (c == undefined || c == null) { return null } var a = this.regex.exec(jQuery.trim(c.toString())); if (a[2]) { var b = parseFloat(a[1]); var d = this.powers[a[2]] || 1; return b * d } else { return c } }, add: function(e, c, h, g, b, f) { var a = 0; if (jQuery.isFunction(h)) { if (!b) { b = g } g = h; h = c } c = jQuery.timer.timeParse(c); if (typeof c != "number" || isNaN(c) || c <= 0) { return } if (b && b.constructor != Number) { f = !!b; b = 0 } b = b || 0; f = f || false; var d = jQuery.data(e, this.dataKey) || jQuery.data(e, this.dataKey, {}); if (!d[h]) { d[h] = {} } g.timerID = g.timerID || this.guid++; var j = function() { if (f && this.inProgress) { return } this.inProgress = true; if ((++a > b && b !== 0) || g.call(e, a) === false) { jQuery.timer.remove(e, h, g) } this.inProgress = false }; j.timerID = g.timerID; if (!d[h][g.timerID]) { d[h][g.timerID] = window.setInterval(j, c) } this.global.push(e) }, remove: function(c, b, d) { var e = jQuery.data(c, this.dataKey), a; if (e) { if (!b) { for (b in e) { this.remove(c, b, d) } } else { if (e[b]) { if (d) { if (d.timerID) { window.clearInterval(e[b][d.timerID]); delete e[b][d.timerID] } } else { for (var d in e[b]) { window.clearInterval(e[b][d]); delete e[b][d] } } for (a in e[b]) { break } if (!a) { a = null; delete e[b] } } } for (a in e) { break } if (!a) { jQuery.removeData(c, this.dataKey) } } } } }); jQuery(window).bind("unload", function() { jQuery.each(jQuery.timer.global, function(a, b) { jQuery.timer.remove(b) }) }); (function(a) { a.fn.dumbCrossFade = function(k) { var j = "dumbCrossFade.publicAccessor"; var r = "dumbCrossFade.config"; if (typeof (this.data(j)) !== "undefined" && this.data(j) !== null) { var p = this.data(j); var e = this.data(r); var m = Array.prototype.slice.apply(arguments); if (m.length > 0) { if (typeof (m[0]) === "object") { if (k) { a.extend(e, k) } var m = Array.prototype.slice.apply(arguments); if (m.length > 1) { m = m.slice(1, m.length) } else { p.start(); return this } } if (arguments.length === 1) { p[arguments[0]]() } else { if (arguments.length > 1) { var m = Array.prototype.slice.apply(arguments); m = m.slice(1, m.length); p[arguments[0]].apply(this, m) } } } return this } var g = { slideType: "slidehorizontal", index: 0, showTime: 5000, transitionTime: 1000, doHoverPause: true, maxZIndex: 100, slideChange: null, direction: "forward", fadeInOut: false }, n = null, d = [], h = false, l = -1, o = this; $window = a(window), $body = a("body"); if (k) { a.extend(g, k) } function c() { if (n !== null) { window.clearTimeout(n); n = null } } function b() { if (h) { if (arguments.length > 0) { l = arguments[0] } return } var y = g.index; var w = (arguments.length > 0) ? arguments[0] : (g.index >= d.length - 1) ? 0 : g.index + 1; if (g.direction === "backward") { if (y === 0) { w = d.length - 1 } else { w = y - 1 } } if (y == w) { return } var s = d[y].show(), z = d[w]; h = true; doneF = function() { s.hide(); if (g.fadeInOut) { s.css({ opacity: "1.0" }); z.css({ opacity: "1.0" }) } h = false; if (l != -1) { b(l); l = -1 } }; s.css("z-index", (g.maxZIndex - 1) + ""); z.css("z-index", g.maxZIndex + ""); switch (g.slideType) { case "slidehorizontal": var A = s.position(), t = s.width(), v = "-=" + t; if (g.direction === "forward") { z.css({ left: (parseInt(A.left) + t) + "px" }) } else { z.css({ left: (parseInt(A.left) - t) + "px" }); v = "+=" + t } if (g.fadeInOut) { z.css({ opacity: "0", display: "block" }); s.animate({ left: v, opacity: "0" }, g.transitionTime, "swing"); z.animate({ left: v, opacity: "1.0" }, g.transitionTime, "swing", doneF) } else { z.show(); s.animate({ left: v }, g.transitionTime, "swing"); z.animate({ left: v }, g.transitionTime, "swing", doneF) } break; case "slidevertical": var A = s.position(), B = s.height(), u = "-=" + B; if (g.direction === "forward") { z.css({ top: (parseInt(A.top) + B) + "px", display: "block" }) } else { z.css({ top: (parseInt(A.top) - B) + "px", display: "block" }); u = "+=" + B } if (g.fadeInOut) { z.css({ opacity: "0", display: "block" }); s.animate({ top: u, opacity: "0" }, g.transitionTime, "swing"); z.animate({ top: u, opacity: "1.0" }, g.transitionTime, "swing", doneF) } else { z.show(); s.animate({ top: u }, g.transitionTime); z.animate({ top: u }, g.transitionTime, doneF) } break; case "fade": z.fadeIn(g.transitionTime, doneF); break } if (g.slideChange !== null) { g.slideChange(w) } g.index = w } function q() { c(); n = window.setTimeout(function() { b(); q() }, g.showTime) } o.each(function() { (d.length === g.index) ? a(this).show() : a(this).hide(); if (d.length === 0) { if (g.doHoverPause) { a(this).parent().hover(function() { c() }, function() { c(); q() }) } } d[d.length] = a(this) }); var f = { jump: function(s) { c(); b(s); return f }, start: function() { o.children().hide(); d[g.index].show(); g.direction = "forward"; q() }, stop: function() { c() }, next: function() { g.direction = "forward"; c(); b() }, previous: function() { g.direction = "backward"; c(); b() } }; this.data(j, f); this.data(r, g); q(); return this } })(jQuery); (function(E) { var t = "colorbox", r = "hover", A = true, S = false, X, p = !E.support.opacity, U = p && !window.XMLHttpRequest, B = "cbox_open", M = "cbox_load", w = "cbox_complete", L = "cbox_cleanup", q = "cbox_closed", P = "resize.cbox_resize", J, V, W, d, C, m, b, I, c, Q, G, h, g, u, l, o, N, n, K, v, Y, k, f, a, s, j, D, R, z, O, F = { transition: "elastic", speed: 350, width: S, height: S, innerWidth: S, innerHeight: S, initialWidth: "400", initialHeight: "400", maxWidth: S, maxHeight: S, scalePhotos: A, scrolling: A, inline: S, html: S, iframe: S, photo: S, href: S, title: S, rel: S, opacity: 0.9, preloading: A, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: S, overlayClose: A, slideshow: S, slideshowAuto: A, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: S, onLoad: S, onComplete: S, onCleanup: S, onClosed: S }; function H(Z, aa) { aa = aa === "x" ? Q.width() : Q.height(); return (typeof Z === "string") ? Math.round((Z.match(/%/) ? (aa / 100) * parseInt(Z, 10) : parseInt(Z, 10))) : Z } function y(Z) { Z = E.isFunction(Z) ? Z.call(s) : Z; return R.photo || Z.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i) } function T() { for (var Z in R) { if (E.isFunction(R[Z]) && Z.substring(0, 2) !== "on") { R[Z] = R[Z].call(s) } } R.rel = R.rel || s.rel; R.href = R.href || s.href; R.title = R.title || s.title } function e(Z) { s = Z; R = E(s).data(t); T(); if (R.rel && R.rel !== "nofollow") { c = E(".cboxElement").filter(function() { var aa = E(this).data(t).rel || this.rel; return (aa === R.rel) }); D = c.index(s); if (D < 0) { c = c.add(s); D = c.length - 1 } } else { c = E(s); D = 0 } if (!z) { z = A; O = A; j = s; j.blur(); E(document).bind("keydown.cbox_close", function(aa) { if (aa.keyCode === 27) { aa.preventDefault(); X.close() } }).bind("keydown.cbox_arrows", function(aa) { if (c.length > 1) { if (aa.keyCode === 37) { aa.preventDefault(); K.click() } else { if (aa.keyCode === 39) { aa.preventDefault(); n.click() } } } }); if (R.overlayClose) { J.css({ cursor: "pointer" }).one("click", X.close) } E.event.trigger(B); if (R.onOpen) { R.onOpen.call(s) } J.css({ opacity: R.opacity }).show(); R.w = H(R.initialWidth, "x"); R.h = H(R.initialHeight, "y"); X.position(0); if (U) { Q.bind("resize.cboxie6 scroll.cboxie6", function() { J.css({ width: Q.width(), height: Q.height(), top: Q.scrollTop(), left: Q.scrollLeft() }) }).trigger("scroll.cboxie6") } } o.add(K).add(n).add(N).add(l).hide(); v.html(R.close).show(); X.slideshow(); X.load() } X = E.fn.colorbox = function(Z, ab) { var aa = this; if (!aa.length) { if (aa.selector === "") { aa = E("<a/>"); Z.open = A } else { return this } } aa.each(function() { var ac = E.extend({}, E(this).data(t) ? E(this).data(t) : F, Z); E(this).data(t, ac).addClass("cboxElement"); if (ab) { E(this).data(t).onComplete = ab } }); if (Z && Z.open) { e(aa) } return this }; X.init = function() { function Z(aa) { return E('<div id="cbox' + aa + '"/>') } Q = E(window); V = E('<div id="colorbox"/>'); J = Z("Overlay").hide(); W = Z("Wrapper"); d = Z("Content").append(G = Z("LoadedContent").css({ width: 0, height: 0 }), g = Z("LoadingOverlay"), u = Z("LoadingGraphic"), l = Z("Title"), o = Z("Current"), N = Z("Slideshow"), n = Z("Next"), K = Z("Previous"), v = Z("Close")); W.append(E("<div/>").append(Z("TopLeft"), C = Z("TopCenter"), Z("TopRight")), E("<div/>").append(m = Z("MiddleLeft"), d, b = Z("MiddleRight")), E("<div/>").append(Z("BottomLeft"), I = Z("BottomCenter"), Z("BottomRight"))).children().children().css({ "float": "left" }); h = E("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>"); E("body").prepend(J, V.append(W, h)); if (p) { V.addClass("cboxIE"); if (U) { J.css("position", "absolute") } } d.children().bind("mouseover mouseout", function() { E(this).toggleClass(r) }).addClass(r); Y = C.height() + I.height() + d.outerHeight(A) - d.height(); k = m.width() + b.width() + d.outerWidth(A) - d.width(); f = G.outerHeight(A); a = G.outerWidth(A); V.css({ "padding-bottom": Y, "padding-right": k }).hide(); n.click(X.next); K.click(X.prev); v.click(X.close); d.children().removeClass(r); E(".cboxElement").live("click", function(aa) { if (aa.button !== 0 && typeof aa.button !== "undefined") { return A } else { e(this); return S } }) }; X.position = function(ae, ab) { var ad, aa = Q.height(), ac = Math.max(aa - R.h - f - Y, 0) / 2 + Q.scrollTop(), Z = Math.max(document.documentElement.clientWidth - R.w - a - k, 0) / 2 + Q.scrollLeft(); ad = (V.width() === R.w + a && V.height() === R.h + f) ? 0 : ae; W[0].style.width = W[0].style.height = "9999px"; function af(ag) { C[0].style.width = I[0].style.width = d[0].style.width = ag.style.width; u[0].style.height = g[0].style.height = d[0].style.height = m[0].style.height = b[0].style.height = ag.style.height } V.dequeue().animate({ width: R.w + a, height: R.h + f, top: ac, left: Z }, { duration: ad, complete: function() { af(this); O = S; W[0].style.width = (R.w + a + k) + "px"; W[0].style.height = (R.h + f + Y) + "px"; if (ab) { ab() } }, step: function() { af(this) } }) }; X.resize = function(ad) { if (!z) { return } var ae, ac, aa, ag, ak, Z, ai, ab = R.transition === "none" ? 0 : R.speed; Q.unbind(P); if (!ad) { ai = setTimeout(function() { var al = G.wrapInner("<div style='overflow:auto'></div>").children(); R.h = al.height(); G.css({ height: R.h }); al.replaceWith(al.children()); X.position(ab) }, 1); return } G.remove(); G = E('<div id="cboxLoadedContent"/>').html(ad); function ah() { R.w = R.w || G.width(); R.w = R.mw && R.mw < R.w ? R.mw : R.w; return R.w } function af() { R.h = R.h || G.height(); R.h = R.mh && R.mh < R.h ? R.mh : R.h; return R.h } G.hide().appendTo(h).css({ width: ah(), overflow: R.scrolling ? "auto" : "hidden" }).css({ height: af() }).prependTo(d); E("#cboxPhoto").css({ cssFloat: "none" }); if (U) { E("select:not(#colorbox select)").filter(function() { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one(L, function() { this.style.visibility = "inherit" }) } function aj(al) { X.position(al, function() { if (!z) { return } if (p) { if (Z) { G.fadeIn(100) } V[0].style.removeAttribute("filter") } if (R.iframe) { G.append("<iframe id='cboxIframe'" + (R.scrolling ? " " : "scrolling='no'") + " name='iframe_" + new Date().getTime() + "' frameborder=0 src='" + R.href + "' " + (p ? "allowtransparency='true'" : "") + " />") } G.show(); l.show().html(R.title); if (c.length > 1) { o.html(R.current.replace(/\{current\}/, D + 1).replace(/\{total\}/, c.length)).show(); n.html(R.next).show(); K.html(R.previous).show(); if (R.slideshow) { N.show() } } g.hide(); u.hide(); E.event.trigger(w); if (R.onComplete) { R.onComplete.call(s) } if (R.transition === "fade") { V.fadeTo(ab, 1, function() { if (p) { V[0].style.removeAttribute("filter") } }) } Q.bind(P, function() { X.position(0) }) }) } if ((R.transition === "fade" && V.fadeTo(ab, 0, function() { aj(0) })) || aj(ab)) { } if (R.preloading && c.length > 1) { ac = D > 0 ? c[D - 1] : c[c.length - 1]; ag = D < c.length - 1 ? c[D + 1] : c[0]; ak = E(ag).data(t).href || ag.href; aa = E(ac).data(t).href || ac.href; if (y(ak)) { E("<img />").attr("src", ak) } if (y(aa)) { E("<img />").attr("src", aa) } } }; X.load = function() { var aa, Z, ac, ab = X.resize; O = A; s = c[D]; R = E(s).data(t); T(); E.event.trigger(M); if (R.onLoad) { R.onLoad.call(s) } R.h = R.height ? H(R.height, "y") - f - Y : R.innerHeight ? H(R.innerHeight, "y") : S; R.w = R.width ? H(R.width, "x") - a - k : R.innerWidth ? H(R.innerWidth, "x") : S; R.mw = R.w; R.mh = R.h; if (R.maxWidth) { R.mw = H(R.maxWidth, "x") - a - k; R.mw = R.w && R.w < R.mw ? R.w : R.mw } if (R.maxHeight) { R.mh = H(R.maxHeight, "y") - f - Y; R.mh = R.h && R.h < R.mh ? R.h : R.mh } aa = R.href; g.show(); u.show(); if (R.inline) { E('<div id="cboxInlineTemp" />').hide().insertBefore(E(aa)[0]).bind(M + " " + L, function() { E(this).replaceWith(G.children()) }); ab(E(aa)) } else { if (R.iframe) { ab(" ") } else { if (R.html) { ab(R.html) } else { if (y(aa)) { Z = new Image(); Z.onload = function() { var ad; Z.onload = null; Z.id = "cboxPhoto"; E(Z).css({ margin: "auto", border: "none", display: "block", cssFloat: "left" }); if (R.scalePhotos) { ac = function() { Z.height -= Z.height * ad; Z.width -= Z.width * ad }; if (R.mw && Z.width > R.mw) { ad = (Z.width - R.mw) / Z.width; ac() } if (R.mh && Z.height > R.mh) { ad = (Z.height - R.mh) / Z.height; ac() } } if (R.h) { Z.style.marginTop = Math.max(R.h - Z.height, 0) / 2 + "px" } ab(Z); if (c.length > 1) { E(Z).css({ cursor: "pointer" }).click(X.next) } if (p) { Z.style.msInterpolationMode = "bicubic" } }; Z.src = aa } else { E("<div />").appendTo(h).load(aa, function(ad, ae) { if (ae === "success") { ab(this) } else { ab(E("<p>Request unsuccessful.</p>")) } }) } } } } }; X.next = function() { if (!O) { D = D < c.length - 1 ? D + 1 : 0; X.load() } }; X.prev = function() { if (!O) { D = D > 0 ? D - 1 : c.length - 1; X.load() } }; X.slideshow = function() { var aa, Z, ab = "cboxSlideshow_"; N.bind(q, function() { N.unbind(); clearTimeout(Z); V.removeClass(ab + "off " + ab + "on") }); function ac() { N.text(R.slideshowStop).bind(w, function() { Z = setTimeout(X.next, R.slideshowSpeed) }).bind(M, function() { clearTimeout(Z) }).one("click", function() { aa(); E(this).removeClass(r) }); V.removeClass(ab + "off").addClass(ab + "on") } aa = function() { clearTimeout(Z); N.text(R.slideshowStart).unbind(w + " " + M).one("click", function() { ac(); Z = setTimeout(X.next, R.slideshowSpeed); E(this).removeClass(r) }); V.removeClass(ab + "on").addClass(ab + "off") }; if (R.slideshow && c.length > 1) { if (R.slideshowAuto) { ac() } else { aa() } } }; X.close = function() { E.event.trigger(L); if (R.onCleanup) { R.onCleanup.call(s) } z = S; E(document).unbind("keydown.cbox_close keydown.cbox_arrows"); Q.unbind(P + " resize.cboxie6 scroll.cboxie6"); J.css({ cursor: "auto" }).fadeOut("fast"); V.stop(A, S).fadeOut("fast", function() { E("#colorbox iframe").attr("src", "about:blank"); G.remove(); V.css({ opacity: 1 }); try { j.focus() } catch (Z) { } E.event.trigger(q); if (R.onClosed) { R.onClosed.call(s) } }) }; X.element = function() { return E(s) }; X.settings = F; E(X.init) } (jQuery)); (function(g) { g.fn.adGallery = function(k) { var m = { loader_image: "http://d2br62l25pxkcl.cloudfront.net/Images/ad-gallery_loader.gif", start_at_index: 0, thumb_opacity: 0.7, animate_first_image: false, animation_speed: 400, width: false, height: false, display_next_and_prev: true, display_back_and_forward: true, scroll_jump: 0, slideshow: { enable: true, autostart: false, speed: 5000, start_label: "Start", stop_label: "Stop", stop_on_scroll: true, countdown_prefix: "(", countdown_sufix: ")", onStart: false, onStop: false }, effect: "slide-hori", enable_keyboard_move: true, cycle: true, callbacks: { init: false, afterImageVisible: false, beforeImageVisible: false} }; var l = g.extend(false, m, k); if (k && k.slideshow) { l.slideshow = g.extend(false, m.slideshow, k.slideshow) } if (!l.slideshow.enable) { l.slideshow.autostart = false } var j = []; g(this).each(function() { var n = new c(this, l); j[j.length] = n }); return j }; function f(k, l, m) { var n = parseInt(k.css("top"), 10); if (l == "left") { var j = "-" + this.image_wrapper_height + "px"; k.css("top", this.image_wrapper_height + "px") } else { var j = this.image_wrapper_height + "px"; k.css("top", "-" + this.image_wrapper_height + "px") } if (m) { m.css("bottom", "-" + m[0].offsetHeight + "px"); m.animate({ bottom: 0 }, this.settings.animation_speed * 2) } return { old_image: { top: j }, new_image: { top: n}} } function e(k, l, n) { var m = parseInt(k.css("left"), 10); if (l == "left") { var j = "-" + this.image_wrapper_width + "px"; k.css("left", this.image_wrapper_width + "px") } else { var j = this.image_wrapper_width + "px"; k.css("left", "-" + this.image_wrapper_width + "px") } if (n) { n.css("bottom", "-" + n[0].offsetHeight + "px"); n.animate({ bottom: 0 }, this.settings.animation_speed * 2) } return { old_image: { left: j }, new_image: { left: m}} } function d(l, m, o) { var k = l.width(); var j = l.height(); var n = parseInt(l.css("left"), 10); var p = parseInt(l.css("top"), 10); l.css({ width: 0, height: 0, top: this.image_wrapper_height / 2, left: this.image_wrapper_width / 2 }); return { old_image: { width: 0, height: 0, top: this.image_wrapper_height / 2, left: this.image_wrapper_width / 2 }, new_image: { width: k, height: j, top: p, left: n}} } function b(j, k, l) { j.css("opacity", 0); return { old_image: { opacity: 0 }, new_image: { opacity: 1}} } function h(j, k, l) { j.css("opacity", 0); return { old_image: { opacity: 0 }, new_image: { opacity: 1 }, speed: 0} } function c(k, j) { this.init(k, j) } c.prototype = { wrapper: false, image_wrapper: false, gallery_info: false, nav: false, loader: false, preloads: false, thumbs_wrapper: false, scroll_back: false, scroll_forward: false, next_link: false, prev_link: false, slideshow: false, image_wrapper_width: 0, image_wrapper_height: 0, current_index: 0, current_image: false, nav_display_width: 0, settings: false, images: false, in_transition: false, animations: false, init: function(n, m) { var l = this; this.wrapper = g(n); this.settings = m; this.setupElements(); this.setupAnimations(); if (this.settings.width) { this.image_wrapper_width = this.settings.width; this.image_wrapper.width(this.settings.width); this.wrapper.width(this.settings.width) } else { this.image_wrapper_width = this.image_wrapper.width() } if (this.settings.height) { this.image_wrapper_height = this.settings.height; this.image_wrapper.height(this.settings.height) } else { this.image_wrapper_height = this.image_wrapper.height() } this.nav_display_width = this.nav.width(); this.current_index = 0; this.current_image = false; this.in_transition = false; this.findImages(); if (this.settings.display_next_and_prev) { this.initNextAndPrev() } var j = function(o) { return l.nextImage(o) }; this.slideshow = new a(j, this.settings.slideshow); this.controls.append(this.slideshow.create()); if (this.settings.slideshow.enable) { this.slideshow.enable() } else { this.slideshow.disable() } if (this.settings.display_back_and_forward) { this.initBackAndForward() } if (this.settings.enable_keyboard_move) { this.initKeyEvents() } var k = this.settings.start_at_index; if (window.location.hash && window.location.hash.indexOf("#ad-image") === 0) { k = window.location.hash.replace(/[^0-9]+/g, ""); if ((k * 1) != k) { k = this.settings.start_at_index } } this.loading(true); this.showImage(k, function() { if (l.settings.slideshow.autostart) { l.preloadImage(k + 1); l.slideshow.start() } }); this.fireCallback(this.settings.callbacks.init) }, setupAnimations: function() { this.animations = { "slide-vert": f, "slide-hori": e, resize: d, fade: b, none: h} }, setupElements: function() { this.controls = this.wrapper.find(".ad-controls"); this.gallery_info = g('<p class="ad-info"></p>'); this.controls.append(this.gallery_info); this.image_wrapper = this.wrapper.find(".ad-image-wrapper"); this.image_wrapper.empty(); this.nav = this.wrapper.find(".ad-nav"); this.thumbs_wrapper = this.nav.find(".ad-thumbs"); this.preloads = g('<div class="ad-preloads"></div>'); this.loader = g('<img class="ad-loader" src="' + this.settings.loader_image + '">'); this.image_wrapper.append(this.loader); this.loader.hide(); g(document.body).append(this.preloads) }, loading: function(j) { if (j) { this.loader.show() } else { this.loader.hide() } }, addAnimation: function(j, k) { if (g.isFunction(k)) { this.animations[j] = k } }, findImages: function() { var o = this; this.images = []; var n = 0; var m = 0; var l = this.thumbs_wrapper.find("a"); var k = l.length; if (this.settings.thumb_opacity < 1) { l.find("img").css("opacity", this.settings.thumb_opacity) } l.each(function(q) { var s = g(this); var r = s.attr("href"); var p = s.find("img"); if (!o.isImageLoaded(p[0])) { p.load(function() { n += this.parentNode.parentNode.offsetWidth; m++ }) } else { n += p[0].parentNode.parentNode.offsetWidth; m++ } s.addClass("ad-thumb" + q); s.click(function() { o.showImage(q); o.slideshow.stop(); return false }).hover(function() { if (!g(this).is(".ad-active") && o.settings.thumb_opacity < 1) { g(this).find("img").fadeTo(300, 1) } o.preloadImage(q) }, function() { if (!g(this).is(".ad-active") && o.settings.thumb_opacity < 1) { g(this).find("img").fadeTo(300, o.settings.thumb_opacity) } }); var u = false; if (p.data("ad-desc")) { u = p.data("ad-desc") } else { if (p.attr("longdesc") && p.attr("longdesc").length) { u = p.attr("longdesc") } } var t = false; if (p.data("ad-title")) { t = p.data("ad-title") } else { if (p.attr("title") && p.attr("title").length) { t = p.attr("title") } } o.images[q] = { thumb: p.attr("src"), image: r, error: false, preloaded: false, desc: u, title: t, size: false} }); var j = setInterval(function() { if (k == m) { o.nav.find(".ad-thumb-list").css("width", n + "px"); clearInterval(j) } }, 100) }, initKeyEvents: function() { var j = this; g(document).keydown(function(k) { if (k.keyCode == 39) { j.nextImage(); j.slideshow.stop() } else { if (k.keyCode == 37) { j.prevImage(); j.slideshow.stop() } } }) }, initNextAndPrev: function() { this.next_link = g('<div class="ad-next"><div class="ad-next-image"></div></div>'); this.prev_link = g('<div class="ad-prev"><div class="ad-prev-image"></div></div>'); this.image_wrapper.append(this.next_link); this.image_wrapper.append(this.prev_link); var j = this; this.prev_link.add(this.next_link).mouseover(function(k) { g(this).css("height", j.image_wrapper_height); g(this).find("div").show() }).mouseout(function(k) { g(this).find("div").hide() }).click(function() { if (g(this).is(".ad-next")) { j.nextImage(); j.slideshow.stop() } else { j.prevImage(); j.slideshow.stop() } }).find("div").css("opacity", 0.7) }, initBackAndForward: function() { var l = this; this.scroll_forward = g('<div class="ad-forward"></div>'); this.scroll_back = g('<div class="ad-back"></div>'); this.nav.append(this.scroll_forward); this.nav.prepend(this.scroll_back); var k = 0; var j = false; g(this.scroll_back).add(this.scroll_forward).click(function() { var m = l.nav_display_width - 50; if (l.settings.scroll_jump > 0) { var m = l.settings.scroll_jump } if (g(this).is(".ad-forward")) { var n = l.thumbs_wrapper.scrollLeft() + m } else { var n = l.thumbs_wrapper.scrollLeft() - m } if (l.settings.slideshow.stop_on_scroll) { l.slideshow.stop() } l.thumbs_wrapper.animate({ scrollLeft: n + "px" }); return false }).css("opacity", 0.6).hover(function() { var m = "left"; if (g(this).is(".ad-forward")) { m = "right" } j = setInterval(function() { k++; if (k > 30 && l.settings.slideshow.stop_on_scroll) { l.slideshow.stop() } var n = l.thumbs_wrapper.scrollLeft() + 1; if (m == "left") { n = l.thumbs_wrapper.scrollLeft() - 1 } l.thumbs_wrapper.scrollLeft(n) }, 10); g(this).css("opacity", 1) }, function() { k = 0; clearInterval(j); g(this).css("opacity", 0.6) }) }, _afterShow: function() { this.gallery_info.html((this.current_index + 1) + " / " + this.images.length); if (!this.settings.cycle) { this.prev_link.show().css("height", this.image_wrapper_height); this.next_link.show().css("height", this.image_wrapper_height); if (this.current_index == (this.images.length - 1)) { this.next_link.hide() } if (this.current_index == 0) { this.prev_link.hide() } } this.fireCallback(this.settings.callbacks.afterImageVisible) }, _getContainedImageSize: function(k, j) { if (j > this.image_wrapper_height) { var l = k / j; j = this.image_wrapper_height; k = this.image_wrapper_height * l } if (k > this.image_wrapper_width) { var l = j / k; k = this.image_wrapper_width; j = this.image_wrapper_width * l } return { width: k, height: j} }, _centerImage: function(m, k, j) { m.css("top", "0px"); if (j < this.image_wrapper_height) { var l = this.image_wrapper_height - j; m.css("top", (l / 2) + "px") } m.css("left", "0px"); if (k < this.image_wrapper_width) { var l = this.image_wrapper_width - k; m.css("left", (l / 2) + "px") } }, _getDescription: function(j) { var l = false; if (j.desc.length || j.title.length) { var k = ""; if (j.title.length) { k = '<strong class="ad-description-title">' + j.title + "</strong>" } var l = ""; if (j.desc.length) { l = "<span>" + j.desc + "</span>" } l = g('<p class="ad-image-description">' + k + l + "</p>") } return l }, showImage: function(j, m) { if (this.images[j] && !this.in_transition) { var k = this; var l = this.images[j]; this.in_transition = true; if (!l.preloaded) { this.loading(true); this.preloadImage(j, function() { k.loading(false); k._showWhenLoaded(j, m) }) } else { this._showWhenLoaded(j, m) } } }, _showWhenLoaded: function(o, m) { if (this.images[o]) { var l = this; var r = this.images[o]; var n = g(document.createElement("a")).addClass("fullSize ad-image cboxElement"); var t = r.image; var y = t.split("/"); var s = y[y.length - 1].substring(5, y[y.length - 1].length); var u = ""; var C; for (C = 1; C < y.length - 1; C++) { u += "/" + y[C] } u += "/" + s; n.attr("href", u); n.attr("title", r.title); var p = n; var D = g(new Image()).attr("src", r.image); p.append(D); this.image_wrapper.prepend(p); var q = this._getContainedImageSize(r.size.width, r.size.height); D.attr("width", q.width); D.attr("height", q.height); p.css({ width: q.width + "px", height: q.height + "px" }); this._centerImage(p, q.width, q.height); var z = this._getDescription(r, p); if (z) { p.append(z); var w = q.width - parseInt(z.css("padding-left"), 10) - parseInt(z.css("padding-right"), 10); z.css("width", w + "px") } this.highLightThumb(this.nav.find(".ad-thumb" + o)); var B = "right"; if (this.current_index < o) { B = "left" } this.fireCallback(this.settings.callbacks.beforeImageVisible); if (this.current_image || this.settings.animate_first_image) { var k = this.settings.animation_speed; var v = "swing"; var A = this.animations[this.settings.effect].call(this, p, B, z); if (typeof A.speed != "undefined") { k = A.speed } if (typeof A.easing != "undefined") { v = A.easing } if (this.current_image) { var j = this.current_image; j.animate(A.old_image, k, v, function() { j.remove() }) } p.animate(A.new_image, k, v, function() { l.current_index = o; l.current_image = p; l.in_transition = false; l._afterShow(); l.fireCallback(m) }) } else { this.current_index = o; this.current_image = p; this.in_transition = false; l._afterShow(); this.fireCallback(m) } } }, nextIndex: function() { if (this.current_index == (this.images.length - 1)) { if (!this.settings.cycle) { return false } var j = 0 } else { var j = this.current_index + 1 } return j }, nextImage: function(k) { var j = this.nextIndex(); if (j === false) { return false } this.preloadImage(j + 1); this.showImage(j, k); return true }, prevIndex: function() { if (this.current_index == 0) { if (!this.settings.cycle) { return false } var j = this.images.length - 1 } else { var j = this.current_index - 1 } return j }, prevImage: function(k) { var j = this.prevIndex(); if (j === false) { return false } this.preloadImage(j - 1); this.showImage(j, k); return true }, preloadAll: function() { var k = this; var j = 0; function l() { if (j < k.images.length) { j++; k.preloadImage(j, l) } } k.preloadImage(j, l) }, preloadImage: function(k, n) { if (this.images[k]) { var m = this.images[k]; if (!this.images[k].preloaded) { var j = g(new Image()); j.attr("src", m.image); if (!this.isImageLoaded(j[0])) { this.preloads.append(j); var l = this; j.load(function() { m.preloaded = true; m.size = { width: this.width, height: this.height }; l.fireCallback(n) }).error(function() { m.error = true; m.preloaded = false; m.size = false }) } else { m.preloaded = true; m.size = { width: j[0].width, height: j[0].height }; this.fireCallback(n) } } else { this.fireCallback(n) } } }, isImageLoaded: function(j) { if (typeof j.complete != "undefined" && !j.complete) { return false } if (typeof j.naturalWidth != "undefined" && j.naturalWidth == 0) { return false } return true }, highLightThumb: function(j) { this.thumbs_wrapper.find(".ad-active").removeClass("ad-active"); j.addClass("ad-active"); if (this.settings.thumb_opacity < 1) { this.thumbs_wrapper.find("a:not(.ad-active) img").fadeTo(300, this.settings.thumb_opacity); j.find("img").fadeTo(300, 1) } var k = j[0].parentNode.offsetLeft; k -= (this.nav_display_width / 2) - (j[0].offsetWidth / 2); this.thumbs_wrapper.animate({ scrollLeft: k + "px" }) }, fireCallback: function(j) { if (g.isFunction(j)) { j.call(this) } } }; function a(j, k) { this.init(j, k) } a.prototype = { start_link: false, stop_link: false, countdown: false, controls: false, settings: false, nextimage_callback: false, enabled: false, running: false, countdown_interval: false, init: function(j, l) { var k = this; this.nextimage_callback = j; this.settings = l }, create: function() { this.start_link = g('<span class="ad-slideshow-start">' + this.settings.start_label + "</span>"); this.stop_link = g('<span class="ad-slideshow-stop">' + this.settings.stop_label + "</span>"); this.countdown = g('<span class="ad-slideshow-countdown"></span>'); this.controls = g('<div class="ad-slideshow-controls"></div>'); this.controls.append(this.start_link).append(this.stop_link).append(this.countdown); this.countdown.hide(); var j = this; this.start_link.click(function() { j.start() }); this.stop_link.click(function() { j.stop() }); g(document).keydown(function(k) { if (k.keyCode == 83) { if (j.running) { j.stop() } else { j.start() } } }); return this.controls }, disable: function() { this.enabled = false; this.stop(); this.controls.hide() }, enable: function() { this.enabled = true; this.controls.show() }, toggle: function() { if (this.enabled) { this.disable() } else { this.enable() } }, start: function() { if (this.running || !this.enabled) { return false } var j = this; this.running = true; this.controls.addClass("ad-slideshow-running"); this._next(); this.fireCallback(this.settings.onStart); return true }, stop: function() { if (!this.running) { return false } this.running = false; this.countdown.hide(); this.controls.removeClass("ad-slideshow-running"); clearInterval(this.countdown_interval); this.fireCallback(this.settings.onStop); return true }, _next: function() { var l = this; var m = this.settings.countdown_prefix; var k = this.settings.countdown_sufix; clearInterval(l.countdown_interval); this.countdown.show().html(m + (this.settings.speed / 1000) + k); var j = 0; this.countdown_interval = setInterval(function() { j += 1000; if (j >= l.settings.speed) { var o = function() { if (l.running) { l._next() } j = 0 }; if (!l.nextimage_callback(o)) { l.stop() } j = 0 } var n = parseInt(l.countdown.text().replace(/[^0-9]/g, ""), 10); n--; if (n > 0) { l.countdown.html(m + n + k) } }, 1000) }, fireCallback: function(j) { if (g.isFunction(j)) { j.call(this) } } } })(jQuery); (function($) { $.fn.validationEngine = function(settings) { if ($.validationEngineLanguage) { allRules = $.validationEngineLanguage.allRules } else { $.validationEngine.debug("Validation engine rules are not loaded check your external file") } settings = jQuery.extend({ allrules: allRules, validationEventTriggers: "blur", inlineValidation: true, returnIsValid: false, animateSubmit: true, unbindEngine: true, ajaxSubmit: false, promptPosition: "topRight", success: false, failure: function() { } }, settings); $.validationEngine.settings = settings; $.validationEngine.ajaxValidArray = new Array(); if (settings.inlineValidation == true) { if (!settings.returnIsValid) { allowReturnIsvalid = false; $(this).find("[class*=validate]").not("[type=checkbox]").bind(settings.validationEventTriggers, function(caller) { _inlinEvent(this) }); $(this).find("[class*=validate][type=checkbox]").bind("click", function(caller) { _inlinEvent(this) }); firstvalid = false } function _inlinEvent(caller) { $.validationEngine.settings = settings; if ($.validationEngine.intercept == false || !$.validationEngine.intercept) { $.validationEngine.onSubmitValid = false; $.validationEngine.loadValidation(caller) } else { $.validationEngine.intercept = false } } } if (settings.returnIsValid) { if ($.validationEngine.submitValidation(this, settings)) { return false } else { return true } } $(this).bind("submit", function(caller) { $.validationEngine.onSubmitValid = true; $.validationEngine.settings = settings; if ($.validationEngine.submitValidation(this, settings) == false) { if ($.validationEngine.submitForm(this, settings) == true) { return false } } else { settings.failure && settings.failure(); return false } }) }; $.validationEngine = { defaultSetting: function(caller) { if ($.validationEngineLanguage) { allRules = $.validationEngineLanguage.allRules } else { $.validationEngine.debug("Validation engine rules are not loaded check your external file") } settings = { allrules: allRules, validationEventTriggers: "blur", inlineValidation: true, returnIsValid: false, animateSubmit: true, unbindEngine: true, ajaxSubmit: false, promptPosition: "topRight", success: false, failure: function() { } }; $.validationEngine.settings = settings }, loadValidation: function(caller) { if (!$.validationEngine.settings) { $.validationEngine.defaultSetting() } rulesParsing = $(caller).attr("class"); rulesRegExp = /\[(.*)\]/; getRules = rulesRegExp.exec(rulesParsing); str = getRules[1]; pattern = /\W+/; result = str.split(pattern); var validateCalll = $.validationEngine.validateCall(caller, result); return validateCalll }, validateCall: function(caller, rules) { var promptText = ""; if (!$(caller).attr("id")) { $.validationEngine.debug("This field have no ID attribut( name & class displayed): " + $(caller).attr("name") + " " + $(caller).attr("class")) } caller = caller; ajaxValidate = false; var callerName = $(caller).attr("name"); $.validationEngine.isError = false; $.validationEngine.showTriangle = true; callerType = $(caller).attr("type"); for (i = 0; i < rules.length; i++) { switch (rules[i]) { case "optional": if (!$(caller).val()) { $.validationEngine.closePrompt(caller); return $.validationEngine.isError } break; case "required": _required(caller, rules); break; case "custom": _customRegex(caller, rules, i); break; case "ajax": if (!$.validationEngine.onSubmitValid) { _ajax(caller, rules, i) } break; case "length": _length(caller, rules, i); break; case "maxCheckbox": _maxCheckbox(caller, rules, i); groupname = $(caller).attr("name"); caller = $("input[name='" + groupname + "']"); break; case "minCheckbox": _minCheckbox(caller, rules, i); groupname = $(caller).attr("name"); caller = $("input[name='" + groupname + "']"); break; case "confirm": _confirm(caller, rules, i); break; default: } } radioHack(); if ($.validationEngine.isError == true) { linkTofield = $.validationEngine.linkTofield(caller); ($("div." + linkTofield).size() == 0) ? $.validationEngine.buildPrompt(caller, promptText, "error") : $.validationEngine.updatePromptText(caller, promptText) } else { $.validationEngine.closePrompt(caller) } function radioHack() { if ($("input[name='" + callerName + "']").size() > 1 && (callerType == "radio" || callerType == "checkbox")) { caller = $("input[name='" + callerName + "'][type!=hidden]:first"); $.validationEngine.showTriangle = false } } function _required(caller, rules) { callerType = $(caller).attr("type"); if (callerType == "text" || callerType == "password" || callerType == "textarea") { if (!$(caller).val()) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[rules[i]].alertText + "<br />" } } if (callerType == "radio" || callerType == "checkbox") { callerName = $(caller).attr("name"); if ($("input[name='" + callerName + "']:checked").size() == 0) { $.validationEngine.isError = true; if ($("input[name='" + callerName + "']").size() == 1) { promptText += $.validationEngine.settings.allrules[rules[i]].alertTextCheckboxe + "<br />" } else { promptText += $.validationEngine.settings.allrules[rules[i]].alertTextCheckboxMultiple + "<br />" } } } if (callerType == "select-one") { if (!$(caller).val()) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[rules[i]].alertText + "<br />" } } if (callerType == "select-multiple") { if (!$(caller).find("option:selected").val()) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[rules[i]].alertText + "<br />" } } } function _customRegex(caller, rules, position) { customRule = rules[position + 1]; pattern = eval($.validationEngine.settings.allrules[customRule].regex); if (!pattern.test($(caller).attr("value"))) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[customRule].alertText + "<br />" } } function _ajax(caller, rules, position) { customAjaxRule = rules[position + 1]; postfile = $.validationEngine.settings.allrules[customAjaxRule].file; fieldValue = $(caller).val(); ajaxCaller = caller; fieldId = $(caller).attr("id"); ajaxValidate = true; ajaxisError = $.validationEngine.isError; if (!$.validationEngine.settings.allrules[customAjaxRule].extraData) { extraData = $.validationEngine.settings.allrules[customAjaxRule].extraData } else { extraData = "" } if (!ajaxisError) { $.ajax({ type: "POST", url: postfile, async: true, data: "validateValue=" + fieldValue + "&validateId=" + fieldId + "&validateError=" + customAjaxRule + extraData, beforeSend: function() { if ($.validationEngine.settings.allrules[customAjaxRule].alertTextLoad) { if (!$("div." + fieldId + "formError")[0]) { return $.validationEngine.buildPrompt(ajaxCaller, $.validationEngine.settings.allrules[customAjaxRule].alertTextLoad, "load") } else { $.validationEngine.updatePromptText(ajaxCaller, $.validationEngine.settings.allrules[customAjaxRule].alertTextLoad, "load") } } }, error: function(data, transport) { $.validationEngine.debug("error in the ajax: " + data.status + " " + transport) }, success: function(data) { data = eval("(" + data + ")"); ajaxisError = data.jsonValidateReturn[2]; customAjaxRule = data.jsonValidateReturn[1]; ajaxCaller = $("#" + data.jsonValidateReturn[0])[0]; fieldId = ajaxCaller; ajaxErrorLength = $.validationEngine.ajaxValidArray.length; existInarray = false; if (ajaxisError == "false") { _checkInArray(false); if (!existInarray) { $.validationEngine.ajaxValidArray[ajaxErrorLength] = new Array(2); $.validationEngine.ajaxValidArray[ajaxErrorLength][0] = fieldId; $.validationEngine.ajaxValidArray[ajaxErrorLength][1] = false; existInarray = false } $.validationEngine.ajaxValid = false; promptText += $.validationEngine.settings.allrules[customAjaxRule].alertText + "<br />"; $.validationEngine.updatePromptText(ajaxCaller, promptText, "", true) } else { _checkInArray(true); $.validationEngine.ajaxValid = true; if ($.validationEngine.settings.allrules[customAjaxRule].alertTextOk) { $.validationEngine.updatePromptText(ajaxCaller, $.validationEngine.settings.allrules[customAjaxRule].alertTextOk, "pass", true) } else { ajaxValidate = false; $.validationEngine.closePrompt(ajaxCaller) } } function _checkInArray(validate) { for (x = 0; x < ajaxErrorLength; x++) { if ($.validationEngine.ajaxValidArray[x][0] == fieldId) { $.validationEngine.ajaxValidArray[x][1] = validate; existInarray = true } } } } }) } } function _confirm(caller, rules, position) { confirmField = rules[position + 1]; if ($(caller).attr("value") != $("#" + confirmField).attr("value")) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules.confirm.alertText + "<br />" } } function _length(caller, rules, position) { startLength = eval(rules[position + 1]); endLength = eval(rules[position + 2]); feildLength = $(caller).attr("value").length; if (feildLength < startLength || feildLength > endLength) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules.length.alertText + startLength + $.validationEngine.settings.allrules.length.alertText2 + endLength + $.validationEngine.settings.allrules.length.alertText3 + "<br />" } } function _maxCheckbox(caller, rules, position) { nbCheck = eval(rules[position + 1]); groupname = $(caller).attr("name"); groupSize = $("input[name='" + groupname + "']:checked").size(); if (groupSize > nbCheck) { $.validationEngine.showTriangle = false; $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules.maxCheckbox.alertText + "<br />" } } function _minCheckbox(caller, rules, position) { nbCheck = eval(rules[position + 1]); groupname = $(caller).attr("name"); groupSize = $("input[name='" + groupname + "']:checked").size(); if (groupSize < nbCheck) { $.validationEngine.isError = true; $.validationEngine.showTriangle = false; promptText += $.validationEngine.settings.allrules.minCheckbox.alertText + " " + nbCheck + " " + $.validationEngine.settings.allrules.minCheckbox.alertText2 + "<br />" } } return ($.validationEngine.isError) ? $.validationEngine.isError : false }, submitForm: function(caller) { if ($.validationEngine.settings.ajaxSubmit) { if ($.validationEngine.settings.ajaxSubmitExtraData) { extraData = $.validationEngine.settings.ajaxSubmitExtraData } else { extraData = "" } $.ajax({ type: "POST", url: $.validationEngine.settings.ajaxSubmitFile, async: true, data: $(caller).serialize() + "&" + extraData, error: function(data, transport) { $.validationEngine.debug("error in the ajax: " + data.status + " " + transport) }, success: function(data) { if (data == "true") { $(caller).css("opacity", 1); $(caller).animate({ opacity: 0, height: 0 }, function() { $(caller).css("display", "none"); $(caller).before("<div class='ajaxSubmit'>" + $.validationEngine.settings.ajaxSubmitMessage + "</div>"); $.validationEngine.closePrompt(".formError", true); $(".ajaxSubmit").show("slow"); if ($.validationEngine.settings.success) { $.validationEngine.settings.success && $.validationEngine.settings.success(); return false } }) } else { data = eval("(" + data + ")"); if (!data.jsonValidateReturn) { $.validationEngine.debug("you are not going into the success fonction and jsonValidateReturn return nothing") } errorNumber = data.jsonValidateReturn.length; for (index = 0; index < errorNumber; index++) { fieldId = data.jsonValidateReturn[index][0]; promptError = data.jsonValidateReturn[index][1]; type = data.jsonValidateReturn[index][2]; $.validationEngine.buildPrompt(fieldId, promptError, type) } } } }); return true } if ($.validationEngine.settings.success) { if ($.validationEngine.settings.unbindEngine) { $(caller).unbind("submit") } $.validationEngine.settings.success && $.validationEngine.settings.success(); return true } return false }, buildPrompt: function(caller, promptText, type, ajaxed) { if (!$.validationEngine.settings) { $.validationEngine.defaultSetting() } var divFormError = document.createElement("div"); var formErrorContent = document.createElement("div"); linkTofield = $.validationEngine.linkTofield(caller); $(divFormError).addClass("formError"); if (type == "pass") { $(divFormError).addClass("greenPopup") } if (type == "load") { $(divFormError).addClass("blackPopup") } if (ajaxed) { $(divFormError).addClass("ajaxed") } $(divFormError).addClass(linkTofield); $(formErrorContent).addClass("formErrorContent"); $("body").append(divFormError); $(divFormError).append(formErrorContent); if ($.validationEngine.showTriangle != false) { var arrow = document.createElement("div"); $(arrow).addClass("formErrorArrow"); $(divFormError).append(arrow); if ($.validationEngine.settings.promptPosition == "bottomLeft" || $.validationEngine.settings.promptPosition == "bottomRight") { $(arrow).addClass("formErrorArrowBottom"); $(arrow).html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>') } if ($.validationEngine.settings.promptPosition == "topLeft" || $.validationEngine.settings.promptPosition == "topRight") { $(divFormError).append(arrow); $(arrow).html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>') } } $(formErrorContent).html(promptText); callerTopPosition = $(caller).offset().top; callerleftPosition = $(caller).offset().left; callerWidth = $(caller).width(); inputHeight = $(divFormError).height(); if ($.validationEngine.settings.promptPosition == "topRight") { callerleftPosition += callerWidth - 30; callerTopPosition += -inputHeight - 10 } if ($.validationEngine.settings.promptPosition == "topLeft") { callerTopPosition += -inputHeight - 10 } if ($.validationEngine.settings.promptPosition == "centerRight") { callerleftPosition += callerWidth + 13 } if ($.validationEngine.settings.promptPosition == "bottomLeft") { callerHeight = $(caller).height(); callerleftPosition = callerleftPosition; callerTopPosition = callerTopPosition + callerHeight + 15 } if ($.validationEngine.settings.promptPosition == "bottomRight") { callerHeight = $(caller).height(); callerleftPosition += callerWidth - 30; callerTopPosition += callerHeight + 15 } $(divFormError).css({ top: callerTopPosition, left: callerleftPosition, opacity: 0 }); return $(divFormError).animate({ opacity: 0.87 }, function() { return true }) }, updatePromptText: function(caller, promptText, type, ajaxed) { linkTofield = $.validationEngine.linkTofield(caller); var updateThisPrompt = "." + linkTofield; if (type == "pass") { $(updateThisPrompt).addClass("greenPopup") } else { $(updateThisPrompt).removeClass("greenPopup") } if (type == "load") { $(updateThisPrompt).addClass("blackPopup") } else { $(updateThisPrompt).removeClass("blackPopup") } if (ajaxed) { $(updateThisPrompt).addClass("ajaxed") } else { $(updateThisPrompt).removeClass("ajaxed") } $(updateThisPrompt).find(".formErrorContent").html(promptText); callerTopPosition = $(caller).offset().top; inputHeight = $(updateThisPrompt).height(); if ($.validationEngine.settings.promptPosition == "bottomLeft" || $.validationEngine.settings.promptPosition == "bottomRight") { callerHeight = $(caller).height(); callerTopPosition = callerTopPosition + callerHeight + 15 } if ($.validationEngine.settings.promptPosition == "centerRight") { callerleftPosition += callerWidth + 13 } if ($.validationEngine.settings.promptPosition == "topLeft" || $.validationEngine.settings.promptPosition == "topRight") { callerTopPosition = callerTopPosition - inputHeight - 10 } $(updateThisPrompt).animate({ top: callerTopPosition }) }, linkTofield: function(caller) { linkTofield = $(caller).attr("id") + "formError"; linkTofield = linkTofield.replace(/\[/g, ""); linkTofield = linkTofield.replace(/\]/g, ""); return linkTofield }, closePrompt: function(caller, outside) { if (!$.validationEngine.settings) { $.validationEngine.defaultSetting() } if (outside) { $(caller).fadeTo("fast", 0, function() { $(caller).remove() }); return false } if (!ajaxValidate) { linkTofield = $.validationEngine.linkTofield(caller); closingPrompt = "." + linkTofield; $(closingPrompt).fadeTo("fast", 0, function() { $(closingPrompt).remove() }) } }, debug: function(error) { if (!$("#debugMode")[0]) { $("body").append("<div id='debugMode'><div class='debugError'><strong>This is a debug mode, you got a problem with your form, it will try to help you, refresh when you think you nailed down the problem</strong></div></div>") } $(".debugError").append("<div class='debugerror'>" + error + "</div>") }, submitValidation: function(caller) { var stopForm = false; $.validationEngine.ajaxValid = true; $(caller).find(".formError").remove(); var toValidateSize = $(caller).find("[class*=validate]").size(); $(caller).find("[class*=validate]").each(function() { linkTofield = $.validationEngine.linkTofield(this); if (!$("." + linkTofield).hasClass("ajaxed")) { var validationPass = $.validationEngine.loadValidation(this); return (validationPass) ? stopForm = true : "" } }); ajaxErrorLength = $.validationEngine.ajaxValidArray.length; for (x = 0; x < ajaxErrorLength; x++) { if ($.validationEngine.ajaxValidArray[x][1] == false) { $.validationEngine.ajaxValid = false } } if (stopForm || !$.validationEngine.ajaxValid) { if ($.validationEngine.settings.animateSubmit) { destination = $(".formError:not('.greenPopup'):first").offset().top; $(".formError:not('.greenPopup')").each(function() { testDestination = $(this).offset().top; if (destination > testDestination) { destination = $(this).offset().top } }); $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 1100) } return true } else { return false } } } })(jQuery); (function(a) { a.fn.validationEngineLanguage = function() { }; a.validationEngineLanguage = { newLang: function() { a.validationEngineLanguage.allRules = { required: { regex: "none", alertText: "* This field is required", alertTextCheckboxMultiple: "* Please select an option", alertTextCheckboxe: "* This checkbox is required" }, length: { regex: "none", alertText: "*Between ", alertText2: " and ", alertText3: " characters allowed" }, maxCheckbox: { regex: "none", alertText: "* Checks allowed Exceeded" }, minCheckbox: { regex: "none", alertText: "* Please select ", alertText2: " options" }, confirm: { regex: "none", alertText: "* Your field is not matching" }, telephone: { regex: "/^[0-9-() ]+$/", alertText: "* Invalid phone number" }, email: { regex: "/^[a-zA-Z0-9_.-]+@([a-zA-Z0-9-]+.)+[a-zA-Z0-9]{2,4}$/", alertText: "* Invalid email address" }, date: { regex: "/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/", alertText: "* Invalid date, must be in YYYY-MM-DD format" }, onlyNumber: { regex: "/^[0-9 ]+$/", alertText: "* Numbers only" }, noSpecialCaracters: { regex: "/^[0-9a-zA-Z]+$/", alertText: "* No special caracters allowed" }, ajaxUser: { file: "validateUser.php", extraData: "name=eric", alertTextOk: "* This user is available", alertTextLoad: "* Loading, please wait", alertText: "* This user is already taken" }, ajaxName: { file: "validateUser.php", alertText: "* This name is already taken", alertTextOk: "* This name is available", alertTextLoad: "* Loading, please wait" }, onlyLetter: { regex: "/^[a-zA-Z ']+$/", alertText: "* Letters only"}} } } })(jQuery); $(document).ready(function() { $.validationEngineLanguage.newLang() }); (function($) { var ie6 = $.browser.msie && parseInt($.browser.version) == 6 && typeof window['XMLHttpRequest'] != "object", ieQuirks = null, w = []; $.modal = function(data, options) { return $.modal.impl.init(data, options); }; $.modal.close = function() { $.modal.impl.close(); }; $.fn.modal = function(options) { return $.modal.impl.init(this, options); }; $.modal.defaults = { appendTo: 'body', focus: true, opacity: 50, overlayId: 'simplemodal-overlay', overlayCss: {}, containerId: 'simplemodal-container', containerCss: {}, dataId: 'simplemodal-data', dataCss: {}, minHeight: null, minWidth: null, maxHeight: null, maxWidth: null, autoResize: false, autoPosition: true, zIndex: 1000, close: true, closeHTML: '<a class="modalCloseImg" title="Close"></a>', closeClass: 'simplemodal-close', escClose: true, overlayClose: false, position: null, persist: false, transient: false, onOpen: null, onShow: null, onClose: null }; $.modal.impl = { o: null, d: {}, init: function(data, options) { var s = this; if (s.d.data) { return false; } ieQuirks = $.browser.msie && !$.support.boxModel; s.o = $.extend({}, $.modal.defaults, options); s.zIndex = s.o.zIndex; s.occb = false; if (typeof data == 'object') { data = data instanceof jQuery ? data : $(data); s.d.placeholder = false; if (data.parent().parent().size() > 0) { data.before($('<span></span>').attr('id', 'simplemodal-placeholder').css({ display: 'none' })); s.d.placeholder = true; s.display = data.css('display'); if (!s.o.persist) { s.d.orig = data.clone(true); } } } else if (typeof data == 'string' || typeof data == 'number') { data = $('<div></div>').html(data); } else { alert('SimpleModal Error: Unsupported data type: ' + typeof data); return s; } s.create(data); data = null; s.open(); if ($.isFunction(s.o.onShow)) { s.o.onShow.apply(s, [s.d]); } return s; }, create: function(data) { var s = this; w = s.getDimensions(); if (!s.o.transient && ie6) { s.d.iframe = $('<iframe src="javascript:false;"></iframe>').css($.extend(s.o.iframeCss, { display: 'none', opacity: 0, position: 'fixed', height: w[0], width: w[1], zIndex: s.o.zIndex, top: 0, left: 0 })).appendTo(s.o.appendTo); } s.d.overlay = $('<div></div>').attr('id', s.o.overlayId).addClass('simplemodal-overlay').css($.extend(s.o.overlayCss, { display: 'none', opacity: s.o.opacity / 100, height: s.o.transient ? 0 : w[0], width: s.o.transient ? 0 : w[1], position: 'fixed', left: 0, top: 0, zIndex: s.o.zIndex + 1 })).appendTo(s.o.appendTo); s.d.container = $('<div></div>').attr('id', s.o.containerId).addClass('simplemodal-container').css($.extend(s.o.containerCss, { display: 'none', position: 'fixed', zIndex: s.o.zIndex + 2 })).append(s.o.close && s.o.closeHTML ? $(s.o.closeHTML).addClass(s.o.closeClass) : '').appendTo(s.o.appendTo); s.d.wrap = $('<div></div>').attr('tabIndex', -1).addClass('simplemodal-wrap').css({ height: '100%', outline: 0, width: '100%' }).appendTo(s.d.container); s.d.data = data.attr('id', data.attr('id') || s.o.dataId).addClass('simplemodal-data').css($.extend(s.o.dataCss, { display: 'none' })).appendTo('body'); data = null; s.setContainerDimensions(); s.d.data.appendTo(s.d.wrap); if (ie6 || ieQuirks) { s.fixIE(); } }, bindEvents: function() { var s = this; $('.' + s.o.closeClass).bind('click.simplemodal', function(e) { e.preventDefault(); s.close(); }); if (!s.o.transient && s.o.close && s.o.overlayClose) { s.d.overlay.bind('click.simplemodal', function(e) { e.preventDefault(); s.close(); }); } $(document).bind('keydown.simplemodal', function(e) { if (!s.o.transient && s.o.focus && e.keyCode == 9) { s.watchTab(e); } else if ((s.o.close && s.o.escClose) && e.keyCode == 27) { e.preventDefault(); s.close(); } }); $(window).bind('resize.simplemodal', function() { w = s.getDimensions(); s.setContainerDimensions(true); if (ie6 || ieQuirks) { s.fixIE(); } else if (!s.o.transient) { s.d.iframe && s.d.iframe.css({ height: w[0], width: w[1] }); s.d.overlay.css({ height: w[0], width: w[1] }); } }); }, unbindEvents: function() { $('.' + this.o.closeClass).unbind('click.simplemodal'); $(document).unbind('keydown.simplemodal'); $(window).unbind('resize.simplemodal'); this.d.overlay.unbind('click.simplemodal'); }, fixIE: function() { var s = this, p = s.o.position; $.each([s.d.iframe || null, s.o.transient ? null : s.d.overlay, s.d.container], function(i, el) { if (el) { var bch = 'document.body.clientHeight', bcw = 'document.body.clientWidth', bsh = 'document.body.scrollHeight', bsl = 'document.body.scrollLeft', bst = 'document.body.scrollTop', bsw = 'document.body.scrollWidth', ch = 'document.documentElement.clientHeight', cw = 'document.documentElement.clientWidth', sl = 'document.documentElement.scrollLeft', st = 'document.documentElement.scrollTop', s = el[0].style; s.position = 'absolute'; if (i < 2) { s.removeExpression('height'); s.removeExpression('width'); s.setExpression('height', '' + bsh + ' > ' + bch + ' ? ' + bsh + ' : ' + bch + ' + "px"'); s.setExpression('width', '' + bsw + ' > ' + bcw + ' ? ' + bsw + ' : ' + bcw + ' + "px"'); } else { var te, le; if (p && p.constructor == Array) { var top = p[0] ? typeof p[0] == 'number' ? p[0].toString() : p[0].replace(/px/, '') : el.css('top').replace(/px/, ''); te = top.indexOf('%') == -1 ? top + ' + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"' : parseInt(top.replace(/%/, '')) + ' * ((' + ch + ' || ' + bch + ') / 100) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"'; if (p[1]) { var left = typeof p[1] == 'number' ? p[1].toString() : p[1].replace(/px/, ''); le = left.indexOf('%') == -1 ? left + ' + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"' : parseInt(left.replace(/%/, '')) + ' * ((' + cw + ' || ' + bcw + ') / 100) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"'; } } else { te = '(' + ch + ' || ' + bch + ') / 2 - (this.offsetHeight / 2) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"'; le = '(' + cw + ' || ' + bcw + ') / 2 - (this.offsetWidth / 2) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"'; } s.removeExpression('top'); s.removeExpression('left'); s.setExpression('top', te); s.setExpression('left', le); } } }); }, focus: function(pos) { var s = this, p = pos || 'first'; var input = $(':input:enabled:visible:' + p, s.d.wrap); input.length > 0 ? input.focus() : s.d.wrap.focus(); }, getDimensions: function() { var el = $(window); var h = $.browser.opera && $.browser.version > '9.5' && $.fn.jquery <= '1.2.6' ? document.documentElement['clientHeight'] : $.browser.opera && $.browser.version < '9.5' && $.fn.jquery > '1.2.6' ? window.innerHeight : el.height(); return [h, el.width()]; }, getVal: function(v) { return v == 'auto' ? 0 : v.indexOf('%') > 0 ? v : parseInt(v.replace(/px/, '')); }, setContainerDimensions: function(resize) { var s = this; if (!resize || (resize && s.o.autoResize)) { var ch = $.browser.opera ? s.d.container.height() : s.getVal(s.d.container.css('height')), cw = $.browser.opera ? s.d.container.width() : s.getVal(s.d.container.css('width')), dh = s.d.data.outerHeight(true), dw = s.d.data.outerWidth(true); var mh = s.o.maxHeight && s.o.maxHeight < w[0] ? s.o.maxHeight : w[0], mw = s.o.maxWidth && s.o.maxWidth < w[1] ? s.o.maxWidth : w[1]; if (!ch) { if (!dh) { ch = s.o.minHeight; } else { if (dh > mh) { ch = mh; } else if (dh < s.o.minHeight) { ch = s.o.minHeight; } else { ch = dh; } } } else { ch = ch > mh ? mh : ch; } if (!cw) { if (!dw) { cw = s.o.minWidth; } else { if (dw > mw) { cw = mw; } else if (dw < s.o.minWidth) { cw = s.o.minWidth; } else { cw = dw; } } } else { cw = cw > mw ? mw : cw; } s.d.container.css({ height: ch, width: cw }); if (dh > ch || dw > cw) { s.d.wrap.css({ overflow: 'auto' }); } } if (s.o.autoPosition) { s.setPosition(); } }, setPosition: function() { var s = this, top, left, hc = (w[0] / 2) - (s.d.container.outerHeight(true) / 2), vc = (w[1] / 2) - (s.d.container.outerWidth(true) / 2); if (s.o.position && Object.prototype.toString.call(s.o.position) === "[object Array]") { top = s.o.position[0] || hc; left = s.o.position[1] || vc; } else { top = hc; left = vc; } s.d.container.css({ left: left, top: top }); }, watchTab: function(e) { var s = this; if ($(e.target).parents('.simplemodal-container').length > 0) { s.inputs = $(':input:enabled:visible:first, :input:enabled:visible:last', s.d.data[0]); if ((!e.shiftKey && e.target == s.inputs[s.inputs.length - 1]) || (e.shiftKey && e.target == s.inputs[0]) || s.inputs.length == 0) { e.preventDefault(); var pos = e.shiftKey ? 'last' : 'first'; setTimeout(function() { s.focus(pos); }, 10); } } else { e.preventDefault(); setTimeout(function() { s.focus(); }, 10); } }, open: function() { var s = this; s.d.iframe && s.d.iframe.show(); if ($.isFunction(s.o.onOpen)) { s.o.onOpen.apply(s, [s.d]); } else { s.d.overlay.show(); s.d.container.show(); s.d.data.show(); } s.focus(); s.bindEvents(); }, close: function() { var s = this; if (!s.d.data) { return false; } s.unbindEvents(); if ($.isFunction(s.o.onClose) && !s.occb) { s.occb = true; s.o.onClose.apply(s, [s.d]); } else { if (s.d.placeholder) { var ph = $('#simplemodal-placeholder'); if (s.o.persist) { ph.replaceWith(s.d.data.removeClass('simplemodal-data').css('display', s.display)); } else { s.d.data.hide().remove(); ph.replaceWith(s.d.orig); } } else { s.d.data.hide().remove(); } s.d.container.hide().remove(); s.d.overlay.hide().remove(); s.d.iframe && s.d.iframe.hide().remove(); s.d = {}; } } }; })(jQuery); $(document).ready(function() { $(".rollover").hover(function() { var d = $(this).attr("src"); $(this).attr("src", $(this).attr("hover")); $(this).attr("hover", d) }, function() { var d = $(this).attr("src"); $(this).attr("src", $(this).attr("hover")); $(this).attr("hover", d) }); (function(e) { var d = []; e.preLoadImages = function() { var h = arguments.length; for (var g = h; g--; ) { var f = document.createElement("img"); f.hover = arguments[g]; d.push(f) } } })(jQuery); $.preLoadImages("http://d2br62l25pxkcl.cloudfront.net/Images/thejump_butt_roll.png", "http://dkqjp70vk7l7v.cloudfront.net/Images/hours_butt_roll.png", "http://d2br62l25pxkcl.cloudfront.net/Images/merchant_butt_roll.png", "http://dkqjp70vk7l7v.cloudfront.net/Images/avail_butt_roll.png", "http://d2br62l25pxkcl.cloudfront.net/Images/gallery_butt_roll.png", "http://dkqjp70vk7l7v.cloudfront.net/Images/testimon_butt_roll.png", "http://d2br62l25pxkcl.cloudfront.net/Images/contact_butt_roll.png"); var c = document.URL; var b = c.split("/"); var a = b[b.length - 1]; if (a.length > 0) { $("img#" + a).attr("src", function() { switch (a) { case "Skyjump": return "http://d2br62l25pxkcl.cloudfront.net/Images/thejump_butt_roll.png"; case "Hours": return "http://dkqjp70vk7l7v.cloudfront.net/Images/hours_butt_roll.png"; case "Merchandise": return "http://d2br62l25pxkcl.cloudfront.net/Images/merchant_butt_roll.png"; case "Availability": return "http://dkqjp70vk7l7v.cloudfront.net/Images/avail_butt_roll.png"; case "Gallery": return "http://d2br62l25pxkcl.cloudfront.net/Images/gallery_butt_roll.png"; case "Testimonials": return "http://dkqjp70vk7l7v.cloudfront.net/Images/testimon_butt_roll.png"; case "Contact": return "http://d2br62l25pxkcl.cloudfront.net/Images/contact_butt_roll.png"; default: break } }) } }); function showInfo(a) { $("#" + a).modal({ overlayCss: { backgroundColor: "#000" }, opacity: 80, overlayClose: true, onOpen: function(b) { b.overlay.fadeIn("fast", function() { b.data.hide(); b.container.fadeIn("fast", function() { b.data.slideDown("fast") }) }) }, onClose: function(b) { b.data.fadeOut("fast", function() { b.container.hide("fast", function() { b.overlay.slideUp("fast", function() { $.modal.close() }) }) }) } }) }; (function(c) { var d = []; c.tools = c.tools || {}; c.tools.tooltip = { version: "1.1.3", conf: { effect: "toggle", fadeOutSpeed: "fast", tip: null, predelay: 0, delay: 30, opacity: 1, lazy: undefined, position: ["top", "center"], offset: [0, 0], cancelDefault: true, relative: false, oneInstance: true, events: { def: "mouseover,mouseout", input: "focus,blur", widget: "focus mouseover,blur mouseout", tooltip: "mouseover,mouseout" }, api: false }, addEffect: function(e, g, f) { b[e] = [g, f] } }; var b = { toggle: [function(e) { var f = this.getConf(), g = this.getTip(), h = f.opacity; if (h < 1) { g.css({ opacity: h }) } g.show(); e.call() }, function(e) { this.getTip().hide(); e.call() } ], fade: [function(e) { this.getTip().fadeIn(this.getConf().fadeInSpeed, e) }, function(e) { this.getTip().fadeOut(this.getConf().fadeOutSpeed, e) } ] }; function a(f, g) { var p = this, k = c(this); f.data("tooltip", p); var l = f.next(); if (g.tip) { l = c(g.tip); if (l.length > 1) { l = f.nextAll(g.tip).eq(0); if (!l.length) { l = f.parent().nextAll(g.tip).eq(0) } } } function o(u) { var t = g.relative ? f.position().top : f.offset().top, s = g.relative ? f.position().left : f.offset().left, v = g.position[0]; t -= l.outerHeight() - g.offset[0]; s += f.outerWidth() + g.offset[1]; var q = l.outerHeight() + f.outerHeight(); if (v == "center") { t += q / 2 } if (v == "bottom") { t += q } v = g.position[1]; var r = l.outerWidth() + f.outerWidth(); if (v == "center") { s -= r / 2 } if (v == "left") { s -= r } return { top: t, left: s} } var i = f.is(":input"), e = i && f.is(":checkbox, :radio, select, :button"), h = f.attr("type"), n = g.events[h] || g.events[i ? (e ? "widget" : "input") : "def"]; n = n.split(/,\s*/); if (n.length != 2) { throw "Tooltip: bad events configuration for " + h } f.bind(n[0], function(r) { if (g.oneInstance) { c.each(d, function() { this.hide() }) } var q = l.data("trigger"); if (q && q[0] != this) { l.hide().stop(true, true) } r.target = this; p.show(r); n = g.events.tooltip.split(/,\s*/); l.bind(n[0], function() { p.show(r) }); if (n[1]) { l.bind(n[1], function() { p.hide(r) }) } }); f.bind(n[1], function(q) { p.hide(q) }); if (!c.browser.msie && !i && !g.predelay) { f.mousemove(function() { if (!p.isShown()) { f.triggerHandler("mouseover") } }) } if (g.opacity < 1) { l.css("opacity", g.opacity) } var m = 0, j = f.attr("title"); if (j && g.cancelDefault) { f.removeAttr("title"); f.data("title", j) } c.extend(p, { show: function(r) { if (r) { f = c(r.target) } clearTimeout(l.data("timer")); if (l.is(":animated") || l.is(":visible")) { return p } function q() { l.data("trigger", f); var t = o(r); if (g.tip && j) { l.html(f.data("title")) } r = r || c.Event(); r.type = "onBeforeShow"; k.trigger(r, [t]); if (r.isDefaultPrevented()) { return p } t = o(r); l.css({ position: "absolute", top: t.top, left: t.left }); var s = b[g.effect]; if (!s) { throw 'Nonexistent effect "' + g.effect + '"' } s[0].call(p, function() { r.type = "onShow"; k.trigger(r) }) } if (g.predelay) { clearTimeout(m); m = setTimeout(q, g.predelay) } else { q() } return p }, hide: function(r) { clearTimeout(l.data("timer")); clearTimeout(m); if (!l.is(":visible")) { return } function q() { r = r || c.Event(); r.type = "onBeforeHide"; k.trigger(r); if (r.isDefaultPrevented()) { return } b[g.effect][1].call(p, function() { r.type = "onHide"; k.trigger(r) }) } if (g.delay && r) { l.data("timer", setTimeout(q, g.delay)) } else { q() } return p }, isShown: function() { return l.is(":visible, :animated") }, getConf: function() { return g }, getTip: function() { return l }, getTrigger: function() { return f }, bind: function(q, r) { k.bind(q, r); return p }, onHide: function(q) { return this.bind("onHide", q) }, onBeforeShow: function(q) { return this.bind("onBeforeShow", q) }, onShow: function(q) { return this.bind("onShow", q) }, onBeforeHide: function(q) { return this.bind("onBeforeHide", q) }, unbind: function(q) { k.unbind(q); return p } }); c.each(g, function(q, r) { if (c.isFunction(r)) { p.bind(q, r) } }) } c.prototype.tooltip = function(e) { var f = this.eq(typeof e == "number" ? e : 0).data("tooltip"); if (f) { return f } var g = c.extend(true, {}, c.tools.tooltip.conf); if (c.isFunction(e)) { e = { onBeforeShow: e} } else { if (typeof e == "string") { e = { tip: e} } } e = c.extend(true, g, e); if (typeof e.position == "string") { e.position = e.position.split(/,?\s/) } if (e.lazy !== false && (e.lazy === true || this.length > 20)) { this.one("mouseover", function(h) { f = new a(c(this), e); f.show(h); d.push(f) }) } else { this.each(function() { f = new a(c(this), e); d.push(f) }) } return e.api ? f : this } })(jQuery); (function(b) { var a = b.tools.tooltip; a.effects = a.effects || {}; a.effects.slide = { version: "1.0.0" }; b.extend(a.conf, { direction: "up", bounce: false, slideOffset: 10, slideInSpeed: 200, slideOutSpeed: 200, slideFade: !b.browser.msie }); var c = { up: ["-", "top"], down: ["+", "top"], left: ["-", "left"], right: ["+", "left"] }; b.tools.tooltip.addEffect("slide", function(d) { var f = this.getConf(), g = this.getTip(), h = f.slideFade ? { opacity: f.opacity} : {}, e = c[f.direction] || c.up; h[e[1]] = e[0] + "=" + f.slideOffset; if (f.slideFade) { g.css({ opacity: 0 }) } g.show().animate(h, f.slideInSpeed, d) }, function(e) { var g = this.getConf(), i = g.slideOffset, h = g.slideFade ? { opacity: 0} : {}, f = c[g.direction] || c.up; var d = "" + f[0]; if (g.bounce) { d = d == "+" ? "-" : "+" } h[f[1]] = d + "=" + i; this.getTip().animate(h, g.slideOutSpeed, function() { b(this).hide(); e.call() }) }) })(jQuery); (function(d) { var c = d.tools.tooltip; c.plugins = c.plugins || {}; c.plugins.dynamic = { version: "1.0.1", conf: { api: false, classNames: "top right bottom left"} }; function b(h) { var e = d(window); var g = e.width() + e.scrollLeft(); var f = e.height() + e.scrollTop(); return [h.offset().top <= e.scrollTop(), g <= h.offset().left + h.width(), f <= h.offset().top + h.height(), e.scrollLeft() >= h.offset().left] } function a(f) { var e = f.length; while (e--) { if (f[e]) { return false } } return true } d.fn.dynamic = function(g) { var h = d.extend({}, c.plugins.dynamic.conf), f; if (typeof g == "number") { g = { speed: g} } g = d.extend(h, g); var e = g.classNames.split(/\s/), i; this.each(function() { if (d(this).tooltip().jquery) { throw "Lazy feature not supported by dynamic plugin. set lazy: false for tooltip" } var j = d(this).tooltip().onBeforeShow(function(n, o) { var m = this.getTip(), l = this.getConf(); if (!i) { i = [l.position[0], l.position[1], l.offset[0], l.offset[1], d.extend({}, l)] } d.extend(l, i[4]); l.position = [i[0], i[1]]; l.offset = [i[2], i[3]]; m.css({ visibility: "hidden", position: "absolute", top: o.top, left: o.left }).show(); var k = b(m); if (!a(k)) { if (k[2]) { d.extend(l, g.top); l.position[0] = "top"; m.addClass(e[0]) } if (k[3]) { d.extend(l, g.right); l.position[1] = "right"; m.addClass(e[1]) } if (k[0]) { d.extend(l, g.bottom); l.position[0] = "bottom"; m.addClass(e[2]) } if (k[1]) { d.extend(l, g.left); l.position[1] = "left"; m.addClass(e[3]) } if (k[0] || k[2]) { l.offset[0] *= -1 } if (k[1] || k[3]) { l.offset[1] *= -1 } } m.css({ visibility: "visible" }).hide() }); j.onShow(function() { var l = this.getConf(), k = this.getTip(); l.position = [i[0], i[1]]; l.offset = [i[2], i[3]] }); j.onHide(function() { var k = this.getTip(); k.removeClass(g.classNames) }); f = j }); return g.api ? f : this } })(jQuery);

$(document).ready(function() {
    $("#content1").hide(); $("#datePicker").datepicker({ onSelect: function(d) {
        try { var c = 1; for (c; c < 8; c++) { $("#" + c).empty() } } catch (f) { }
        var b = $("#datePicker").val().replace("/", "-"); var e = b.replace("/", "-"); a(e)
    }, showOn: "button", buttonImage: "http://dkqjp70vk7l7v.cloudfront.net/Images/Calendar_ICON.png", buttonImageOnly: true, buttonText: "Click here for a calendar of dates", showOn: "both"
    }); $("a.close").click(function() { $("#content1").hide("slide", { direction: "down" }, 500); $(".availFadeBG").fadeTo(500, 1); $("#datePicker").val(""); }); function a(b) { $.get("GetAvailableDates", { selectedDate: b }, function(c) { var e = c.substring(1, c.length - 1); var f = e.split(","); for (var d = 0; d < f.length - 1; d++) { var g = '<img src="http://dkqjp70vk7l7v.cloudfront.net/AvailImages/' + f[d] + '" alt="Date Image" />'; $("#" + (d + 1)).append(g) } }); $("#content1").show("slide", { direction: "up" }, 500); $(".availFadeBG").fadeTo(500, 0.33) } 
}); $(document).ready(function() { $(".pressBody img[title]").tooltip({ tip: '#dynatip', offset: [10, 2], effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); }); $(document).ready(function() { $(".indexFadebox .indexDumbItem").dumbCrossFade({ slideType: "fade", doHoverPause: true, transitionTime: 1000 }); function a() { showInfo("videoPopup") } }); $(document).ready(function() { $(".ad-gallery").adGallery({ callbacks: { afterImageVisible: function() { $(".fullSize").colorbox({ opacity: 0.8, maxHeight: "100%", maxWidth: "100%", scalePhotos: true }) } } }); }); $(document).ready(function() { $("#testimonial").hide(); $("#contactForm").validationEngine(); }); $(document).ready(function() { $("#pressRelease").hide(); $("#pressReleaseGuiness").hide(); }); function showTestimonialForm() { $("#testimonial").show("slide", { direction: "right" }, 500) }
function hideTestimonialForm() { $("#testimonial").hide("slide", { direction: "right" }, 500) }
function showPressRelease() { if ($("#pressReleaseGuiness").is(':visible')) { $("#pressReleaseGuiness").hide("slide", { direction: 'right' }, 500, function() { $("#pressRelease").show("slide", { direction: "right" }, 500) }); } else { $("#pressRelease").show("slide", { direction: "right" }, 500); } }
function showPressReleaseGuiness() { if ($("#pressRelease").is(':visible')) { $("#pressRelease").hide("slide", { direction: 'right' }, 500, function() { $("#pressReleaseGuiness").show("slide", { direction: "right" }, 500) }); } else { $("#pressReleaseGuiness").show("slide", { direction: "right" }, 500); } }
function hidePressRelease() { $("#pressRelease").hide("slide", { direction: "right" }, 500) }; function hidePressReleaseGuiness() { $("#pressReleaseGuiness").hide("slide", { direction: "right" }, 500) }; $(document).ready(function() { $("#skyJumpFacts").hide(); $("#goodies").hide(); $("#branding").hide(); $("#broll").hide(); $("#photos").hide(); }); var visibleDivs; var blnIsVisible; var showDivs = new Array(); showDivs[0] = "skyJumpFacts"; showDivs[1] = "goodies"; showDivs[2] = "branding"; showDivs[3] = "broll"; showDivs[4] = "photos"; function showSkyJumpFacts() { showHideDiv("skyJumpFacts"); }
function showGoodies() { showHideDiv("goodies"); }
function showBranding() { showHideDiv("branding"); }
function showBRoll() { showHideDiv("broll"); }
function showPhotos() { showHideDiv("photos"); }
function hideSkyJumpFacts() { $("#skyJumpFacts").hide("slide", { direction: 'right' }, 500); blnIsVisible = false; }
function hideGoodies() { $("#goodies").hide("slide", { direction: 'right' }, 500); blnIsVisible = false; }
function hideBranding() { $("#branding").hide("slide", { direction: 'right' }, 500); blnIsVisible = false; }
function hideBRoll() { $("#broll").hide("slide", { direction: 'right' }, 500); blnIsVisible = false; }
function hidePhotos() { $("#photos").hide("slide", { direction: 'right' }, 500); blnIsVisible = false; }
function showHideDiv(showDiv) {
    for (visibleDivs in showDivs) { if ($("#" + showDivs[visibleDivs]).is(':visible')) { blnIsVisible = true; $("#" + showDivs[visibleDivs]).hide("slide", { direction: 'right' }, 500, function() { $("#" + showDiv).show("slide", { direction: 'right' }, 500); }); } }
    if (!blnIsVisible) { $("#" + showDiv).show("slide", { direction: 'right' }, 500); blnIsVisible = false; } 
}
var incorrectCount = 0; var correctPassword = false; var dataPath; $("#btnDownloadVideo").click(function() { $.get('http://www.skyjumplasvegas.com/CheckPassword', { data: $("#txtDownloadPassword").val() }, function(data) { if (data == "true") { correctPassword = true; checkForCorrectPassword(dataPath); $.modal.close(); } else { if (incorrectCount < 2) { incorrectCount++; $("#errorMessage").text("Incorrect password. You have " + (3 - incorrectCount) + " tries left."); $("#errorMessage").css("display", "inline"); } else { $.modal.close(); } } }, "text"); }); function checkForCorrectPassword(data) { if (!correctPassword) { showInfo('passwordPopup'); dataPath = data; } else { window.location = data; } }; $(document).ready(function() { $("#package1").tooltip({ tip: "#package1ToolTip", position: 'center left', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("#package2").tooltip({ tip: "#package2ToolTip", position: 'center left', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("#package3").tooltip({ tip: "#package3ToolTip", position: 'center left', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("#basePackage").tooltip({ tip: "#basePackageToolTip", position: 'center left', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("#stratosphere").tooltip({ tip: "#stratosphereToolTip", position: 'top center', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("span#skyjump").tooltip({ tip: "#skyJumpToolTip", position: 'top center', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("span#merchandise").tooltip({ tip: "#merchandiseToolTip", position: 'top center', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); $("span#contactNumber").tooltip({ tip: "#contactToolTip", position: 'top center', effect: 'slide' }).dynamic({ bottom: { direction: 'down', bounce: true} }); }); $(document).ready(function() {
    $('.rollover').hover(function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }, function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }); (function($) { var cache = []; $.preLoadImages = function() { var args_len = arguments.length; for (var i = args_len; i--; ) { var cacheImage = document.createElement('img'); cacheImage.hover = arguments[i]; cache.push(cacheImage); } } })(jQuery)
    $.preLoadImages('../Content/Images/thejump_butt_roll.png', '../Content/Images/hours_butt_roll.png', '../Content/Images/merchant_butt_roll.png', '../Content/Images/avail_butt_roll.png', '../Content/Images/gallery_butt_roll.png', '../Content/Images/testimon_butt_roll.png', '../Content/Images/contact_butt_roll.png'); var pathInfo = document.URL; var pathSplit = pathInfo.split('/'); var pageName = pathSplit[pathSplit.length - 1]; if (pageName.length > 0) { $("img#" + pageName).attr("src", function() { switch (pageName) { case "Skyjump": return '../Content/Images/thejump_butt_roll.png'; case "Hours": return '../Content/Images/hours_butt_roll.png'; case "Merchandise": return '../Content/Images/merchant_butt_roll.png'; case "Availability": return '../Content/Images/avail_butt_roll.png'; case "Gallery": return '../Content/Images/gallery_butt_roll.png'; case "Testimonials": return '../Content/Images/testimon_butt_roll.png'; case "Contact": return '../Content/Images/contact_butt_roll.png'; default: break; } }); }
}); function showInfo(popupName) { $("#" + popupName).modal({ overlayCss: { backgroundColor: "#000" }, opacity: 80, overlayClose: true, onOpen: function(dialog) { dialog.overlay.fadeIn('fast', function() { dialog.data.hide(); dialog.container.fadeIn('fast', function() { dialog.data.slideDown('fast'); }); }); }, onClose: function(dialog) { dialog.data.fadeOut('fast', function() { dialog.container.hide('fast', function() { dialog.overlay.slideUp('fast', function() { $.modal.close(); }); }); }); } }); } $(function() { var i = 1; $("#Image_0").show(); setInterval(function() { if (i < 4) { i++; } else { i = 1; } slideShowSwitch(i) }, 7000); }); function slideShowSwitch(i) { $("#Image_0").hide(); $("#Image_" + i).fadeIn('fast', function() { setTimeout(function() { $("#Image_" + i).fadeOut(); }, 6000); }); };
