Advertisement
livechatinc

correct_js

Oct 20th, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var __lc = {};
  2. __lc.license = 2206881;
  3.  
  4. function initializeRetailChat(country) {
  5.  
  6.     // Countries that should display the UK Lead Gen chat room
  7.     var UKChatCountries = ["GB", "CH", "FR", "ES", "IE", "DE", "AT", "AE", "SA", "ZA"];
  8.     var NAChatCountries = ["US", "CA", "MX"];
  9.  
  10.     switch (window.location.pathname) {
  11.  
  12.         case '/support/retail/':
  13.             __lc.group = 8;
  14.             break;
  15.         case '/support/onsite/':
  16.             __lc.group = 3;
  17.             break;
  18.         case '/support/restaurant/':
  19.             __lc.group = 9;
  20.             break;
  21.         case '/support/':
  22.             __lc.group = undefined;
  23.             break;
  24.         default:
  25.             if ($.inArray(country, UKChatCountries)) {
  26.                 // Lead Gen UK (renamed to Lead Gen UK - London): 12
  27.                 __lc.group = 12;
  28.             }
  29.             else if ($.inArray(country, NAChatCountries)) {
  30.                 // Lead Gen (Lead Gen NA): 1
  31.                 __lc.group = 1;
  32.             } else {
  33.                 // Lead Gen Europe (renamed to Lead Gen Benelux - Ghent): 10
  34.                 __lc.group = 10;
  35.             }
  36.             break;
  37.     }
  38. }
  39. initializeRetailChat('GB');
  40.  
  41. if (typeof __lc.group !== "undefined")
  42. {
  43.     var lc = document.createElement('script');
  44.     lc.type = 'text/javascript';
  45.     lc.async = true;
  46.     lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
  47.     var s = document.getElementsByTagName('script')[0];
  48.     s.parentNode.insertBefore(lc, s);
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement