
           
    


// ATT Jobs (att.jobs) - Accessibility Enhancements
// Developer(s): Michael "Spell" Spellacy, Twitter: spellacy, GitHub: michaelspellacy, michael.spellacy[at]tmp.com

(function(){

    // A11y Fixes

    // A11y: Fix elements that contain aria-required (should be on input)

    $(".data-form .form-field.required").removeAttr("aria-required").find("input").attr("aria-required", "true");

    // A11y: Remove "aria-expanded" from all adjacent elements of "expandable-parent"

    $(".expandable-parent").attr("aria-expanded", "false").next().removeAttr("aria-expanded");

    $(".expandable-parent").on("click", function() {

    	$(this).attr('aria-expanded', function (i, attr) {

    		return attr == 'true' ? 'false' : 'true'

    	});

    	$(this).next().removeAttr("aria-expanded");

    });

    // A11y: Remove read only input from tab index

    if($(".search-form").length) {

        $(document).ajaxSuccess(function() {

            $(".display-typeahead").attr("tabindex", "-1");

        });

    }

    // A11y: Let's improve our links that open in new windows:

    $("a[target=_blank]").attr("rel", "noopener").append(" <span class='wai'>(Opens in New Window)</span>");

})();
