﻿// Application javascripts

// Any calls within this block will be executed when the document is loaded.
$(document).ready(function() {
    $("#history_accordion").accordion({ autoHeight: false });
    $("#history_accordion").accordion();

    $("#recommendation_accordion").accordion({ autoHeight: false, collapsible: true, active: -1 });
    $("#recommendation_accordion").accordion();

    $("#guide_sections").accordion({ autoHeight: false, collapsible: true, active: -1, header: 'h3' });
    $("#guide_sections").accordion();

    $("#video_content").dialog({ modal: true, title: "CEO Introduction", width: 450, autoOpen: false });
    $("a#launch_video").click(function() { $("#video_content").dialog('open'); });

    if ($("code").is("code")) {
        try {
            prettyPrint();
        }
        catch (e) {
            // Nothing
        }
    }
});

function popWin(val) {
    window.open(val, '', '');
}


function enterHere(e) {
    e = e || window.event;
    var code = e.keyCode || e.which;
    if (code == 13) {
        var d = document.getElementById("ctl00_ctl00_btnSearch");
        d.click();
    }
}