var cookieval = "";
var agentname = '';
var supportAgentName = "";
var LCStatus = "";

function GetCookie(cookiename) {
    cookieval = $.cookies.get(cookiename);
    return cookieval;
}

/* Monitoring Tag */

function MonitorTag() {
    
    agentname = GetCookie('salesAgentName');
    supportAgentName = GetCookie('supportAgentName');
    LCStatus = GetCookie('LCStatus');

    setSessionVar();

}


/* Setting Variables for Session of Skill and Operator */

function setSessionVar() {

    if (typeof (lpMTagConfig.sessionVar) == "undefined") {
        lpMTagConfig.sessionVar = new Array();
    }
    if (agentname != null && agentname != "") {
        lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'skill=' + agentname;
    }
    if (supportAgentName != null && supportAgentName != "") {
        lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'Support Agent=' + supportAgentName;
    }
    if (LCStatus != null && LCStatus != "") {
        lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'Life Cycle Status=' + LCStatus;
    }

}


MonitorTag();


