(function (h) { function m() { var s = h(); if ( (h.each(k, function (o, t) { var u = t.data.selector, c = t.$element; s = s.add(u ? c.find(u) : c); }), s.length) ) { for (var p = 0; s.length > p; p++) { if (s[p]) { if (h.contains(l, s[p])) { var d = h(s[p]), e = d.data("inview"), q = d[0].getBoundingClientRect(), r = d.height() + 600, n = d.width(); q.top >= 0 - r && q.left >= 0 - n && q.bottom <= (g.innerHeight || l.clientHeight) + (r - 600) && q.right <= (g.innerWidth || l.clientWidth) + n ? e || d.data("inview", !0).trigger("inview", [!0]) : e && d.data("inview", !1).trigger("inview", [!1]); } else { delete s[p]; } } } } } var j, k = {}, b = document, g = window, l = b.documentElement, f = h.expando; h.event.special.inview = { add: function (c) { (k[c.guid + "-" + this[f]] = { data: c, $element: h(this) }), j || h.isEmptyObject(k) || (j = setInterval(m, 333)); }, remove: function (d) { try { delete k[d.guid + "-" + this[f]]; } catch (c) {} h.isEmptyObject(k) && (clearInterval(j), (j = null)); }, }; })(jQuery); var pageUrl = location.href; var hostName = location.hostname; function setPrinterText() { $(".page-url").text(pageUrl); } if ($("#floatingDesktopISI #isiCopy").length) { $("#isiCopyMobile").bind("inview", function (a, b) { if (b) { $("#floatingDesktopISI #isiCopy").fadeOut(); } else { $("#floatingDesktopISI #isiCopy").fadeIn(); } }); } $("#floatingDesktopISI #isiCopy h2").click(function () { $("html, body") .removeAttr("style") .animate({ scrollTop: $("#isiCopyMobile").offset().top }, 2000); $("#floatingDesktopISI #isiCopy").fadeOut(); }); $(window).scroll(function () { var b = $(window).scrollTop(); var a = $(window).height(); }); function toggleISI(a) { $(".isi-main-copy-mobile").toggle(); $(".isi-main-copy").toggle(); if ($("#isiCopy").attr("style")) { $("#isiCopy").height(""); $(".isi-main-copy").height(""); } else { $("#isiCopy").height(window.innerHeight - 40); $(".isi-main-copy").height(window.innerHeight - 85); } $(a).toggleClass("glyphicon-plus"); $(a).toggleClass("glyphicon-minus"); } $(".glyphicon-minus").click(function () { $("#isiCopy").removeAttr("style"); }); function createCookie(b, c) { var a = ""; document.cookie = b + "=" + c + "; " + a + "; path=/"; } function readCookie(e) { var f = e + "="; var b = document.cookie.split(";"); for (var d = 0; d < b.length; d++) { var a = b[d]; while (a.charAt(0) == " ") { a = a.substring(1, a.length); } if (a.indexOf(f) == 0) { return a.substring(f.length, a.length); } } return null; } function eraseCookie(a) { createCookie(a, "", -1); } function setFont(a) { var b; $(".font-selector span").each(function () { $(this).removeClass("selected"); }); $(a).addClass("selected"); if (a.hasClass("font-med")) { $( "body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div" ).css({ "font-size": "18px" }); b = "18px"; } else { if (a.hasClass("font-lg")) { $( "body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div" ).css({ "font-size": "21px" }); b = "21px"; } else { $( "body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div" ).css({ "font-size": "14px" }); b = "14px"; } } createCookie("font_size", b); createCookie("ISI_font_size", b); } function populateAnchorTag(e, f, d, b, c, a) { var g = !!JSON.parse(e.toLowerCase()) ? "_blank" : "_self"; if (!!JSON.parse(d.toLowerCase())) { jQuery("div.imgDiv").wrap( '' ); } if (!!JSON.parse(b.toLowerCase())) { jQuery("div.textimagebox").wrap( '' ); } if (!!JSON.parse(c.toLowerCase())) { jQuery("div.textHeading").wrap( '' ); } if (!!JSON.parse(a.toLowerCase())) { jQuery("div.buttonText").wrap( '' ); } } function SetBrandName(a) { if (a != "" && a != undefined) { hostName = a + ".com"; } } function SearchFocus(a) { a.removeAttr("placeholder"); if (a.val() != "") { a.val(""); } } function SearchBlur(a) { a.attr("placeholder", "Search"); if (Modernizr.input.placeholder) { } else { if (a.val() == "" || a.val() == "Search") { a.val("Search"); } } } function SetSearchText() { $( "#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveoMobileSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox" ).blur(); if (Modernizr.input.placeholder) { } else { $( "#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox" ).val("Search"); } } var pfHeaderImgUrl = ""; var pfHeaderTagline = ""; var pfdisableClickToDel = 1; var pfHideImages = 0; var pfImageDisplayStyle = "none"; var pfDisablePDF = 0; var pfDisableEmail = 1; var pfDisablePrint = 1; var pfCustomCSS = "http://" + hostName + "/areas/globalcomponents/css/brands/" + hostName + "/print.css"; var pfBtVersion = "1"; function printFriendly(a) { $("script[src='http://cdn.printfriendly.com/printfriendly.js']").remove(); if (a == "noPrint") { pfDisablePrint = 1; } else { pfDisablePrint = 0; } $.getScript("http://cdn.printfriendly.com/printfriendly.js", function () { window.print(); }); } $(document).ready(function () { processCoachUrls(); $(".print-btn").click(function () { window.print(); }); setPrinterText(); SetSearchText(); $( "#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveoMobileSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox" ).focus(function () { var e = $(this); SearchFocus(e); }); $( "#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveoMobileSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox" ).blur(function () { var e = $(this); SearchBlur(e); }); if ($("#brandName") != undefined) { SetBrandName($("#brandName").val()); } $(".nav-tabs .dropdown-menu").hover( function () { $(this).prev().toggleClass("active-submenu"); }, function () { $(this).prev().toggleClass("active-submenu"); } ); $(".isi-button .glyphicon").click(function () { toggleISI($(this)); }); $(".font-selector span").click(function () { setFont($(this)); }); if (readCookie("font_size") == "14px") { $( "body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div" ).css({ "font-size": "14px" }); $(".font-selector span").each(function () { $(this).removeClass("selected"); }); $(".font-selector span:eq(0)").addClass("selected"); } else { if (readCookie("font_size") == "18px") { $( "body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div" ).css({ "font-size": "18px" }); $(".font-selector span").each(function () { $(this).removeClass("selected"); }); $(".font-selector span:eq(1)").addClass("selected"); } else { if (readCookie("font_size") == "21px") { $( "body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div" ).css({ "font-size": "21px" }); $(".font-selector span").each(function () { $(this).removeClass("selected"); }); $(".font-selector span:eq(2)").addClass("selected"); } } } $(".share-btn").click(function () { if ($(this).hasClass("selected")) { $(".share-show-hide").hide(); $(this).removeClass("selected"); } else { $(".share-show-hide").show(); $(this).addClass("selected"); } return false; }); $(".share-show-hide li").click(function () { $(".share-show-hide").hide(); $(".share-btn").removeClass("selected"); }); $(".share-show-hide .social-pop-up").click(function () { var f = $(this).attr("product-name"); var e = $(this).attr("brand-name"); var h = $(this).attr("website-name"); var g = $(this).attr("url-path"); $("#myModal .product-name").text(f); $("#myModal .brand-name").text(e); $("#myModal .website-name").text(h); $("#myModal .goToSite").attr("website-path", g); }); $(".goToSite").click(function () { var e = $(this).attr("website-path"); window.open(e); }); if ($("#hdnHCPLinks").length) { lstHCPLinks = $("#hdnHCPLinks") .val() .replace(/http:\/\//g, "") .replace(/https:\/\//g, "") .replace(/www./g, "") .replace(/\\/g, "/"); var b = []; if (lstHCPLinks.length > 0) { b = lstHCPLinks.split(","); for (i = 0; i < b.length; i++) { if (b[i].slice(-1) == "/") { b[i] = b[i].slice(0, -1); } b[i] = b[i].toLowerCase(); } } } if ($("#hdnExternalLinks").length) { lstExternalLinks = $("#hdnExternalLinks") .val() .replace(/http:\/\//g, "") .replace(/https:\/\//g, "") .replace(/www./g, ""); var a = []; if (lstExternalLinks.length > 0) { a = lstExternalLinks.split(","); for (i = 0; i < a.length; i++) { a[i] = $.trim(a[i]); if (a[i].slice(-1) == "/") { a[i] = a[i].slice(0, -1); } a[i] = a[i].toLowerCase(); } } } if ($("#hdnRegionLinks").length) { lstRegionLinks = $("#hdnRegionLinks") .val() .replace(/http:\/\//g, "") .replace(/https:\/\//g, "") .replace(/www./g, "") .replace(/\\/g, "/"); var c = []; if (lstRegionLinks.length > 0) { c = lstRegionLinks.split(","); for (i = 0; i < c.length; i++) { if (c[i].slice(-1) == "/") { c[i] = c[i].slice(0, -1); } c[i] = c[i].toLowerCase(); } } } if ($("#hdnUnbrandedLinks").length) { lstUnbrandedLinks = $("#hdnUnbrandedLinks") .val() .replace(/http:\/\//g, "") .replace(/https:\/\//g, "") .replace(/www./g, "") .replace(/\\/g, "/"); var d = []; if (lstUnbrandedLinks.length > 0) { d = lstUnbrandedLinks.split(","); for (i = 0; i < d.length; i++) { if (d[i].slice(-1) == "/") { d[i] = d[i].slice(0, -1); } d[i] = d[i].toLowerCase(); } } } if ($(".panel-group")) { $(".panel-group div:first-child div.panel-heading h4 a").trigger("click"); } $("a").each(function () { if (b != undefined) { if (typeof $(this).attr("href") != "undefined") { if ( $(this).attr("href").indexOf("http") == 0 || $(this).attr("href").indexOf("www") == 0 ) { var e = $.trim($(this).attr("href")); e = $.trim( $(this) .attr("href") .replace(/http:\/\//g, "") .replace(/https:\/\//g, "") ) .replace(/www./g, "") .replace(/\\/g, "/"); if (e.slice(-1) == "/") { e = e.slice(0, -1); } e = e.toLowerCase(); var g = false; if (hostName == "") { hostName = location.hostname; } if (e.length > 1) { var f = []; f = e.split("/"); for (i = 0; i < b.length; i++) { if (e.toLowerCase() === b[i].toLowerCase()) { g = true; $(this).addClass("lnkHCP"); $(this).attr("brand-name", hostName); $(this).attr("website-name", f[0]); $(this).attr("data-toggle", "modal"); $(this).attr("data-target", "#hcpMod"); break; } } if (!g) { for (i = 0; i < a.length; i++) { if (f[0].toLowerCase() === a[i].toLowerCase()) { g = true; $(this).addClass("lnkExternal"); $(this).attr("brand-name", hostName); $(this).attr("website-name", f[0]); $(this).attr("data-toggle", "modal"); $(this).attr("data-target", "#thirdPartyMod"); break; } } } if (!g) { for (i = 0; i < c.length; i++) { if (e.toLowerCase() === c[i].toLowerCase()) { g = true; $(this).addClass("lnkRegion"); $(this).attr("brand-name", hostName); $(this).attr("website-name", f[0]); $(this).attr("data-toggle", "modal"); $(this).attr("data-target", "#regionMod"); break; } } } if (!g) { for (i = 0; i < d.length; i++) { if (e.toLowerCase() === d[i].toLowerCase()) { g = true; $(this).addClass("lnkUnbranded"); $(this).attr("brand-name", hostName); $(this).attr("website-name", f[0]); $(this).attr("data-toggle", "modal"); $(this).attr("data-target", "#unbrandedMod"); break; } } } } } } } }); $(".lnkHCP,.lnkExternal,.lnkRegion, .lnkUnbranded").each(function () { $(this).on("click", function (g) { g.preventDefault(); var f = $(this).attr("brand-name"); var h = $(this).attr("href"); if ($(this).attr("data-targethost") != undefined) { var j = $(this).attr("data-targethost"); } else { var j = $(this).attr("website-name"); } if ($(this).attr("class").indexOf("lnkHCP") > -1) { $("#hcpMod .brand-name").text(f); $("#hcpMod .website-name").text(j); $("#hcpMod .websiteBtn").attr("website-path", h); } else { if ($(this).attr("class").indexOf("lnkExternal") > -1) { $("#thirdPartyMod .brand-name").text(f); $("#thirdPartyMod .website-name").text(j); $("#thirdPartyMod .websiteBtn").attr("website-path", h); } else { if ($(this).attr("class").indexOf("lnkRegion") > -1) { $("#regionMod .brand-name").text(f); $("#regionMod .website-name").text(j); $("#regionMod .websiteBtn").attr("website-path", h); } else { if ($(this).attr("class").indexOf("lnkUnbranded") > -1) { $("#unbrandedMod .brand-name").text(f); $("#unbrandedMod .website-name").text(j); $("#unbrandedMod .websiteBtn").attr("website-path", h); } } } } }); }); $(".websiteBtn").each(function () { $(this).on("click", function (f) { var g = $(this).attr("website-path"); $(this).attr("data-dismiss", "modal"); window.open(g); }); }); $.ajaxPrefilter(function (e) { var f = $("#RequestTokenID").val(); if (!e.beforeSend) { e.beforeSend = function (g) { g.setRequestHeader("RequestVerificationToken", f); }; } }); if ( $("#enablePrintCanvas")[0] != null && $("#enablePrintCanvas")[0] != undefined ) { $(".print-btn").unbind("click"); $(".print-btn").click(function () { $.getScript( "/areas/globalcomponents/js/global/vendor/html2canvas.min.js", function () { html2canvas($("body"), { onrendered: function (e) { var f = e.toDataURL("image/png"); var g = window.open(f, "_self"); g.document.write(''); g.print(); g.location.reload(); }, }); } ); }); } }); function processCoachUrls() { var b = location.hostname + ".utmz"; if (readCookie(b) != null) { $('a[href*="coach.toujeo.com"]').each(function () { var j = $(this).attr("href"); j += (j.match(/\?/) ? "&" : "?") + readCookie(b); $(this).attr("href", j); }); } else { var c = ""; var h = getParameterByName("utm_campaign"); var d = getParameterByName("utm_medium"); var a = getParameterByName("utm_content"); var f = getParameterByName("utm_source"); var g = getParameterByName("utm_term"); var e = getParameterByName("moc"); if ($.trim(h) != "") { c += "utm_campaign=" + h + "&"; } if ($.trim(d) != "") { c += "utm_medium=" + d + "&"; } if ($.trim(a) != "") { c += "utm_content=" + a + "&"; } if ($.trim(f) != "") { c += "utm_source=" + f + "&"; } if ($.trim(g) != "") { c += "utm_term=" + g + "&"; if ($.trim(e) != "") { c += "moc=" + e + "&"; } else { if ($.trim(g).split("_").length > 1) { c += "moc=" + $.trim(g).split("_")[1] + "&"; } } } if ($.trim(c) != "") { createCookie(b, c.substring(0, c.length - 1)); $('a[href*="coach.toujeo.com"]').each(function () { var j = $(this).attr("href"); j += (j.match(/\?/) ? "&" : "?") + readCookie(b); $(this).attr("href", j); }); } } } function getParameterByName(a) { a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var b = new RegExp("[\\?&]" + a + "=([^&#]*)"), c = b.exec(location.search); return c === null ? "" : decodeURIComponent(c[1].replace(/\+/g, " ")); } function LoadDTSearchResults() { $(".CoveoSearchBox").addClass("coveo-executing-query"); if ($("#brandSearchDT #searchtextbox").val().length > 0) { window.location.href = window.location.protocol + "//" + window.location.hostname + $("#hdnSearchPageUrl").val() + "#q=" + $("#brandSearchDT #searchtextbox").val(); } else { window.location.href = window.location.protocol + "//" + window.location.hostname + $("#hdnSearchPageUrl").val() + "#"; } $(".CoveoSearchBox").removeClass("coveo-executing-query"); } function LoadMBSearchResults() { $(".CoveoSearchBox").addClass("coveo-executing-query"); if ($("#brandSearchMB #searchtextbox").val().length > 0) { window.location.href = window.location.protocol + "//" + window.location.hostname + $("#hdnSearchPageUrl").val() + "#q=" + $("#brandSearchMB #searchtextbox").val(); } else { window.location.href = window.location.protocol + "//" + window.location.hostname + $("#hdnSearchPageUrl").val() + "#"; } $(".CoveoSearchBox").removeClass("coveo-executing-query"); } $("#brandSearchDT #searchbutton").click(function () { LoadDTSearchResults(); }); $("#brandSearchMB #searchbutton").click(function () { LoadMBSearchResults(); }); $("#brandSearchDT #searchtextbox").keypress(function (a) { if (a.keyCode == 13) { LoadDTSearchResults(); } }); $("#brandSearchMB #searchtextbox").keypress(function (a) { if (a.keyCode == 13) { LoadMBSearchResults(); } }); $("#brandSearchDT #searchtextbox").keyup(function () { if ($("#brandSearchDT #searchtextbox").val().length > 0) { $(".coveo-query-box-clear").css("display", "block"); } else { $(".coveo-query-box-clear").css("display", "none"); } }); $("#brandSearchMB #searchtextbox").keyup(function () { if ($("#brandSearchMB #searchtextbox").val().length > 0) { $(".coveo-query-box-clear").css("display", "block"); } else { $(".coveo-query-box-clear").css("display", "none"); } }); $(".coveo-query-box-clear").click(function () { $("#brandSearchDT #searchtextbox").val(""); $("#brandSearchMB #searchtextbox").val(""); $(".coveo-query-box-clear").css("display", "none"); }); (function (a) { window.cookiePolicy = (function () { !(function (f, h) { var g = function () { return g.get.apply(g, arguments); }; (g.utils = utils = { isArray: Array.isArray || function (j) { return Object.prototype.toString.call(j) === "[object Array]"; }, isPlainObject: function (j) { return !!j && Object.prototype.toString.call(j) === "[object Object]"; }, toArray: function (j) { return Array.prototype.slice.call(j); }, getKeys: Object.keys || function (j) { var l = [], k = ""; for (k in j) { j.hasOwnProperty(k) && l.push(k); } return l; }, escape: function (j) { return String(j).replace(/[,;"\\=\s%]/g, function (k) { return encodeURIComponent(k); }); }, retrieve: function (j, k) { return j == null ? k : j; }, }), (g.defaults = {}), (g.expiresMultiplier = 86400), (g.set = function (q, v, m) { if (utils.isPlainObject(q)) { for (var w in q) { q.hasOwnProperty(w) && this.set(w, q[w], v); } } else { m = utils.isPlainObject(m) ? m : { expires: m }; var t = m.expires !== h ? m.expires : this.defaults.expires || "", x = typeof t; x === "string" && t !== "" ? (t = new Date(t)) : x === "number" && (t = new Date(+new Date() + 1000 * this.expiresMultiplier * t)), t !== "" && "toGMTString" in t && (t = ";expires=" + t.toGMTString()); var j = this.defaults.path; j = ";path=/"; var k = m.domain || this.defaults.domain; k = k ? ";domain=" + k : ""; var p = m.secure || this.defaults.secure ? ";secure" : ""; f.cookie = utils.escape(q) + "=" + utils.escape(v) + t + j + k + p; } return this; }), (g.remove = function (j) { j = utils.isArray(j) ? j : utils.toArray(arguments); for (var l = 0, k = j.length; l < k; l++) { this.set(j[l], "", -1); } return this; }), (g.empty = function () { return this.remove(utils.getKeys(this.all())); }), (g.get = function (j, l) { l = l || h; var p = this.all(); if (utils.isArray(j)) { var k = {}; for (var q = 0, m = j.length; q < m; q++) { var t = j[q]; k[t] = utils.retrieve(p[t], l); } return k; } return utils.retrieve(p[j], l); }), (g.all = function () { if (f.cookie === "") { return {}; } var o = f.cookie.split("; "), k = {}; for (var l = 0, j = o.length; l < j; l++) { var m = o[l].split("="); k[decodeURIComponent(m[0])] = decodeURIComponent(m[1]); } return k; }), (g.enabled = function () { if (navigator.cookieEnabled) { return !0; } var j = g.set("_", "_").get("_") === "_"; return g.remove("_"), j; }), typeof define == "function" && define.amd ? define(function () { return g; }) : typeof exports != "undefined" ? (exports.cookie = g) : (window.cookie = g); })(document); function e() { b(); a(".cookie-alert .cookie-close").on("click", function (f) { f.preventDefault(); c(); }); } function b() { if (cookie.get("cookie-alert") !== "true") { d(); } } function d() { setTimeout(function () { a(".cookie-alert").addClass("show"); }, 1000); } function c() { a(".cookie-alert").removeClass("show"); cookie.set("cookie-alert", "true"); } return { init: e, close: c }; })(); a(document).ready(function () { cookiePolicy.init(); }); })(jQuery); if (cookie.get("WhiteLBLCookie")) { $("#divCookiclose").remove(); } else { $("#divCookiclose").removeClass("hide-cookie"); $("#btnCookieClose").click(function () { cookie.set("WhiteLBLCookie", "true", 180); $("#divCookiclose").remove(); }); } $(document).ready(function () { $(".sub-child-list").each(function () { if ($(this).children().length < 1) { $(this).closest("li.hasChildren").removeClass("hasChildren"); } }); $(".child-list").each(function () { if ($(this).children().length < 1) { $(this).closest("li.hasChildren").removeClass("hasChildren"); } }); $(".lastItemParent").each(function () { if ($(this).next("ul.sub-child-list").children().length < 1) { var a = $(this).find("span.lastItem").text(); $(this).find("span.lastItem").parent().remove(); $(this).html(a); } }); }); /* jQuery Validation Plugin - v1.11.0 - 2/4/2013 * https://github.com/jzaefferer/jquery-validation * Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */ (function (a) { a.extend(a.fn, { validate: function (c) { if (!this.length) { c && c.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing."); return; } var b = a.data(this[0], "validator"); return b ? b : (this.attr("novalidate", "novalidate"), (b = new a.validator(c, this[0])), a.data(this[0], "validator", b), b.settings.onsubmit && (this.validateDelegate(":submit", "click", function (d) { b.settings.submitHandler && (b.submitButton = d.target), a(d.target).hasClass("cancel") && (b.cancelSubmit = !0); }), this.submit(function (e) { function d() { var f; return b.settings.submitHandler ? (b.submitButton && (f = a("") .attr("name", b.submitButton.name) .val(b.submitButton.value) .appendTo(b.currentForm)), b.settings.submitHandler.call(b, b.currentForm, e), b.submitButton && f.remove(), !1) : !0; } return ( b.settings.debug && e.preventDefault(), b.cancelSubmit ? ((b.cancelSubmit = !1), d()) : b.form() ? b.pendingRequest ? ((b.formSubmitted = !0), !1) : d() : (b.focusInvalid(), !1) ); })), b); }, valid: function () { if (a(this[0]).is("form")) { return this.validate().form(); } var c = !0, b = a(this[0].form).validate(); return ( this.each(function () { c &= b.element(this); }), c ); }, removeAttrs: function (d) { var b = {}, c = this; return ( a.each(d.split(/\s/), function (f, g) { (b[g] = c.attr(g)), c.removeAttr(g); }), b ); }, rules: function (k, e) { var h = this[0]; if (k) { var d = a.data(h.form, "validator").settings, j = d.rules, g = a.validator.staticRules(h); switch (k) { case "add": a.extend(g, a.validator.normalizeRule(e)), (j[h.name] = g), e.messages && (d.messages[h.name] = a.extend(d.messages[h.name], e.messages)); break; case "remove": if (!e) { return delete j[h.name], g; } var l = {}; return ( a.each(e.split(/\s/), function (f, m) { (l[m] = g[m]), delete g[m]; }), l ); } } var b = a.validator.normalizeRules( a.extend( {}, a.validator.classRules(h), a.validator.attributeRules(h), a.validator.dataRules(h), a.validator.staticRules(h) ), h ); if (b.required) { var c = b.required; delete b.required, (b = a.extend({ required: c }, b)); } return b; }, }), a.extend(a.expr[":"], { blank: function (b) { return !a.trim("" + b.value); }, filled: function (b) { return !!a.trim("" + b.value); }, unchecked: function (b) { return !b.checked; }, }), (a.validator = function (c, b) { (this.settings = a.extend(!0, {}, a.validator.defaults, c)), (this.currentForm = b), this.init(); }), (a.validator.format = function (c, b) { return arguments.length === 1 ? function () { var d = a.makeArray(arguments); return d.unshift(c), a.validator.format.apply(this, d); } : (arguments.length > 2 && b.constructor !== Array && (b = a.makeArray(arguments).slice(1)), b.constructor !== Array && (b = [b]), a.each(b, function (d, f) { c = c.replace(new RegExp("\\{" + d + "\\}", "g"), function () { return f; }); }), c); }), a.extend(a.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: !0, errorContainer: a([]), errorLabelContainer: a([]), onsubmit: !0, ignore: ":hidden", ignoreTitle: !1, onfocusin: function (b, c) { (this.lastActive = b), this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call( this, b, this.settings.errorClass, this.settings.validClass ), this.addWrapper(this.errorsFor(b)).hide()); }, onfocusout: function (b, c) { !this.checkable(b) && (b.name in this.submitted || !this.optional(b)) && this.element(b); }, onkeyup: function (b, c) { if (c.which === 9 && this.elementValue(b) === "") { return; } (b.name in this.submitted || b === this.lastElement) && this.element(b); }, onclick: function (b, c) { b.name in this.submitted ? this.element(b) : b.parentNode.name in this.submitted && this.element(b.parentNode); }, highlight: function (d, b, c) { d.type === "radio" ? this.findByName(d.name).addClass(b).removeClass(c) : a(d).addClass(b).removeClass(c); }, unhighlight: function (d, b, c) { d.type === "radio" ? this.findByName(d.name).removeClass(b).addClass(c) : a(d).removeClass(b).addClass(c); }, }, setDefaults: function (b) { a.extend(a.validator.defaults, b); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", maxlength: a.validator.format( "Please enter no more than {0} characters." ), minlength: a.validator.format("Please enter at least {0} characters."), rangelength: a.validator.format( "Please enter a value between {0} and {1} characters long." ), range: a.validator.format("Please enter a value between {0} and {1}."), max: a.validator.format( "Please enter a value less than or equal to {0}." ), min: a.validator.format( "Please enter a value greater than or equal to {0}." ), }, autoCreateRanges: !1, prototype: { init: function () { function c(g) { var e = a.data(this[0].form, "validator"), f = "on" + g.type.replace(/^validate/, ""); e.settings[f] && e.settings[f].call(e, this[0], g); } (this.labelContainer = a(this.settings.errorLabelContainer)), (this.errorContext = (this.labelContainer.length && this.labelContainer) || a(this.currentForm)), (this.containers = a(this.settings.errorContainer).add( this.settings.errorLabelContainer )), (this.submitted = {}), (this.valueCache = {}), (this.pendingRequest = 0), (this.pending = {}), (this.invalid = {}), this.reset(); var d = (this.groups = {}); a.each(this.settings.groups, function (e, f) { typeof f == "string" && (f = f.split(/\s/)), a.each(f, function (g, h) { d[h] = e; }); }); var b = this.settings.rules; a.each(b, function (f, e) { b[f] = a.validator.normalizeRule(e); }), a(this.currentForm) .validateDelegate( ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", c ) .validateDelegate( "[type='radio'], [type='checkbox'], select, option", "click", c ), this.settings.invalidHandler && a(this.currentForm).bind( "invalid-form.validate", this.settings.invalidHandler ); }, form: function () { return ( this.checkForm(), a.extend(this.submitted, this.errorMap), (this.invalid = a.extend({}, this.errorMap)), this.valid() || a(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid() ); }, checkForm: function () { this.prepareForm(); for ( var b = 0, c = (this.currentElements = this.elements()); c[b]; b++ ) { this.check(c[b]); } return this.valid(); }, element: function (c) { (c = this.validationTargetFor(this.clean(c))), (this.lastElement = c), this.prepareElement(c), (this.currentElements = a(c)); var b = this.check(c) !== !1; return ( b ? delete this.invalid[c.name] : (this.invalid[c.name] = !0), this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), b ); }, showErrors: function (c) { if (c) { a.extend(this.errorMap, c), (this.errorList = []); for (var b in c) { this.errorList.push({ message: c[b], element: this.findByName(b)[0], }); } this.successList = a.grep(this.successList, function (d) { return !(d.name in c); }); } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors(); }, resetForm: function () { a.fn.resetForm && a(this.currentForm).resetForm(), (this.submitted = {}), (this.lastElement = null), this.prepareForm(), this.hideErrors(), this.elements() .removeClass(this.settings.errorClass) .removeData("previousValue"); }, numberOfInvalids: function () { return this.objectLength(this.invalid); }, objectLength: function (b) { var d = 0; for (var c in b) { d++; } return d; }, hideErrors: function () { this.addWrapper(this.toHide).hide(); }, valid: function () { return this.size() === 0; }, size: function () { return this.errorList.length; }, focusInvalid: function () { if (this.settings.focusInvalid) { try { a( this.findLastActive() || (this.errorList.length && this.errorList[0].element) || [] ) .filter(":visible") .focus() .trigger("focusin"); } catch (b) {} } }, findLastActive: function () { var b = this.lastActive; return ( b && a.grep(this.errorList, function (c) { return c.element.name === b.name; }).length === 1 && b ); }, elements: function () { var c = this, b = {}; return a(this.currentForm) .find("input, select, textarea") .not(":submit, :reset, :image, [disabled]") .not(this.settings.ignore) .filter(function () { return ( !this.name && c.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in b || !c.objectLength(a(this).rules()) ? !1 : ((b[this.name] = !0), !0) ); }); }, clean: function (b) { return a(b)[0]; }, errors: function () { var b = this.settings.errorClass.replace(" ", "."); return a(this.settings.errorElement + "." + b, this.errorContext); }, reset: function () { (this.successList = []), (this.errorList = []), (this.errorMap = {}), (this.toShow = a([])), (this.toHide = a([])), (this.currentElements = a([])); }, prepareForm: function () { this.reset(), (this.toHide = this.errors().add(this.containers)); }, prepareElement: function (b) { this.reset(), (this.toHide = this.errorsFor(b)); }, elementValue: function (d) { var b = a(d).attr("type"), c = a(d).val(); return b === "radio" || b === "checkbox" ? a("input[name='" + a(d).attr("name") + "']:checked").val() : typeof c == "string" ? c.replace(/\r/g, "") : c; }, check: function (h) { h = this.validationTargetFor(this.clean(h)); var d = a(h).rules(), f = !1, c = this.elementValue(h), g; for (var e in d) { var j = { method: e, parameters: d[e] }; try { g = a.validator.methods[e].call(this, c, h, j.parameters); if (g === "dependency-mismatch") { f = !0; continue; } f = !1; if (g === "pending") { this.toHide = this.toHide.not(this.errorsFor(h)); return; } if (!g) { return this.formatAndAdd(h, j), !1; } } catch (b) { throw ( (this.settings.debug && window.console && console.log( "Exception occured when checking element " + h.id + ", check the '" + j.method + "' method.", b ), b) ); } } if (f) { return; } return this.objectLength(d) && this.successList.push(h), !0; }, customDataMessage: function (c, b) { return ( a(c).data("msg-" + b.toLowerCase()) || (c.attributes && a(c).attr("data-msg-" + b.toLowerCase())) ); }, customMessage: function (b, d) { var c = this.settings.messages[b]; return c && (c.constructor === String ? c : c[d]); }, findDefined: function () { for (var b = 0; b < arguments.length; b++) { if (arguments[b] !== undefined) { return arguments[b]; } } return undefined; }, defaultMessage: function (c, b) { return this.findDefined( this.customMessage(c.name, b), this.customDataMessage(c, b), (!this.settings.ignoreTitle && c.title) || undefined, a.validator.messages[b], "Warning: No message defined for " + c.name + "" ); }, formatAndAdd: function (e, c) { var d = this.defaultMessage(e, c.method), b = /\$?\{(\d+)\}/g; typeof d == "function" ? (d = d.call(this, c.parameters, e)) : b.test(d) && (d = a.validator.format(d.replace(b, "{$1}"), c.parameters)), this.errorList.push({ message: d, element: e }), (this.errorMap[e.name] = d), (this.submitted[e.name] = d); }, addWrapper: function (b) { return ( this.settings.wrapper && (b = b.add(b.parent(this.settings.wrapper))), b ); }, defaultShowErrors: function () { var b, d; for (b = 0; this.errorList[b]; b++) { var c = this.errorList[b]; this.settings.highlight && this.settings.highlight.call( this, c.element, this.settings.errorClass, this.settings.validClass ), this.showLabel(c.element, c.message); } this.errorList.length && (this.toShow = this.toShow.add(this.containers)); if (this.settings.success) { for (b = 0; this.successList[b]; b++) { this.showLabel(this.successList[b]); } } if (this.settings.unhighlight) { for (b = 0, d = this.validElements(); d[b]; b++) { this.settings.unhighlight.call( this, d[b], this.settings.errorClass, this.settings.validClass ); } } (this.toHide = this.toHide.not(this.toShow)), this.hideErrors(), this.addWrapper(this.toShow).show(); }, validElements: function () { return this.currentElements.not(this.invalidElements()); }, invalidElements: function () { return a(this.errorList).map(function () { return this.element; }); }, showLabel: function (d, b) { var c = this.errorsFor(d); c.length ? (c .removeClass(this.settings.validClass) .addClass(this.settings.errorClass), c.html(b)) : ((c = a("<" + this.settings.errorElement + ">") .attr("for", this.idOrName(d)) .addClass(this.settings.errorClass) .html(b || "")), this.settings.wrapper && (c = c .hide() .show() .wrap("<" + this.settings.wrapper + "/>") .parent()), this.labelContainer.append(c).length || (this.settings.errorPlacement ? this.settings.errorPlacement(c, a(d)) : c.insertAfter(d))), !b && this.settings.success && (c.text(""), typeof this.settings.success == "string" ? c.addClass(this.settings.success) : this.settings.success(c, d)), (this.toShow = this.toShow.add(c)); }, errorsFor: function (c) { var b = this.idOrName(c); return this.errors().filter(function () { return a(this).attr("for") === b; }); }, idOrName: function (b) { return ( this.groups[b.name] || (this.checkable(b) ? b.name : b.id || b.name) ); }, validationTargetFor: function (b) { return ( this.checkable(b) && (b = this.findByName(b.name).not(this.settings.ignore)[0]), b ); }, checkable: function (b) { return /radio|checkbox/i.test(b.type); }, findByName: function (b) { return a(this.currentForm).find("[name='" + b + "']"); }, getLength: function (c, b) { switch (b.nodeName.toLowerCase()) { case "select": return a("option:selected", b).length; case "input": if (this.checkable(b)) { return this.findByName(b.name).filter(":checked").length; } } return c.length; }, depend: function (b, c) { return this.dependTypes[typeof b] ? this.dependTypes[typeof b](b, c) : !0; }, dependTypes: { boolean: function (b, c) { return b; }, string: function (c, b) { return !!a(c, b.form).length; }, function: function (b, c) { return b(c); }, }, optional: function (c) { var b = this.elementValue(c); return ( !a.validator.methods.required.call(this, b, c) && "dependency-mismatch" ); }, startRequest: function (b) { this.pending[b.name] || (this.pendingRequest++, (this.pending[b.name] = !0)); }, stopRequest: function (c, b) { this.pendingRequest--, this.pendingRequest < 0 && (this.pendingRequest = 0), delete this.pending[c.name], b && this.pendingRequest === 0 && this.formSubmitted && this.form() ? (a(this.currentForm).submit(), (this.formSubmitted = !1)) : !b && this.pendingRequest === 0 && this.formSubmitted && (a(this.currentForm).triggerHandler("invalid-form", [this]), (this.formSubmitted = !1)); }, previousValue: function (b) { return ( a.data(b, "previousValue") || a.data(b, "previousValue", { old: null, valid: !0, message: this.defaultMessage(b, "remote"), }) ); }, }, classRuleSettings: { required: { required: !0 }, email: { email: !0 }, url: { url: !0 }, date: { date: !0 }, dateISO: { dateISO: !0 }, number: { number: !0 }, digits: { digits: !0 }, creditcard: { creditcard: !0 }, }, addClassRules: function (c, b) { c.constructor === String ? (this.classRuleSettings[c] = b) : a.extend(this.classRuleSettings, c); }, classRules: function (d) { var b = {}, c = a(d).attr("class"); return ( c && a.each(c.split(" "), function () { this in a.validator.classRuleSettings && a.extend(b, a.validator.classRuleSettings[this]); }), b ); }, attributeRules: function (f) { var c = {}, d = a(f); for (var b in a.validator.methods) { var e; b === "required" ? ((e = d.get(0).getAttribute(b)), e === "" && (e = !0), (e = !!e)) : (e = d.attr(b)), e ? (c[b] = e) : d[0].getAttribute("type") === b && (c[b] = !0); } return ( c.maxlength && /-1|2147483647|524288/.test(c.maxlength) && delete c.maxlength, c ); }, dataRules: function (f) { var c, d, b = {}, e = a(f); for (c in a.validator.methods) { (d = e.data("rule-" + c.toLowerCase())), d !== undefined && (b[c] = d); } return b; }, staticRules: function (d) { var b = {}, c = a.data(d.form, "validator"); return ( c.settings.rules && (b = a.validator.normalizeRule(c.settings.rules[d.name]) || {}), b ); }, normalizeRules: function (c, b) { return ( a.each(c, function (e, d) { if (d === !1) { delete c[e]; return; } if (d.param || d.depends) { var f = !0; switch (typeof d.depends) { case "string": f = !!a(d.depends, b.form).length; break; case "function": f = d.depends.call(b, b); } f ? (c[e] = d.param !== undefined ? d.param : !0) : delete c[e]; } }), a.each(c, function (e, d) { c[e] = a.isFunction(d) ? d(b) : d; }), a.each(["minlength", "maxlength"], function () { c[this] && (c[this] = Number(c[this])); }), a.each(["rangelength"], function () { var d; c[this] && (a.isArray(c[this]) ? (c[this] = [Number(c[this][0]), Number(c[this][1])]) : typeof c[this] == "string" && ((d = c[this].split(/[\s,]+/)), (c[this] = [Number(d[0]), Number(d[1])]))); }), a.validator.autoCreateRanges && (c.min && c.max && ((c.range = [c.min, c.max]), delete c.min, delete c.max), c.minlength && c.maxlength && ((c.rangelength = [c.minlength, c.maxlength]), delete c.minlength, delete c.maxlength)), c ); }, normalizeRule: function (c) { if (typeof c == "string") { var b = {}; a.each(c.split(/\s/), function () { b[this] = !0; }), (c = b); } return c; }, addMethod: function (d, b, c) { (a.validator.methods[d] = b), (a.validator.messages[d] = c !== undefined ? c : a.validator.messages[d]), b.length < 3 && a.validator.addClassRules(d, a.validator.normalizeRule(d)); }, methods: { required: function (e, c, d) { if (!this.depend(d, c)) { return "dependency-mismatch"; } if (c.nodeName.toLowerCase() === "select") { var b = a(c).val(); return b && b.length > 0; } return this.checkable(c) ? this.getLength(e, c) > 0 : a.trim(e).length > 0; }, remote: function (g, c, e) { if (this.optional(c)) { return "dependency-mismatch"; } var b = this.previousValue(c); this.settings.messages[c.name] || (this.settings.messages[c.name] = {}), (b.originalMessage = this.settings.messages[c.name].remote), (this.settings.messages[c.name].remote = b.message), (e = (typeof e == "string" && { url: e }) || e); if (b.old === g) { return b.valid; } b.old = g; var f = this; this.startRequest(c); var d = {}; return ( (d[c.name] = g), a.ajax( a.extend( !0, { url: e, mode: "abort", port: "validate" + c.name, dataType: "json", data: d, success: function (l) { f.settings.messages[c.name].remote = b.originalMessage; var k = l === !0 || l === "true"; if (k) { var m = f.formSubmitted; f.prepareElement(c), (f.formSubmitted = m), f.successList.push(c), delete f.invalid[c.name], f.showErrors(); } else { var h = {}, j = l || f.defaultMessage(c, "remote"); (h[c.name] = b.message = a.isFunction(j) ? j(g) : j), (f.invalid[c.name] = !0), f.showErrors(h); } (b.valid = k), f.stopRequest(c, k); }, }, e ) ), "pending" ); }, minlength: function (e, c, d) { var b = a.isArray(e) ? e.length : this.getLength(a.trim(e), c); return this.optional(c) || b >= d; }, maxlength: function (e, c, d) { var b = a.isArray(e) ? e.length : this.getLength(a.trim(e), c); return this.optional(c) || b <= d; }, rangelength: function (e, c, d) { var b = a.isArray(e) ? e.length : this.getLength(a.trim(e), c); return this.optional(c) || (b >= d[0] && b <= d[1]); }, min: function (b, d, c) { return this.optional(d) || b >= c; }, max: function (b, d, c) { return this.optional(d) || b <= c; }, range: function (b, d, c) { return this.optional(d) || (b >= c[0] && b <= c[1]); }, email: function (b, c) { return ( this.optional(c) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test( b ) ); }, url: function (b, c) { return ( this.optional(c) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( b ) ); }, date: function (b, c) { return ( this.optional(c) || !/Invalid|NaN/.test(new Date(b).toString()) ); }, dateISO: function (b, c) { return ( this.optional(c) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(b) ); }, number: function (b, c) { return ( this.optional(c) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(b) ); }, digits: function (b, c) { return this.optional(c) || /^\d+$/.test(b); }, creditcard: function (b, j) { if (this.optional(j)) { return "dependency-mismatch"; } if (/[^0-9 \-]+/.test(b)) { return !1; } var d = 0, g = 0, c = !1; b = b.replace(/\D/g, ""); for (var h = b.length - 1; h >= 0; h--) { var f = b.charAt(h); (g = parseInt(f, 10)), c && (g *= 2) > 9 && (g -= 9), (d += g), (c = !c); } return d % 10 === 0; }, equalTo: function (e, c, d) { var b = a(d); return ( this.settings.onfocusout && b .unbind(".validate-equalTo") .bind("blur.validate-equalTo", function () { a(c).valid(); }), e === b.val() ); }, }, }), (a.format = a.validator.format); })(jQuery), (function (a) { var c = {}; if (a.ajaxPrefilter) { a.ajaxPrefilter(function (d, g, h) { var f = d.port; d.mode === "abort" && (c[f] && c[f].abort(), (c[f] = h)); }); } else { var b = a.ajax; a.ajax = function (e) { var d = ("mode" in e ? e : a.ajaxSettings).mode, f = ("port" in e ? e : a.ajaxSettings).port; return d === "abort" ? (c[f] && c[f].abort(), (c[f] = b.apply(this, arguments))) : b.apply(this, arguments); }; } })(jQuery), (function (a) { a.extend(a.fn, { validateDelegate: function (d, b, c) { return this.bind(b, function (f) { var e = a(f.target); if (e.is(d)) { return c.apply(e, arguments); } }); }, }); })(jQuery); /* ** Unobtrusive validation support library for jQuery and jQuery Validate ** Copyright (C) Microsoft Corporation. All rights reserved. */ (function (a) { var b = a.validator, c, e = "unobtrusiveValidation"; function m(p, q, r) { p.rules[q] = r; if (p.message) { p.messages[q] = p.message; } } function n(p) { return p.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); } function f(p) { return p.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); } function g(p) { return p.substr(0, p.lastIndexOf(".") + 1); } function d(q, p) { if (q.indexOf("*.") === 0) { q = q.replace("*.", p); } return q; } function h(q, r) { var p = a(this).find("[data-valmsg-for='" + f(r[0].name) + "']"), t = p.attr("data-valmsg-replace"), s = t ? a.parseJSON(t) !== false : null; p.removeClass("field-validation-valid").addClass("field-validation-error"); q.data("unobtrusiveContainer", p); if (s) { p.empty(); q.removeClass("input-validation-error").appendTo(p); } else { q.hide(); } } function j(q, s) { var p = a(this).find("[data-valmsg-summary=true]"), r = p.find("ul"); if (r && r.length && s.errorList.length) { r.empty(); p.addClass("validation-summary-errors").removeClass( "validation-summary-valid" ); a.each(s.errorList, function () { a("
  • ").html(this.message).appendTo(r); }); } } function l(q) { var p = q.data("unobtrusiveContainer"), s = p.attr("data-valmsg-replace"), r = s ? a.parseJSON(s) : null; if (p) { p.addClass("field-validation-valid").removeClass( "field-validation-error" ); q.removeData("unobtrusiveContainer"); if (r) { p.empty(); } } } function k(q) { var p = a(this); p.data("validator").resetForm(); p.find(".validation-summary-errors") .addClass("validation-summary-valid") .removeClass("validation-summary-errors"); p.find(".field-validation-error") .addClass("field-validation-valid") .removeClass("field-validation-error") .removeData("unobtrusiveContainer") .find(">*") .removeData("unobtrusiveContainer"); } function o(q) { var p = a(q), s = p.data(e), r = a.proxy(k, q); if (!s) { s = { options: { errorClass: "input-validation-error", errorElement: "span", errorPlacement: a.proxy(h, q), invalidHandler: a.proxy(j, q), messages: {}, rules: {}, success: a.proxy(l, q), }, attachValidation: function () { p.unbind("reset." + e, r) .bind("reset." + e, r) .validate(this.options); }, validate: function () { p.validate(); return p.valid(); }, }; p.data(e, s); } return s; } b.unobtrusive = { adapters: [], parseElement: function (q, u) { var p = a(q), r = p.parents("form")[0], v, t, s; if (!r) { return; } v = o(r); v.options.rules[q.name] = t = {}; v.options.messages[q.name] = s = {}; a.each(this.adapters, function () { var y = "data-val-" + this.name, w = p.attr(y), x = {}; if (w !== undefined) { y += "-"; a.each(this.params, function () { x[this] = p.attr(y + this); }); this.adapt({ element: q, form: r, message: w, params: x, rules: t, messages: s, }); } }); a.extend(t, { __dummy__: true }); if (!u) { v.attachValidation(); } }, parse: function (q) { var p = a(q) .parents("form") .andSelf() .add(a(q).find("form")) .filter("form"); a(q) .find(":input[data-val=true]") .each(function () { b.unobtrusive.parseElement(this, true); }); p.each(function () { var r = o(this); if (r) { r.attachValidation(); } }); }, }; c = b.unobtrusive.adapters; c.add = function (p, r, q) { if (!q) { q = r; r = []; } this.push({ name: p, params: r, adapt: q }); return this; }; c.addBool = function (p, q) { return this.add(p, function (r) { m(r, q || p, true); }); }; c.addMinMax = function (p, u, r, t, s, q) { return this.add(p, [s || "min", q || "max"], function (x) { var w = x.params.min, v = x.params.max; if (w && v) { m(x, t, [w, v]); } else { if (w) { m(x, u, w); } else { if (v) { m(x, r, v); } } } }); }; c.addSingleVal = function (p, q, r) { return this.add(p, [q || "val"], function (s) { m(s, r || p, s.params[q]); }); }; b.addMethod("__dummy__", function (r, p, q) { return true; }); b.addMethod("regex", function (s, p, r) { var q; if (this.optional(p)) { return true; } q = new RegExp(r).exec(s); return q && q.index === 0 && q[0].length === s.length; }); b.addMethod("nonalphamin", function (s, p, r) { var q; if (r) { q = s.match(/\W/g); q = q && q.length >= r; } return q; }); c.addSingleVal("accept", "exts").addSingleVal("regex", "pattern"); c.addBool("creditcard") .addBool("date") .addBool("digits") .addBool("email") .addBool("number") .addBool("url"); c.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax( "range", "min", "max", "range" ); c.add("equalto", ["other"], function (r) { var t = g(r.element.name), s = r.params.other, q = d(s, t), p = a(r.form).find(":input[name='" + f(q) + "']")[0]; m(r, "equalTo", p); }); c.add("required", function (p) { if ( p.element.tagName.toUpperCase() !== "INPUT" || p.element.type.toUpperCase() !== "CHECKBOX" ) { m(p, "required", true); } }); c.add("remote", ["url", "type", "additionalfields"], function (p) { var r = { url: p.params.url, type: p.params.type || "GET", data: {} }, q = g(p.element.name); a.each(n(p.params.additionalfields || p.element.name), function (t, s) { var u = d(s, q); r.data[u] = function () { return a(p.form) .find(":input[name='" + f(u) + "']") .val(); }; }); m(p, "remote", r); }); c.add("password", ["min", "nonalphamin", "regex"], function (p) { if (p.params.min) { m(p, "minlength", p.params.min); } if (p.params.nonalphamin) { m(p, "nonalphamin", p.params.nonalphamin); } if (p.params.regex) { m(p, "regex", p.params.regex); } }); a(function () { b.unobtrusive.parse(document); }); })(jQuery); (function (a) { var b = function (d, e) { return d.find("[name='" + e + "']"); }; var c = function (d) { return a(d).closest("form"); }; a.validator.addMethod("enforcetrue", function (f, d, e) { return d.checked; }); a.validator.unobtrusive.adapters.addBool("enforcetrue"); a.validator.unobtrusive.adapters.add( "atleastonerequired", ["properties"], function (d) { d.rules.atleastonerequired = d.params; d.messages.atleastonerequired = d.message; } ); a.validator.addMethod( "atleastonerequired", function (h, e, f) { var d = c(e); var g = f.properties.split(","); var j = a.map(g, function (l, k) { var m = b(d, l).val(); return m != "" ? m : null; }); return j.length > 0; }, "" ); a.validator.unobtrusive.adapters.add( "requiredor", ["otherproperties"], function (d) { d.rules.requiredor = d.params; d.messages.requiredor = d.message; } ); a.validator.addMethod( "requiredor", function (h, e, f) { if (h != "") { return true; } var d = c(e); var g = f.otherproperties.split(","); var j = a.map(g, function (l, k) { var m = b(d, l).val(); return m != "" ? m : null; }); return j.length > 0; }, "" ); })(window.jQuery); /* * Bootstrap v3.1.1 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ if ("undefined" == typeof jQuery) { throw new Error("Bootstrap's JavaScript requires jQuery"); } +(function (c) { function d() { var e = document.createElement("bootstrap"), f = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend", }; for (var g in f) { if (void 0 !== e.style[g]) { return { end: f[g] }; } } return !1; } (c.fn.emulateTransitionEnd = function (a) { var f = !1, g = this; c(this).one(c.support.transition.end, function () { f = !0; }); var h = function () { f || c(g).trigger(c.support.transition.end); }; return setTimeout(h, a), this; }), c(function () { c.support.transition = d(); }); })(jQuery), +(function (e) { var f = '[data-dismiss="alert"]', g = function (a) { e(a).on("click", f, this.close); }; g.prototype.close = function (a) { function j() { m.trigger("closed.bs.alert").remove(); } var k = e(this), l = k.attr("data-target"); l || ((l = k.attr("href")), (l = l && l.replace(/.*(?=#[^\s]*$)/, ""))); var m = e(l); a && a.preventDefault(), m.length || (m = k.hasClass("alert") ? k : k.parent()), m.trigger((a = e.Event("close.bs.alert"))), a.isDefaultPrevented() || (m.removeClass("in"), e.support.transition && m.hasClass("fade") ? m.one(e.support.transition.end, j).emulateTransitionEnd(150) : j()); }; var h = e.fn.alert; (e.fn.alert = function (a) { return this.each(function () { var b = e(this), c = b.data("bs.alert"); c || b.data("bs.alert", (c = new g(this))), "string" == typeof a && c[a].call(b); }); }), (e.fn.alert.Constructor = g), (e.fn.alert.noConflict = function () { return (e.fn.alert = h), this; }), e(document).on("click.bs.alert.data-api", f, g.prototype.close); })(jQuery), +(function (d) { var e = function (a, b) { (this.$element = d(a)), (this.options = d.extend({}, e.DEFAULTS, b)), (this.isLoading = !1); }; (e.DEFAULTS = { loadingText: "loading..." }), (e.prototype.setState = function (a) { var g = "disabled", h = this.$element, j = h.is("input") ? "val" : "html", k = h.data(); (a += "Text"), k.resetText || h.data("resetText", h[j]()), h[j](k[a] || this.options[a]), setTimeout( d.proxy(function () { "loadingText" == a ? ((this.isLoading = !0), h.addClass(g).attr(g, g)) : this.isLoading && ((this.isLoading = !1), h.removeClass(g).removeAttr(g)); }, this), 0 ); }), (e.prototype.toggle = function () { var g = !0, h = this.$element.closest('[data-toggle="buttons"]'); if (h.length) { var j = this.$element.find("input"); "radio" == j.prop("type") && (j.prop("checked") && this.$element.hasClass("active") ? (g = !1) : h.find(".active").removeClass("active")), g && j .prop("checked", !this.$element.hasClass("active")) .trigger("change"); } g && this.$element.toggleClass("active"); }); var f = d.fn.button; (d.fn.button = function (a) { return this.each(function () { var b = d(this), c = b.data("bs.button"), g = "object" == typeof a && a; c || b.data("bs.button", (c = new e(this, g))), "toggle" == a ? c.toggle() : a && c.setState(a); }); }), (d.fn.button.Constructor = e), (d.fn.button.noConflict = function () { return (d.fn.button = f), this; }), d(document).on( "click.bs.button.data-api", "[data-toggle^=button]", function (a) { var g = d(a.target); g.hasClass("btn") || (g = g.closest(".btn")), g.button("toggle"), a.preventDefault(); } ); })(jQuery), +(function (d) { var e = function (a, g) { (this.$element = d(a)), (this.$indicators = this.$element.find(".carousel-indicators")), (this.options = g), (this.paused = this.sliding = this.interval = this.$active = this.$items = null), "hover" == this.options.pause && this.$element .on("mouseenter", d.proxy(this.pause, this)) .on("mouseleave", d.proxy(this.cycle, this)); }; (e.DEFAULTS = { interval: 5000, pause: "hover", wrap: !0 }), (e.prototype.cycle = function (a) { return ( a || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval( d.proxy(this.next, this), this.options.interval )), this ); }), (e.prototype.getActiveIndex = function () { return ( (this.$active = this.$element.find(".item.active")), (this.$items = this.$active.parent().children()), this.$items.index(this.$active) ); }), (e.prototype.to = function (a) { var g = this, h = this.getActiveIndex(); return a > this.$items.length - 1 || 0 > a ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function () { g.to(a); }) : h == a ? this.pause().cycle() : this.slide(a > h ? "next" : "prev", d(this.$items[a])); }), (e.prototype.pause = function (a) { return ( a || (this.paused = !0), this.$element.find(".next, .prev").length && d.support.transition && (this.$element.trigger(d.support.transition.end), this.cycle(!0)), (this.interval = clearInterval(this.interval)), this ); }), (e.prototype.next = function () { return this.sliding ? void 0 : this.slide("next"); }), (e.prototype.prev = function () { return this.sliding ? void 0 : this.slide("prev"); }), (e.prototype.slide = function (a, k) { var l = this.$element.find(".item.active"), m = k || l[a](), n = this.interval, o = "next" == a ? "left" : "right", p = "next" == a ? "first" : "last", q = this; if (!m.length) { if (!this.options.wrap) { return; } m = this.$element.find(".item")[p](); } if (m.hasClass("active")) { return (this.sliding = !1); } var r = d.Event("slide.bs.carousel", { relatedTarget: m[0], direction: o, }); return ( this.$element.trigger(r), r.isDefaultPrevented() ? void 0 : ((this.sliding = !0), n && this.pause(), this.$indicators.length && (this.$indicators.find(".active").removeClass("active"), this.$element.one("slid.bs.carousel", function () { var c = d(q.$indicators.children()[q.getActiveIndex()]); c && c.addClass("active"); })), d.support.transition && this.$element.hasClass("slide") ? (m.addClass(a), m[0].offsetWidth, l.addClass(o), m.addClass(o), l .one(d.support.transition.end, function () { m.removeClass([a, o].join(" ")).addClass("active"), l.removeClass(["active", o].join(" ")), (q.sliding = !1), setTimeout(function () { q.$element.trigger("slid.bs.carousel"); }, 0); }) .emulateTransitionEnd( 1000 * l.css("transition-duration").slice(0, -1) )) : (l.removeClass("active"), m.addClass("active"), (this.sliding = !1), this.$element.trigger("slid.bs.carousel")), n && this.cycle(), this) ); }); var f = d.fn.carousel; (d.fn.carousel = function (a) { return this.each(function () { var b = d(this), c = b.data("bs.carousel"), h = d.extend({}, e.DEFAULTS, b.data(), "object" == typeof a && a), j = "string" == typeof a ? a : h.slide; c || b.data("bs.carousel", (c = new e(this, h))), "number" == typeof a ? c.to(a) : j ? c[j]() : h.interval && c.pause().cycle(); }); }), (d.fn.carousel.Constructor = e), (d.fn.carousel.noConflict = function () { return (d.fn.carousel = f), this; }), d(document).on( "click.bs.carousel.data-api", "[data-slide], [data-slide-to]", function (a) { var h, j = d(this), k = d( j.attr("data-target") || ((h = j.attr("href")) && h.replace(/.*(?=#[^\s]+$)/, "")) ), l = d.extend({}, k.data(), j.data()), m = j.attr("data-slide-to"); m && (l.interval = !1), k.carousel(l), (m = j.attr("data-slide-to")) && k.data("bs.carousel").to(m), a.preventDefault(); } ), d(window).on("load", function () { d('[data-ride="carousel"]').each(function () { var a = d(this); a.carousel(a.data()); }); }); })(jQuery), +(function (d) { var e = function (a, b) { (this.$element = d(a)), (this.options = d.extend({}, e.DEFAULTS, b)), (this.transitioning = null), this.options.parent && (this.$parent = d(this.options.parent)), this.options.toggle && this.toggle(); }; (e.DEFAULTS = { toggle: !0 }), (e.prototype.dimension = function () { var b = this.$element.hasClass("width"); return b ? "width" : "height"; }), (e.prototype.show = function () { if (!this.transitioning && !this.$element.hasClass("in")) { var a = d.Event("show.bs.collapse"); if ((this.$element.trigger(a), !a.isDefaultPrevented())) { var h = this.$parent && this.$parent.find("> .panel > .in"); if (h && h.length) { var j = h.data("bs.collapse"); if (j && j.transitioning) { return; } h.collapse("hide"), j || h.data("bs.collapse", null); } var k = this.dimension(); this.$element.removeClass("collapse").addClass("collapsing")[k](0), (this.transitioning = 1); var l = function () { this.$element .removeClass("collapsing") .addClass("collapse in") [k]("auto"), (this.transitioning = 0), this.$element.trigger("shown.bs.collapse"); }; if (!d.support.transition) { return l.call(this); } var m = d.camelCase(["scroll", k].join("-")); this.$element .one(d.support.transition.end, d.proxy(l, this)) .emulateTransitionEnd(350) [k](this.$element[0][m]); } } }), (e.prototype.hide = function () { if (!this.transitioning && this.$element.hasClass("in")) { var a = d.Event("hide.bs.collapse"); if ((this.$element.trigger(a), !a.isDefaultPrevented())) { var g = this.dimension(); this.$element[g](this.$element[g]())[0].offsetHeight, this.$element .addClass("collapsing") .removeClass("collapse") .removeClass("in"), (this.transitioning = 1); var h = function () { (this.transitioning = 0), this.$element .trigger("hidden.bs.collapse") .removeClass("collapsing") .addClass("collapse"); }; return d.support.transition ? void this.$element[g](0) .one(d.support.transition.end, d.proxy(h, this)) .emulateTransitionEnd(350) : h.call(this); } } }), (e.prototype.toggle = function () { this[this.$element.hasClass("in") ? "hide" : "show"](); }); var f = d.fn.collapse; (d.fn.collapse = function (a) { return this.each(function () { var b = d(this), c = b.data("bs.collapse"), g = d.extend({}, e.DEFAULTS, b.data(), "object" == typeof a && a); !c && g.toggle && "show" == a && (a = !a), c || b.data("bs.collapse", (c = new e(this, g))), "string" == typeof a && c[a](); }); }), (d.fn.collapse.Constructor = e), (d.fn.collapse.noConflict = function () { return (d.fn.collapse = f), this; }), d(document).on( "click.bs.collapse.data-api", "[data-toggle=collapse]", function (a) { var k, l = d(this), m = l.attr("data-target") || a.preventDefault() || ((k = l.attr("href")) && k.replace(/.*(?=#[^\s]+$)/, "")), n = d(m), o = n.data("bs.collapse"), p = o ? "toggle" : l.data(), q = l.attr("data-parent"), r = q && d(q); (o && o.transitioning) || (r && r .find('[data-toggle=collapse][data-parent="' + q + '"]') .not(l) .addClass("collapsed"), l[n.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), n.collapse(p); } ); })(jQuery), +(function (h) { function j(a) { h(l).remove(), h(m).each(function () { var b = k(h(this)), c = { relatedTarget: this }; b.hasClass("open") && (b.trigger((a = h.Event("hide.bs.dropdown", c))), a.isDefaultPrevented() || b.removeClass("open").trigger("hidden.bs.dropdown", c)); }); } function k(a) { var e = a.attr("data-target"); e || ((e = a.attr("href")), (e = e && /#[A-Za-z]/.test(e) && e.replace(/.*(?=#[^\s]*$)/, ""))); var f = e && h(e); return f && f.length ? f : a.parent(); } var l = ".dropdown-backdrop", m = "[data-toggle=dropdown]", n = function (a) { h(a).on("click.bs.dropdown", this.toggle); }; (n.prototype.toggle = function (a) { var b = h(this); if (!b.is(".disabled, :disabled")) { var c = k(b), p = c.hasClass("open"); if ((j(), !p)) { "ontouchstart" in document.documentElement && !c.closest(".navbar-nav").length && h('
  • " + l + "
  • "; g.append(j); }); g.find("li").first().addClass("active"); f.find("div.tab-pane").first().addClass("active"); }); a(".score-accordion").each(function () { a(this).find(".panel-collapse").first().addClass("in"); }); a(".score-tab").each(function () { a(this).find(".tab-pane").first().addClass("in"); }); a(".score-megamenu").find(".btn").addClass("navbar-btn"); } return { run: c, prepare: b }; })(jQuery); $(function () { BrainJocks.BootstrapUI.prepare(); }); $(document).ready(function () { BrainJocks.BootstrapUI.run(); }); var requiredfieldError, pNameAlphaRegex, yNameAlphaRegex, alphaError, yEmailRegex, pEmailRegex, emailError, eMailRegx, alphaRegex, minLenError, maxLenError; eMailRegx = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; alphaRegex = /^[^!@$%^&*()_+|~=`\\#{}\[\]:";<>?,.\/^\d]*$/; var emv = $(".email-content"); requiredfieldError = Boolean(emv.data("requirederror")) ? emv.data("requirederror") : "This field is required."; alphaError = Boolean(emv.data("alphaerror")) ? emv.data("alphaerror") : "Please enter letters only"; emailError = Boolean(emv.data("emailerror")) ? emv.data("emailerror") : "Please provide a valid email address."; minLenError = Boolean(emv.data("minlenerror")) ? emv.data("minlenerror") : "Please enter at least 3 characters."; maxLenError = Boolean(emv.data("maxlenerror")) ? emv.data("maxlenerror") : "Please enter no more than 80 characters."; pNameAlphaRegex = Boolean(emv.data("isrecipientalpha")) ? IsChecked(emv.data("isrecipientalpha")) ? emv.data("ralpharegex") : alphaRegex : alphaRegex; pEmailRegex = Boolean(emv.data("isrecipientemailval")) ? IsChecked(emv.data("isrecipientemailval")) ? emv.data("remailregex") : eMailRegx : eMailRegx; yNameAlphaRegex = Boolean(emv.data("issenderalpha")) ? IsChecked(emv.data("issenderalpha")) ? emv.data("salpharegex") : alphaRegex : alphaRegex; yEmailRegex = Boolean(emv.data("issenderemailval")) ? IsChecked(emv.data("issenderemailval")) ? emv.data("semailregex") : eMailRegx : eMailRegx; var emailThisPageValidator = $("#emailModal").validate({ onkeyup: false, onclick: false, rules: { pName: { minlength: 3, maxlength: 80, required: true, onlyalphabetspName: true, }, pEmail: { RecipientEmailValidate: true, required: true }, yName: { minlength: 3, maxlength: 80, required: true, onlyalphabetsyName: true, }, yEmail: { SenderEmailValidate: true, required: true }, }, highlight: function (a) { $(a).closest(".form-group").addClass("has-error"); }, unhighlight: function (a) { $(a).closest(".form-group").removeClass("has-error"); }, errorElement: "span", errorClass: "help-block", messages: { pEmail: { required: emailError, RecipientEmailValidate: emailError }, yEmail: { required: emailError, SenderEmailValidate: emailError }, pName: { required: requiredfieldError, onlyalphabetspName: alphaError, minlength: minLenError, maxlength: maxLenError, }, yName: { required: requiredfieldError, onlyalphabetsyName: alphaError, minlength: minLenError, maxlength: maxLenError, }, }, }); jQuery.validator.addMethod("onlyalphabetspName", function (a) { return ValidateByRegex($("#pName").val(), pNameAlphaRegex); }); jQuery.validator.addMethod("onlyalphabetsyName", function (a) { return ValidateByRegex($("#yName").val(), yNameAlphaRegex); }); jQuery.validator.addMethod("SenderEmailValidate", function (a) { return ValidateByRegex($("#yEmail").val(), yEmailRegex); }); jQuery.validator.addMethod("RecipientEmailValidate", function (a) { return ValidateByRegex($("#pEmail").val(), pEmailRegex); }); function ValidateByRegex(d, a) { var c = d; var b = new RegExp(a); if (c.trim() != c) { return false; } else { if (!b.test(c)) { return false; } else { return true; } } } function IsChecked(a) { return a.toLowerCase() == "true" ? true : false; } function sendEmailClick(a) { var b = $("#emailModal"); b.validate(); if (b.valid()) { sendEmail(a); } } $(document).ready(function () { $(".subContent").text($(".subContent").text().replace("{Sender}", "")); $("#myModalEmail").on("hidden.bs.modal", function () { $(".email-container").show(); $(".email-success-container").hide(); $("#emailModal").find("input[type=text], textarea").val(""); $("#cbSendCopy").prop("checked", false); emailThisPageValidator.resetForm(); $("#emailModal .has-error .help-block").remove(); $(".form-group").removeClass("has-error has-feedback"); $(".form-group").find("small.help-block").hide(); $(".form-group").find("i.form-control-feedback").hide(); }); $("#btnSendAnother").click(function (a) { $(".email-container").show(); $(".email-success-container").hide(); }); $("#btnDone").click(function (a) { $("#myModalEmail").modal("hide"); $(".email-container").show(); $(".email-success-container").hide(); }); }); function sendEmail(a) { var b = { RecipientName: $("#pName").val(), RecipientEmail: $("#pEmail").val(), SenderName: $("#yName").val(), SenderEmail: $("#yEmail").val(), SendACopy: $("#cbSendCopy").is(":checked"), SharedUrl: document.URL, EmailComponentGuid: a, }; document.getElementById("btnSend").disabled = true; $.ajax({ type: "POST", url: "/api/form/ShareByEmail/", data: JSON.stringify(b), contentType: "application/json; charset=utf-8", dataType: "json", asyn: false, success: function (c) { if (c === "true") { $("#recipientName").text($("#pName").val()); $("#recipientEmail").text($("#pEmail").val()); $(".email-container").hide(); $(".email-success-container").show(); $("#emailModal").find("input[type=text], textarea").val(""); $("#cbSendCopy").prop("checked", false); document.getElementById("btnSend").disabled = false; } else { alert("Error sending email:" + c); } return false; }, error: function (c) { alert("Error sending email:" + c); return false; }, }); } (function (a) { a.fn.unveil = function (j, d) { var b = a(window), h = j || 0, g = window.devicePixelRatio > 1, c = g ? "data-src-retina" : "data-src", e = this, f; this.one("unveil", function () { var l = this.getAttribute(c); l = l || this.getAttribute("data-src"); if (l) { this.setAttribute("src", l); if (typeof d === "function") { d.call(this); } } }); function k() { var l = e.filter(function () { var m = a(this); if (m.is(":hidden")) { return; } var q = b.scrollTop(), p = q + b.height(), o = m.offset().top, n = o + m.height(); return n >= q - h && o <= p + h; }); f = l.trigger("unveil"); e = e.not(f); } b.on("scroll.unveil resize.unveil lookup.unveil", k); k(); return this; }; })(window.jQuery || window.Zepto); $(document).ready(function () { $("head").append( "" ); $(".share_line").insertAfter( $( ".score-container.antidiarroico .container .score-page.score-column1 .score-structural.score-column2-equal.first-level-col .score-left .score-structural.score-column2-equal.enterog_bottom_img" ) ); $(".score-header-wrapper .CoveoSearchBox .CoveoQueryBox").attr( "maxlength", "50" ); $(".Testdis") .clone() .insertAfter(".FormControllerClass .col-xs-12:nth-child(2) button") .removeClass("hidden"); $(".video-section .hidden-xs > div").css("padding-top", "41%"); if ($(window).width() >= 768) { $(".head-section, .sintomi-icon").wrapAll('
    '); } else { $(".head-section, .sintomi-icon").wrapAll('
    '); } $(".CoveoSearchButton span.coveo-icon").html(""); $(".coveo-query-box-clear .coveo-icon").hide(); $(".menu-bg").hover(function () { $(this).parent().find("a").addClass("tryangle"); }); $(".score-menu-link-item").hover(function () { $(this).parent().parent().find("a").addClass("tryangle"); }); $(".score-menu-link-item").mouseout(function () { $(this).parent().parent().find("a").removeClass("tryangle"); }); $(".dropdown").hover(function () { $(this).find("a").removeClass("tryangle"); }); $(".navbar-nav>li>a").each(function () { var a = "" + $(this).html() + ""; $(this).html(a); }); }); $(document).ready(function () { $("#mobile_carousal .score-carousel") .find(".item.score-carouselpane") .removeClass("active"); $("#mobile_carousal .score-carousel") .find(".item.score-carouselpane") .first() .addClass("active"); $("#mobile_carousal .score-carousel").each(function () { var b = $(this); var c = b.data.rotationSpeed; if ($.isNumeric(c) && c >= 1) { b.carousel({ interval: c }); } }); var a = $(".prodotti-header-panel img").height(); console.log(a); $(".en-banner-outer").css("margin-top", "-" + a + "px"); $(".en-banner-outer").css("height", a + "px"); $(window).resize(function () { var b = $(".en-banner").height(); $(".en-banner-outer").css("margin-top", "-" + b + "px"); $(".en-banner-outer").css("height", b + "px"); }); }); $(".image-component").each(function () { var a = $(this); a.html(a.html().replace(/ /g, "")); }); $(".image-component p").each(function () { var a = $(this); if (a.html().replace(/\s| /g, "").length == 0) { a.remove(); } }); $(document).ready(function () { var a = $(window).width(); if ($(window).width() <= 1100) { $(".score-column3-widemiddle .score-right").insertBefore( ".top-section .brandLogo.right" ); } }); $(window).resize(function () { var a = $(this).width(); if (a <= 1100) { $(".score-column3-widemiddle .score-right").insertBefore( ".top-section .brandLogo.right" ); } }); $(window).resize(function () { var a = $(this).width(); if (a >= 1100) { $(".top-section .score-right").insertAfter( ".score-column3-widemiddle .score-center" ); } }); $(window).resize(function () { var a = $(this).width(); if (a <= 768) { $(".second-level-col .social_Entero").insertBefore(".enterog_right"); } }); (function (a) { if ( navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Mac") != -1 && navigator.userAgent.indexOf("Chrome") == -1 ) { a("body").addClass("safari-mac"); } })(jQuery); $(".safari-mac .navbar-nav li.score-megamenu-dropdown.dropdown > a").click( function (a) { if ($(window).width() <= 1024) { $(".safari-mac .navbar-nav li.score-megamenu-dropdown.dropdown > a") .not(this) .data("flag", ""); if (!$(this).data("flag")) { a.preventDefault(); $(this).data("flag", true); } else { } } } ); if (typeof Coveo !== "undefined") { Coveo.$("#search").on("deferredQuerySuccess", function (b, a) { $(".coveo-previous,.coveo-next").remove(); }); } $(function () { var b = window.location.pathname.split("/"); var a = b.length; $("ul.nav li a,ul.page-links li a").each(function () { if ($(this).attr("href") == "/" + b[1] + "/" + b[2]) { $(this).parent("li").addClass("mact"); $(this).find("span").addClass("mactive"); } else { if ($(this).attr("href") == "/" + b[1]) { $(this).parent("li").addClass("mact"); $(this).find("span").addClass("mactive"); } } }); }); $(".CoveoQueryBox").blur(function () { $("#search").focus(); }); $(window).resize(function () { if ($(window).width() <= 1024) { $("html, body").removeAttr("style"); } }); $(document).ready(function () { var a = $(window).width(); if ($(window).width() <= 1023) { $(".score-column3-widemiddle .score-right").insertBefore( ".top-section .pull-right" ); $(".navbar-toggle") .removeClass("score-hamburger navbar-toggle") .addClass("score-hamburger navbar-toggle collapsed"); $('').insertBefore( ".navbar-header.score-navbar-header span.icon-bar:first-child" ); } }); $(window).resize(function () { var a = $(this).width(); if (a <= 1023) { $(".score-column3-widemiddle .score-right").insertBefore( ".top-section .pull-right" ); $(".navbar-toggle") .removeClass("score-hamburger navbar-toggle") .addClass("score-hamburger navbar-toggle collapsed"); $('').insertBefore( ".navbar-header.score-navbar-header span.icon-bar:first-child" ); } }); $(function () { $(".CoveoQueryBox").blur(); $( '' ).insertAfter(".CoveoQueryBox"); if ($(window).width() > 1099) { $(".CoveoSearchBox.CoveoSearchInterface") .find("div") .addClass("form-group has-feedback"); $(".CoveoQueryBox").addClass("form-control"); } else { $(".CoveoSearchBox.CoveoSearchInterface") .find("div") .removeClass("form-group has-feedback"); $(".CoveoQueryBox").removeClass("form-control"); } }); $(window).resize(function () { if ($(window).width() > 1099) { $(".CoveoSearchBox.CoveoSearchInterface") .find("div") .addClass("form-group has-feedback"); $(".CoveoQueryBox").addClass("form-control"); } else { $(".CoveoSearchBox.CoveoSearchInterface") .find("div") .removeClass("form-group has-feedback"); $(".CoveoQueryBox").removeClass("form-control"); } }); $(document).keyup(function (a) { if (a.which == 13) { var b = $("#search").val(); if (b != "") { $(".CoveoSearchButton .coveo-icon").click(); } } }); $(function () { $(".ento-video-sec a").click(function () { $("html, body").animate( { scrollTop: $($(this).attr("href")).offset().top }, 600 ); return false; }); $(".child-title").click(function () { $(".video-title").attr("id", "bg2"); }); $(".adult-title").click(function () { $(".video-title").attr("id", ""); }); $(".coveo-icon").on("click", function () { var a = $(".CoveoQueryBox").val(); if (a != "") { return true; } return false; }); }); $(document).ready(function () { $("head").append( "" ); }); $(document).ready(function () { if ( /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test( navigator.userAgent ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( navigator.userAgent.substr(0, 4) ) ) { $("#widget2").css("width", "100%"); } }); $(document).ready(function () { var e = $("html").attr("lang"); var f; if (e == "en-gb") { $("body").addClass("en-gb"); f = "hi-in"; } else { if (e == "hi-in") { $("body").addClass("hi-in"); f = "en-gb"; } } var g = function () { return ( typeof Sitecore !== "undefined" && Sitecore && Sitecore.PageModes && Sitecore.PageModes.PageEditor ); }; var j = function () { return typeof Sitecore !== "undefined" && !g(); }; var h = function () { return typeof Sitecore === "undefined"; }; if (g()) { console.log("in Edit mode"); } if (j()) { console.log("in preview mode"); } if (h()) { console.log("in normal mode"); var b = $("html").attr("lang"); console.log(window.location.href.indexOf("/" + b)); if (window.location.href.indexOf("/" + b) == -1) { var d = window.location.protocol + "//" + window.location.host + "/" + b + window.location.pathname; console.log(d); window.history.pushState({ path: d }, "", d); } } $(".switcher").click(function () { if (window.location.pathname.indexOf(e) != -1) { curr_url_loaded = window.location.pathname.replace(e, f); } else { curr_url_loaded = "/" + f + window.location.pathname; } window.location.href = curr_url_loaded; }); $("a").each(function () { if ($(this).attr("href") !== undefined) { if ($(this).attr("href").indexOf("#") !== 0) { var c = $(this)[0].hostname == window.location.hostname; if (c) { var a = $(this).attr("href"); $(this).attr("href", "/" + e + a); } } } }); }); $(document).ready(function () { $(".btn-lan").click(function () { var a = $(this).data("target"); $(".btn-lan").removeClass("active"); $(this).addClass("active"); $(".carousel").css("display", "none"); $("#" + a) .css("display", "block") .carousel($(this).data("slide-to")); }); });