﻿// JScript File



function _tnRollOn(sender) {
    sender.style.backgroundColor = '#A1C3BD';
    if (!sender.parentID == 0 | sender.parentID == null) {
        sender.style.color = '#FFFFFF';
    }

    sender.style.cursor = 'hand';

    try {
        if (!sender.firstChild.parentID == 0 | sender.firstChild.parentID == null) {
            sender.firstChild.style.color = '#FFFFFF';
        }
        sender.firstChild.style.cursor = 'hand';
    }
    catch (e) {
    }
}

function _tnRollMove(sender) {
    if (sender.parentID == 0 | sender.parentID == null) {
        sender.style.color = '#FFFFFF';
    }
    sender.style.cursor = 'hand';

    try {
        if (sender.firstChild.parentID == 0 | sender.firstChild.parentID == null) {
            sender.firstChild.style.color = '#FFFFFF';
        }
        sender.firstChild.style.cursor = 'hand';
    }
    catch (e) {
    }
}

function _tnRollOut(sender) {
    if (sender.getAttribute("childselected") == 'true' & sender.getAttribute("selected") != 'true') {
        sender.style.backgroundColor = 'transparent';
    }

    if (sender.getAttribute("selected") != 'true') {
        sender.style.backgroundColor = 'transparent';

        if ((sender.firstChild.parentID == 0 | sender.firstChild.parentID == null) & sender.getAttribute("childselected") != 'true') {
            try {
                sender.firstChild.style.color = '#2E2254';
            }
            catch (e) {
            }
        }
        sender.style.cursor = 'pointer';
        try {
            sender.firstChild.style.backgroundColor = 'transparent';
            sender.firstChild.style.cursor = 'pointer';
        }
        catch (e) {
        }
    }
}

function _tnSelectAction(sender) {
    location.href = 'SectionView.aspx?Section=' + sender.sectionlbl + '&_sNavId=' + sender.dbID + '&_sParentId=' + sender.parentID;
}

function _tnGetConsultant(_sNodeId, alphaBetPosition, narativeId) {
    var anode = "hbManagementTeam";
    if (_sNodeId == anode) {
        window.location = 'SectionView.aspx?Section=[CONSULTANTS]&_sNodeId=' + _sNodeId;
        return;
    }
    if (narativeId == -1) {
        window.location = 'SectionView.aspx?Section=[CONSULTANTS]&_sNodeId=' + _sNodeId + '&alphaBetPosition=' + alphaBetPosition;
    }
    else {
        window.location = 'SectionView.aspx?Section=[CONSULTANTS]&_sNodeId=' + _sNodeId + '&alphaBetPosition=' + alphaBetPosition + '&narativeId=' + narativeId;
    }
}
