/* FILE ARCHIVED ON 17:16:28 Jan 24, 2017 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 6:22:00 Jul 3, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ (function (window, document, undefined) { /* ********************************************************************** basic.js ********************************************************************** */ /* ====================================================================== search box ===================================================================== */ //for global header search form var overLabeler = { init: function (form, input) { var label = form.find('label').addClass('overlabel'); input.bind({ focus: function () { label.css("visibility","hidden"); }, blur: function () { if ($(this).val().length === 0) { label.css("visibility","visible"); } } }); }, initKnown: function (form, input) { var label = form.find('.overlabel'); input.bind({ focus: function () { label.css("visibility","hidden"); }, blur: function () { if ($(this).val().length === 0) { label.css("visibility","visible"); } } }); } }; $(function () { // prepare global header search form // (capture g.a. data / clear text box / apply overlabels) var searchForm = $('#global-search-form'); var searchBox = searchForm.find('input#global-search-box').val(""); var searchButton = searchForm.find('input#global-search-submit').keypress(function (e) { if (e.which === 13) { searchForm.data({ 'submission-type': 'from button via keyboard' }); } }); searchForm.submit(function () { var submissionType = '', submissionData = $(this).data('submission-type'); if (typeof submissionData !== "undefined") { submissionType = submissionData; } else if (document.activeElement.id !== "global-search-box") { submissionType = 'from button via mouse'; } else { submissionType = 'from text input'; } submissionType = 'submit (' + submissionType + ')'; _gaq.push(['_trackEvent', 'global header search form', submissionType]); }); overLabeler.init(searchForm, searchBox); var searchForm2 = $('#search-form'); var searchBox2 = searchForm2.find('input#search-box').val(""); overLabeler.init(searchForm2, searchBox2); $('#search-box').on("input", function() { if($('#search-box').val() === undefined || $('#search-box').val().length == 0) { $('#global-clear-button').css("display", "none"); } else { $('#global-clear-button').css("display", "block"); } }); $('#global-clear-button').click(function() { $('#search-box').val(''); $('#global-clear-button').css("display", "none"); $('#search-form').find('label').css("visibility","visible"); }) }); /* ====================================================================== GovDelivery subscribe box ===================================================================== */ $(function () { var subscribeForm = $('#subscribe-form'); var emailBox = subscribeForm.find('input#gov-delivery-box').val(""); overLabeler.init(subscribeForm, emailBox); subscribeForm.find('input').on('keypress', function (e) { if (e.which === 13) { e.preventDefault(); subscribeForm.submit(); subscribeForm.reset(); } }); subscribeForm.find('#gov-delivery-submit').on('click', function(e) { e.preventDefault(); subscribeForm.submit(); subscribeForm.reset(); }); }); /* ===================================================================== page filter box ===================================================================== */ $(function () { var searchForm = $('#digital-gov-form'); var searchBox = searchForm.find('input#gov-delivery-box').val(""); overLabeler.init(searchForm, searchBox); }); /* ========================================================================================== navigation and breadcrumbs ========================================================================================== */ var orient = { altPathname: $('head').find('meta[name="dcterms.isPartOf"]').attr('content'), crumbsSeparator: '>', hasCrumbs: false, homeURL: '/', init: function (menus) { var that = this; for (var i = 0; i < menus.length; i++) { findNavTrail(menus[i]); } function findNavTrail (menu, isFound, savedItems) { if (typeof isFound === "undefined" || typeof savedItems === "undefined") { var isFound = false, savedItems = []; } var items = menu.children(); $.each(items, function () { var href, item, link, submenu; item = $(this); submenu = item.find('ul').first(); link = item.find('a').first(); href = link.attr('href'); if (isFound) { return; } else if (href !== location.pathname && href !== that.altPathname) { savedItems.push(item); if (submenu.length !== 0) { findNavTrail(submenu, isFound, savedItems); } savedItems.pop(); } else { savedItems.push(item); savedItems = $(savedItems); configureNav(savedItems, href); /* if (!that.hasCrumbs) { outputCrumbs(savedItems, href); } */ isFound = true; } }); } function configureNav (items, href) { var numLinks = items.length; items.each(function (index) { var item = $(this); var link = item.find('a').first(); // first LI in array if (index === 0) { item.addClass('first-item'); link.addClass('first-link'); } // neither first nor last LI in array if (index > 0 && index < (numLinks - 1)) { item.addClass('middle-item'); link.addClass('middle-link'); } // last LI in array if (index === (numLinks - 1)) { item.addClass('last-item'); item.parent('ul').addClass('last-menu'); link.addClass('last-link'); } }); } function outputCrumbs (items, href) { // get the number of columns in the template var numCols = $('#global-wrapper').attr('class').split('_')[1]; // create a grid unit for the list // add the list to the grid unit // add the grid unit to the DOM and hide it var crumbsContainer = $('').append(crumbs).insertAfter('#global-header').hide(); // begin the breadcrumb trail with a link to the homepage and a separator var crumbs = $('').appendTo(crumbsContainer); // create an empty list item for the breadcrumb var crumb = $('
  • '); // if a link to the current page *was* found, add the relevant breadcrumbs if (typeof items !== "undefined") { items.each(function (index) { var item = $(this), link = item.children(':first').clone(); if (index !== (items.length - 1) || href !== location.pathname) { crumb.clone().append(link, ' ' + that.crumbsSeparator + ' ').appendTo(crumbs); } else { crumb.clone().append(link).appendTo(crumbs); } }); } // if a link to the current page *wasn't* found, use the page's H1 as the source of the last breadcrumb if (typeof href === "undefined" || href !== location.pathname) { var h1 = $('body').find('h1').html(); crumb.clone().append(h1).appendTo(crumbs); } // show the grid unit crumbsContainer.show(); // flag the breadcrumbs as having been added so that they're not added more than once that.hasCrumbs = true; } } }; /* ========================================================================================== plugins ========================================================================================== */ /* ---------------------------------------------------------------------- prepare accordion ---------------------------------------------------------------------- */ ;(function ( $, window, undefined ) { var pluginName = 'prepareAccordion', document = window.document, defaults = { target: null, // element after which to insert tabs keys: null // element from which to generate keys }; function Plugin( element, options ) { this.element = element; this.options = $.extend( {}, defaults, options) ; this._defaults = defaults; this._name = pluginName; this.init(); } Plugin.prototype.init = function () { var accordion = $('
    ').insertAfter(this.options.target), keys = this.options.keys, tabName = keys.get(0).nodeName, newPane = true, pane = $('
    '); if (accordion.next().length !== 0) { addSibling(accordion.next()); } function addSibling (sibling, newPane, thisPane) { var siblingName = sibling.get(0).nodeName; if (siblingName !== tabName) { if (newPane) { thisPane = pane.clone().appendTo(accordion); newPane = false; } thisPane.append(sibling); } else { accordion.append(sibling); newPane = true; } if (accordion.next().length !== 0) { addSibling(accordion.next(), newPane, thisPane); } } }; $.fn[pluginName] = function ( options ) { return this.each(function () { if (!$.data(this, 'plugin_' + pluginName)) { $.data(this, 'plugin_' + pluginName, new Plugin( this, options )); } }); } }(jQuery, window)); /* ---------------------------------------------------------------------- replace self-referring links ---------------------------------------------------------------------- */ (function ($) { $.fn.replaceSelfReferringLinks = function (options) { var settings = $.extend({ test: location.pathname }, options); return this.each(function () { var link = $(this); var href = link.attr('href'); var text = link.text(); var span = $('').append(text); if (href === settings.test) { link.parent().prepend(span); link.remove(); } }); } })(jQuery); /* ====================================================================== on dom ready ====================================================================== */ $(function () { // configure Superfish // see https://webarchive.library.unt.edu/web/20170124171628/http://users.tpg.com.au/j_birch/plugins/superfish/ var superfishOptions = { hoverClass: 'over', delay: 650, // delay on mouseout animation: {height:'show'}, // fade-in and slide-down animation speed: 'normal', // faster animation speed autoArrows: false, // disable generation of arrow mark-up dropShadows: false // disable drop shadows }; // array for nav menus var navMenus = []; // initialize global navigation var globalNavUL = $('#global-nav').find('ul').first(); if (globalNavUL.length !== 0) { globalNavUL.superfish(superfishOptions); navMenus.push(globalNavUL); } // remove bottom border from last link in each dropdown menu var globalNavLIS = globalNavUL.children(); globalNavLIS.find('ul a:last').addClass('last'); // initialize local navigation var localNavDIV = $('#local-nav'); var localNavUL = localNavDIV.find('ul').first(); if (localNavDIV.length !== 0 && localNavUL.length !== 0) { navMenus.push(localNavUL); } // add pipe characters between list items in footer var footerDIV = $('#global-footer'); var footerULS = footerDIV.find('ul'); footerULS.each(function () { var ul = $(this); ul.find('li:not(:last)').append('|'); navMenus.push(ul); }); // initialize wayfinding orient.init(navMenus); }); //to get around bfcache window.onunload = function () {}; })(window, document); $(function () { // reports var sliders = $('#sliders'); var slidersKeys = $('.slider').find('> a').wrap('
  • '); sliders.find('> ul').wrapInner('
    '); sliders.find('li > ul').wrap('
    '); sliders.find('div.accordion').tabs('div.accordion div.accordion-slide', { current: 'accordion-key-is-current', tabs: slidersKeys, initialIndex: null, effect: 'slide' }); }); $(function () { // media kit $('#media ul.tabs-menu').addClass('clearfix').tabs('div.tabs-panes > div', { current: 'tabs-menu-item-is-current' }); $('#media').addClass('box-1').css('visibility', 'visible'); }); $(function () { // reports var reports = $('#reports'); reports.find('h2').addClass('charlie'); var reportsKeys = reports.find('h3').addClass('accordion-key').wrapInner(''); reports .wrapInner('
    ') .find('dl') .wrap('
    '); reports .find('div.accordion') .tabs('div.accordion div.accordion-slide', { current: 'accordion-key-is-current', tabs: reportsKeys, initialIndex: -1, effect: 'slide' }) .css('visibility', 'visible'); // resources $('#resources ul.tabs-menu').addClass('clearfix').tabs('div.tabs-panes > div', { current: 'tabs-menu-item-is-current', heightStyle:"auto" }); $('#resources').addClass('box-1').css('visibility', 'visible'); // resources2 $('#resources2 ul.tabs-menu').addClass('clearfix').tabs('div.tabs-panes > div', { current: 'tabs-menu-item-is-current', heightStyle:"auto" }); $('#resources2').addClass('box-1').css('visibility', 'visible'); // news $('#news-list').wrap('
    '); // registrants $('#registrants ul.tabs-menu').addClass('clearfix').tabs('> .tabs-pane', { current: 'tabs-menu-item-is-current', heightStyle:"52px" }); $('#registrants').addClass('island-1').css('visibility', 'visible'); // registrants' sec orders var secOrders = $('#sec-orders'); var secOrdersKeys = secOrders.find('h3').addClass('accordion-key').wrapInner(''); secOrders .wrapInner('
    ') .find('dl') .wrap('
    '); secOrders .find('div.accordion') .tabs('div.accordion div.accordion-slide', { current: 'accordion-key-is-current', tabs: secOrdersKeys, initialIndex: -1 }) .css('visibility', 'visible'); }); // Load up USA Search utilities var usasearch_config = { siteHandle:"secsearch" }; (function() { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "//search.usa.gov/javascripts/remote.loader.js"; document.getElementsByTagName("head")[0].appendChild(script); })(); $(document).ready(function () { //AddThis async load function var checkAddThisLoadedInterval = null; function checkAddThisLoaded() { if($('.addthis_button_compact')) { $('.appIconsDetail').css('visibility', 'visible'); clearInterval(checkAddThisLoadedInterval); } } if(typeof addthis !== 'undefined') { addthis.init(); checkAddThisLoadedInterval = setInterval(checkAddThisLoaded, 100); } $(function() { $('.scroll-pane').jScrollPane({showArrows: true}).bind('mousewheel', function(e) { e.preventDefault(); }); }); $.fn.getQueryVariable = function() { var query = window.location.search.substring(1); var vars = query.split("&"); var pair; var i = 0; var elem; if (vars.length > 0) { while (i < vars.length) { pair = vars[i].split("="); if (pair[0]=='aId') { elem = pair[1]; } i++; } } return elem; } $.fn.setAutoFocus = function(id, w) { var showId = '#'+id; var elem; if (w > 480) { if (showId.indexOf('_mobile') > 0 ) { elem = showId.replace('mobile','top'); } else if (showId.indexOf('_m1') > 0) { elem = showId.replace('m1','t1'); } else if (showId.indexOf('_m2') > 0) { elem = showId.replace('m2','t2'); } else if (showId.indexOf('-mobile') > 0) { elem = showId.replace('-mobile',''); } else { elem = showId; } } else { if (showId.indexOf('_top') > 0 ) { elem = showId.replace('top','mobile'); } else if (showId.indexOf('_t1') > 0) { elem = showId.replace('t1','m1'); } else if (showId.indexOf('_t2') > 0) { elem = showId.replace('t2','m2'); } else if (showId.indexOf('-typeahead') > 0) { elem = showId + '-mobile'; } else { elem = showId; } } $(elem).focus(); } // function to fix the alignment and padding $.fn.resetTabs = function() { // finds the largest height and creates tabs that are equal $('li.tabs-menu-item').css('height', '') $('li.tabs-menu-item').children().removeAttr('style'); } $.fn.showMobileView = function() { $.fn.resetTabs(); } $.fn.showNormalView = function() { $.fn.resetTabs(); // finds the largest height and creates tabs that are equal heights var tabHeights=[]; var tabWidths=[]; var contentHeights=[]; var tabHeight, tabWidth; var currentHeight, maxHeight, minHeight; var newPadding; Array.max = function( array ){ return Math.max.apply( Math, array ); }; Array.min = function( array ){ return Math.min.apply( Math, array ); }; $('ul.tabs-menu li').each(function(i) { tabHeights.push( $(this).height() ); contentHeights.push( $(this).children().height() ); }); $('li.tabs-menu-item').css('height', Array.max(tabHeights)); tabHeight = Array.max(tabHeights); tabWidth = Array.max(tabWidths); maxHeight = Array.max(contentHeights); minHeight = Array.min(contentHeights); $('li.tabs-menu-item > a').each(function(i) { var h = contentHeights[i]; var p = (tabHeight-h)/2; if (h < maxHeight) { $(this).css('padding', p+'px 4px'); } }); // this block will calculate the padding // required to vertically center the tab label if ( $('.accordion').length ) { var stacks = $('.accordion').length; tabHeight = 43; var h = 18; var p = (tabHeight-h)/2; $('.accordion ul.tabs-menu').each(function(a){ $('li.tabs-menu-item').css('height', tabHeight+'px'); $(this).children($('li.tabs-menu-item > a')).each(function(i) { if ($(window).width() < 420 ){ if ((i+1)==3) { $(this).children($('li.tabs-menu-item > a')).css({ padding: (p/2)+'px 4px', lineHeight: '1.2em' }); } else { $(this).children($('li.tabs-menu-item > a')).css('padding', p +'px 4px'); } } else { $(this).children($('li.tabs-menu-item > a')).css('padding', p +'px 4px'); } }); }); } } // end function $.fn.showNormalView var ua = $.browser.device = (/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent.toLowerCase())); //when the window loads $(window).load(function(){ var w = $(window).width(); var q = $.fn.getQueryVariable(); if ($('.tabs').length) { $.fn.showNormalView(); } if (q) { $.fn.setAutoFocus(q, w); } }); //check if window size changes $(window).resize(function() { var w=$(window).width(); var q = $.fn.getQueryVariable(); if ($('.tabs').length) { $.fn.showNormalView(); } if (q) { $.fn.setAutoFocus(q, w); } }); /* J.Schwartz 2016-09-02 Adding pull quote script */ $(function() { // Does the pullquote tag contain an attribution tag? // If so, add 'attribution' class to tag $("q:has(strong)").addClass("attribution"); }); });