﻿// File JScript
function glComboBox_onChange (combo)
{
    var md = GetAttribute (combo.parentNode, "modifyDocument");
    if (md == null || md == "true")
        docModified = true;
        
    docModified = true;
    requestControl = combo;

    CallCustomFunction (combo, "customOnChangeCallback");
    
    if (GetAttribute (combo, "ajaxEnabled") == "true")
        GLWebLibrary.GlComboBox.OnSelectedValueChanged (document.getElementById("sessionState").value, combo.id, combo.value, combo.selectedIndex, onGlComboBox_onChangeCallback);
}


function onGlComboBox_onChangeCallback (res)
{
    if (res.value != null)
    {
        if (res.value.TargetID == "sessionEnded")
        {
            window.location = res.value.EndContent;
            return;
        }            
        
        document.getElementById(res.value.TargetID).innerHTML = res.value.EndContent;
        if (document.getElementById(res.value.TargetID2) != null)
            document.getElementById(res.value.TargetID2).innerHTML = res.value.EndContent2;
        
        var ddl = document.getElementById (res.value.GenericValue);
        CallCustomFunction (ddl, "customPostOnChangeCallback");
    }
}