var countryList = [{
code: 'AF',
name: 'Afghanistan'
}, {
code: 'AX',
name: "\xC5land Islands"
}, {
code: 'AL',
name: 'Albania',
currency: 'EUR'
}, {
code: 'DZ',
name: 'Algeria'
}, {
code: 'AS',
name: 'American Samoa'
}, {
code: 'AD',
name: 'Andorra',
currency: 'EUR'
}, {
code: 'AO',
name: 'Angola'
}, {
code: 'AI',
name: 'Anguilla'
}, {
code: 'AQ',
name: 'Antarctica'
}, {
code: 'AG',
name: 'Antigua and Barbuda'
}, {
code: 'AR',
name: 'Argentina'
}, {
code: 'AM',
name: 'Armenia'
}, {
code: 'AW',
name: 'Aruba'
}, {
code: 'AU',
name: 'Australia',
currency: 'AUD'
}, {
code: 'AT',
name: 'Austria',
currency: 'EUR'
}, {
code: 'AZ',
name: 'Azerbaijan'
}, {
code: 'BS',
name: 'Bahamas'
}, {
code: 'BH',
name: 'Bahrain'
}, {
code: 'BD',
name: 'Bangladesh'
}, {
code: 'BB',
name: 'Barbados'
}, {
code: 'BY',
name: 'Belarus'
}, {
code: 'BE',
name: 'Belgium',
currency: 'EUR'
}, {
code: 'BZ',
name: 'Belize'
}, {
code: 'BJ',
name: 'Benin'
}, {
code: 'BM',
name: 'Bermuda'
}, {
code: 'BT',
name: 'Bhutan'
}, {
code: 'BO',
name: 'Bolivia, Plurinational State of'
}, {
code: 'BQ',
name: 'Bonaire, Sint Eustatius and Saba'
}, {
code: 'BA',
name: 'Bosnia and Herzegovina',
currency: 'EUR'
}, {
code: 'BW',
name: 'Botswana'
}, {
code: 'BV',
name: 'Bouvet Island'
}, {
code: 'BR',
name: 'Brazil'
}, {
code: 'IO',
name: 'British Indian Ocean Territory'
}, {
code: 'BN',
name: 'Brunei Darussalam'
}, {
code: 'BG',
name: 'Bulgaria',
currency: 'EUR'
}, {
code: 'BF',
name: 'Burkina Faso'
}, {
code: 'BI',
name: 'Burundi'
}, {
code: 'KH',
name: 'Cambodia'
}, {
code: 'CM',
name: 'Cameroon'
}, {
code: 'CA',
name: 'Canada',
currency: 'CAD'
}, {
code: 'CV',
name: 'Cape Verde'
}, {
code: 'KY',
name: 'Cayman Islands'
}, {
code: 'CF',
name: 'Central African Republic'
}, {
code: 'TD',
name: 'Chad'
}, {
code: 'CL',
name: 'Chile'
}, {
code: 'CN',
name: 'China'
}, {
code: 'CX',
name: 'Christmas Island'
}, {
code: 'CC',
name: 'Cocos (Keeling) Islands'
}, {
code: 'CO',
name: 'Colombia'
}, {
code: 'KM',
name: 'Comoros'
}, {
code: 'CG',
name: 'Congo'
}, {
code: 'CD',
name: 'Congo, the Democratic Republic of the'
}, {
code: 'CK',
name: 'Cook Islands'
}, {
code: 'CR',
name: 'Costa Rica'
}, {
code: 'CI',
name: "C\xF4te d'Ivoire"
}, {
code: 'HR',
name: 'Croatia',
currency: 'EUR'
}, {
code: 'CU',
name: 'Cuba'
}, {
code: 'CW',
name: "Cura\xE7ao"
}, {
code: 'CY',
name: 'Cyprus',
currency: 'EUR'
}, {
code: 'CZ',
name: 'Czech Republic',
currency: 'EUR'
}, {
code: 'DK',
name: 'Denmark',
currency: 'EUR'
}, {
code: 'DJ',
name: 'Djibouti'
}, {
code: 'DM',
name: 'Dominica'
}, {
code: 'DO',
name: 'Dominican Republic'
}, {
code: 'EC',
name: 'Ecuador'
}, {
code: 'EG',
name: 'Egypt'
}, {
code: 'SV',
name: 'El Salvador'
}, {
code: 'GQ',
name: 'Equatorial Guinea'
}, {
code: 'ER',
name: 'Eritrea'
}, {
code: 'EE',
name: 'Estonia',
currency: 'EUR'
}, {
code: 'ET',
name: 'Ethiopia'
}, {
code: 'FK',
name: 'Falkland Islands (Malvinas)'
}, {
code: 'FO',
name: 'Faroe Islands'
}, {
code: 'FJ',
name: 'Fiji'
}, {
code: 'FI',
name: 'Finland',
currency: 'EUR'
}, {
code: 'FR',
name: 'France',
currency: 'EUR'
}, {
code: 'GF',
name: 'French Guiana'
}, {
code: 'PF',
name: 'French Polynesia'
}, {
code: 'TF',
name: 'French Southern Territories'
}, {
code: 'GA',
name: 'Gabon'
}, {
code: 'GM',
name: 'Gambia'
}, {
code: 'GE',
name: 'Georgia'
}, {
code: 'DE',
name: 'Germany',
currency: 'EUR'
}, {
code: 'GH',
name: 'Ghana'
}, {
code: 'GI',
name: 'Gibraltar'
}, {
code: 'GR',
name: 'Greece',
currency: 'EUR'
}, {
code: 'GL',
name: 'Greenland'
}, {
code: 'GD',
name: 'Grenada'
}, {
code: 'GP',
name: 'Guadeloupe'
}, {
code: 'GU',
name: 'Guam'
}, {
code: 'GT',
name: 'Guatemala'
}, {
code: 'GG',
name: 'Guernsey'
}, {
code: 'GN',
name: 'Guinea'
}, {
code: 'GW',
name: 'Guinea-Bissau'
}, {
code: 'GY',
name: 'Guyana'
}, {
code: 'HT',
name: 'Haiti'
}, {
code: 'HM',
name: 'Heard Island and McDonald Islands'
}, {
code: 'VA',
name: 'Holy See (Vatican City State)',
currency: 'EUR'
}, {
code: 'HN',
name: 'Honduras'
}, {
code: 'HK',
name: 'Hong Kong'
}, {
code: 'HU',
name: 'Hungary',
currency: 'EUR'
}, {
code: 'IS',
name: 'Iceland',
currency: 'EUR'
}, {
code: 'IN',
name: 'India'
}, {
code: 'ID',
name: 'Indonesia'
}, {
code: 'IR',
name: 'Iran, Islamic Republic of'
}, {
code: 'IQ',
name: 'Iraq'
}, {
code: 'IE',
name: 'Ireland',
currency: 'EUR'
}, {
code: 'IM',
name: 'Isle of Man'
}, {
code: 'IL',
name: 'Israel'
}, {
code: 'IT',
name: 'Italy',
currency: 'EUR'
}, {
code: 'JM',
name: 'Jamaica'
}, {
code: 'JP',
name: 'Japan'
}, {
code: 'JE',
name: 'Jersey'
}, {
code: 'JO',
name: 'Jordan'
}, {
code: 'KZ',
name: 'Kazakhstan'
}, {
code: 'KE',
name: 'Kenya'
}, {
code: 'KI',
name: 'Kiribati'
}, {
code: 'KP',
name: "Korea, Democratic People's Republic of"
}, {
code: 'KR',
name: 'Korea, Republic of'
}, {
code: 'KW',
name: 'Kuwait'
}, {
code: 'KG',
name: 'Kyrgyzstan'
}, {
code: 'LA',
name: "Lao People's Democratic Republic"
}, {
code: 'LV',
name: 'Latvia',
currency: 'EUR'
}, {
code: 'LB',
name: 'Lebanon'
}, {
code: 'LS',
name: 'Lesotho'
}, {
code: 'LR',
name: 'Liberia'
}, {
code: 'LY',
name: 'Libya'
}, {
code: 'LI',
name: 'Liechtenstein',
currency: 'EUR'
}, {
code: 'LT',
name: 'Lithuania',
currency: 'EUR'
}, {
code: 'LU',
name: 'Luxembourg',
currency: 'EUR'
}, {
code: 'MO',
name: 'Macao'
}, {
code: 'MK',
name: 'Macedonia, the Former Yugoslav Republic of',
currency: 'EUR'
}, {
code: 'MG',
name: 'Madagascar'
}, {
code: 'MW',
name: 'Malawi'
}, {
code: 'MY',
name: 'Malaysia'
}, {
code: 'MV',
name: 'Maldives'
}, {
code: 'ML',
name: 'Mali'
}, {
code: 'MT',
name: 'Malta',
currency: 'EUR'
}, {
code: 'MH',
name: 'Marshall Islands'
}, {
code: 'MQ',
name: 'Martinique'
}, {
code: 'MR',
name: 'Mauritania'
}, {
code: 'MU',
name: 'Mauritius'
}, {
code: 'YT',
name: 'Mayotte'
}, {
code: 'MX',
name: 'Mexico'
}, {
code: 'FM',
name: 'Micronesia, Federated States of'
}, {
code: 'MD',
name: 'Moldova, Republic of',
currency: 'EUR'
}, {
code: 'MC',
name: 'Monaco',
currency: 'EUR'
}, {
code: 'MN',
name: 'Mongolia'
}, {
code: 'ME',
name: 'Montenegro',
currency: 'EUR'
}, {
code: 'MS',
name: 'Montserrat'
}, {
code: 'MA',
name: 'Morocco'
}, {
code: 'MZ',
name: 'Mozambique'
}, {
code: 'MM',
name: 'Myanmar'
}, {
code: 'NA',
name: 'Namibia'
}, {
code: 'NR',
name: 'Nauru'
}, {
code: 'NP',
name: 'Nepal'
}, {
code: 'NL',
name: 'Netherlands',
currency: 'EUR'
}, {
code: 'NC',
name: 'New Caledonia'
}, {
code: 'NZ',
name: 'New Zealand',
currency: 'NZD'
}, {
code: 'NI',
name: 'Nicaragua'
}, {
code: 'NE',
name: 'Niger'
}, {
code: 'NG',
name: 'Nigeria'
}, {
code: 'NU',
name: 'Niue'
}, {
code: 'NF',
name: 'Norfolk Island'
}, {
code: 'MP',
name: 'Northern Mariana Islands'
}, {
code: 'NO',
name: 'Norway',
currency: 'EUR'
}, {
code: 'OM',
name: 'Oman'
}, {
code: 'PK',
name: 'Pakistan'
}, {
code: 'PW',
name: 'Palau'
}, {
code: 'PS',
name: 'Palestine, State of'
}, {
code: 'PA',
name: 'Panama'
}, {
code: 'PG',
name: 'Papua New Guinea'
}, {
code: 'PY',
name: 'Paraguay'
}, {
code: 'PE',
name: 'Peru'
}, {
code: 'PH',
name: 'Philippines'
}, {
code: 'PN',
name: 'Pitcairn'
}, {
code: 'PL',
name: 'Poland',
currency: 'EUR'
}, {
code: 'PT',
name: 'Portugal',
currency: 'EUR'
}, {
code: 'PR',
name: 'Puerto Rico'
}, {
code: 'QA',
name: 'Qatar'
}, {
code: 'RE',
name: "R\xE9union"
}, {
code: 'RO',
name: 'Romania',
currency: 'EUR'
}, {
code: 'RU',
name: 'Russian Federation'
}, {
code: 'RW',
name: 'Rwanda'
}, {
code: 'BL',
name: "Saint Barth\xE9lemy"
}, {
code: 'SH',
name: 'Saint Helena, Ascension and Tristan da Cunha'
}, {
code: 'KN',
name: 'Saint Kitts and Nevis'
}, {
code: 'LC',
name: 'Saint Lucia'
}, {
code: 'MF',
name: 'Saint Martin (French part)'
}, {
code: 'PM',
name: 'Saint Pierre and Miquelon'
}, {
code: 'VC',
name: 'Saint Vincent and the Grenadines'
}, {
code: 'WS',
name: 'Samoa'
}, {
code: 'SM',
name: 'San Marino',
currency: 'EUR'
}, {
code: 'ST',
name: 'Sao Tome and Principe'
}, {
code: 'SA',
name: 'Saudi Arabia'
}, {
code: 'SN',
name: 'Senegal'
}, {
code: 'RS',
name: 'Serbia',
currency: 'EUR'
}, {
code: 'SC',
name: 'Seychelles'
}, {
code: 'SL',
name: 'Sierra Leone'
}, {
code: 'SG',
name: 'Singapore'
}, {
code: 'SX',
name: 'Sint Maarten (Dutch part)'
}, {
code: 'SK',
name: 'Slovakia',
currency: 'EUR'
}, {
code: 'SI',
name: 'Slovenia',
currency: 'EUR'
}, {
code: 'SB',
name: 'Solomon Islands'
}, {
code: 'SO',
name: 'Somalia'
}, {
code: 'ZA',
name: 'South Africa',
currency: 'ZAR'
}, {
code: 'GS',
name: 'South Georgia and the South Sandwich Islands'
}, {
code: 'SS',
name: 'South Sudan'
}, {
code: 'ES',
name: 'Spain',
currency: 'EUR'
}, {
code: 'LK',
name: 'Sri Lanka'
}, {
code: 'SD',
name: 'Sudan'
}, {
code: 'SR',
name: 'Suriname'
}, {
code: 'SJ',
name: 'Svalbard and Jan Mayen'
}, {
code: 'SZ',
name: 'Swaziland'
}, {
code: 'SE',
name: 'Sweden',
currency: 'EUR'
}, {
code: 'CH',
name: 'Switzerland',
currency: 'EUR'
}, {
code: 'SY',
name: 'Syrian Arab Republic'
}, {
code: 'TW',
name: 'Taiwan, Province of China'
}, {
code: 'TJ',
name: 'Tajikistan'
}, {
code: 'TZ',
name: 'Tanzania, United Republic of'
}, {
code: 'TH',
name: 'Thailand'
}, {
code: 'TL',
name: 'Timor-Leste'
}, {
code: 'TG',
name: 'Togo'
}, {
code: 'TK',
name: 'Tokelau'
}, {
code: 'TO',
name: 'Tonga'
}, {
code: 'TT',
name: 'Trinidad and Tobago'
}, {
code: 'TN',
name: 'Tunisia'
}, {
code: 'TR',
name: 'Turkey'
}, {
code: 'TM',
name: 'Turkmenistan'
}, {
code: 'TC',
name: 'Turks and Caicos Islands'
}, {
code: 'TV',
name: 'Tuvalu'
}, {
code: 'UG',
name: 'Uganda'
}, {
code: 'UA',
name: 'Ukraine',
currency: 'EUR'
}, {
code: 'AE',
name: 'United Arab Emirates'
}, {
code: 'GB',
name: 'United Kingdom',
currency: 'GBP'
}, {
code: 'US',
name: 'United States',
currency: 'USD'
}, {
code: 'UM',
name: 'United States Minor Outlying Islands'
}, {
code: 'UY',
name: 'Uruguay'
}, {
code: 'UZ',
name: 'Uzbekistan'
}, {
code: 'VU',
name: 'Vanuatu'
}, {
code: 'VE',
name: 'Venezuela, Bolivarian Republic of'
}, {
code: 'VN',
name: 'Viet Nam'
}, {
code: 'VG',
name: 'Virgin Islands, British'
}, {
code: 'VI',
name: 'Virgin Islands, U.S.'
}, {
code: 'WF',
name: 'Wallis and Futuna'
}, {
code: 'EH',
name: 'Western Sahara'
}, {
code: 'YE',
name: 'Yemen'
}, {
code: 'ZM',
name: 'Zambia'
}, {
code: 'ZW',
name: 'Zimbabwe'
}];
var priceList = {
AUD: {
prefix: '$',
suffix: '',
info: 'Prices in AUD, excluding GST',
base: {
starter: 65,
silver: 390,
gold: 540,
platinum: 860
},
more: {
starter: 65,
silver: 39,
gold: 17,
platinum: 15
},
discount: {
info: null,
base: {
starter: null,
silver: null,
gold: null,
platinum: null
},
more: {
starter: null,
silver: null,
gold: null,
platinum: null
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
},
CAD: {
prefix: '$',
suffix: '',
info: 'Prices in CAD, excluding GST',
base: {
starter: 60,
silver: 340,
gold: 500,
platinum: 910
},
more: {
starter: 60,
silver: 34,
gold: 21,
platinum: 17
},
discount: {
info: null,
base: {
starter: null,
silver: null,
gold: null,
platinum: null
},
more: {
starter: null,
silver: null,
gold: null,
platinum: null
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
},
EUR: {
prefix: '',
suffix: '€',
info: 'Prices in EUR, excluding any applicable taxes',
base: {
starter: 39,
silver: 225,
gold: 335,
platinum: 575
},
more: {
starter: 39,
silver: 22,
gold: 14,
platinum: 11
},
discount: {
info: null,
base: {
starter: null,
silver: null,
gold: null,
platinum: null
},
more: {
starter: null,
silver: null,
gold: null,
platinum: null
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
},
GBP: {
prefix: '£',
suffix: '',
info: 'Prices in GBP, excluding VAT',
base: {
starter: 38,
silver: 210,
gold: 315,
platinum: 520
},
more: {
starter: 38,
silver: 21,
gold: 12,
platinum: 10
},
discount: {
info: null,
base: {
starter: null,
silver: null,
gold: null,
platinum: null
},
more: {
starter: null,
silver: null,
gold: null,
platinum: null
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
},
NZD: {
prefix: '$',
suffix: '',
info: 'Prices in NZD, excluding GST',
base: {
starter: 65,
silver: 390,
gold: 540,
platinum: 860
},
more: {
starter: 65,
silver: 39,
gold: 17,
platinum: 15
},
discount: {
info: null,
base: {
starter: null,
silver: null,
gold: null,
platinum: null
},
more: {
starter: null,
silver: null,
gold: null,
platinum: null
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
},
USD: {
prefix: '$',
suffix: '',
info: 'Prices in USD, excluding Sales Tax',
base: {
starter: 53,
silver: 280,
gold: 400,
platinum: 720
},
more: {
starter: 53,
silver: 28,
gold: 15,
platinum: 12
},
discount: {
info: null,
base: {
starter: null,
silver: null,
gold: null,
platinum: null
},
more: {
starter: null,
silver: null,
gold: null,
platinum: null
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
},
ZAR: {
prefix: 'R',
suffix: '*',
info: 'Prices in ZAR, excluding VAT/GST',
base: {
starter: 480,
silver: 2450,
gold: 3650,
platinum: 6600
},
more: {
starter: 480,
silver: 240,
gold: 160,
platinum: 140
},
discount: {
info: '*For a limited time, Fathom is offered at a 33% discount for the first 12 months of new subscriptions',
base: {
starter: 720,
silver: 3675,
gold: 5475,
platinum: 9900
},
more: {
starter: 720,
silver: 360,
gold: 240,
platinum: 210
}
},
included: {
starter: 1,
silver: 10,
gold: 25,
platinum: 50
}
}
};
var debugEnabled;
function debugLog(caption, message) {
if (debugEnabled) {
var scope = caption;
if (!caption) {
scope = 'LOG';
}
console.log("[".concat(scope, "]"), message);
}
}
function getParameterByName(name) {
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.href;
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp("[?&]".concat(name, "(=([^]*)|&|#|$)"));
var results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
function addCalculator() {
var calculator = $(calculatorSelector.appendAfter);
var calculatorClass = '';
if (pagePath === alt1Path) {
calculatorClass = 'class="calculator-alt1"';
} else if (pagePath === alt2Path) {
calculatorClass = 'class="calculator-alt2"';
}
var value1 = 0;
var value2 = 1;
switch (pagePath) {
case alt1Path:
case alt2Path:
value2 = 10;
break;
}
var max = 50;
calculator.append("\n
\n \n
\n
\n
\n
\n
\n
\n
\n ").concat(value1, "\n
\n
\n ").concat(value2, "\n
\n
\n
\n
\n
\n \n
\n \n \n \n \n \n \n | \n \n \n \n \n \n \n | \n
\n \n \n | \n \n \n | \n
\n
\n
\n "));
}
var devParameter = getParameterByName('dev');
var debugParameter = getParameterByName('debug');
debugEnabled = debugParameter !== null;
var pagePath = window.location.pathname;
debugLog('page path', pagePath);
var webinarsPath = devParameter !== null ? '/Live%20Webinars.html' : '/live-webinars';
var alt1Path = devParameter !== null ? '/price.html' : '/price';
var alt2Path = devParameter !== null ? '/pricing.html' : '/pricing';
var calculatorSelector;
var priceSelector;
if (pagePath === webinarsPath) {} else {
if (pagePath === alt1Path) {
priceSelector = {
starter: {
base: '.plan_wrap .pricing__price-span',
more: '.plan_wrap ul.pricing__checks-list li:last-child .cc-80 span.text-span-7'
},
silver: {
base: '.plan_wrap .pricing__price-span',
more: '.plan_wrap ul.pricing__checks-list li:last-child .cc-80 span.text-span-7'
},
gold: {
base: '.plan_wrap .pricing__price-span',
more: '.plan_wrap ul.pricing__checks-list li:last-child .cc-80 span.text-span-7'
},
platinum: {
base: '.plan_wrap .pricing__price-span',
more: '.plan_wrap ul.pricing__checks-list li:last-child .cc-80 span.text-span-7'
},
info: '.pricing__prices-info',
perCompany: '.plan_wrap div.text-block-4'
};
} else if (pagePath === alt2Path) {
priceSelector = {
starter: {
base: '.pricing__option-wrap:nth-child(1) .plan_price_starter strong',
more: '.pricing__option-wrap:nth-child(1) .extra_price_starter strong'
},
silver: {
base: '.pricing__option-wrap:nth-child(2) .cc-80 strong:nth-of-type(1)',
more: '.pricing__option-wrap:nth-child(2) .cc-80 strong:nth-of-type(2)'
},
gold: {
base: '.pricing__option-wrap:nth-child(3) .cc-80 strong:nth-of-type(1)',
more: '.pricing__option-wrap:nth-child(3) .cc-80 strong:nth-of-type(2)'
},
platinum: {
base: '.pricing__option-wrap:nth-child(4) .cc-80 strong:nth-of-type(1)',
more: '.pricing__option-wrap:nth-child(4) .cc-80 strong:nth-of-type(2)'
},
info: '.pricing__prices-info',
perCompany: '#calculator-info-more'
};
} else {
priceSelector = {
starter: {
base: '.pricing__option-wrap:nth-child(1) .pricing__price-span',
more: '.pricing__option-wrap:nth-child(1) .pricing__extra-company-span'
},
silver: {
base: '.pricing__option-wrap:nth-child(2) .pricing__price-span',
more: '.pricing__option-wrap:nth-child(2) .pricing__extra-company-span'
},
gold: {
base: '.pricing__option-wrap:nth-child(3) .pricing__price-span',
more: '.pricing__option-wrap:nth-child(3) .pricing__extra-company-span'
},
platinum: {
base: '.pricing__option-wrap:nth-child(4) .pricing__price-span',
more: '.pricing__option-wrap:nth-child(4) .pricing__extra-company-span'
},
info: '.pricing__prices-info',
perCompany: ''
};
}
calculatorSelector = {
appendAfter: '.wrap.pricing__hero-bottom',
headerId: 'calculator-header',
rangeId: 'calculator-companies',
infoId: 'calculator-info',
info: {
companies: 'calculator-info-companies',
starterOrPlural: 'calculator-info-plural',
price: 'calculator-info-price',
priceAfter: 'calculator-info-price-after',
priceBefore: 'calculator-info-price-before',
more: 'calculator-info-more'
},
text: {
priceAfter: 'per month',
priceBefore: '='
},
style: {
bubble: '',
infoCompanies: '',
infoMore: '',
infoPrice: '',
infoRight: ''
}
};
switch (pagePath) {
case alt1Path:
calculatorSelector.appendAfter = '.wrap.pricing__hero';
calculatorSelector.info.companies = '.plan_wrap .pricing__company-text';
$('.plan_wrap .grid-4').css('visibility', 'hidden');
break;
case alt2Path:
calculatorSelector.appendAfter = '.wrap.pricing__hero';
calculatorSelector.style.infoCompanies += 'font-size: 38px;';
calculatorSelector.style.infoPrice += 'font-size: 38px;';
calculatorSelector.style.infoPrice += 'padding-right: 20px;';
calculatorSelector.style.infoMore += 'font-size: 14px;';
calculatorSelector.style.infoRight += 'padding-left: 80px;';
calculatorSelector.style.infoRight += 'text-align: left;';
calculatorSelector.text.priceAfter = '/ month';
calculatorSelector.text.priceBefore = '';
break;
}
addCalculator();
switch (pagePath) {
case alt1Path:
case alt2Path:
var afterCalculator = document.getElementsByClassName('pricing__hero-deco');
if (afterCalculator.length) {
afterCalculator[0].style.marginBottom = '-50px';
}
break;
}
}
$(document).ready(function () {
function isVisible(selector) {
var visibility = $(selector).css('visibility');
return visibility !== 'hidden';
}
function setVisibility(selector) {
var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var collapsable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var visibility;
var css;
if (collapsable) {
css = 'display';
if (visible) {
visibility = 'block';
} else {
visibility = 'none';
}
} else {
css = 'visibility';
if (visible) {
visibility = 'visible';
} else {
visibility = 'hidden';
}
}
$(selector).css(css, visibility);
}
function loadScript(url, onSuccess) {
var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var onTimeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var isTimeout = false;
var isSuccess = false;
if (typeof timeout === 'number' && typeof onTimeout === 'function') {
setTimeout(function () {
if (!isSuccess) {
debugLog('loadScript', "timeout ".concat(timeout, "ms"));
isTimeout = true;
onTimeout();
}
}, timeout);
}
var script = document.createElement('script');
script.type = 'text/javascript';
if (script.readyState) {
script.onreadystatechange = function () {
if (script.readyState === 'loaded' || script.readyState === 'complete') {
script.onreadystatechange = null;
onSuccess();
}
};
} else {
script.onload = function () {
if (!isTimeout) {
debugLog('loadScript', 'success');
isSuccess = true;
onSuccess();
}
};
}
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
}
var nogeoipParameter = getParameterByName('nogeoip');
var timeoutParameter = getParameterByName('timeout');
var countryParameter = getParameterByName('country');
var geoipScript = 'https://geoip-js.com/js/apis/geoip2/v2.1/geoip2.js';
var geoipEnabled = nogeoipParameter === null;
var timeout = null;
if (timeoutParameter !== null) {
debugLog('timeout', 'setting');
timeout = +timeoutParameter;
if (Number.isNaN(timeout)) {
debugLog('timeout', 'catching NaN');
timeout = 0;
}
}
var geoipCountryEnabled = true;
var forceCountry = typeof countryParameter === 'string' ? countryParameter.toUpperCase() : null;
var countryList = window.countryList || [];
var priceList = window.priceList || [];
var globalPrice;
var loadScriptTimeout = 3000;
function getIsoCode(geoipResponse) {
var isoCode;
if (forceCountry) {
isoCode = forceCountry;
debugLog('force country', forceCountry);
} else if (geoipResponse) {
if (geoipResponse.country) {
isoCode = geoipResponse.country.iso_code;
debugLog('geoip: try country.iso code', isoCode);
}
if (!isoCode && geoipResponse.registered_country) {
isoCode = geoipResponse.registered_country.iso_code;
debugLog('geoip: try registered_country.iso code', isoCode);
}
}
debugLog('geoip iso code', isoCode);
return isoCode;
}
function getCountry(isoCode) {
var country;
if (isoCode) {
for (var i = 0; i < countryList.length; i += 1) {
if (countryList[i].code === isoCode) {
country = countryList[i];
break;
}
}
}
debugLog('country', country);
return country;
}
if (pagePath === webinarsPath) {
(function () {
var webinarSelector = {
us: '#live-webinars div.live-web__wrap:nth-child(2)',
au_nz: '#live-webinars div.live-web__wrap:nth-child(3)',
gb_za: '#live-webinars div.live-web__wrap:nth-child(4)'
};
function updatePage(country) {
var code = country.code;
if (code === 'US' || code === 'CA') {
debugLog('webinar block', 'US / CA');
setVisibility(webinarSelector.au_nz, false, true);
setVisibility(webinarSelector.gb_za, false, true);
} else if (code === 'AU' || code === 'NZ') {
debugLog('webinar block', 'AU / NZ');
setVisibility(webinarSelector.us, false, true);
setVisibility(webinarSelector.gb_za, false, true);
} else if (code === 'GB' || code === 'ZA') {
debugLog('webinar block', 'GB / ZA');
setVisibility(webinarSelector.us, false, true);
setVisibility(webinarSelector.au_nz, false, true);
} else {
debugLog('webinar block', 'else');
}
}
function processGeoip(geoip2) {
debugLog(null, 'geoip loaded');
if (typeof geoip2 !== 'undefined') {
if (geoipCountryEnabled) {
geoip2.country(function (geoipResponse) {
debugLog('geoip response', geoipResponse);
updatePage(getCountry(getIsoCode(geoipResponse)));
}, function (error) {
debugLog('geoip error', error);
});
}
}
}
if (geoipEnabled) {
loadScript(geoipScript, function () {
processGeoip(geoip2);
}, loadScriptTimeout, function () {});
}
})();
} else {
(function () {
var discountSelector = {
starter: {
base: '.pricing__option-wrap:nth-child(1) .pricing__discount',
more: '.pricing__option-wrap:nth-child(1) .pricing__discount-more'
},
silver: {
base: '.pricing__option-wrap:nth-child(2) .pricing__discount',
more: '.pricing__option-wrap:nth-child(2) .pricing__discount-more'
},
gold: {
base: '.pricing__option-wrap:nth-child(3) .pricing__discount',
more: '.pricing__option-wrap:nth-child(3) .pricing__discount-more'
},
platinum: {
base: '.pricing__option-wrap:nth-child(4) .pricing__discount',
more: '.pricing__option-wrap:nth-child(4) .pricing__discount-more'
},
info: '.pricing__discount-info'
};
var boxSelector = {
starter: {
root: '.pricing__option-wrap:nth-child(1)'
},
silver: {
root: '.pricing__option-wrap:nth-child(2)'
},
gold: {
root: '.pricing__option-wrap:nth-child(3)'
},
platinum: {
root: '.pricing__option-wrap:nth-child(4)'
}
};
function debugTest(message) {
var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (debugEnabled) {
var element = $('.pricing__hero-text div');
if (append) {
element.html("".concat(element.html(), " ").concat(message));
} else {
element.html(message);
}
}
}
function getFriendlyPlanName(plan) {
return {
"starter": "starter",
"silver": "silver",
"gold": "gold",
"platinum": "platinum"
} [plan]
}
function getPrice(country) {
var defaultCurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'USD';
var currency;
if (country && country.currency && priceList[country.currency]) {
currency = country.currency;
debugLog('currency/price found', currency);
} else {
currency = defaultCurrency;
debugLog('currency/price not found, defaults used', currency);
}
var price = priceList[currency];
price.currency = currency;
globalPrice = price;
debugLog('price', price);
return price;
}
function formatPrice(value, price) {
var extended = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
debugLog('price currency', price.currency);
var prefix = price.prefix || '';
var suffix = price.suffix || '';
var extension = '';
if (extended) {
extension = " ".concat(price.currency);
}
var formatted = "".concat(prefix).concat(value).concat(suffix).concat(extension);
debugLog('formatted price', formatted);
return formatted;
}
function getBasePrice(price, option, type, discount) {
debugLog('price option', option);
debugLog('price type', type);
var selectedPrice;
if (discount) {
selectedPrice = price.discount[type][option];
} else {
selectedPrice = price[type][option];
}
var formatted = formatPrice(selectedPrice, price);
return formatted;
}
function updatePrice(price, option, type, selector) {
var afterPrice = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
var formatted = getBasePrice(price, option, type);
$(selector[option][type]).text(formatted + afterPrice);
setVisibility(selector[option][type]);
if (price.discount[type][option]) {
var discountPrice = getBasePrice(price, option, type, price.discount);
var discount = $(discountSelector[option][type]);
discount.text(discountPrice);
discount.show();
}
}
function updateInfo(price, selector) {
$(selector.info).html(price.info);
setVisibility(selector.info);
debugLog('discount into', price.discount.info);
if (price.discount.info) {
var info = $(discountSelector.info);
info.html(price.discount.info);
info.show();
}
}
function updateAllPrices(price) {
switch (pagePath) {
case alt1Path:
break;
default:
var option = ['starter', 'silver', 'gold', 'platinum'];
var type = ['base', 'more'];
var afterBasePrice = '';
var afterMorePrice = '';
if (pagePath === alt2Path) {
afterBasePrice = ' / month';
}
afterPrice = '';
for (var o = 0; o < option.length; o += 1) {
for (var t = 0; t < type.length; t += 1) {
if ('base' === type[t]) {
afterPrice = afterBasePrice;
} else if ('more' === type[t]) {
afterPrice = afterMorePrice;
}
updatePrice(price, option[o], type[t], priceSelector, afterPrice);
}
}
break;
}
updateInfo(price, priceSelector);
}
function getTestPrice(companies, option) {
var price = {
base: globalPrice.base[option],
more: globalPrice.more[option],
included: globalPrice.included[option]
};
debugLog('test price values', price);
var test;
if (companies <= price.included) {
test = price.base;
} else {
test = price.base + price.more * (companies - price.included);
}
debugLog('test price', test);
return test;
}
function getBestPlan(companies) {
var testA;
var testB;
var price;
var name;
testA = getTestPrice(companies, 'starter');
testB = getTestPrice(companies, 'silver');
if (testA <= testB) {
price = testA;
name = 'starter';
} else {
testA = testB;
testB = getTestPrice(companies, 'gold');
if (testA <= testB) {
price = testA;
name = 'silver';
} else {
testA = testB;
testB = getTestPrice(companies, 'platinum');
if (testA <= testB) {
price = testA;
name = 'gold';
} else {
price = testB;
name = 'platinum';
}
}
}
debugLog('final cheaper option', name);
debugLog('final test price', price);
plan = {
price: price,
name: name
};
return plan;
}
function getPlanColor(plan) {
switch (plan) {
case 'starter':
return '#4abea7';
break;
case 'silver':
return '#9099a9';
break;
case 'gold':
return '#c09d55';
break;
case 'platinum':
return '#0f2043';
break;
}
}
function updateCalculator() {
var companies = $("#".concat(calculatorSelector.rangeId)).val();
var starterOrPlural = 'company';
if (companies > 1) {
starterOrPlural = 'companies';
}
switch (pagePath) {
case alt1Path:
$(calculatorSelector.info.companies).html("".concat(companies, " ").concat(starterOrPlural, ""));
break;
default:
$("#".concat(calculatorSelector.info.companies)).text(companies);
$("#".concat(calculatorSelector.info.starterOrPlural)).text(starterOrPlural);
break;
}
var extended = true;
var perCompany = ' ';
switch (pagePath) {
case alt1Path:
case alt2Path:
extended = false;
$('.section.pricing__hero-deco').css('margin-bottom', '-50px');
break;
}
var plan = getBestPlan(companies);
globalPrice.plan = plan.name;
var formatted = formatPrice(plan.price, globalPrice, extended);
$("#".concat(calculatorSelector.info.priceBefore)).html(calculatorSelector.text.priceBefore);
$("#".concat(calculatorSelector.info.price)).text(formatted);
$("#".concat(calculatorSelector.info.priceAfter)).html(calculatorSelector.text.priceAfter);
switch (pagePath) {
case alt1Path:
case alt2Path:
if (6 <= companies) {
var pricePerCompany = roundNumber(plan.price / companies, 2);
var pricePerCompanyFormatted = formatPrice(pricePerCompany, globalPrice, extended);
perCompany = "only ".concat(pricePerCompanyFormatted, " per company");
}
$(priceSelector.perCompany).html(perCompany);
break;
}
switch (pagePath) {
case alt1Path:
$(priceSelector[plan.name].base).text(formatted);
var included = globalPrice.included[plan.name];
$('.plan_wrap ul.pricing__checks-list li:nth-last-child(2) .cc-80').html("".concat(included, " ").concat(starterOrPlural, " included in plan"));
var priceMore = globalPrice.more[plan.name];
var priceMoreFormatted = formatPrice(priceMore, globalPrice);
$(priceSelector[plan.name].more).text(priceMoreFormatted);
var planColor = getPlanColor(plan.name);
$(priceSelector[plan.name].base).css('color', planColor);
$('.plan_wrap .pricing__name-tag').css('background-color', planColor);
$('.plan_wrap .pricing__name-tag h2.pricing__plan-name').text(plan.name);
$('.plan_wrap .grid-4').css('visibility', 'visible');
break;
case alt2Path:
if (boxSelector[plan.name] && boxSelector[plan.name].root) {
debugLog('dynamic', 'darken other plans');
for (var planAvailable in boxSelector) {
var filter = void 0;
if (planAvailable === plan.name) {
debugLog('dynamic', 'focus plan ' + planAvailable);
filter = 'none';
} else {
debugLog('dynamic', 'hide plan ' + planAvailable);
filter = 'brightness(70%)';
}
$(boxSelector[planAvailable].root).css('filter', filter);
}
}
break;
}
}
window.updateCalculator = updateCalculator;
function roundNumber(number, digits) {
return (Math.round(number * Math.pow(10, digits)) / Math.pow(10, digits)).toFixed(digits);
}
function updatePage(geoipResponse) {
if (geoipResponse === null) {
var priceVisible = isVisible(priceSelector.starter.base);
debugLog('prices visible', priceVisible);
if (priceVisible) {
debugLog('defaults', 'skipping');
return;
}
}
updateAllPrices(getPrice(getCountry(getIsoCode(geoipResponse))));
updateCalculator();
}
function processGeoip(geoip2) {
debugLog(null, 'geoip loaded');
if (typeof geoip2 !== 'undefined') {
if (geoipCountryEnabled) {
geoip2.country(function (geoipResponse) {
debugLog('geoip response', geoipResponse);
updatePage(geoipResponse);
}, function (error) {
debugLog('geoip error', error);
updatePage(null);
});
}
} else {
updatePage(null);
}
}
if (timeout !== null) {
setTimeout(function () {
debugLog('timeout', 'setting defaults');
updatePage(null);
}, timeout);
}
if (geoipEnabled) {
loadScript(geoipScript, function () {
processGeoip(geoip2);
}, loadScriptTimeout, function () {
updatePage(null);
});
} else {
updatePage(null);
}
})();
}
});