1$(document).ready(function () { 2 "use strict"; 3 4 // If header is fixed push marketing message or page title down 5 $(window).on('load resize', function () { 6 var $headerHeight = $('header.masthead').outerHeight(); 7 8 if ($('.masthead').css('position') == 'fixed' && $('section.mod-marketing').length > 0) { 9 $('.slides > li').css("padding-top", $headerHeight); 10 return false; 11 } else if ($('.masthead').css('position') == 'fixed') { 12 $('.page-title').css("padding-top", $headerHeight); 13 return false; 14 } else { 15 $('.slides > li, .page-title').css("padding-top", ""); 16 } 17 }) 18 19 // On skip content link click, change tabindex to content area 20 $('.skip-to-content').on('click', function () { 21 var $skip = $('#content-anchor'); 22 23 $skip.attr('tabindex', -1).on('blur focusout', function () { 24 $(this).removeAttr('tabindex'); 25 }).focus(); 26 }); 27 28 // Change <img> to a <div> with that image as a background - Replacement for object-fit: cover; which doesn't work on IE 29 // Keep in mind, you will need to specify a height as these will be empty <div>'s with no height 30 // The css selector to target this is div.js-cover or whatever other class you previously had on the <img> as those are carried over 31 $('img.js-cover').each(function () { 32 var $imagePath = $(this).attr('src'); 33 var $imageClasses = $(this).attr('class'); 34 $(this).replaceWith('<div class="' + $imageClasses + '" style="background-image:url(' + $imagePath + ');background-size:cover;"></div>'); 35 }); 36 37 // If content on page is shorter than the window height, push footer to bottom of screen 38 $(window).on('load', function () { 39 var $bodyHeight = $('body').outerHeight(); 40 var $windowHeight = $(window).height(); 41 42 if ($bodyHeight < $windowHeight) { 43 $('footer').css('padding-top', (($windowHeight - $bodyHeight) + 1)); // The + 1 here makes sure that the scrollbar is still visible so the break-out classes don't break 44 } 45 }); 46 47 // Search 48 $('a.nav-search').on('click', function () { 49 $('.search-field-wrapper').slideToggle(); 50 $('.searchField').focus(); 51 return false; 52 }); 53 54 $('.close-search').on('click', function () { 55 $('.search-field-wrapper').slideUp(); 56 return false; 57 }); 58 59 // Open Mobile Menu 60 $('.open-mobilemenu').on('click', function () { 61 $('.mobilemenu').toggleClass('slide-in'); 62 $('html').addClass('overflow-hidden'); 63 return false; 64 }); 65 66 // Close Mobile Menu 67 $('.close-mobilemenu').on('click', function () { 68 $('.mobilemenu').removeClass('slide-in'); 69 $('html').removeClass('overflow-hidden'); 70 return false; 71 }); 72 73 // Clone Parent Pages 74 $('.mobilemenu ul li a').each(function () { 75 if ($(this).siblings().length > 0 && !$(this).siblings().hasClass('active')) { 76 if ($(this).attr('href') != '#') { 77 var cloney = $(this).prop('outerHTML'); 78 $(this).siblings('ul').prepend('<li>' + cloney + '</li>'); 79 } 80 } 81 }); 82 83 // Mobile Menu Sliding 84 $('.mobilemenu.sliding-menu ul li a').on('click', function () { 85 if ($(this).siblings().length > 0) { 86 $(this).parents('ul').removeClass('active'); 87 $(this).parents('ul').addClass('left'); 88 $(this).siblings('ul').addClass('active'); 89 $(this).siblings('ul').removeClass('right'); 90 return false; 91 } 92 93 if ($(this).hasClass('backup')) { 94 $(this).parents('.active').addClass('right'); 95 $(this).closest('.left').addClass('active'); 96 $(this).closest('.left').removeClass('left'); 97 $(this).closest('ul').removeClass('active'); 98 return false; 99 } 100 }); 101 102 //disclaimer 103 $('#disclaimerGo').click(function () { 104 setTimeout(function () { history.back(); }, 2000); 105 }); 106 107 // Overlays 108 $('[data-overlay]').on('click', function () { 109 var overlayrel = $(this).data('overlay'); 110 111 $('body').addClass('overflow-hidden'); 112 $(overlayrel + ', .overlay-mask').fadeIn(); 113 return false;
114 }); 115 116 $('.modal .close, .overlay-mask').on('click', function () { 117 $('body').removeClass('overflow-hidden'); 118 $('.modal, .overlay-mask, .wizard-process').fadeOut(); 119 return false; 120 }); 121 122 123 // Animation Handler 124 $('.animate').each(function () { 125 // Grab the data-animation value to add class, grab offset and height to set the scroll position. 126 var $this = $(this), 127 anim = $this.data('animation'), 128 delay = $this.data('delay'), 129 duration = $this.data('duration'), 130 offset = $(this).offset().top - ($(window).height() / 1.05); 131 132 // If data-delay is added 133 if (delay) { 134 $this.css('animation-delay', delay); 135 } 136 137 // If data-duration is added 138 if (duration) { 139 $this.css('animation-duration', duration); 140 } 141 142 // Add the animation class when scroll position is met 143 $(window).on('scroll load', function () { 144 if ($(window).scrollTop() >= offset) { 145 $this.addClass(anim); 146 $this.addClass('animated'); 147 } 148 149 // Remove the classes to allow for z-indexing after animations run. 150 // Removes animate because above script adds it back and we can't always target the animation name. 151 if ($this.hasClass('animated')) { 152 var timeout = 1000; 153 154 setTimeout(function () { 155 $this.removeClass('animate'); 156 }, timeout); 157 } 158 }); 159 }); 160 161 // Back to Top 162 $(window).scroll(function () { 163 if ($(this).scrollTop() > 400) { 164 $('.back-to-top').addClass('visible'); 165 } else { 166 $('.back-to-top').removeClass('visible'); 167 } 168 }); 169 170 $('.back-to-top').on('click', function (e) { 171 e.preventDefault(); 172 $('html, body').animate({ scrollTop: 0 }, 500); 173 }); 174 175 176 // Text resize using HTML classes (minus 3 stylesheets) 177 $('.resizerButton').on('click', function () { 178 var item = $(this); 179 $.post("/ajax/text-resizer.php", { style: $(this).attr("data-style") }, function (d) { 180 // DO NOTHING 181 $('.resizerButton').each(function () { 182 $(this).css("opacity", ".7"); 183 $(this).css("filter", "alpha(opacity=70)"); 184 }); 185 186 item.css("opacity", "1"); 187 item.css("filter", "alpha(opacity=100)"); 188 $('html').removeClass('text-normal'); 189 $('html').removeClass('text-medium'); 190 $('html').removeClass('text-large'); 191 $('html').addClass(d); 192 193 }); 194 return false; 195 }); 196 197 198 // IE Fix for jumpy fixed backgrounds 199 if (navigator.userAgent.match(/Trident\/7\./)) { // if IE 200 $('body').on("mousewheel", function () { 201 // remove default behavior 202 event.preventDefault(); 203 204 //scroll without smoothing 205 var wheelDelta = event.wheelDelta; 206 var currentScrollPosition = window.pageYOffset; 207 window.scrollTo(0, currentScrollPosition - wheelDelta); 208 }); 209 } 210 211 // Tabbed Content Module 212 /* $(".panel").hide(); 213 $(".panel:first-of-type").show(), $("ul.tabs li a").click(function() { 214 var t = $(this).data("tab"); 215 return $("ul.tabs li a").removeClass("active"), $(this).addClass("active"), $(".panel").hide(), $(".panel#" + t + " ").show(), !1 216 });*/ 217 218 // Notification message close 219 $("div.message.relative").on('click', function () { 220 $(this).slideUp(); 221 }); 222 223 224 // Smooth Scroll 225 $('a[href*="#"]').not('[href="#"]').not('[href="#0"]').on('click', function (event) { 226 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 227 var target = $(this.hash); 228 229 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 230 if (target.length) { 231 event.preventDefault(); 232 233 $('html, body').animate({ scrollTop: target.offset().top }, 1000, function () { 234 var $target = $(target);
235 $target.focus(); 236 237 if ($target.is(":focus")) { 238 return false; 239 } else { 240 $target.attr('tabindex', '-1'); 241 $target.focus(); 242 } 243 }); 244 } 245 } 246 }); 247}); 248 249 250// Class to fade in on load - Can be used to hide html exploding before the jquery can get to it 251$(window).on('load', function () { 252 $('.show-on-load').css('opacity', '1'); 253}); 254 255 256// Measure the scrollbar width 257// Create the measurement node 258var scrollDiv = document.createElement("div"); 259scrollDiv.className = "js-scrollbar-measure"; 260document.body.appendChild(scrollDiv); 261 262// Get the scrollbar width 263var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 264 265// Delete the DIV 266document.body.removeChild(scrollDiv); 267 268// Add data-scrollbarwidth to elements that may use it 269// elements that use .js-break-out 270var breakOutElements = document.querySelectorAll('.js-break-out'); 271for (var i = 0; i < breakOutElements.length; i++) { 272 breakOutElements[i].setAttribute('data-scrollbarwidth', scrollbarWidth); 273} 274 275 276// Password Input Toggle 277$(".js-toggle-password").on('click', function () { 278 $(this).toggleClass("fa-eye fa-eye-slash"); 279 var input = $($(this).attr("toggle")); 280 281 if (input.attr("type") == "password") { 282 input.attr("type", "text"); 283 } else { 284 input.attr("type", "password"); 285 } 286}); 287 288 289function createCookie(name, value, days) { 290 if (days) { 291 var date = new Date(); 292 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 293 var expires = "; expires=" + date.toGMTString(); 294 } 295 else expires = ""; 296 document.cookie = name + "=" + value + expires + "; path=/"; 297} 298 299function readCookie(name) { 300 var nameEQ = name + "="; 301 var ca = document.cookie.split(';'); 302 for (var i = 0; i < ca.length; i++) { 303 var c = ca[i]; 304 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 305 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 306 } 307 return null; 308} 309 310var cookie = readCookie("style"); 311 312 313if (siteType == 'BANK') { 314 //////////////////////////////////////// URI OBJECT MINIFIED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 315 316 function URI(a) { if (!a) a = ""; var b = /^(?:([^:\/?\#]+):)?(?:\/\/([^\/?\#]*))?([^?\#]*)(?:\?([^\#]*))?(?:\#(.*))?/; var c = a.match(b); this.scheme = c[1] || null; this.authority = c[2] || null; this.path = c[3] || null; this.query = c[4] || null; this.fragment = c[5] || null } URI.prototype.toString = function () { var a = ""; if (this.scheme) { a += this.scheme + ":" } if (this.authority) { a += "//" + this.authority } if (this.path) { a += this.path } if (this.query) { a += "?" + this.query } if (this.fragment) { a += "#" + this.fragment } return a }; (function () { function a(a, b) { var c = /^(.*)\//; if (a.authority && !a.path) { return "/" + b } else { return a.path.match(c)[0] + b } } function c(a) { if (!a) return ""; var c = a.replace(/\/\.\//g, "/"); c = c.replace(/\/\.$/, "/"); while (c.match(b)) { c = c.replace(b, "/") } c = c.replace(/\/([^\/]*)\/\.\.$/, "/"); while (c.match(/\/\.\.\//)) { c = c.replace(/\/\.\.\//, "/") } return c } var b = /\/((?!\.\.\/)[^\/]*)\/\.\.\//; URI.prototype.resolve = function (b) { var d = new URI; if (this.scheme) { d.scheme = this.scheme; d.authority = this.authority; d.path = c(this.path); d.query = this.query } else { if (this.authority) { d.authority = this.authority; d.path = c(this.path); d.query = this.query } else { if (!this.path) { d.path = b.path; if (this.query) { d.query = this.query } else { d.query = b.query } } else { if (this.path.charAt(0) === "/") { d.path = c(this.path) } else { d.path = a(b, this.path); d.path = c(d.path) } d.query = this.query } d.authority = b.authority } d.scheme = b.scheme } d.fragment = this.fragment; return d } })() 317 318 ///////////////////////////////////////// DISCLAIMER WINDOW \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\; 319 var url; 320 var newWin; 321 var domains = ''; 322 323 $(function () { 324 // add the class to all external links 325 $("a[href*='http://'], a[href*='https://']").not("[data-nodisclaimer='true']").not(".nodisclaimer").each(function () { 326 var uri = new URI($(this).attr('href').toLowerCase()); 327 var lowerCaseURL = $(this).attr('href').toLowerCase(); 328 var url = $(this).attr('href'); 329 var token = encodeURIComponent(window.btoa(url)); 330 if (domains.toLowerCase().indexOf(uri.authority) < 0 && lowerCaseURL.indexOf('disclaimer?') == -1) { 331 $(this).addClass('triggerDisclaimer'); 332 $(this).attr("target", "_self"); 333 $(this).attr("href", "/disclaimer?url=" + token); 334 } 335 }); 336
337 ///////////////////////////////////////// EMAIL DISCLAIMER WINDOW \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\; 338 $("a[href*='mailto:']").not("[data-nodisclaimer='true']").not(".nodisclaimer").each(function () { 339 $(this).addClass('triggerDisclaimer'); 340 $(this).attr("target", "_self"); 341 $(this).attr("href", "/email-disclaimer?email=" + $(this).attr("href")); 342 $(this).attr("target", "_self"); 343 }); 344 }); 345} else if (siteType == "ECOMMERCE") { 346 $(function () { 347 $("img.lazy").lazyload({ threshold: 200 }); 348 }); 349}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.