﻿//jQuery.noConflict();
// passing the jQuery object to prevent conflict with
// other libraries that are potentially using the $
(function($) {
    // shorthand for $(document).ready(function(){});
    $(function() {
        // Skip link fix for Webkit and Opera
        // The focus order doesn't move when an anchor links to an element 
        // in the same page
        var is_webkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1,
			is_opera = navigator.userAgent.toLowerCase().indexOf('opera') > -1;

        if (is_webkit || is_opera) {
            if (location.hash) { setFocus(location.hash); }
            $('.navaid').find('a').click(function() { setFocus($(this).attr('href')); });
            function setFocus(href) { $(href).attr('tabindex', 0).focus(); };
        }
    });
})(jQuery);

