function trial_modal(){
	var el = document.createElement('div');
	el.id='modal_div';
	el.style.cssText='background:rgba(0, 0, 0, 0.3); position:fixed; width:100%; height:100%; top:0px; left:0px; z-index:100;';
	el.innerHTML = '<iframe style="width:90%;max-width:500px;height:590px;background:#fff;display:block;border:0;margin:auto;margin-top:100px;box-shadow:0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);" scrolling="no" src="/app/trial/?start=trial&c='+encodeURIComponent(cookies_obj()['_ga'])+'&p='+encodeURIComponent(location.href)+'"></iframe>';
	document.body.appendChild(el);
	return false;
}

function modal_close(){
	document.body.style.overflow='unset';
    var modal = document.getElementById('modal_div');
    if (modal) { modal.parentNode.removeChild(modal); }
}

function callback_modal(){
	document.body.style.overflow='hidden';
	var el = document.createElement('div');
	el.id='modal_div';
	el.style.cssText = 'background:rgba(0, 0, 0, 0.3); position:fixed; width:100%; height:100%; top:0px; left:0px; z-index:100; opacity:0; transition: opacity 0.3s ease-in-out;';
	el.innerHTML = '<iframe style="width:90%;max-width:500px;height:590px;background:#fff;display:block;border:0;margin:auto;margin-top:100px;box-shadow:0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);" scrolling="no" src="/help/callback/?c='+encodeURIComponent(cookies_obj()['_ga'])+'&p='+encodeURIComponent(location.href)+'"></iframe>';
	document.body.appendChild(el);
	void el.offsetWidth;
    el.style.opacity = '1';
	return false;
}
function cookies_obj() {
	var cookies = {};
	document.cookie.split(';').forEach(function(el) {
		var splitCookie = el.split('=');
		var key = splitCookie[0].trim();
		var value = splitCookie[1];
		cookies[key] = value;
  	});
	return cookies;
}
function intToString(number) {
	const absNumber = Math.abs(number);
	const abbreviations = {
	    T: 1000000000000,
	    B: 1000000000,
	    M: 1000000,
	    K: 1000,
	  };

  	for (const key in abbreviations) {
			    if (absNumber >= abbreviations[key]) {
			      const roundedValue = number / abbreviations[key];
			      const decimalPlaces = roundedValue < 10 ? 1 : 0;
			      return roundedValue.toFixed(decimalPlaces) + key;
			    }
	}
  return number.toString();
}