<script>
window.addEventListener('load', function() {
var role_ids = {2: "Site Admin",3: "Course Instructor",4: "Student",7: "Affiliate",8: "Lead", 11: "Assistant", 12: "Support"};
var userDetails = {};
var settings = {
"url": "Website_URL/api/v1/users/"+siteTracking.userId,
"method": "GET",
"timeout": 0,
"headers": {
"X-API-Key": "Zenler_API_Key",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Account-Name": "Account_Name"
},
};
$.ajax(settings).done(function (response) {
if(response.message == "success"){
userDetails = response.data;
}
window.chat_appid = 'AtomChat_APP_ID';
window.chat_auth = 'AtomChat_AUTH_KEY';
window.chat_id = siteTracking.userId;
window.chat_name = userDetails.first_name+' '+userDetails.last_name;
window.chat_avatar = document.getElementsByClassName('zl-navbar-rhs-img')[0].src;
window.chat_role = role_ids[userDetails.roles[0]];
(function() {
var chat_css = document.createElement('link'); chat_css.rel = 'stylesheet'; chat_css.type = 'text/css'; chat_css.href = 'https://fast.cometondemand.net/'+chat_appid+'x_xchat.css';
document.getElementsByTagName("head")[0].appendChild(chat_css);
var chat_js = document.createElement('script'); chat_js.type = 'text/javascript'; chat_js.src = 'https://fast.cometondemand.net/'+chat_appid+'x_xchat.js'; var chat_script = document.getElementsByTagName('script')[0]; chat_script.parentNode.insertBefore(chat_js, chat_script);
})();
});
}, false);
</script>
<script>
window.chat_height = '600px';
window.chat_width = '990px';
window.chat_appid = 'AtomChat_APP_ID';
document.write('<div id="cometchat_embed_synergy_container" style="width:'+window.chat_width+';height:'+window.chat_height+';max-width:100%;border:1px solid #CCCCCC;border-radius:5px;overflow:hidden;"></div>');
window.addEventListener('load', function() {
var role_ids = {2: "Site Admin",3: "Course Instructor",4: "Student",7: "Affiliate",8: "Lead", 11: "Assistant", 12: "Support"};
var userDetails = {};
var settings = {
"url": "Website_URL/api/v1/users/"+siteTracking.userId,
"method": "GET",
"timeout": 0,
"headers": {
"X-API-Key": "Zenler_API_Key",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Account-Name": "Account_Name"
},
};
$.ajax(settings).done(function (response) {
if(response.message == "success"){
userDetails = response.data;
}
window.chat_auth = 'AtomChat_AUTH_KEY';
window.chat_id = siteTracking.userId;
window.chat_name = userDetails.first_name+' '+userDetails.last_name;
window.chat_avatar = document.getElementsByClassName('zl-navbar-rhs-img')[0].src;
window.chat_role = role_ids[userDetails.roles[0]];
var chat_js = document.createElement('script'); chat_js.type = 'text/javascript'; chat_js.src = 'https://fast.cometondemand.net/'+window.chat_appid+'x_xchatx_xcorex_xembedcode.js';
chat_js.onload = function() {
var chat_iframe = {};chat_iframe.module="synergy";chat_iframe.style="min-height:"+window.chat_height+";min-width:"+window.chat_width+";";chat_iframe.width=window.chat_width.replace('px','');chat_iframe.height=window.chat_height.replace('px','');chat_iframe.src='https://'+window.chat_appid+'.cometondemand.net/cometchat_embedded.php'; if(typeof(addEmbedIframe)=="function"){addEmbedIframe(chat_iframe);}
};
var chat_script = document.getElementsByTagName('script')[0]; chat_script.parentNode.insertBefore(chat_js, chat_script);
});
}, false);
</script>