function loadScript_chat(url){ if (document.getElementById('wcchat_script') == null) { var script = document.createElement("script"); script.type = "text/javascript"; script.id = "wcchat_script"; if (script.readyState){ //IE script.onreadystatechange = function(){ if (script.readyState == "loaded" || script.readyState == "complete"){ script.onreadystatechange = null; init_chat(); window.dispatchEvent(new Event('wcxReady')); } }; } else { script.onload = function(){ init_chat(); window.dispatchEvent(new Event('wcxReady')); }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); } } function init_chat(){ if (typeof (wcchat) !== 'undefined') { wcchat.init({ accountID: 'Sp546', wcchatID: 'f3189cef051348e18e5d579f288f9d2e', available_agent: true, show_tab: true, initStatus:'contracted', codeArea:'OQG17092', tabTooltip:'Chat Online', tabOffline:'Chat Offline', tabColor:'#ffca00',tabImageURL:'',automatic_chat:false,automatic_chat_time:30,tabBottom:0,language:'es', openNewWindow:false, tabPosition:'left' }); } } /*loadScript_chat("https://wcentrix.net/tabhelp/external/wcbox/wcchat.v3a.js");*/ loadScript_chat("https://f.wcentrix.com/tabhelp/external/wcbox-dist/wcchat.v3a.min.js?v=1.3"); var fileref=document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); /*fileref.setAttribute("href", "https://wcentrix.net/tabhelp/external/wcbox/wcchat.v3a.css");*/ fileref.setAttribute("href", "https://f.wcentrix.com/tabhelp/external/wcbox-dist/wcchat.v3a.min.css?v=1.2"); document.getElementsByTagName("head")[0].appendChild(fileref);