
// Misc utility functions for the schedule browser search form
// ----------------------------------------------------------------------------
//  NOTE: these scripts require the jQuery library to be included!
// ----------------------------------------------------------------------------

function ShowScheduleInfo(classId, sessionInstanceId)
{
    SetLoadingAnimationVisibility(true);
    
    $('#ScheduleDetailFrame').attr("src", "");
    var srcUrl = "ScheduleDetailInfo.aspx?classid=" + classId + "&siid=" + sessionInstanceId;
    $('#ScheduleDetailFrame').attr("src", srcUrl);
    
    var behavior = $find('ModalScheduleDetailExtenderBehavior');
    if (behavior != null) 
        behavior.show();
    else
        alert('Your web browser isn\'t compatible with this function.  Please call us for more information.');
}

function HideScheduleInfo()
{
    $find('ModalScheduleDetailExtenderBehavior').hide();
}

function SetLoadingAnimationVisibility(isVisible)
{
    if (isVisible)
    {
        $('#ScheduleDetailLoadingPanel').css('opacity', 100);
        $('#ScheduleDetailLoadingPanel').show();
    }
    else
        $('#ScheduleDetailLoadingPanel').fadeTo('slow', 0, function(){ $('#ScheduleDetailLoadingPanel').hide(); });
}

function SetSectionToggle(clickableSelector, toggleContentSelector)
{
    $(toggleContentSelector).hide();
    $(clickableSelector).click(
        function () {
            $(this).next(toggleContentSelector).slideToggle(300);
        });
}
