/**
 * fis.initialize.js - Run required Javascript on site load.
 * 
 * This depends on and must be loaded after jQuery.
 * newwindow.js - Use jQuery to cause all <a rel="external" ...> elements to
 * open their links in a new window.
 *
 * Done this way because target="_blank" is not valid XHTML.
 */

$(document).ready(function() {

    /// --- EXTERNAL LINKS ---
    /// set all links marked with rel="external" to open in a new window
    $('a[rel="external"]').each(function() {    
        $(this).click(function(e) {
            // stop the browser's normal response to a link click
            // otherwise the link would open in both the new and current window
            e.preventDefault();
            e.stopPropagation();

            window.open(this.href, "_blank");
        });
    });
    /// --- END EXTERNAL LINKS
    
    
    
    /// --- APPLY STICKYFOOTER ---
    /// make the FIS footer always stick to the bottom of the window
    // --- sticky footer ---
    $("#fis-footer_footer").pinFooter();
    
    // Fix on resizing
    $(window).resize(function() {
        $("#fis-footer_footer").pinFooter();
    });
    /// --- END STICKYFOOTER ---
    
});

