﻿// JScript File
function GetNCB(result) {
    if (result) {
        if (result.value!='') {
            ALI(result.value,false);
        }
    }
}

function refreshSessionCB(controls)
{
    if (controls) {
        if (controls.value) {
            var sessionId = controls.context;
            // Update controls
            controlList = controls.value.split(",");
            var numOfProp = 3;
            var clid = '';
            var cid = '';
            var nid = '';
            for (var i=0; i < controlList.length; i++) {
                if (i%numOfProp==0) {
                    clid = controlList[i];
                }
                
                if (i%numOfProp==1) {
                    cid = controlList[i];
                }
                
                if (i%numOfProp==2) {
                    nid = controlList[i];

                    var control = null;
                    
                    if (clid!='') {                                    
                        // Get the associated control
                        control = dge(clid);
                    }
                    
                    Webscene.UI.State.StateManager.GetN(sessionId, clid, cid, nid, nodeId, GetNCB, clid);
                }
            }  
        }
    }
}

function refreshSession() {
    if (sessionId) {
        if (sessionId!='') {
            try {
                Webscene.UI.State.StateManager.RefreshSession(sessionId,refreshSessionCB, sessionId);
                }
                catch(ex) {
                    AL(conErr);
                }
                setTimeout('refreshSession()', refreshTimeout);
            }
        }
    }

