CVE-2022-0935: Improper Encoding or Escaping of Output (CWE-116)
value: Host Header injection in password Reset in GitHub repository livehelperchat/livehelperchat prior to 3.97.
CWE description: The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
CVSS v3 base score: 8.8
Published: 2022-04-07T19:15Z
Repository: https://github.com/livehelperchat/livehelperchat
Language: PHP
Files changed: lhc_web/cli/lib/install.php, lhc_web/design/defaulttheme/tpl/lhbrowseoffer/getstatus.tpl.php, lhc_web/design/defaulttheme/tpl/lhbrowseoffer/htmlcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/chat_tabs/information_rows/id.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/chatcheckoperatormessage.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getmessagesnippet/operator_profile.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/container.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/dynamic_events.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey_page.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/send_notification.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_start_window.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_status_widget.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/getstatus_migrate.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/native_placement.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatus/we_here_substatus.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/getstatusembed.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/lists/op_msg_row_nick.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_name_support_img.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_start_chat.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/chatbox.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/faq.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/live_help.tpl.php, lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/questionary.tpl.php, lhc_web/design/defaulttheme/tpl/lhchatbox/embed.tpl.php, lhc_web/design/defaulttheme/tpl/lhchatbox/embedcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhchatbox/getstatus.tpl.php, lhc_web/design/defaulttheme/tpl/lhchatbox/htmlcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit.tpl.php, lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit_onlineuser.tpl.php, lhc_web/design/defaulttheme/tpl/lhcobrowse/userinit.tpl.php, lhc_web/design/defaulttheme/tpl/lhexport/xml.tpl.php, lhc_web/design/defaulttheme/tpl/lhfaq/embed.tpl.php, lhc_web/design/defaulttheme/tpl/lhfaq/embedcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhfaq/getstatus.tpl.php, lhc_web/design/defaulttheme/tpl/lhfaq/htmlcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhform/collected.tpl.php, lhc_web/design/defaulttheme/tpl/lhform/embed.tpl.php, lhc_web/design/defaulttheme/tpl/lhform/embedcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhgenericbot/message/content/quick_replies.tpl.php, lhc_web/design/defaulttheme/tpl/lhnotifications/settings.tpl.php, lhc_web/design/defaulttheme/tpl/lhquestionary/embed.tpl.php, lhc_web/design/defaulttheme/tpl/lhquestionary/embedcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhquestionary/getstatus.tpl.php, lhc_web/design/defaulttheme/tpl/lhquestionary/htmlcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhsystem/embedcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhsystem/htmlcode.tpl.php, lhc_web/design/defaulttheme/tpl/lhsystem/htmlcodebeta.tpl.php, lhc_web/design/defaulttheme/tpl/lhsystem/update.tpl.php, lhc_web/design/defaulttheme/tpl/lhuser/autologinconfig.tpl.php, lhc_web/design/defaulttheme/tpl/lhwebhooks/form_incoming.tpl.php, lhc_web/design/defaulttheme/tpl/lhxmp/xmp.tpl.php, lhc_web/lib/core/lhbbcode/lhbbcode.php, lhc_web/lib/core/lhbbcode/lhbbcode_cleanup.php, lhc_web/lib/core/lhchat/lhchatcommand.php, lhc_web/lib/core/lhchat/lhchatexport.php, lhc_web/lib/core/lhchat/lhchatmail.php, lhc_web/lib/core/lhcore/lhsys.php, lhc_web/lib/core/lhcore/lhupdate.php, lhc_web/lib/core/lhform/lhformrenderer.php, lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactionrestapi.php, lhc_web/lib/core/lhrestapi/lhrestapivalidator.php, lhc_web/lib/core/lhxmp/lhxmp.php, lhc_web/lib/models/lhabstract/erlhabstractmodelformcollected.php, lhc_web/lib/models/lhabstract/erlhabstractmodelwidgettheme.php, lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbotbot.php, lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbottrgroup.php, lhc_web/lib/models/lhuser/erlhcoreclassmodeluser.php, lhc_web/modules/lhcobrowse/proxycss.php, lhc_web/modules/lhcron/test.php, lhc_web/modules/lhexport/getchat.php, lhc_web/modules/lhexport/getcount.php, lhc_web/modules/lhexport/getlist.php, lhc_web/modules/lhform/downloadcollected.php, lhc_web/modules/lhform/downloaditem.php, lhc_web/modules/lhinstall/install.php, lhc_web/modules/lhpermission/explorer.php, lhc_web/modules/lhrestapi/fetchchatmessages.php, lhc_web/modules/lhrestapi/generateautologin.php, lhc_web/modules/lhrestapi/loginbytoken.php, lhc_web/modules/lhrestapi/swagger.php, lhc_web/modules/lhuser/forgotpassword.php, lhc_web/modules/lhwidgetrestapi/checkinvitation.php, lhc_web/modules/lhwidgetrestapi/screensharesettings.php, lhc_web/modules/lhwidgetrestapi/settings.php, lhc_web/modules/lhwidgetrestapi/updatejs.php, lhc_web/modules/lhxmp/configuration.php, lhc_web/settings/settings.ini.default.php
Commit date: 2022-04-06 13:07:00 +0300
Commit message: Migrate to static HTTP_HOST (#1754)

Static HTTP_HOST option and security section in update page.
Diff: diff --git a/lhc_web/cli/lib/install.php b/lhc_web/cli/lib/install.php
index 1b62317f085..12d22b3e5dd 100644
--- a/lhc_web/cli/lib/install.php
+++ b/lhc_web/cli/lib/install.php
@@ -1265,13 +1265,13 @@ class Install
                   `explain` varchar(250) NOT NULL,
                   `hidden` int(11) NOT NULL DEFAULT '0',
                   PRIMARY KEY (`identifier`)
                 ) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
 
-            $randomHash = erLhcoreClassModelForgotPassword::randomPassword(9);
+            $randomHash = erLhcoreClassModelForgotPassword::randomPassword(80);
             $randomHashLength = strlen($randomHash);
-            $exportHash = erLhcoreClassModelForgotPassword::randomPassword(9);
+            $exportHash = erLhcoreClassModelForgotPassword::randomPassword(80);
 
             if (extension_loaded('bcmath')){
                 $geoRow = "('geo_data','a:5:{i:0;b:0;s:21:\"geo_detection_enabled\";i:1;s:22:\"geo_service_identifier\";s:8:\"max_mind\";s:23:\"max_mind_detection_type\";s:7:\"country\";s:22:\"max_mind_city_location\";s:37:\"var/external/geoip/GeoLite2-City.mmdb\";}',0,'',1)";
             } else {
                 $geoRow = "('geo_data', '', '0', '', '1')";
diff --git a/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/getstatus.tpl.php b/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/getstatus.tpl.php
index b7b9fa3a754..52ce018dbd2 100644
--- a/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/getstatus.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/getstatus.tpl.php
@@ -52,11 +52,11 @@ var lhc_BrowseOffer = {
 
     hide : function() {
         var th = document.getElementsByTagName('head')[0];
         var s = document.createElement('script');
         s.setAttribute('type','text/javascript');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widgetclosed')?>/<?php echo $invite->hash?>');
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widgetclosed')?>/<?php echo $invite->hash?>');
         th.appendChild(s);
         this.removeById('lhc_container_browseoffer');
         this.removeById('lhc_browseoffer-bg');
         this.cookieDataPers.of.push(<?php echo $invite->id?>);
         this.storePersistenCookie();
@@ -71,11 +71,11 @@ var lhc_BrowseOffer = {
 
    		  this.removeById('lhc_container_browseoffer');
 		
    		  <?php if ($invite->custom_iframe_url != '' || $invite->lhc_iframe_content == 1) : ?>
    		  this.iframe_html = '<iframe id="lhcbrowseoffer_iframe" allowTransparency="true" scrolling="no" frameborder="0" ' +
-                       ' src="<?php if ($invite->custom_iframe_url != '') : ?><?php echo $invite->custom_iframe_url ?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widget')?>/<?php echo $invite->hash?><?php endif;?>"' +                    
+                       ' src="<?php if ($invite->custom_iframe_url != '') : ?><?php echo $invite->custom_iframe_url ?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widget')?>/<?php echo $invite->hash?><?php endif;?>"' +
                        ' style="width: 100%; height: <?php echo $size_height?>px;"></iframe>';
          <?php else : ?>
          this.iframe_html = "<div id=\"lhcbrowseoffer_content\">"+<?php echo json_encode($invite->content)?>+"</div>";
          <?php endif; ?>
           	  
@@ -100,11 +100,11 @@ var lhc_BrowseOffer = {
          },500);
          
          var th = document.getElementsByTagName('head')[0];
          var s = document.createElement('script');
          s.setAttribute('type','text/javascript');
-         s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('browseoffer/addhit')?>/<?php echo $invite->hash?>');
+         s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('browseoffer/addhit')?>/<?php echo $invite->hash?>');
          th.appendChild(s);
          
          if (<?php echo $browseofferOptionsVariable;?>.openCallback) {
         	<?php echo $browseofferOptionsVariable;?>.openCallback(<?php echo $invite->callback_content?>);
          }          
diff --git a/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/htmlcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/htmlcode.tpl.php
index a2f8632ba3c..f7a0110adfc 100644
--- a/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/htmlcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhbrowseoffer/htmlcode.tpl.php
@@ -94,11 +94,11 @@ function generateEmbedCode(){
     
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
         'var referrer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf(\'://\')+1)) : \'\';'+"\n"+
         'var location  = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : \'\';'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'browseoffer/getstatus'+size+id_size_height+topposition+id_timeout+id_show_overlay+id_identifier+id_canreopen+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'browseoffer/getstatus'+size+id_size_height+topposition+id_timeout+id_show_overlay+id_identifier+id_canreopen+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/chat_tabs/information_rows/id.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/chat_tabs/information_rows/id.tpl.php
index bd745cfe930..2194578d2f3 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/chat_tabs/information_rows/id.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/chat_tabs/information_rows/id.tpl.php
@@ -1,5 +1,5 @@
 <?php if (isset($orderInformation['id']['enabled']) && $orderInformation['id']['enabled'] == true) : ?>
 <div class="col-6 pb-1">
-    <span class="material-icons user-select-none">vpn_key</span><span><?php echo $chat->id;?></span><button data-success="Copied" class="ml-1 btn btn-xs btn-link text-muted py-1" data-copy="<?php echo (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ?><?php echo erLhcoreClassDesign::baseurl('front/default')?>/(cid)/<?php echo $chat->id?>/#!#chat-id-<?php echo $chat->id?>" onclick="lhinst.copyContent($(this))" type="button"><i class="material-icons">link</i>Copy link</button>
+    <span class="material-icons user-select-none">vpn_key</span><span><?php echo $chat->id;?></span><button data-success="Copied" class="ml-1 btn btn-xs btn-link text-muted py-1" data-copy="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('front/default')?>/(cid)/<?php echo $chat->id?>/#!#chat-id-<?php echo $chat->id?>" onclick="lhinst.copyContent($(this))" type="button"><i class="material-icons">link</i>Copy link</button>
 </div>
 <?php endif; ?>
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/chatcheckoperatormessage.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/chatcheckoperatormessage.tpl.php
index 9474026e90d..9abc3192a97 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/chatcheckoperatormessage.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/chatcheckoperatormessage.tpl.php
@@ -9,19 +9,19 @@ lh_inst.stopCheckNewMessage();
 
     <?php if (($visitor->invitation_assigned == false && $visitor->invitation->delay > 0) || $visitor->invitation->delay_init > 0) : ?>
     setTimeout(function() {
     <?php endif; ?>
 
-        var invitationURL =  '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
+        var invitationURL =  '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
 
         <?php if (isset($visitor->invitation->design_data_array['mobile_html']) && $visitor->invitation->design_data_array['mobile_html'] != '') : ?>
 
             <?php if (isset($visitor->invitation->design_data_array['mobile_style']) && $visitor->invitation->design_data_array['mobile_style'] != '') : ?>
                 <?php
                     $replaceStyleArray = array();
                     for ($i = 1; $i < 5; $i++) {
-                        $replaceStyleArray['{proactive_img_' . $i . '}'] =  erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . $visitor->invitation->{'design_data_img_' . $i . '_url'};
+                        $replaceStyleArray['{proactive_img_' . $i . '}'] = erLhcoreClassSystem::getHost() . $visitor->invitation->{'design_data_img_' . $i . '_url'};
                     }
                 ?>
                 <?php
                     $contentCSS = str_replace(array_keys($replaceStyleArray),array_values($replaceStyleArray),$visitor->invitation->design_data_array['mobile_style']);
                     $contentCSS = str_replace(array("\n","\r"),'',$contentCSS);
@@ -53,11 +53,11 @@ lh_inst.stopCheckNewMessage();
 
 <?php else : ?>
             <?php if ($visitor->invitation instanceof erLhAbstractModelProactiveChatInvitation && (($visitor->invitation_assigned == false && $visitor->invitation->delay > 0) || $visitor->invitation->delay_init > 0)) : ?>
                 setTimeout(function() {
             <?php endif; ?>
-            var urlInvitation = '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
+            var urlInvitation = '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
             <?php if ($visitor->invitation instanceof erLhAbstractModelProactiveChatInvitation && isset($visitor->invitation->design_data_array['api_do_not_show']) && $visitor->invitation->design_data_array['api_do_not_show'] == 1) : ?>
                 lh_inst.showBasicInvitation(urlInvitation);
             <?php else : ?>
                 if (window.innerWidth > 700) {
                         lh_inst.isProactivePending = 1;
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getmessagesnippet/operator_profile.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getmessagesnippet/operator_profile.tpl.php
index ebc141ff903..5faa77bbeeb 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getmessagesnippet/operator_profile.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getmessagesnippet/operator_profile.tpl.php
@@ -1,11 +1,11 @@
 <div class="align-self-center op-photo">
     <?php if ($user->has_photo_avatar) : ?>
         <?php if ($user->has_photo) : ?>
             <img width="20" height="20" src="<?php echo $user->photo_path?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
         <?php else : ?>
-            <img width="20" height="20" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
+            <img width="20" height="20" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
         <?php endif; ?>
     <?php else : ?>
         <i class="icon-assistant material-icons mr-0"><?php if (isset($react) && $react === true) : ?>&#xf10d;<?php else : ?>account_box<?php endif; ?></i>
     <?php endif;?>
 </div>
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php
index edfaee94fa1..1983e117ce2 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php
@@ -49,11 +49,11 @@ var lh_inst  = {
 	langDefault: '/<?php echo erLhcoreClassSystem::instance()->SiteAccess?>',
 	is_dragging : false,
 	is_full_height : <?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ? 'true' : 'false' ?>,
 	online_tracked : false,
     urlopen : function(){
-    	return "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/startchat<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>"+this.survey_id;
+    	return "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/startchat<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>"+this.survey_id;
     },
 	<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/custom_get_status_lh_inst_js.tpl.php')); ?>
     hasSurvey : <?php echo $survey !== false ? 'true ': 'false'?>,
     survey_id : '<?php echo $survey !== false ? '/(survey)/' . $survey : ''?>',
     surveyShown : false,
@@ -264,11 +264,11 @@ var lh_inst  = {
             <?php endif;?>
 
             var th = document.getElementsByTagName('head')[0];
             var s = document.createElement('script');
             s.setAttribute('type','text/javascript');
-            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatwidgetclosed'+this.getAppendCookieArguments()+'?ts='+Date.now());
+            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatwidgetclosed'+this.getAppendCookieArguments()+'?ts='+Date.now());
             th.appendChild(s);
             this.toggleStatusWidget(false);
 
             this.removeCookieAttr('pos');
             this.removeCookieAttr('m');
@@ -591,11 +591,11 @@ var lh_inst  = {
         }
     },
 
     updateAttribute : function(attributes) {
         var xhr = new XMLHttpRequest();
-        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updateattribute'+this.getAppendCookieArguments(), true);
+        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updateattribute'+this.getAppendCookieArguments(), true);
      	xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      	xhr.send( "data=" + encodeURIComponent( this.JSON.stringify(attributes) ) );
     },
 
     startNewMessageCheck : function() {
@@ -608,11 +608,11 @@ var lh_inst  = {
             var dynamic = inst.dynamicAssigned.length > 0 ? '/(dyn)/' +  inst.dynamicAssigned.join('/') : '';
             var th = document.getElementsByTagName('head')[0];
             var s = document.createElement('script');
             s.setAttribute('id','lhc_operator_message');
             s.setAttribute('type','text/javascript');
-            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(vid)/'+vid + lh_inst.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+inst.tag+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
+            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(vid)/'+vid + lh_inst.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+inst.tag+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
             th.appendChild(s);
             lh_inst.startNewMessageCheck();
         }, <?php echo (int)(erLhcoreClassModelChatConfig::fetch('sync_sound_settings')->data['check_for_operator_msg']*1000); ?> );*/ ?>
     },
 
@@ -650,11 +650,11 @@ var lh_inst  = {
 
             var dynamic = this.dynamicAssigned.length > 0 ? '/(dyn)/' +  this.dynamicAssigned.join('/'): '';
 
             s.setAttribute('id','lhc_operator_message');
             s.setAttribute('type','text/javascript');
-            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(tz)/' + tzOffset + this.survey_id + '/(count_page)/1/(vid)/'+vid+'/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+this.tag+this.parseStorageArguments()+this.parseOptionsOnline()+this.parseOptions()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
+            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(tz)/' + tzOffset + this.survey_id + '/(count_page)/1/(vid)/'+vid+'/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+this.tag+this.parseStorageArguments()+this.parseOptionsOnline()+this.parseOptions()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
             th.appendChild(s);
         }
     },
 
     logPageView : function() {
@@ -663,26 +663,26 @@ var lh_inst  = {
         var s = document.createElement('script');
         var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
         var tzOffset = this.getTzOffset();
         s.setAttribute('id','lhc_log_pageview');
         s.setAttribute('type','text/javascript');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logpageview<?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>/(tz)/'+tzOffset+'/(vid)/' + vid + this.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+'?l='+locationCurrent+this.parseStorageArguments()+this.parseOptionsOnline()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logpageview<?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>/(tz)/'+tzOffset+'/(vid)/' + vid + this.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+'?l='+locationCurrent+this.parseStorageArguments()+this.parseOptionsOnline()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
         th.appendChild(s);
     },
 
     updateJSVars : function(vars){
         var xhr = new XMLHttpRequest();
-        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updatejsvars'+this.getAppendCookieArguments(), true);
+        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updatejsvars'+this.getAppendCookieArguments(), true);
         xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
         xhr.send( "data=" + encodeURIComponent( this.JSON.stringify(vars) ) );
     },
 
     storeEvents : function() {
         if (typeof <?php echo $chatOptionsVariable?>.events != 'undefined') {
             if (<?php echo $chatOptionsVariable?>.events.length > 0) {
                  var xhr = new XMLHttpRequest();
-                 xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logevent'+this.getAppendCookieArguments(), true);
+                 xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logevent'+this.getAppendCookieArguments(), true);
              	 xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
              	 xhr.send( "data=" + encodeURIComponent( this.JSON.stringify(<?php echo $chatOptionsVariable?>.events) ) );
              	 <?php echo $chatOptionsVariable?>.events = new Array();
             }
         }
@@ -722,11 +722,11 @@ var lh_inst  = {
     checkCookieTime : function() {
         if (!this.cookieDataPers['ex'] || this.cookieDataPers['ex'] < Math.round(Date.now()/100000000)) {
             this.cookieDataPers['ex'] = Math.round(Date.now()/100000000)+10;
             this.storePersistenCookie();
             var xhr = new XMLHttpRequest();
-            xhr.open( "GET", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/extendcookie/'+this.cookieDataPers.vid, true);
+            xhr.open( "GET", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/extendcookie/'+this.cookieDataPers.vid, true);
             xhr.send();
         }
     },
 
 	setVid : function(vid) {
@@ -744,11 +744,11 @@ var lh_inst  = {
 
 			if (old && old != this.cookieDataPers.vid) {
 				var inst = this;
 				setTimeout(function(){
 					var xhr = new XMLHttpRequest();
-			        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+inst.lang+'/chat/setnewvid', true);
+			        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+inst.lang+'/chat/setnewvid', true);
 			     	xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
 			     	xhr.send( "data=" + encodeURIComponent( inst.JSON.stringify({'vid':old,'new':vid}) ) );
 				},1000);
 			}
 		}
@@ -807,21 +807,21 @@ var lh_inst  = {
     	var inst = this;
     	if (typeof html2canvas == "undefined") {
 		   		var th = document.getElementsByTagName('head')[0];
 		        var s = document.createElement('script');
 		        s.setAttribute('type','text/javascript');
-		        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/html2canvas.min.js');?>');
+		        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('js/html2canvas.min.js');?>');
 		        th.appendChild(s);
 		        s.onreadystatechange = s.onload = function(){
 		        	inst.makeScreenshot();
 		        };
     	} else {
 		    	try {
 				  	html2canvas(document.body, {
 						  onrendered: function(canvas) {
 						         var xhr = new XMLHttpRequest();
-						         xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/file/storescreenshot'+inst.getAppendCookieArguments(), true);
+						         xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/file/storescreenshot'+inst.getAppendCookieArguments(), true);
 							     xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
 							     xhr.send( "data=" + encodeURIComponent( canvas.toDataURL() ) );
 						  }
 					});
 			   } catch(err) {
@@ -841,11 +841,11 @@ var lh_inst  = {
         var s = document.createElement('script');
         var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
         var tzOffset = this.getTzOffset();
         s.setAttribute('id','lhc_finish_shr');
         s.setAttribute('type','text/javascript');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/finishsession/(sharemode)/'+lh_inst.sharemode+lh_inst.getAppendCookieArguments());
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/finishsession/(sharemode)/'+lh_inst.sharemode+lh_inst.getAppendCookieArguments());
         th.appendChild(s);
         this.cobrowser = null;
     },
 
     cobrowse : null,
@@ -861,11 +861,11 @@ var lh_inst  = {
 
 	    	if (typeof TreeMirror == "undefined") {
 			   		var th = document.getElementsByTagName('head')[0];
 			        var s = document.createElement('script');
 			        s.setAttribute('type','text/javascript');
-			        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js');?>');
+			        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js');?>');
 			        th.appendChild(s);
 			        s.onreadystatechange = s.onload = function(){
 			        	inst.startCoBrowse(inst.sharehash,this.sharemode);
 			        };
 	    	} else {
@@ -967,11 +967,11 @@ var lh_inst  = {
         this.removeById('lhc_check_status');
         var th = document.getElementsByTagName('head')[0];
         var s = document.createElement('script');
         s.setAttribute('id','lhc_check_status');
         s.setAttribute('type','text/javascript');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckstatus<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(uaction)/'+sender+'/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckstatus<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(uaction)/'+sender+'/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
         th.appendChild(s);
     },
 
     checkStatusChat : function() {
     	if (<?php echo (int)erLhcoreClassModelChatConfig::fetch('checkstatus_timeout')->current_value > 0 ? 'true' : 'false' ?> || this.isProactivePending === 1) {
@@ -984,11 +984,11 @@ var lh_inst  = {
         }
     },
 
     refreshCustomFields : function() {
         var xhr = new XMLHttpRequest();
-        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/refreshcustomfields'+this.getAppendCookieArguments() , true);
+        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/refreshcustomfields'+this.getAppendCookieArguments() , true);
 	    xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
 	    xhr.send(this.parseOptions());
     },
 
     invitationUrl  :  '',
@@ -1030,11 +1030,11 @@ var lh_inst  = {
         var hashResume = this.cookieData.hash_resume ? '/(hash_resume)/'+this.cookieData.hash_resume : '';
         var th = document.getElementsByTagName('head')[0];
         var s = document.createElement('script');
         s.setAttribute('type','text/javascript');
         var optionsParts = options.split('_');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/htmlsnippet/'+messageId+'/'+optionsParts[0]+"/"+optionsParts[1]+'<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/htmlsnippet/'+messageId+'/'+optionsParts[0]+"/"+optionsParts[1]+'<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
         th.appendChild(s);
     },
 
     <?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/functions/send_notification.tpl.php')); ?>
 
@@ -1043,11 +1043,11 @@ var lh_inst  = {
     	var action = e.data.split(':')[0];
         var originDomain = e.origin.replace("http://", "").replace("https://", "").replace(/:(\d+)$/,'');
 
         // We allow to send events only from chat installation or page where script is embeded.
         if (
-            originDomain !== '<?php echo $_SERVER['HTTP_HOST']?>' &&
+            originDomain !== '<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?>' &&
             originDomain !== document.domain &&
             action != 'lhc_sizing_chat_survey' &&
             action != 'lh_survey_runed' &&
             action != 'lhc_end_cookies'
         ) {
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/container.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/container.tpl.php
index d3c40cfb254..bdb2f19ce49 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/container.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/container.tpl.php
@@ -6,17 +6,17 @@ $iconsStatuses['popup_image_url'] = ($theme !== false && $theme->popup_image_url
 $iconsStatuses['online_image_url'] = ($theme !== false && $theme->online_image_url !== false && strpos($theme->online_image_url, 'http') !== false);
 $iconsStatuses['offline_image_url'] = ($theme !== false && $theme->offline_image_url !== false && strpos($theme->offline_image_url, 'http') !== false);
 ?>
 <?php if ($theme !== false && $theme->modern_look == 0) : ?>
 this.iframe_html = '<div id="<?php echo $chatCSSLayoutOptions['container_id']?>" <?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ? 'style="height:100%"' : '' ?>>' +
-    '<?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header'])?><?php endif?><div id="<?php echo $chatCSSPrefix?>_header"><?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header_body'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header_body'])?><?php endif?><?php if ($theme === false || $theme->hide_close == 0) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a><?php endif; ?><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></div>' +
+    '<?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header'])?><?php endif?><div id="<?php echo $chatCSSPrefix?>_header"><?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header_body'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header_body'])?><?php endif?><?php if ($theme === false || $theme->hide_close == 0) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a><?php endif; ?><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></div>' +
     this.iframe_html + '</div>';
-raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;overflow:hidden;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #FFF;font-size: 12px;font-weight: bold;padding-left: 5px;line-height: 20px;} \n#<?php echo $chatCSSPrefix?>_min{float:left;padding:2px;}#<?php echo $chatCSSPrefix?>_remote_window,#<?php echo $chatCSSPrefix?>_close{padding:2px;float:right;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_close:hover,#<?php echo $chatCSSPrefix?>_min:hover,#<?php echo $chatCSSPrefix?>_remote_window:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) { .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position']?>}}";
+raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;overflow:hidden;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #FFF;font-size: 12px;font-weight: bold;padding-left: 5px;line-height: 20px;} \n#<?php echo $chatCSSPrefix?>_min{float:left;padding:2px;}#<?php echo $chatCSSPrefix?>_remote_window,#<?php echo $chatCSSPrefix?>_close{padding:2px;float:right;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_close:hover,#<?php echo $chatCSSPrefix?>_min:hover,#<?php echo $chatCSSPrefix?>_remote_window:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) { .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position']?>}}";
 <?php else : ?>
 this.iframe_html = '<div id="<?php echo $chatCSSLayoutOptions['container_id']?>" <?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ? 'style="height:100%"' : '' ?>>' +
                               '<a class="status-icon ' +
                               (this.isOnline == true ? 'online-status-icon' : 'offline-status-icon') +
-                              '" id="<?php echo $chatCSSPrefix?>_status-icon-restore" href="#" ><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></a><div id="<?php echo $chatCSSPrefix?>_header"><ul class="<?php echo $chatCSSPrefix?>-cf"><li><a href="#">&#9776;</a><ul class="<?php echo $chatCSSPrefix?>-cf"><?php if ($theme === false || $theme->hide_close == 0) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></li><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a></li><?php endif; ?></ul></li></ul><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a></div>' +
+                              '" id="<?php echo $chatCSSPrefix?>_status-icon-restore" href="#" ><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></a><div id="<?php echo $chatCSSPrefix?>_header"><ul class="<?php echo $chatCSSPrefix?>-cf"><li><a href="#">&#9776;</a><ul class="<?php echo $chatCSSPrefix?>-cf"><?php if ($theme === false || $theme->hide_close == 0) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></li><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a></li><?php endif; ?></ul></li></ul><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a></div>' +
                               this.iframe_html + '</div>';
 
-raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSLayoutOptions['container_id']?> .status-icon{display:none;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{display:inline-block;<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon.offline-status-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center center}<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/burger_menu_css.tpl.php')); ?> #<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;max-width: none}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #ffffff;font-size: 12px;font-weight: normal;line-height: 23px;position: absolute;background-color: red;border-radius: 37px;display: inline-block;padding-left: 8px;padding-right: 8px;margin-top: -5px;margin-left: -4px;} \n#<?php echo $chatCSSPrefix?>_min{float:right;padding:2px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($iconsStatuses['restore_image_url'] == false) : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php endif; if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_min:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;	overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) {ul.<?php echo $chatCSSPrefix?>-cf li ul a{padding:8px 14px!important} ul.<?php echo $chatCSSPrefix?>-cf li:hover ul, ul.<?php echo $chatCSSPrefix?>-cf li ul {top: 30px;} .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important}} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{display:none;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position_modern']?>}";
+raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSLayoutOptions['container_id']?> .status-icon{display:none;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{display:inline-block;<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon.offline-status-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center center}<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/burger_menu_css.tpl.php')); ?> #<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;max-width: none}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #ffffff;font-size: 12px;font-weight: normal;line-height: 23px;position: absolute;background-color: red;border-radius: 37px;display: inline-block;padding-left: 8px;padding-right: 8px;margin-top: -5px;margin-left: -4px;} \n#<?php echo $chatCSSPrefix?>_min{float:right;padding:2px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($iconsStatuses['restore_image_url'] == false) : ?><?php echo erLhcoreClassSystem::getHost()?><?php endif; if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_min:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;	overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) {ul.<?php echo $chatCSSPrefix?>-cf li ul a{padding:8px 14px!important} ul.<?php echo $chatCSSPrefix?>-cf li:hover ul, ul.<?php echo $chatCSSPrefix?>-cf li ul {top: 30px;} .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important}} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{display:none;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position_modern']?>}";
 <?php endif; ?>
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/dynamic_events.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/dynamic_events.tpl.php
index 65f0d78eb01..693072c3417 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/dynamic_events.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/dynamic_events.tpl.php
@@ -11,11 +11,11 @@ lh_inst.outWindowCallback = function(e) {
     if (lh_inst.timeoutStatusWidgetOpen == 0 && lh_inst.chat_started == false) {
         e = e ? e : window.event;
         var from = e.relatedTarget || e.toElement;
         if (!from || from.nodeName == "HTML") {                
             lh_inst.stopCheckNewMessage();
-            lh_inst.showStartWindow('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
+            lh_inst.showStartWindow('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
             lh_inst.removeEvent(document,"mouseout",lh_inst.outWindowCallback);
         }
     }
 };    
 lh_inst.addEvent(document, "mouseout", lh_inst.outWindowCallback);
@@ -34,11 +34,11 @@ lh_inst.iddleEventResetActivity = function() {
     this.iddleTimeoutActivity = setTimeout(function(){
         
         clearTimeout(_that.iddleTimeoutActivity); 
         
         lh_inst.stopCheckNewMessage();
-        lh_inst.showStartWindow('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
+        lh_inst.showStartWindow('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
  
         ['mousemove','mousedown','click','scroll','keypress','load'].forEach(function(element) {
             lh_inst.removeEvent(window,element,lh_inst.resetTimeoutIddle);   
         });
         
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey.tpl.php
index ece210a69b9..d53dd0812f6 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey.tpl.php
@@ -1,7 +1,7 @@
 showSurvey : function() {
     if (lh_inst.cookieData.hash && lh_inst.hasSurvey == true && lh_inst.surveyShown == false){
         var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
         this.surveyShown = true;
-        document.getElementById('<?php echo $chatCSSPrefix?>_iframe').contentWindow.location.replace("<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
+        document.getElementById('<?php echo $chatCSSPrefix?>_iframe').contentWindow.location.replace("<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
     }
 },
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey_page.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey_page.tpl.php
index d7c014a77ca..e4ff2ef6886 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey_page.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/part/show_survey_page.tpl.php
@@ -1,7 +1,7 @@
 showSurvey : function() {
     if (this.cookieData.hash && this.hasSurvey == true && this.surveyShown == false){
         var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
         this.surveyShown = true;
-        document.getElementById('<?php echo $chatCSSPrefix?>_iframe_page').contentWindow.location.replace("<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget/(mode)/embed<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
+        document.getElementById('<?php echo $chatCSSPrefix?>_iframe_page').contentWindow.location.replace("<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget/(mode)/embed<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
     }
 },
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/send_notification.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/send_notification.tpl.php
index 425fd882313..60044bc4756 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/send_notification.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/send_notification.tpl.php
@@ -74,11 +74,11 @@ sendNotification : function() {
             authToken: token ? btoa(String.fromCharCode.apply(null, new Uint8Array(token))) : null,
             contentEncoding : contentEncoding
         });
 
         var xhr = new XMLHttpRequest();
-        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+that.lang+'/notifications/subscribe<?php $theme !== false ? print '/(theme)/' . (is_object($theme) ? $theme->id : $theme) : ''?>' + (subscribe == true ? '/(action)/sub' : '/(action)/unsub') + that.getAppendCookieArguments(), true);
+        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+that.lang+'/notifications/subscribe<?php $theme !== false ? print '/(theme)/' . (is_object($theme) ? $theme->id : $theme) : ''?>' + (subscribe == true ? '/(action)/sub' : '/(action)/unsub') + that.getAppendCookieArguments(), true);
         xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
         xhr.send( "data=" + encodeURIComponent( payload ) );
     }
 
     var that = this;
@@ -140,8 +140,8 @@ sendNotification : function() {
 },
 
 readNotification : function(chat_id, hash) {
     <?php $notificationsSettings = erLhcoreClassModelChatConfig::fetch('notifications_settings')->data_value;?>
     <?php if (isset($notificationsSettings['enabled']) && $notificationsSettings['enabled'] == 1) : ?>
-        this.showStartWindow("<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/notifications/read/<?php $theme !== false ? print '/(theme)/'.(is_object($theme) ? $theme->id : $theme) : ''?>/(id)/"+chat_id+"/(hashread)/"+hash+"/(mode)/widget");
+        this.showStartWindow("<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/notifications/read/<?php $theme !== false ? print '/(theme)/'.(is_object($theme) ? $theme->id : $theme) : ''?>/(id)/"+chat_id+"/(hashread)/"+hash+"/(mode)/widget");
     <?php endif; ?>
 },
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_start_window.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_start_window.tpl.php
index 3df473ee66c..8a45f132183 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_start_window.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_start_window.tpl.php
@@ -11,11 +11,11 @@ preloadWidget : function() {
     if (this.is_full_height === true) {
         widgetHeight = 100;
         widgetHeightUnit = '%';
     }
 
-    this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
+    this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
 
     this.iframePreloaded = true;
 
     this.iframe_html = '<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/before_iframe_container.tpl.php')); ?>'+'<div id="<?php echo $chatCSSPrefix?>_iframe_container" <?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ? 'style="height: calc(100% - 25px);"' : '' ?>><iframe id="<?php echo $chatCSSPrefix?>_iframe" allowTransparency="true" class="<?php echo $chatCSSPrefix?>-loading" frameborder="0" ' +
         ( this.initial_iframe_url != '' ? ' src="'    + this.initial_iframe_url + '"' : '' ) +
@@ -75,11 +75,11 @@ showStartWindow : function(url_to_open,delayShow) {
        		this.chatOpenedCallback('internal_invitation');	
             this.initial_iframe_url = url_to_open+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
             this.iframeCustomUrl = true;
       } else {
       		this.chatOpenedCallback(this.isOnline == false ? 'internal_offline' : 'internal');	
-            this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
+            this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
       };
        
       this.addClass(document.body,'<?php echo $chatCSSPrefix?>-opened');
       
       lh_inst.surveyShown = false;                             
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_status_widget.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_status_widget.tpl.php
index 936694602ec..f0f552a784d 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_status_widget.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/functions/show_status_widget.tpl.php
@@ -15,11 +15,11 @@ showStatusWidget : function() {
       	$iconsStatuses = array(
       	    'online_image_url' => ($theme !== false && $theme->online_image_url !== false && strpos($theme->online_image_url, 'http') !== false),
       	    'offline_image_url' => ($theme !== false && $theme->offline_image_url !== false && strpos($theme->offline_image_url, 'http') !== false)
       	);          	          	
       	?>
-    	var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background-image:url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>')}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;-moz-box-shadow:<?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);padding:5px 0px 0px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{padding:32px 15px 9px 31px;background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status']?>}}\n";
+    	var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background-image:url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>')}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;-moz-box-shadow:<?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);padding:5px 0px 0px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{padding:32px 15px 9px 31px;background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status']?>}}\n";
     	this.addCss(raw_css<?php ($theme !== false && $theme->custom_status_css_front !== '') ? print '+\''.str_replace(array("\n","\r","'"), array('','','\\\''), $theme->custom_status_css_front).'\'' : '' ?>);
 	};
     <?php else : ?>
         var statusTEXT = '<?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_status'])) : ?><?php echo str_replace(array("\n","\r","'"), array('','','\\\''),$theme->bot_configuration_array['custom_html_status'])?><?php endif?><i class="<?php echo $chatCSSPrefix?>-invitation-status" onclick="return lh_inst.lh_openchatWindow()">!</i><a id="'+(this.isOnline == true ? 'online-icon' : 'offline-icon')+'" class="status-icon" href="#" onclick="return lh_inst.lh_openchatWindow()" ></a>';
 
@@ -29,11 +29,11 @@ showStatusWidget : function() {
         $iconsStatuses = array(
             'online_image_url' => ($theme !== false && $theme->online_image_url !== false && strpos($theme->online_image_url, 'http') !== false),
             'offline_image_url' => ($theme !== false && $theme->offline_image_url !== false && strpos($theme->offline_image_url, 'http') !== false)
         );
         ?>
-        var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-invitation-status{display:none;position:absolute;}#<?php echo $chatCSSPrefix?>_status_container.<?php echo $chatCSSPrefix?>_invitation-mode .<?php echo $chatCSSPrefix?>-invitation-status{width: 16px;height:16px;padding: 2px;border-radius: 10px;text-align: center;font-weight: bold;color: #FFF;background-color: red;display: inline-block;}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover_modern']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;padding:5px 0px 0px 5px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position_modern']?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status_modern']?>}}\n";
+        var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-invitation-status{display:none;position:absolute;}#<?php echo $chatCSSPrefix?>_status_container.<?php echo $chatCSSPrefix?>_invitation-mode .<?php echo $chatCSSPrefix?>-invitation-status{width: 16px;height:16px;padding: 2px;border-radius: 10px;text-align: center;font-weight: bold;color: #FFF;background-color: red;display: inline-block;}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover_modern']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;padding:5px 0px 0px 5px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position_modern']?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status_modern']?>}}\n";
         this.addCss(raw_css<?php ($theme !== false && $theme->custom_status_css_front !== '') ? print '+\''.str_replace(array("\n","\r","'"), array('','','\\\''), $theme->custom_status_css_front).'\'' : '' ?>);
     };
     <?php endif; ?>
 
 	<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/we_here.tpl.php')); ?>
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/getstatus_migrate.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/getstatus_migrate.tpl.php
index 176ead2e32d..e82fc263ca4 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/getstatus_migrate.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/getstatus_migrate.tpl.php
@@ -40,11 +40,11 @@ lh_inst.lh_openchatWindow = function(){
 }
 
 <?php $lang = erLhcoreClassSystem::instance()->SiteAccess != 'site_admin' ?  erLhcoreClassSystem::instance()->SiteAccess . '/' : ''; ?>
 
 var LHC_API = LHC_API||{};
-LHC_API.args = {'lang':'<?php echo $lang?>',mode:'<?php echo $mode?>'<?php (isset($position) && $position == 'api') ? print ",position:'api'" : ''?>,lhc_base_url:'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('/')?>',domain: lhc_domain, wheight:<?php isset($wheight) ? print (int)$wheight : print 450?>, wwidth:<?php isset($wwidth) ? print (int)$wwidth : print 350?>,pheight:520,pwidth:500<?php if (is_array($depId) && !empty($depId)) : ?>,department:[<?php echo implode(',',$depId)?>]<?php endif;?><?php if ($leaveamessage == true) : ?>,leaveamessage:true<?php endif; ?><?php if ($disable_pro_active == true) : ?>,proactive:false<?php else : ?>,check_messages:true<?php endif;?><?php isset($uparams['theme']) & is_numeric($uparams['theme']) ? print ',theme:' . (int)$uparams['theme'] : ''?>};
+LHC_API.args = {'lang':'<?php echo $lang?>',mode:'<?php echo $mode?>'<?php (isset($position) && $position == 'api') ? print ",position:'api'" : ''?>,lhc_base_url:'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('/')?>',domain: lhc_domain, wheight:<?php isset($wheight) ? print (int)$wheight : print 450?>, wwidth:<?php isset($wwidth) ? print (int)$wwidth : print 350?>,pheight:520,pwidth:500<?php if (is_array($depId) && !empty($depId)) : ?>,department:[<?php echo implode(',',$depId)?>]<?php endif;?><?php if ($leaveamessage == true) : ?>,leaveamessage:true<?php endif; ?><?php if ($disable_pro_active == true) : ?>,proactive:false<?php else : ?>,check_messages:true<?php endif;?><?php isset($uparams['theme']) & is_numeric($uparams['theme']) ? print ',theme:' . (int)$uparams['theme'] : ''?>};
 (function() {
 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
-var date = new Date();po.src = '//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js');?>?v1'+(""+date.getFullYear() + date.getMonth() + date.getDate());
+var date = new Date();po.src = '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js');?>?v1'+(""+date.getFullYear() + date.getMonth() + date.getDate());
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 })();
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/native_placement.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/native_placement.tpl.php
index ba3c5d37f1a..2de6b1d00b4 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/native_placement.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/native_placement.tpl.php
@@ -1 +1 @@
-document.getElementById('<?php echo $chatCSSPrefix?>_status_container').innerHTML = '<p class="<?php echo $chatCSSPrefix?>-status-native-'+(this.isOnline == true ? 'online' : 'offline')+'"><a href="#" onclick="return lh_inst.lh_openchatWindow()">'+(this.isOnline == true ? '<img src="<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->online_text !== '') : print htmlspecialchars_decode($theme->online_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is online...')?><?php endif?>' : '<img src="<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->offline_text != '') : print htmlspecialchars_decode($theme->offline_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is offline...')?><?php endif;?>')+'</a></p>';
+document.getElementById('<?php echo $chatCSSPrefix?>_status_container').innerHTML = '<p class="<?php echo $chatCSSPrefix?>-status-native-'+(this.isOnline == true ? 'online' : 'offline')+'"><a href="#" onclick="return lh_inst.lh_openchatWindow()">'+(this.isOnline == true ? '<img src="<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->online_text !== '') : print htmlspecialchars_decode($theme->online_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is online...')?><?php endif?>' : '<img src="<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->offline_text != '') : print htmlspecialchars_decode($theme->offline_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is offline...')?><?php endif;?>')+'</a></p>';
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/we_here_substatus.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/we_here_substatus.tpl.php
index ee11904c790..2b98a94a1bf 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/we_here_substatus.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatus/we_here_substatus.tpl.php
@@ -1,9 +1,9 @@
 var titleText = (typeof <?php echo $chatOptionsVariable;?>.opt.nh_title_text != 'undefined') ? <?php echo $chatOptionsVariable;?>.opt.nh_title_text : <?php if ($theme !== false && $theme->need_help_header !== '') : print json_encode($theme->need_help_header); else : ?><?php echo json_encode(htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Need help?'),ENT_QUOTES))?><?php endif;?>;
 var subTitleText = (typeof <?php echo $chatOptionsVariable;?>.opt.nh_sub_title_text != 'undefined') ? <?php echo $chatOptionsVariable;?>.opt.nh_sub_title_text : <?php if ($theme !== false && $theme->need_help_text !== '') : print json_encode($theme->need_help_text); else : ?><?php echo json_encode(htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Our staff are always ready to help'),ENT_QUOTES))?><?php endif;?>;
 <?php $iconsStatuses['need_help_image_url'] = ($theme !== false && $theme->need_help_image_url !== false && strpos($theme->need_help_image_url, 'http') !== false); ?>
-var imageTooltip = (typeof <?php echo $chatOptionsVariable;?>.opt.nh_image != 'undefined') ? <?php echo $chatOptionsVariable;?>.opt.nh_image : '<?php if ($theme !== false && $theme->need_help_image_url !== false) : print $theme->need_help_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/operator.png');?><?php endif;?>';
+var imageTooltip = (typeof <?php echo $chatOptionsVariable;?>.opt.nh_image != 'undefined') ? <?php echo $chatOptionsVariable;?>.opt.nh_image : '<?php if ($theme !== false && $theme->need_help_image_url !== false) : print $theme->need_help_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/operator.png');?><?php endif;?>';
 
 subStatus = '<div id="<?php echo $chatCSSPrefix?>_need_help_container" style="<?php echo $currentPosition[$nh_hor_pos]?>">'+
 '<span id="<?php echo $chatCSSPrefix?>_need_help_triangle" style="<?php echo $currentPosition['nh_tr_pos']?>"></span>'+
 '<i id="<?php echo $chatCSSPrefix?>_need_help_close" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" href="#">&#xd7;</i>';
 if (imageTooltip !== false) {
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/getstatusembed.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/getstatusembed.tpl.php
index 80c4fac409c..8779222f094 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/getstatusembed.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/getstatusembed.tpl.php
@@ -32,11 +32,11 @@ var lh_inst_page  = {
     hide : function() {
         if (!this.cookieData.hash || this.hasSurvey == false || this.surveyShown == true) {
             var th = document.getElementsByTagName('head')[0];
             var s = document.createElement('script');
             s.setAttribute('type','text/javascript');
-            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidgetclosed')?>/(eclose)/t'+this.getAppendCookieArguments());
+            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidgetclosed')?>/(eclose)/t'+this.getAppendCookieArguments());
             th.appendChild(s);
             s.onreadystatechange = s.onload = function(){
                 lh_inst_page.removeCookieAttr('hash');
                 lh_inst_page.showStartWindow();
                 lh_inst_page.surveyShown = false;
@@ -176,11 +176,11 @@ var lh_inst_page  = {
         var mobileFullHeight = typeof <?php echo $chatOptionsVariablePage?>.opt.mobile === 'undefined' || <?php echo $chatOptionsVariablePage?>.opt.mobile === true;
 
         if ( url_to_open != undefined ) {
             this.initial_iframe_url = url_to_open+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+'&dt='+encodeURIComponent(document.title)+this.parseStorageArguments();
         } else {
-            this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidget')?><?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>/(mode)/embed" + (mobileFullHeight === false ? '/(mobile)/false' : '') + this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments();
+            this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidget')?><?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>/(mode)/embed" + (mobileFullHeight === false ? '/(mobile)/false' : '') + this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments();
         };
 
         if (mobileFullHeight === true) {
             var raw_css = "@media only screen and (max-device-width : 640px) { #<?php echo $chatCSSPrefix?>_status_container_page{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_status_container_page iframe{width:100% !important;height: 100%!important}}";
             this.addCss(raw_css);
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/lists/op_msg_row_nick.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/lists/op_msg_row_nick.tpl.php
index adb355de45b..6672a24119b 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/lists/op_msg_row_nick.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/lists/op_msg_row_nick.tpl.php
@@ -8,29 +8,29 @@
     ) : ?>
         <i title="<?php echo htmlspecialchars($msg['name_support'])?>" class="chat-operators mi-fs15 mr-0">
             <?php if ($chat->bot->has_photo) : ?>
             <img class="profile-msg-pic" src="<?php echo $chat->bot->photo_path?>" alt="">
             <?php else : ?>
-            <img class="profile-msg-pic" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($chat->bot->avatar)?>" alt="" />
+            <img class="profile-msg-pic" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($chat->bot->avatar)?>" alt="" />
             <?php endif; ?>
         </i>
     <?php elseif ($msg['user_id'] > 0 && isset($theme) && $theme !== false && isset($theme->bot_configuration_array['bubble_style_profile']) && $theme->bot_configuration_array['bubble_style_profile'] == 1 &&
         ($userMessage = erLhcoreClassModelUser::fetch($msg['user_id'],true)) && $userMessage instanceof erLhcoreClassModelUser && $userMessage->has_photo_avatar
     ) : ?>
             <i title="<?php echo htmlspecialchars($msg['name_support'])?>" class="chat-operators mi-fs15 mr-0">
                 <?php if ($userMessage->has_photo) : ?>
                     <img class="profile-msg-pic" src="<?php echo $userMessage->photo_path?>" alt="">
                 <?php else : ?>
-                    <img class="profile-msg-pic" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($userMessage->avatar)?>" alt="" />
+                    <img class="profile-msg-pic" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($userMessage->avatar)?>" alt="" />
                 <?php endif; ?>
             </i>
     <?php elseif (isset($theme) && $theme !== false && isset($theme->bot_configuration_array['bubble_style_profile']) && $theme->bot_configuration_array['bubble_style_profile'] == 1 && $theme->operator_image_avatar !== false) : ?>
         <i title="<?php echo htmlspecialchars($msg['name_support'])?>" class="chat-operators mi-fs15 mr-0">
             <?php if ($theme->operator_image_url !== false) : ?>
                 <img class="profile-msg-pic" src="<?php echo $theme->operator_image_url?>" alt="">
             <?php else : ?>
-                <img class="profile-msg-pic" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
+                <img class="profile-msg-pic" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
             <?php endif; ?>
         </i>
     <?php else : ?>
         <i title="<?php echo htmlspecialchars($msg['name_support'])?>" class="material-icons chat-operators mi-fs15 mr-0"><?php if (isset($react) && $react == true) : ?>&#xf10d;<?php else : ?>account_box<?php endif; ?> </i>
         <span class="op-nick-title"><?php echo htmlspecialchars($msg['name_support'])?></span>
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_name_support_img.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_name_support_img.tpl.php
index 761b6ba3161..39fdf11cf4c 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_name_support_img.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_name_support_img.tpl.php
@@ -1,5 +1,5 @@
 <?php if ($user->has_photo) : ?>
 <img width="48" height="48" src="<?php echo $user->photo_path?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
 <?php else : ?>
-<img width="48" height="48" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
+<img width="48" height="48" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
 <?php endif; ?>
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_start_chat.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_start_chat.tpl.php
index d411408d71f..1aaeb95c591 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_start_chat.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/part/operator_profile_start_chat.tpl.php
@@ -3,11 +3,11 @@
      	<?php if ($theme !== false && $theme->operator_image_avatar !== false) : ?>
 
         <?php if ($theme->operator_image_url !== false) : ?>
      			<img width="48" height="48" src="<?php echo $theme->operator_image_url?>" alt="" />
         <?php else : ?>
-                <img width="48" height="48" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
+                <img width="48" height="48" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
         <?php endif; ?>
 
      	<?php else : ?>
      		<i class="icon-assistant material-icons">
                 <?php if (isset($react) && $react == true) : ?>&#xf10d;<?php else : ?>account_box<?php endif; ?>
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/chatbox.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/chatbox.tpl.php
index 5cec8b8a560..5f3e0f0d941 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/chatbox.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/chatbox.tpl.php
@@ -1 +1 @@
-<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_chatbox_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" rel="noreferrer" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
+<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_chatbox_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" rel="noreferrer" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/faq.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/faq.tpl.php
index b0e2ddb4ac1..45251f9cec9 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/faq.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/faq.tpl.php
@@ -1 +1 @@
-<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_faq_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank" rel="noreferrer"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
+<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_faq_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank" rel="noreferrer"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/live_help.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/live_help.tpl.php
index a5785169050..be4ea49a296 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/live_help.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/live_help.tpl.php
@@ -1,2 +1,2 @@
 <?php $iconsStatuses['copyright_image_url'] = ($theme !== false && $theme->copyright_image_url !== false && strpos($theme->copyright_image_url, 'http') !== false);          	          	
-if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
+if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/questionary.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/questionary.tpl.php
index 3a231274a37..8991d3263ce 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/questionary.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchat/widget_brand/questionary.tpl.php
@@ -1 +1 @@
-<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_questionary_title"><a rel="noreferrer" title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
+<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_questionary_title"><a rel="noreferrer" title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhchatbox/embed.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchatbox/embed.tpl.php
index 6da586d12cc..d101643418c 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchatbox/embed.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchatbox/embed.tpl.php
@@ -7,11 +7,11 @@ var lhc_ChatboxPage = {
     },
 	cookieData : {},
 
 	showVotingForm : function() {
 		  var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme : ''?>/(mode)/embed/(identifier)/"+<?php echo $chatboxOptionsVariablePage;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariablePage;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme : ''?>/(mode)/embed/(identifier)/"+<?php echo $chatboxOptionsVariablePage;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariablePage;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
 
    		  this.iframe_html = '<iframe id="lhc_sizing_chatbox_page" allowTransparency="true" scrolling="no" frameborder="0" ' +
                        ( this.initial_iframe_url != '' ? ' src="'    + this.initial_iframe_url + '"' : '' ) +
                        ' width="100%"' +
                        ' height="300"' +
diff --git a/lhc_web/design/defaulttheme/tpl/lhchatbox/embedcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchatbox/embedcode.tpl.php
index 5ff70fb93a9..5c086acb93c 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchatbox/embedcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchatbox/embedcode.tpl.php
@@ -53,11 +53,11 @@ function generateEmbedCode(){
     <?php include(erLhcoreClassDesign::designtpl('lhchatbox/getstatus/options_variable_page.tpl.php')); ?>
     
     var script = '<script type="text/javascript">'+"\nvar <?php echo $chatboxOptionsVariablePage?> = {hashchatbox:'empty',identifier:'default'};\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/embed'+chat_height+id_theme+"';\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/embed'+chat_height+id_theme+"';\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(id_tag+script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhchatbox/getstatus.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchatbox/getstatus.tpl.php
index 7e890167c23..bf9ad86866d 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchatbox/getstatus.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchatbox/getstatus.tpl.php
@@ -192,11 +192,11 @@ var lhc_Chatbox = {
    hide : function() {
    		
     	var th = document.getElementsByTagName('head')[0];
         var s = document.createElement('script');
         s.setAttribute('type','text/javascript');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidgetclosed')?>');
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidgetclosed')?>');
         th.appendChild(s);
         this.removeById('lhc_container_chatbox');
         this.removeCookieAttr('pos');
         this.removeCookieAttr('is_opened',0);
         this.removeCookieAttr('m');
@@ -241,11 +241,11 @@ var lhc_Chatbox = {
 	showVotingForm : function() {
 
    		  this.removeById('lhc_container_chatbox');
 		  var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
 		  
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>/(identifier)/"+<?php echo $chatboxOptionsVariable;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariable;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>/(identifier)/"+<?php echo $chatboxOptionsVariable;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariable;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
 
    		  if (window.innerWidth < 1024) {
           		window.open(this.initial_iframe_url,"_blank");
           		return;
           };
@@ -257,14 +257,14 @@ var lhc_Chatbox = {
                        ' width="<?php echo $widthwidget?>"' +
                        ' height="<?php echo $heightwidget?>"' +
                        ' style="width: <?php echo $widthwidget?>px; height: <?php echo $heightwidget?>px;"></iframe></div>';
 
           this.iframe_html = '<div id="lhc_container_chatbox">' +
-                              '<div id="lhc_chatbox_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/chatbox.tpl.php')); ?><?php if ($show_content === false) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_chatbox_close"><img src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if ($disable_min === false) : ?><a href="#" id="lhc_chatbox_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><?php endif;?></div><div id="lhc_iframe_container">' +
+                              '<div id="lhc_chatbox_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/chatbox.tpl.php')); ?><?php if ($show_content === false) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_chatbox_close"><img src="<?php echo erLhcoreClassSystem::getHost()?><?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if ($disable_min === false) : ?><a href="#" id="lhc_chatbox_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><?php endif;?></div><div id="lhc_iframe_container">' +
                               this.iframe_html + '</div></div>';
 
-          raw_css = ".lhc-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n.lhc-min{height:35px !important}\n#lhc_container_chatbox * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;font-size:12px\;line-height:100%\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_chatbox img {border:0;}\n#lhc_chatbox_title{float:left;}\n#lhc_chatbox_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_chatbox_close,#lhc_chatbox_min{padding:2px;float:right;}.lhc-min #lhc_chatbox_min{background-image:url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#lhc_chatbox_min{width:14px;height:14px;background:url(<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>) no-repeat center center;}\n\n#lhc_chatbox_close:hover,#lhc_chatbox_min:hover{opacity:0.4}\n#lhc_container_chatbox {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_chatbox iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_chatbox iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_chatbox #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_chatbox{margin-bottom:5px;position:relative;right:0 !important;bottom:0 !important;top:0 !important}#lhc_container_chatbox iframe{width:100% !important}}";
+          raw_css = ".lhc-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n.lhc-min{height:35px !important}\n#lhc_container_chatbox * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;font-size:12px\;line-height:100%\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_chatbox img {border:0;}\n#lhc_chatbox_title{float:left;}\n#lhc_chatbox_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_chatbox_close,#lhc_chatbox_min{padding:2px;float:right;}.lhc-min #lhc_chatbox_min{background-image:url(<?php echo erLhcoreClassSystem::getHost()?><?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#lhc_chatbox_min{width:14px;height:14px;background:url(<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>) no-repeat center center;}\n\n#lhc_chatbox_close:hover,#lhc_chatbox_min:hover{opacity:0.4}\n#lhc_container_chatbox {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_chatbox iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_chatbox iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_chatbox #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_chatbox{margin-bottom:5px;position:relative;right:0 !important;bottom:0 !important;top:0 !important}#lhc_container_chatbox iframe{width:100% !important}}";
 
           if (!this.cssWasAdded) {
           		this.cssWasAdded = true;
           		this.addCss(raw_css<?php ($theme !== false && $theme->custom_container_css !== '') ? print '+\''.str_replace(array("\n","\r"), '', $theme->custom_container_css).'\'' : '' ?>);
 		  };
@@ -291,11 +291,11 @@ var lhc_Chatbox = {
    },
 
    showStatusWidget : function() {
    		<?php if ($show_content === false) : ?>
        var statusTEXT = '<a id="chatbox-icon" class="status-icon" href="#" >'+<?php echo $chatboxOptionsVariable;?>.status_text+'</a>';
-       var raw_css = "#lhc_chatbox_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_chatbox_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/emotion_amazing.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_chatbox_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_chatbox_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;line-height:100%;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_chatbox_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
+       var raw_css = "#lhc_chatbox_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_chatbox_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/emotion_amazing.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_chatbox_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_chatbox_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;line-height:100%;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_chatbox_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        this.addCss(raw_css<?php ($theme !== false && $theme->custom_status_css !== '') ? print '+\''.str_replace(array("\n","\r"), '', $theme->custom_status_css).'\'' : '' ?>);
        var htmlStatus = '<div id="lhc_chatbox_container">'+statusTEXT+'</div>';
        var fragment = this.appendHTML(htmlStatus);
        document.body.insertBefore(fragment, document.body.childNodes[0]);
        var lhc_obj = this;
diff --git a/lhc_web/design/defaulttheme/tpl/lhchatbox/htmlcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhchatbox/htmlcode.tpl.php
index 8ad394f3128..5e09e5a6bbe 100644
--- a/lhc_web/design/defaulttheme/tpl/lhchatbox/htmlcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhchatbox/htmlcode.tpl.php
@@ -124,11 +124,11 @@ function generateEmbedCode(){
 	<?php include(erLhcoreClassDesign::designtpl('lhchatbox/getstatus/options_variable.tpl.php')); ?>
 	
     var script = '<script type="text/javascript">'+"\nvar <?php echo $chatboxOptionsVariable?> = {hashchatbox:'empty',identifier:'default',status_text:'"+textStatus+"'};\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/getstatus'+id_position+top+id_disable_responsive+topposition+widthwidget+id_theme+heightwidget+chat_height+show_content+show_min+dis_min+"';\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/getstatus'+id_position+top+id_disable_responsive+topposition+widthwidget+id_theme+heightwidget+chat_height+show_content+show_min+dis_min+"';\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit.tpl.php b/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit.tpl.php
index 9b6c1666411..17c3485d7d3 100644
--- a/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit.tpl.php
@@ -1 +1 @@
-var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'chat','lhcbase':'<?php echo (erLhcoreClassSystem::$httpsMode == true ? 'https://' : 'http://').$_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : $_SERVER['HTTP_HOST'])?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'chat_hash':'<?php echo $browse->chat->hash?>','chat_id':<?php echo $browse->chat_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
\ No newline at end of file
+var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'chat','lhcbase':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost()))?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'chat_hash':'<?php echo $browse->chat->hash?>','chat_id':<?php echo $browse->chat_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit_onlineuser.tpl.php b/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit_onlineuser.tpl.php
index 75040eb0e63..b7fe8c266be 100644
--- a/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit_onlineuser.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhcobrowse/operatorinit_onlineuser.tpl.php
@@ -1 +1 @@
-var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'onlineuser','lhcbase':'<?php echo (erLhcoreClassSystem::$httpsMode == true ? 'https://' : 'http://').$_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value)?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'online_user_hash':'<?php echo $browse->online_user->vid?>','online_user_id':<?php echo $browse->online_user_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
\ No newline at end of file
+var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'onlineuser','lhcbase':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value)?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'online_user_hash':'<?php echo $browse->online_user->vid?>','online_user_id':<?php echo $browse->online_user_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhcobrowse/userinit.tpl.php b/lhc_web/design/defaulttheme/tpl/lhcobrowse/userinit.tpl.php
index d53565ed15f..d1c713c4082 100644
--- a/lhc_web/design/defaulttheme/tpl/lhcobrowse/userinit.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhcobrowse/userinit.tpl.php
@@ -1,3 +1,3 @@
 if(typeof formsEnabled == "undefined") var formsEnabled = false;
-this.cobrowser = new LHCCoBrowser({'formsenabled':formsEnabled,'chat_hash':this.sharehash,'nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : $_SERVER['HTTP_HOST'])?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'trans':{'operator_watching':<?php echo json_encode(htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Screen shared, click to finish'),ENT_QUOTES))?>},'url':'<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/storenodemap/(sharemode)/'+inst.sharemode+inst.getAppendCookieArguments()+'/?url='+encodeURIComponent(location.href.match(/^(.*\/)[^\/]*$/)[1])});
+this.cobrowser = new LHCCoBrowser({'formsenabled':formsEnabled,'chat_hash':this.sharehash,'nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost()))?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'trans':{'operator_watching':<?php echo json_encode(htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Screen shared, click to finish'),ENT_QUOTES))?>},'url':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/storenodemap/(sharemode)/'+inst.sharemode+inst.getAppendCookieArguments()+'/?url='+encodeURIComponent(location.href.match(/^(.*\/)[^\/]*$/)[1])});
 this.cobrowser.startMirroring();
\ No newline at end of file
diff --git a/lhc_web/design/defaulttheme/tpl/lhexport/xml.tpl.php b/lhc_web/design/defaulttheme/tpl/lhexport/xml.tpl.php
index ed31db041df..f30058d6a7b 100644
--- a/lhc_web/design/defaulttheme/tpl/lhexport/xml.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhexport/xml.tpl.php
@@ -1,10 +1,10 @@
 <?php // Do not edit this file but create an override ?>
 <?php echo '<?xml version="1.0" encoding="utf-8"?>';?>
 <chat>
 <id><![CDATA[ <?php echo $chat->id?> ]]></id>
-<url><![CDATA[http://<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/single')?>/<?php echo $chat->id?>]]></url>
+<url><![CDATA[<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/single')?>/<?php echo $chat->id?>]]></url>
 <requested_by><![CDATA[ <?php echo htmlspecialchars($chat->email)?> ]]></requested_by>
 <created_at type="datetime"><?php echo date('c',$chat->time)?></created_at>
 <page_url><![CDATA[ <?php echo htmlspecialchars($chat->referrer)?> ]]></page_url>
 <page_referrer><![CDATA[ <?php echo htmlspecialchars($chat->session_referrer)?> ]]></page_referrer>
 <chat_initiator><![CDATA[ <?php echo $chat->chat_initiator?> ]]></chat_initiator>
diff --git a/lhc_web/design/defaulttheme/tpl/lhfaq/embed.tpl.php b/lhc_web/design/defaulttheme/tpl/lhfaq/embed.tpl.php
index 2bf912f3569..cd15d0b0bda 100644
--- a/lhc_web/design/defaulttheme/tpl/lhfaq/embed.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhfaq/embed.tpl.php
@@ -1,11 +1,11 @@
 <?php include(erLhcoreClassDesign::designtpl('lhfaq/getstatus/options_variable.tpl.php')); ?>
 var lhc_FAQEmbed = function() {
 	var self = this;
 	this.showVotingForm = function() {
 		  var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
    		  this.iframe_html = '<iframe id="lhcfaq_iframe_embed" allowTransparency="true" scrolling="no" class="loading" frameborder="0" ' +
                        ( this.initial_iframe_url != '' ? ' src="'    + this.initial_iframe_url + '"' : '' ) +
                        ' width="100%"' +
                        ' height="350"' +
                        ' style="width: 100%; height: 350px;"></iframe>';
diff --git a/lhc_web/design/defaulttheme/tpl/lhfaq/embedcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhfaq/embedcode.tpl.php
index b2cc3739bc1..86d64dc4e10 100644
--- a/lhc_web/design/defaulttheme/tpl/lhfaq/embedcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhfaq/embedcode.tpl.php
@@ -47,11 +47,11 @@ function generateEmbedCode(){
     <?php include(erLhcoreClassDesign::designtpl('lhfaq/getstatus/options_variable.tpl.php')); ?>
     
     var script = '<script type="text/javascript">'+"\nvar <?php echo $faqOptionsVariable;?> = {url:'replace_me_with_dynamic_url',identifier:''};\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/embed'+id_theme+"';\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/embed'+id_theme+"';\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(id_tag+script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhfaq/getstatus.tpl.php b/lhc_web/design/defaulttheme/tpl/lhfaq/getstatus.tpl.php
index 7ee8e9fdfeb..80238290a04 100644
--- a/lhc_web/design/defaulttheme/tpl/lhfaq/getstatus.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhfaq/getstatus.tpl.php
@@ -142,11 +142,11 @@ var lhc_FAQ = {
 	showVotingForm : function() {
 
    		  this.removeById('lhc_container_faq');
 
    		  var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
 
    		  if (window.innerWidth < 1024) {
           		window.open(this.initial_iframe_url,"_blank");
           		return;
           };
@@ -156,14 +156,14 @@ var lhc_FAQ = {
                        ' width="520"' +
                        ' height="350"' +
                        ' style="width: 490px; height: 350px;"></iframe>';
 
           this.iframe_html = '<div id="lhc_container_faq">' +
-                              '<div id="lhc_faq_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/faq.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_faq_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
+                              '<div id="lhc_faq_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/faq.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_faq_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
                               this.iframe_html + '</div></div>';
 
-          raw_css = "#lhc_container_faq * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_faq img {border:0;}\n#lhc_faq_title{float:left;}\n#lhc_faq_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_faq_close{padding:2px;float:right;}\n#lhc_faq_close:hover{opacity:0.4;}\n#lhc_container_faq {-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;width:490px;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#lhc_container_faq iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_faq iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_faq #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_faq{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;width:100%;}#lhc_container_faq iframe{width:100% !important}}";
+          raw_css = "#lhc_container_faq * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_faq img {border:0;}\n#lhc_faq_title{float:left;}\n#lhc_faq_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_faq_close{padding:2px;float:right;}\n#lhc_faq_close:hover{opacity:0.4;}\n#lhc_container_faq {-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;width:490px;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#lhc_container_faq iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_faq iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_faq #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_faq{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;width:100%;}#lhc_container_faq iframe{width:100% !important}}";
 
           if (!this.cssWasAdded) {
           		this.cssWasAdded = true;
           		this.addCss(raw_css<?php ($theme !== false && $theme->custom_container_css !== '') ? print '+\''.str_replace(array("\n","\r"), '', $theme->custom_container_css).'\'' : '' ?>);
 		  };
@@ -182,11 +182,11 @@ var lhc_FAQ = {
           
     },
 
     showStatusWidget : function() {
        var statusTEXT = '<a id="faq-icon" class="status-icon" href="#" >'+<?php echo $faqOptionsVariable;?>.status_text+'</a>';
-       var raw_css = "#lhc_faq_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0;}\n#lhc_faq_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/help.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_faq_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_faq_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_faq_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
+       var raw_css = "#lhc_faq_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0;}\n#lhc_faq_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/help.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_faq_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_faq_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_faq_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        this.addCss(raw_css<?php ($theme !== false && $theme->custom_status_css_front !== '') ? print '+\''.str_replace(array("\n","\r"), '', $theme->custom_status_css_front).'\'' : '' ?>);
        var htmlStatus = '<div id="lhc_faq_container">'+statusTEXT+'</div>';
        var fragment = this.appendHTML(htmlStatus);
        document.body.insertBefore(fragment, document.body.childNodes[0]);
        var inst = this;
diff --git a/lhc_web/design/defaulttheme/tpl/lhfaq/htmlcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhfaq/htmlcode.tpl.php
index 637b6e5c3b7..d9363c8210d 100644
--- a/lhc_web/design/defaulttheme/tpl/lhfaq/htmlcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhfaq/htmlcode.tpl.php
@@ -86,11 +86,11 @@ function generateEmbedCode(){
 	<?php include(erLhcoreClassDesign::designtpl('lhfaq/getstatus/options_variable.tpl.php')); ?>
 	  
     var script = '<script type="text/javascript">'+"\nvar <?php echo $faqOptionsVariable;?> = {status_text:'"+textStatus+"',url:'replace_me_with_dynamic_url',identifier:''};\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/getstatus'+id_position+top+topposition+id_theme+id_disable_responsive+"';\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/getstatus'+id_position+top+topposition+id_theme+id_disable_responsive+"';\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhform/collected.tpl.php b/lhc_web/design/defaulttheme/tpl/lhform/collected.tpl.php
index b91a8d6fb0e..8602947cd0f 100644
--- a/lhc_web/design/defaulttheme/tpl/lhform/collected.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhform/collected.tpl.php
@@ -4,11 +4,11 @@
 	<div class="col-6"><a href="<?php echo erLhcoreClassDesign::baseurl('form/downloadcollected')?>/<?php echo $form->id?>" class="btn btn-secondary"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('form/collected','Download XLS');?></a></div>
 	<div class="col-6">
 	
 	<div class="input-group">
         <div class="input-group-prepend"><span class="input-group-text"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('form/collected','URL');?></span></div>
-      <input type="text" class="form-control" value="<?php echo erLhcoreClassXMP::getBaseHost(). $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('form/fill')?>/<?php echo $form->id?>">
+      <input type="text" class="form-control" value="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('form/fill')?>/<?php echo $form->id?>">
     </div>
     
 	</div>
 </div>
 
diff --git a/lhc_web/design/defaulttheme/tpl/lhform/embed.tpl.php b/lhc_web/design/defaulttheme/tpl/lhform/embed.tpl.php
index 503721573ee..06c21c03a74 100644
--- a/lhc_web/design/defaulttheme/tpl/lhform/embed.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhform/embed.tpl.php
@@ -1,11 +1,11 @@
 <?php include(erLhcoreClassDesign::designtpl('lhform/getstatus/options_variable.tpl.php')); ?>
 
 var lhc_FormEmbed = function() {
 	var self = this;
 	this.showVotingForm = function() {
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('form/formwidget')?>/<?php echo $form_id,$identifier?>";
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('form/formwidget')?>/<?php echo $form_id,$identifier?>";
    		  this.iframe_html = '<iframe id="lhcform_iframe_embed" allowTransparency="true" scrolling="no" class="loading" frameborder="0" ' +
                        ( this.initial_iframe_url != '' ? ' src="'    + this.initial_iframe_url + '"' : '' ) +
                        ' width="100%"' +
                        ' height="350"' +
                        ' style="width: 100%; height: 350px;"></iframe>';
diff --git a/lhc_web/design/defaulttheme/tpl/lhform/embedcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhform/embedcode.tpl.php
index 3b7496ec95b..bb18f9a8260 100644
--- a/lhc_web/design/defaulttheme/tpl/lhform/embedcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhform/embedcode.tpl.php
@@ -52,11 +52,11 @@ function generateEmbedCode(){
     <?php include(erLhcoreClassDesign::designtpl('lhform/getstatus/options_variable.tpl.php')); ?>
     
     var script = '<script type="text/javascript">'+"\nvar <?php echo $formOptionsVariable?> = {};\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'form/embed/'+formid+identifier+"';\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'form/embed/'+formid+identifier+"';\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(id_tag+script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhgenericbot/message/content/quick_replies.tpl.php b/lhc_web/design/defaulttheme/tpl/lhgenericbot/message/content/quick_replies.tpl.php
index e3501102920..81669068413 100644
--- a/lhc_web/design/defaulttheme/tpl/lhgenericbot/message/content/quick_replies.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhgenericbot/message/content/quick_replies.tpl.php
@@ -5,11 +5,11 @@
     <?php foreach ($metaMessage as $item) : $disabledButton = isset($item['content']['disabled']) && $item['content']['disabled'] == true;?>
             <?php if ($item['type'] == 'url') : ?>
             <li class="list-inline-item">
                 <a rel="noreferrer" <?php if (isset($item['content']['button_id']) && $item['content']['button_id'] != '') : ?>id="<?php echo htmlspecialchars($item['content']['button_id'])?>"<?php endif;?> <?php if (isset($item['content']['payload_message']) && $item['content']['payload_message'] != '') : ?>data-payload=<?php echo json_encode($item['content']['payload_message'])?> data-id="<?php echo $messageId?>" onclick='lhinst.buttonClicked(<?php echo json_encode($item['content']['payload_message'])?>,<?php echo $messageId?>,$(this))'<?php endif;?> class="btn btn-sm btn-outline-primary btn-bot" target="_blank" href="<?php echo htmlspecialchars($item['content']['payload'])?>"><i class="material-icons"><?php if (isset($react) && $react == true) : ?>&#xf106;<?php else : ?>open_in_new<?php endif; ?></i><?php echo htmlspecialchars($item['content']['name'])?></a>
             </li>
-            <?php elseif ($item['type'] == 'file') : $fileReply = erLhcoreClassModelChatFile::fetch($item['content']['payload']); if ($fileReply instanceof erLhcoreClassModelChatFile) : $fileLink = '//'. $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$fileReply->id}/{$fileReply->security_hash}"; ?>
+            <?php elseif ($item['type'] == 'file') : $fileReply = erLhcoreClassModelChatFile::fetch($item['content']['payload']); if ($fileReply instanceof erLhcoreClassModelChatFile) : $fileLink = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$fileReply->id}/{$fileReply->security_hash}"; ?>
             <li class="list-inline-item">
                 <a rel="noreferrer" <?php if (isset($item['content']['button_id']) && $item['content']['button_id'] != '') : ?>id="<?php echo htmlspecialchars($item['content']['button_id'])?>"<?php endif;?> <?php if (isset($item['content']['payload_message']) && $item['content']['payload_message'] != '') : ?>data-payload=<?php echo json_encode($item['content']['payload_message'])?> data-id="<?php echo $messageId?>" onclick='lhinst.buttonClicked(<?php echo json_encode($item['content']['payload_message'])?>,<?php echo $messageId?>,$(this))'<?php endif;?> class="btn btn-sm btn-outline-primary btn-bot" target="_blank" href="<?php echo $fileLink?>"><i class="material-icons"><?php if (isset($react) && $react == true) : ?>&#xf10e;<?php else : ?>attach_file<?php endif; ?></i><?php echo htmlspecialchars($item['content']['name'])?></a>
             </li>
             <?php endif; elseif ($item['type'] == 'trigger') : ?>
             <li class="list-inline-item"><button type="button" <?php if (isset($item['content']['button_id']) && $item['content']['button_id'] != '') : ?>id="<?php echo htmlspecialchars($item['content']['button_id'])?>"<?php endif;?> class="btn btn-sm btn-outline-primary btn-bot" <?php if ($disabledButton == true) : ?>disabled="disabled"<?php endif;?> <?php if ($disabledButton == false) : ?>data-payload=<?php echo json_encode($item['content']['payload']. '__' . md5($item['content']['name']))?> data-id="<?php echo $messageId?>" onclick='lhinst.updateTriggerClicked(<?php echo json_encode($item['content']['payload']. '__' . md5($item['content']['name']))?>,<?php echo $messageId?>,$(this))'<?php endif;?>><?php echo htmlspecialchars($item['content']['name'])?></button></li>
diff --git a/lhc_web/design/defaulttheme/tpl/lhnotifications/settings.tpl.php b/lhc_web/design/defaulttheme/tpl/lhnotifications/settings.tpl.php
index 79f2c9684cb..20521ac0ae5 100644
--- a/lhc_web/design/defaulttheme/tpl/lhnotifications/settings.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhnotifications/settings.tpl.php
@@ -42,22 +42,22 @@
         <small><i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('notifications/notifications','You must provide a subject that is either a mailto: or a URL.')?></i></small>
     </div>
 
     <div class="form-group">
         <label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('notifications/notifications','HTTP Host*')?></label>
-        <input type="text" class="form-control" name="http_host" value="<?php (isset($n_settings['http_host']) && !empty($n_settings['http_host'])) ? print htmlspecialchars($n_settings['http_host']) : print $_SERVER['HTTP_HOST']?>">
+        <input type="text" class="form-control" name="http_host" value="<?php (isset($n_settings['http_host']) && !empty($n_settings['http_host'])) ? print htmlspecialchars($n_settings['http_host']) : print str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?>">
         <small><i>You must provide host for notifications images.</i></small>
     </div>
 
     <div class="form-group">
         <label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('notifications/notifications','Default Icon')?></label>
-        <input type="text" class="form-control" name="icon" value="<?php if (isset($n_settings['icon'])) : ?><?php print htmlspecialchars($n_settings['icon']); else : ?>https://<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
+        <input type="text" class="form-control" name="icon" value="<?php if (isset($n_settings['icon'])) : ?><?php print htmlspecialchars($n_settings['icon']); else : ?>https://<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
     </div>
 
     <div class="form-group">
         <label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('notifications/notifications','Badge Icon')?></label>
-        <input type="text" class="form-control" name="badge" value="<?php if (isset($n_settings['badge'])) : ?><?php print htmlspecialchars($n_settings['badge']); else : ?>https://<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
+        <input type="text" class="form-control" name="badge" value="<?php if (isset($n_settings['badge'])) : ?><?php print htmlspecialchars($n_settings['badge']); else : ?>https://<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
         <p><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('notifications/notifications','Notification badges are only being used on mobile, at least at the time of writing. It is used to replace the browser icon that is shown by default.')?></p>
     </div>
 
     <div class="form-group">
         <label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('notifications/notifications','Vibrate')?></label>
diff --git a/lhc_web/design/defaulttheme/tpl/lhquestionary/embed.tpl.php b/lhc_web/design/defaulttheme/tpl/lhquestionary/embed.tpl.php
index 2ecc18ead9f..994c0a1046f 100644
--- a/lhc_web/design/defaulttheme/tpl/lhquestionary/embed.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhquestionary/embed.tpl.php
@@ -1,11 +1,11 @@
 var lhc_QuestionaryPage = function() {
 	var self = this;
 
 	this.showVotingForm = function() {
 		  var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent;
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent;
 
    		  this.iframe_html = '<iframe id="lhc_sizing_questionary_page" allowTransparency="true" scrolling="no" frameborder="0" ' +
                        ( this.initial_iframe_url != '' ? ' src="'    + this.initial_iframe_url + '"' : '' ) +
                        ' width="100%"' +
                        ' height="300"' +
diff --git a/lhc_web/design/defaulttheme/tpl/lhquestionary/embedcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhquestionary/embedcode.tpl.php
index d19cc71511f..dd5f44ef7f7 100644
--- a/lhc_web/design/defaulttheme/tpl/lhquestionary/embedcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhquestionary/embedcode.tpl.php
@@ -42,11 +42,11 @@ function generateEmbedCode(){
     var id_tag = <?php include(erLhcoreClassDesign::designtpl('lhquestionary/embedcode_title.tpl.php'));?>+"\n"+'<div id="lhc_questionary_embed_container" ></div>'+"\n\n"+<?php include(erLhcoreClassDesign::designtpl('lhquestionary/embedcode_title_after.tpl.php'));?>+"\n";
 	
     var script = '<script type="text/javascript">'+"\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/embed'+id_theme+'\';'+"\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/embed'+id_theme+'\';'+"\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(id_tag+script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhquestionary/getstatus.tpl.php b/lhc_web/design/defaulttheme/tpl/lhquestionary/getstatus.tpl.php
index c17a01fa2e7..ce8d9300c56 100644
--- a/lhc_web/design/defaulttheme/tpl/lhquestionary/getstatus.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhquestionary/getstatus.tpl.php
@@ -112,11 +112,11 @@ var lhc_Questionary = {
 
     hide : function() {
         var th = document.getElementsByTagName('head')[0];
         var s = document.createElement('script');
         s.setAttribute('type','text/javascript');
-        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidgetclosed')?>');
+        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidgetclosed')?>');
         th.appendChild(s);
         this.removeById('lhc_container_questionary');
         this.addCookieAttribute('was_opened',true);
         this.removeCookieAttr('pos');
     },
@@ -147,11 +147,11 @@ var lhc_Questionary = {
 	
 	showVotingForm : function() {
 
    		  this.removeById('lhc_container_questionary');
 	      var locationCurrent = encodeURIComponent(window.location.href.substring(window.location.protocol.length));
-   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>"+'?URLReferer='+locationCurrent;
+   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>"+'?URLReferer='+locationCurrent;
 		  
 		  if (window.innerWidth < 1024) {
           		window.open(this.initial_iframe_url,"_blank");
           		return;
           };
@@ -161,14 +161,14 @@ var lhc_Questionary = {
                        ' width="<?php echo $widthwidget?>"' +
                        ' height="<?php echo $heightwidget?>"' +
                        ' style="width: <?php echo $widthwidget?>px; height: <?php echo $heightwidget?>px;"></iframe>';
 
           this.iframe_html = '<div id="lhc_container_questionary">' +
-                              '<div id="lhc_questionary_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/questionary.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_questionary_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
+                              '<div id="lhc_questionary_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/questionary.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_questionary_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
                               this.iframe_html + '</div></div>';
 
-          raw_css = "#lhc_container_questionary * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_questionary img {border:0;}\n#lhc_questionary_title{float:left;}\n#lhc_questionary_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_questionary_close{padding:2px;float:right;}\n#lhc_questionary_close:hover{opacity:0.4;}\n#lhc_container_questionary {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF;z-index:9990;position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_questionary iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_questionary iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }#lhc_container_questionary #lhc_iframe_container{border: <?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}@media only screen and (max-width : 640px) {#lhc_container_questionary{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;}#lhc_container_questionary iframe{width:100% !important}}";
+          raw_css = "#lhc_container_questionary * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_questionary img {border:0;}\n#lhc_questionary_title{float:left;}\n#lhc_questionary_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_questionary_close{padding:2px;float:right;}\n#lhc_questionary_close:hover{opacity:0.4;}\n#lhc_container_questionary {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF;z-index:9990;position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_questionary iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_questionary iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }#lhc_container_questionary #lhc_iframe_container{border: <?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}@media only screen and (max-width : 640px) {#lhc_container_questionary{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;}#lhc_container_questionary iframe{width:100% !important}}";
 
           if (!this.cssWasAdded) {
           		this.cssWasAdded = true;
           		this.addCss(raw_css<?php ($theme !== false && $theme->custom_container_css !== '') ? print '+\''.str_replace(array("\n","\r"), '', $theme->custom_container_css).'\'' : '' ?>);
 		  };
@@ -185,11 +185,11 @@ var lhc_Questionary = {
 		  <?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/drag_drop_logic.tpl.php')); ?>	
     },
 
     showStatusWidget : function() {
        var statusTEXT = '<a id="questionary-icon" class="status-icon" href="#" >'+<?php echo $questionaryOptionsVariable?>.status_text+'</a>';
-       var raw_css = "#lhc_questionary_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_questionary_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/plant.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_questionary_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_questionary_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_questionary_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
+       var raw_css = "#lhc_questionary_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_questionary_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/plant.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_questionary_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_questionary_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_questionary_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        this.addCss(raw_css<?php ($theme !== false && $theme->custom_status_css !== '') ? print '+\''.str_replace(array("\n","\r"), '', $theme->custom_status_css).'\'' : '' ?>);
        var htmlStatus = '<div id="lhc_questionary_container">'+statusTEXT+'</div>';
        var fragment = this.appendHTML(htmlStatus);
        document.body.insertBefore(fragment, document.body.childNodes[0]);
        var inst = this;
diff --git a/lhc_web/design/defaulttheme/tpl/lhquestionary/htmlcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhquestionary/htmlcode.tpl.php
index 22246990dc2..882642efd7c 100644
--- a/lhc_web/design/defaulttheme/tpl/lhquestionary/htmlcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhquestionary/htmlcode.tpl.php
@@ -113,11 +113,11 @@ function generateEmbedCode(){
 	<?php include(erLhcoreClassDesign::designtpl('lhquestionary/getstatus/options_variable.tpl.php')); ?>
 	
     var script = '<script type="text/javascript">'+"\nvar <?php echo $questionaryOptionsVariable?> = {status_text:'"+textStatus+"'};\n"+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/getstatus'+id_position+id_disable_responsive+id_show_widget_on_open+top+topposition+widthwidget+id_theme+heightwidget+"';\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/getstatus'+id_position+id_disable_responsive+id_show_widget_on_open+top+topposition+widthwidget+id_theme+heightwidget+"';\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
     $('#HMLTContent').text(script);
 };
diff --git a/lhc_web/design/defaulttheme/tpl/lhsystem/embedcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhsystem/embedcode.tpl.php
index 99f20aa562a..f8f6928d7e5 100644
--- a/lhc_web/design/defaulttheme/tpl/lhsystem/embedcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhsystem/embedcode.tpl.php
@@ -74,11 +74,11 @@
 	</div>
 </div>
 
 
 <p class="explain"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode','Copy the code from the text area to the page where you want your status to appear');?></p>
-<textarea style="width: 100%; height: 180px; font-size: 12px;" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="//'.$_SERVER['HTTP_HOST'].erLhcoreClassDesign::baseurl('chat/getstatus').'"></script>')?></textarea>
+<textarea style="width: 100%; height: 180px; font-size: 12px;" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="' . erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/getstatus').'"></script>')?></textarea>
 
 <script type="text/javascript">
 var default_site_access = '<?php echo erConfigClassLhConfig::getInstance()->getSetting( 'site', 'default_site_access' ); ?>/';
 function generateEmbedCode() {
     var siteAccess = $('#LocaleID').val() == default_site_access ? '' : $('#LocaleID').val();
@@ -105,11 +105,11 @@ function generateEmbedCode() {
       '<?php echo $chatOptionsVariablePage?>.opt = {};\n'+
       '(function() {'+"\n"+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
         'var referrer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf(\'://\')+1)) : \'\';'+"\n"+
         'var location  = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : \'\';'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chat/getstatusembed<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_hide_then_offline+id_theme+id_operator+id_show_leave_form+id_department+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chat/getstatusembed<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_hide_then_offline+id_theme+id_operator+id_show_leave_form+id_department+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
 
     $('#HMLTContent').text(id_tag+script);
diff --git a/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcode.tpl.php b/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcode.tpl.php
index 7fd920a187d..c5b99dbbd06 100644
--- a/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcode.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcode.tpl.php
@@ -209,11 +209,11 @@
 	</div>
 </div>
 
 
 <p class="explain"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode','Copy the code from the text area to the page where you want your status to appear');?></p>
-<textarea style="width: 100%; height: 200px; font-size: 11px;" class="form-control" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="http://'.$_SERVER['HTTP_HOST'].erLhcoreClassDesign::baseurl('chat/getstatus').'"></script>')?></textarea>
+<textarea style="width: 100%; height: 200px; font-size: 11px;" class="form-control" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="'. erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/getstatus') .'"></script>')?></textarea>
 
 <script type="text/javascript">
 
 var default_site_access = '<?php echo erConfigClassLhConfig::getInstance()->getSetting( 'site', 'default_site_access' ); ?>/';
 
@@ -285,11 +285,11 @@ function generateEmbedCode(){
       '<?php echo $chatOptionsVariable?>.opt = {widget_height:'+$('#id_widget_height').val()+',widget_width:'+$('#id_widget_width').val()+',popup_height:'+$('#id_popup_height').val()+',popup_width:'+$('#id_popup_width').val()+id_embed_domain+id_disable_subdomain+'};\n'+
       '(function() {'+"\n"+langDetectScript+
         'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
         'var referrer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf(\'://\')+1)) : \'\';'+"\n"+
         'var location  = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : \'\';'+"\n"+
-        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+(id_detect_language == false ? siteAccess : '\'+_l+\'')+'chat/getstatus<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_internal_popup+id_position+id_ma+id_hide_then_offline+id_disable_online_tracking+id_check_operator_message+top+topposition+id_show_leave_form+id_department+id_operator+id_identifier+id_disable_pro_active_invitations+id_theme+id_product+id_survey+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
+        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+(id_detect_language == false ? siteAccess : '\'+_l+\'')+'chat/getstatus<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_internal_popup+id_position+id_ma+id_hide_then_offline+id_disable_online_tracking+id_check_operator_message+top+topposition+id_show_leave_form+id_department+id_operator+id_identifier+id_disable_pro_active_invitations+id_theme+id_product+id_survey+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
         'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
       '})();'+"\n"+
     '</scr'+'ipt>';
 
     $('#HMLTContent').text(id_tag+script);
diff --git a/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcodebeta.tpl.php b/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcodebeta.tpl.php
index 7444ea3896c..49a1f34df79 100644
--- a/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcodebeta.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhsystem/htmlcodebeta.tpl.php
@@ -269,11 +269,11 @@
                     var width = parseInt($('#OnlineImageWidth').val()) > 0 ? '&w=' + parseInt($('#OnlineImageWidth').val()) : '';
                     var department = $('#DepartmentID').val() && $('#DepartmentID').val().length > 0 && $('#DepartmentID').val().join('/') != '0' ? '/(department)/'+$('#DepartmentID').val().join('/') : '';
                     var operator = $('#id_operator').val() > 0 ? '/(operator)/'+$('#id_operator').val() : '';
                     var theme = $('#ThemeID').val() != 0 ? '/(theme)/'+$('#ThemeID').val() : '';
 
-                    var baseURL = '<?php echo erLhcoreClassXMP::getBaseHost()?><?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('restapi/onlineimage')?>' + department + operator + theme + '?' + onlineText + offlineText + width;
+                    var baseURL = '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('restapi/onlineimage')?>' + department + operator + theme + '?' + onlineText + offlineText + width;
 
                     $('#static-image-url').attr('src', baseURL);
                     $('#static-image-code').val('<a href="'+$('#static-url-generated').val()+'">'+'<img src="' + baseURL + '" alt="" /></a>');
                 }
                 $('#DepartmentID, #id_operator, #OnlineTextStatic, #OnlineImageWidth, #OfflineTextStatic, #static-url-generated').on('keyup change',function(){
@@ -394,19 +394,19 @@
                 "if (_cl != '' && _cl != _l) _l = _cl;"+
                 "if (_l == undefined || _l == '') {_l = '" + siteAccess + "';"+
                 "} else {_l = _l[0].toLowerCase() + _l[1].toLowerCase(); if ('<?php echo erConfigClassLhConfig::getInstance()->getSetting( 'site', 'default_site_access' )?>' == _l) {_l = ''} else {LHC_API.args.lang = _l + '/';}}\n";
         }
 
-        $('#static-url-generated').val($('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccessStatic +'chat/start'+id_survey_static+id_operator_static+id_fresh_status+id_department_static+id_theme_static+id_identifier_static);
+        $('#static-url-generated').val($('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccessStatic +'chat/start'+id_survey_static+id_operator_static+id_fresh_status+id_department_static+id_theme_static+id_identifier_static);
         staticImageGeneration();
 
         var script = '<script>'+
-            'var LHC_API = LHC_API||{};'+"\n"+'LHC_API.args = {mode:\''+id_widget_mode+'\',lhc_base_url:\'' + $('#HttpMode').val() + '//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>\',wheight:'+$('#id_widget_height').val()+',wwidth:'+$('#id_widget_width').val()+',pheight:'+$('#id_popup_height').val()+',pwidth:'+$('#id_popup_width').val()+id_operator+id_embed_domain+id_fresh+id_show_leave_form+id_department+id_theme+id_survey+id_widget_position+id_check_messages_operator+id_disable_pro_active_invitations+id_identifier+siteAccess+id_position_placement+'};\n'+
+            'var LHC_API = LHC_API||{};'+"\n"+'LHC_API.args = {mode:\''+id_widget_mode+'\',lhc_base_url:\'' + $('#HttpMode').val() + '//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>\',wheight:'+$('#id_widget_height').val()+',wwidth:'+$('#id_widget_width').val()+',pheight:'+$('#id_popup_height').val()+',pwidth:'+$('#id_popup_width').val()+id_operator+id_embed_domain+id_fresh+id_show_leave_form+id_department+id_theme+id_survey+id_widget_position+id_check_messages_operator+id_disable_pro_active_invitations+id_identifier+siteAccess+id_position_placement+'};\n'+
             '(function() {'+"\n"+langDetectScript+
             'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.setAttribute(\'crossorigin\',\'anonymous\'); po.async = true;'+"\n"+
             'var date = new Date();'+
-            'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?\'+(""+date.getFullYear() + date.getMonth() + date.getDate());'+"\n"+
+            'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?\'+(""+date.getFullYear() + date.getMonth() + date.getDate());'+"\n"+
             'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
             '})();'+"\n"+
             '</scr'+'ipt>';
 
         $('#HMLTContent').text(id_tag+script);
diff --git a/lhc_web/design/defaulttheme/tpl/lhsystem/update.tpl.php b/lhc_web/design/defaulttheme/tpl/lhsystem/update.tpl.php
index 27decdb66bc..33d12fce632 100644
--- a/lhc_web/design/defaulttheme/tpl/lhsystem/update.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhsystem/update.tpl.php
@@ -7,11 +7,47 @@
 <div class="row">
 	<div class="col-md-4">
 		<h5><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Your version')?> - <?php echo sprintf("%0.2f", erLhcoreClassUpdate::LHC_RELEASE/100);?></h5>
 		<h5><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Current version')?> - <span class="text-success" id="recent-version">...</span></h5>
 
-        <p class="font-weight-bold">More information</p>
+        <p class="font-weight-bold"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Status/security checks')?></p>
+        <ul>
+            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong secret hash')?> -
+            <?php if (strlen(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'secrethash' )) < 50) : ?>
+                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Weak')?></span>
+            <?php else : ?>
+                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong')?></span>
+            <?php endif; ?>
+                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#secret-hash"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
+            </li>
+            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong export hash')?> -
+            <?php if (strlen(erLhcoreClassModelChatConfig::fetch('export_hash')->current_value) < 50) : ?>
+                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Weak')?></span>
+            <?php else : ?>
+                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong')?></span>
+            <?php endif; ?>
+                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#export-hash"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
+            </li>
+            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Trusted host')?> -
+            <?php if (!is_array(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false )) || empty(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false ))) : ?>
+                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','not set')?></span>
+            <?php else : ?>
+                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','set')?></span>
+            <?php endif; ?>
+                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#trusted-hosts-and-site-address"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
+            </li>
+            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Site address')?> -
+            <?php if (!erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_address', false )) : ?>
+                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','not set')?></span>
+            <?php else : ?>
+                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','set')?> - <?php echo htmlspecialchars(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_address', false )); ?></span>
+            <?php endif; ?>
+                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#trusted-hosts-and-site-address"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
+            </li>
+        </ul>
+
+        <p class="font-weight-bold"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></p>
 
         <ul>
             <li><a rel="noreferrer" href="http://livehelperchat.com/news-5c.html" target="_blank"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','News')?></a></li>
             <li><a target="_blank" rel="noreferrer" href="https://doc.livehelperchat.com/">Documentation</a></li>
             <li><a target="_blank" rel="noreferrer" href="https://doc.livehelperchat.com/docs/upgrading"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Upgrade instructions')?></a></li>
diff --git a/lhc_web/design/defaulttheme/tpl/lhuser/autologinconfig.tpl.php b/lhc_web/design/defaulttheme/tpl/lhuser/autologinconfig.tpl.php
index ba4d4af8584..f7ccb6c69b7 100644
--- a/lhc_web/design/defaulttheme/tpl/lhuser/autologinconfig.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhuser/autologinconfig.tpl.php
@@ -104,11 +104,11 @@
                     </div>
 
                     <div class="col-12">
                         <div class="form-group">
                             <div class="input-group">
-                                <input type="text" class="form-control" readonly="readonly" id="copy-url-<?php echo $i?>" data-original-url="<?php echo erLhcoreClassSystem::$httpsMode == 'true' ? 'https://' : 'http://'?><?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('/')?>" value="">
+                                <input type="text" class="form-control" readonly="readonly" id="copy-url-<?php echo $i?>" data-original-url="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('/')?>" value="">
                                 <div class="input-group-append"><span class="input-group-text"><a onclick="copyURL($(this))" data-index="<?php echo $i?>" data-original-title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('users/autologin','Copied!')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('users/autologin','Copy URL to clipboard')?>"><i class="material-icons mr-0">&#xE14D;</i></a></span></div>
                             </div>
                         </div>
                     </div>
 
diff --git a/lhc_web/design/defaulttheme/tpl/lhwebhooks/form_incoming.tpl.php b/lhc_web/design/defaulttheme/tpl/lhwebhooks/form_incoming.tpl.php
index 0c5c8cbbe1a..fc688410587 100644
--- a/lhc_web/design/defaulttheme/tpl/lhwebhooks/form_incoming.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhwebhooks/form_incoming.tpl.php
@@ -18,11 +18,11 @@
     </div>
 </div>
 
 <div class="form-group">
     <label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/webhooks','URL to put in third party Rest API service');?></label>
-    <input type="text" ng-non-bindable class="form-control form-control-sm" id="api-incoming-url" data-base="<?php echo erLhcoreClassXMP::getBaseHost().(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '')?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/" value="<?php echo erLhcoreClassXMP::getBaseHost().(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '')?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/<?php echo htmlspecialchars($item->identifier);?>">
+    <input type="text" ng-non-bindable class="form-control form-control-sm" id="api-incoming-url" data-base="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/" value="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/<?php echo htmlspecialchars($item->identifier);?>">
 </div>
 
 <div class="form-group">
     <label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/lists/search_panel','Department');?></label>
     <?php echo erLhcoreClassRenderHelper::renderCombobox( array (
diff --git a/lhc_web/design/defaulttheme/tpl/lhxmp/xmp.tpl.php b/lhc_web/design/defaulttheme/tpl/lhxmp/xmp.tpl.php
index 1e8a847dd5b..b6fa3c77868 100644
--- a/lhc_web/design/defaulttheme/tpl/lhxmp/xmp.tpl.php
+++ b/lhc_web/design/defaulttheme/tpl/lhxmp/xmp.tpl.php
@@ -107,11 +107,11 @@
 		</div>
 		<div role="tabpanel" class="tab-pane <?php if (isset($xmp_data['use_standard_xmp']) && $xmp_data['use_standard_xmp'] == '1' ) : ?>active<?php endif;?>" id="gtalk">
 		        <label><input type="radio" name="use_standard_xmp" value="1" <?php isset($xmp_data['use_standard_xmp']) && ($xmp_data['use_standard_xmp'] == '1') ? print 'checked="checked"' : '' ?> /> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/xmpp','Use GTalk for messaging'); ?></label>
 				<h4><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/xmpp','Information for your google app')?></h4>	
 				<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/xmpp','Redirect URL, this url you will have to enter in your google app configuration')?></label>
-				<input class="form-control" type="text" value="<?php echo htmlspecialchars(erLhcoreClassXMP::getBaseHost().$_SERVER['HTTP_HOST'])?><?php echo erLhcoreClassDesign::baseurl('xmp/configuration')?>/(gtalkoauth)/true" />
+				<input class="form-control" type="text" value="<?php echo htmlspecialchars(erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurl('xmp/configuration')?>/(gtalkoauth)/true" />
 				
 				
 				<h4><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/xmpp','Enter your app information bellow')?></h4>						
 				<div class="form-group">
 				<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/xmpp','OAuth 2.0 Client ID');?></label>
diff --git a/lhc_web/lib/core/lhbbcode/lhbbcode.php b/lhc_web/lib/core/lhbbcode/lhbbcode.php
index f2d2f129443..1363223a843 100644
--- a/lhc_web/lib/core/lhbbcode/lhbbcode.php
+++ b/lhc_web/lib/core/lhbbcode/lhbbcode.php
@@ -793,22 +793,11 @@ class erLhcoreClassBBCode
              return $matches[0];
          }
    }
 
    public static function getHost() {
-
-       if (isset($_SERVER['HTTP_HOST'])) {
-           $site_address = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
-       } else if (class_exists('erLhcoreClassInstance')) {
-           $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
-       } else if (class_exists('erLhcoreClassExtensionLhcphpresque')) {
-           $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
-       } else {
-           $site_address = '';
-       }
-
-       return $site_address;
+        return erLhcoreClassSystem::getHost();
    }
 
    public static function _make_upload_link($matches){
        $data = $matches[1];
        return '<a class="action-image alert-link" onclick="lhinst.chooseFile()">' . htmlspecialchars($data) . '</a>';
diff --git a/lhc_web/lib/core/lhbbcode/lhbbcode_cleanup.php b/lhc_web/lib/core/lhbbcode/lhbbcode_cleanup.php
index 11cd7b996d3..953817d56bd 100644
--- a/lhc_web/lib/core/lhbbcode/lhbbcode_cleanup.php
+++ b/lhc_web/lib/core/lhbbcode/lhbbcode_cleanup.php
@@ -829,22 +829,11 @@ class erLhcoreClassBBCodePlain
         }
         return '';
     }
 
     public static function getHost() {
-
-        if (isset($_SERVER['HTTP_HOST'])) {
-            $site_address = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
-        } else if (class_exists('erLhcoreClassInstance')) {
-            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
-        } else if (class_exists('erLhcoreClassExtensionLhcphpresque')) {
-            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
-        } else {
-            $site_address = '';
-        }
-
-        return $site_address;
+        return erLhcoreClassSystem::getHost();
     }
 
     public static function _make_url_survey($matches)
     {
         if (isset($matches[1])){
diff --git a/lhc_web/lib/core/lhchat/lhchatcommand.php b/lhc_web/lib/core/lhchat/lhchatcommand.php
index e5ddf14c273..e003b9ba29e 100644
--- a/lhc_web/lib/core/lhchat/lhchatcommand.php
+++ b/lhc_web/lib/core/lhchat/lhchatcommand.php
@@ -54,11 +54,11 @@ class erLhcoreClassChatCommand
 
         $paramsURL = explode(' ',$params['argument']);
         $URL = array_shift($paramsURL);
 
         if (is_numeric($URL)) {
-            $URL =  (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . erLhcoreClassDesign::baseurldirect('form/formwidget') . '/' . $URL;
+            $URL = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('form/formwidget') . '/' . $URL;
         }
 
         // Store as message to visitor
         $msg = new erLhcoreClassModelmsg();
         $msg->msg = !empty($paramsURL) ? implode(' ',$paramsURL) : erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatcommand','We will show a form in a moment!');
diff --git a/lhc_web/lib/core/lhchat/lhchatexport.php b/lhc_web/lib/core/lhchat/lhchatexport.php
index 0986bdf52ec..47697628d08 100644
--- a/lhc_web/lib/core/lhchat/lhchatexport.php
+++ b/lhc_web/lib/core/lhchat/lhchatexport.php
@@ -496,11 +496,11 @@ class erLhcoreClassChatExport {
                         }
                 } else {
                 	$from = null;
                 }
 
-                $url = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$item->id));
+                $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$item->id));
 
                 $chat_actions = '';
 
                 foreach (erLhcoreClassModelChatAction::getList(['sort' => 'id ASC', 'limit' => false, 'filter' => ['chat_id' => $item->id]]) as $chatActionItem) {
                     $chat_actions .= $chatActionItem->body."\n";
diff --git a/lhc_web/lib/core/lhchat/lhchatmail.php b/lhc_web/lib/core/lhchat/lhchatmail.php
index 32bb8a94119..760be85b00f 100644
--- a/lhc_web/lib/core/lhchat/lhchatmail.php
+++ b/lhc_web/lib/core/lhchat/lhchatmail.php
@@ -113,11 +113,11 @@ class erLhcoreClassChatMail {
     	$surveyContent = self::getSurveyContent($chat);
 
 
         $cfgSite = erConfigClassLhConfig::getInstance();
         $secretHash = $cfgSite->getSetting( 'site', 'secrethash' );
-        $url = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('chat/readchatmail') . '/' . $chat->id . '/' . sha1($secretHash . $chat->hash . $chat->id);
+        $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('chat/readchatmail') . '/' . $chat->id . '/' . sha1($secretHash . $chat->hash . $chat->id);
 
     	$sendMail->content = str_replace(array('{user_chat_nick}','{messages_content}','{chat_id}','{survey}','{operator_name}','{chat_link}'), array($chat->nick, $tpl->fetch(), $chat->id, $surveyContent, $chat->plain_user_name, $url), $sendMail->content);
     	
     	if ($form->hasValidData( 'Message' ) )
     	{
@@ -216,11 +216,11 @@ class erLhcoreClassChatMail {
     		$mail->AddReplyTo($faq->email);
     	}
 
     	$mail->Subject = $sendMail->subject;
     	
-    	$mail->Body = str_replace(array('{email}','{question}','{url_request}','{url_question}'), array($faq->email,$faq->question,erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('faq/view/'.$faq->id)),$faq->url), $sendMail->content);
+    	$mail->Body = str_replace(array('{email}','{question}','{url_request}','{url_question}'), array($faq->email,$faq->question,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('faq/view/'.$faq->id)),$faq->url), $sendMail->content);
     	
     	if ($sendMail->recipient != '') { // Perhaps template has default recipient
     		$emailRecipient = explode(',',$sendMail->recipient);
     	} else { // Lets find first user and send him an e-mail
     		$list = erLhcoreClassModelUser::getUserList(array('limit' => 1,'sort' => 'id ASC'));
@@ -278,11 +278,11 @@ class erLhcoreClassChatMail {
     	$mail->Subject = str_replace(array('{name}','{department}','{country}','{city}','{chat_id}'),array($chat->nick,(string)$chat->department,$chat->country_name,$chat->city,$chat->id),$sendMail->subject);
     	$mail->AddReplyTo($chat->email,$chat->nick);
     	
     	$prefillchat = '-'; 
     	if (isset($params['chatprefill']) && $params['chatprefill'] instanceof erLhcoreClassModelChat){
-    		$prefillchat = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$params['chatprefill']->id));
+    		$prefillchat = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$params['chatprefill']->id));
     	}
     	
     	// Format user friendly additional data
     	if ($chat->additional_data != '') {
     	    $paramsAdditional = json_decode($chat->additional_data,true);
@@ -413,22 +413,22 @@ class erLhcoreClassChatMail {
     	
     	$surveyContent = self::getSurveyContent($chat);
     	    	
     	foreach ($emailRecipient as $receiver) {   
     		$veryfyEmail = 	sha1(sha1($receiver.$secretHash).$secretHash);
-    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
+    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
     		$mail->AddAddress( $receiver );
     		$mail->Send();
     		$mail->ClearAddresses();
     	}
     	
     	if ($sendMail->bcc_recipients != '') {
     		$recipientsBCC = explode(',',$sendMail->bcc_recipients);
     		foreach ($recipientsBCC as $receiver) {
     			$receiver = trim($receiver);
     			$veryfyEmail = 	sha1(sha1($receiver.$secretHash).$secretHash);
-    			$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
+    			$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
     			$mail->AddAddress( $receiver );
     			$mail->Send();
     			$mail->ClearAddresses();    			
     		}
     	}
@@ -489,11 +489,11 @@ class erLhcoreClassChatMail {
     	    $mail->AddReplyTo($params['email']);    	    
     	}
     	
     	$mail->FromName = $sendMail->from_name;    	
     	$mail->Subject = str_replace(array('{form_name}'),array($formCollected->form),$sendMail->subject);   	     	
-    	$mail->Body = str_replace(array('{identifier}','{form_name}','{content}','{ip}','{url_download}','{url_view}'), array($formCollected->identifier,(string)$formCollected->form, $formCollected->form_content, $formCollected->ip, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/downloaditem/'.$formCollected->id)), erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/viewcollected/'.$formCollected->id))), $sendMail->content);
+    	$mail->Body = str_replace(array('{identifier}','{form_name}','{content}','{ip}','{url_download}','{url_view}'), array($formCollected->identifier,(string)$formCollected->form, $formCollected->form_content, $formCollected->ip, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/downloaditem/'.$formCollected->id)), erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/viewcollected/'.$formCollected->id))), $sendMail->content);
 
     	$emailRecipient = array();
     	if ($formCollected->form->recipient != '') {
     		$emailRecipient = array($formCollected->form->recipient);
     	} elseif ($sendMail->recipient != '') {
@@ -653,22 +653,22 @@ class erLhcoreClassChatMail {
     	
     	$surveyContent = self::getSurveyContent($chat);
 
     	foreach ($emailRecipient as $receiver) {   
     		$veryfyEmail = 	sha1(sha1($receiver.$secretHash).$secretHash);
-    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,(isset($_SERVER['HTTP_HOST'])) ?  erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
+    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
     		$mail->AddAddress( $receiver );    		    		
     		$mail->Send();
     		$mail->ClearAddresses();
     	}
     	    	
     	if ($sendMail->bcc_recipients != '') {
     		$recipientsBCC = explode(',',$sendMail->bcc_recipients);
     		foreach ($recipientsBCC as $receiver) {    			
     			$receiver = trim($receiver);
     			$veryfyEmail = 	sha1(sha1($receiver.$secretHash).$secretHash);
-	    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,(isset($_SERVER['HTTP_HOST'])) ?  erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
+	    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
 	    		$mail->AddAddress( $receiver );    		    		
 	    		$mail->Send();
 	    		$mail->ClearAddresses();    			 
     		}
     	}    	
@@ -794,11 +794,11 @@ class erLhcoreClassChatMail {
                 $messagesContent,
                 $additional_data,
                 $item->referrer,
                 $item->ip,
                 ($chat instanceof erLhcoreClassModelChat ? (string)$chat->department : '-'),
-                (isset($_SERVER['HTTP_HOST']) ? erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . $appendURL : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . $appendURL),
+                erLhcoreClassSystem::getHost() . $appendURL,
                 $item->user_country_name,
                 $item->city),
                 $sendMail->content);
 
             $mail->AddAddress( $receiver );
@@ -841,11 +841,11 @@ class erLhcoreClassChatMail {
                     $messagesContent,
                     $additional_data,
                     $item->referrer,
                     $item->ip,
                     ($chat instanceof erLhcoreClassModelChat ? (string)$chat->department : '-'),
-                    (isset($_SERVER['HTTP_HOST']) ? erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . $appendURL : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . $appendURL),
+                    erLhcoreClassSystem::getHost() . $appendURL,
                     $item->user_country_name,
                     $item->city),
                     $sendMail->content);
 
                 $receiver = trim($receiver);
diff --git a/lhc_web/lib/core/lhcore/lhsys.php b/lhc_web/lib/core/lhcore/lhsys.php
index ff581d4bc80..7c430763392 100644
--- a/lhc_web/lib/core/lhcore/lhsys.php
+++ b/lhc_web/lib/core/lhcore/lhsys.php
@@ -467,11 +467,58 @@ class erLhcoreClassSystem{
     			self::setSiteAccess($siteaccess);
     			break;
     		}    		
     	}
     }
-    
+
+    public static function validHttpHost($host) {
+        return substr_count($host, '.') <= 100
+            && substr_count($host, ':') <= 100
+            && preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)
+            && self::isTrustedHost($host);
+    }
+
+    // Borrowed from Drupal
+    public static function isTrustedHost($host) {
+        $trusted_host_patterns = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false);
+        if (PHP_SAPI !== 'cli' && is_array($trusted_host_patterns) && !empty($trusted_host_patterns)) {
+            foreach ($trusted_host_patterns as $pattern) {
+                $pattern = sprintf('{%s}i', str_replace('}', '\\}', $pattern));
+                if (preg_match($pattern, $host)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+        return false;
+    }
+
+    public static function getHost() {
+
+        static $site_address = null;
+
+        if ($site_address !== null) {
+            return $site_address;
+        }
+
+        if (isset($_SERVER['HTTP_HOST']) && self::validHttpHost($_SERVER['HTTP_HOST'])) {
+            $site_address = (erLhcoreClassSystem::$httpsMode == true || erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value == 'https:' ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
+        } else if (class_exists('erLhcoreClassInstance')) {
+            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
+        } else if (($site_address = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_address', false)) && $site_address != '') {
+            return $site_address;
+        } else if (class_exists('erLhcoreClassExtensionLhcphpresque')) {
+            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
+        } elseif (isset($_SERVER['HTTP_HOST']) && (!is_array(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false)) || empty(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false)))) {
+            $site_address = (erLhcoreClassSystem::$httpsMode == true || erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value == 'https:' ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ; // trust only if match array not set
+        } else {
+            $site_address = 'http://localhost'; // We could not determine any valid host
+        }
+
+        return $site_address;
+    }
+
     function wwwDir()
     {
         return (self::$prependDomain ? (self::$httpsMode == true ? 'https:' : '') . '//' . $_SERVER['HTTP_HOST'] : '') . $this->WWWDir;
     }
 
diff --git a/lhc_web/lib/core/lhcore/lhupdate.php b/lhc_web/lib/core/lhcore/lhupdate.php
index 29dd62525e5..cfe41c56daf 100644
--- a/lhc_web/lib/core/lhcore/lhupdate.php
+++ b/lhc_web/lib/core/lhcore/lhupdate.php
@@ -10,10 +10,11 @@ class erLhcoreClassUpdate
 		$db = ezcDbInstance::get();
 
         $errorMessages = array();
 
 		try {
+            $db->query('SET GLOBAL innodb_strict_mode = 0;');
             $db->query('SET GLOBAL innodb_file_per_table=1;');
             $db->query('SET GLOBAL innodb_large_prefix=1;');
         } catch (Exception $e) {
             //$errorMessages[] = $e->getMessage();
         }
diff --git a/lhc_web/lib/core/lhform/lhformrenderer.php b/lhc_web/lib/core/lhform/lhformrenderer.php
index fa87839bea2..fb021692f8f 100644
--- a/lhc_web/lib/core/lhform/lhformrenderer.php
+++ b/lhc_web/lib/core/lhform/lhformrenderer.php
@@ -633,11 +633,11 @@ class erLhcoreClassFormRenderer {
 	    	}
 
     	} else {
     		if (isset(self::$collectedInfo[$params['name']]['value'])){
     			$valueContent = self::$collectedInfo[$params['name']]['value'];
-    			$downloadLink = "<a href=\"http://".$_SERVER['HTTP_HOST'].erLhcoreClassDesign::baseurl('form/download').'/'.self::$collectedObject->id.'/'.self::$collectedObject->hash.'/'.$params['name']."\">Download (".htmlspecialchars($valueContent['name']).")</a>";
+    			$downloadLink = "<a href=\"".erLhcoreClassSystem::getHost().erLhcoreClassDesign::baseurl('form/download').'/'.self::$collectedObject->id.'/'.self::$collectedObject->hash.'/'.$params['name']."\">Download (".htmlspecialchars($valueContent['name']).")</a>";
     		}
     	}
     	
     	return "{$downloadLink}<input type=\"file\" name=\"{$params['name']}\" />";
     }
diff --git a/lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactionrestapi.php b/lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactionrestapi.php
index 2c7bda1c830..f9089b37bf2 100644
--- a/lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactionrestapi.php
+++ b/lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactionrestapi.php
@@ -238,20 +238,11 @@ class erLhcoreClassGenericBotActionRestapi
             $hash = $parts[1];
             try {
                 $file = erLhcoreClassModelChatFile::fetch($fileID);
                 if (is_object($file) && $hash == $file->security_hash) {
 
-                    if (isset($_SERVER['HTTP_HOST'])) {
-                        $url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
-                    } else {
-                        if (class_exists('erLhcoreClassInstance')) {
-                            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
-                        } else {
-                            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
-                        }
-                        $url = $site_address . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
-                    }
+                    $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";;
 
                     $media[] = array(
                         'id' => $file->id,
                         'size' => $file->size,
                         'upload_name' => $file->upload_name,
@@ -359,35 +350,17 @@ class erLhcoreClassGenericBotActionRestapi
 
                 $file_name = $mediaFile->upload_name;
 
                 if ($mediaFile->remote_file !== true) {
                     $file_body = 'data:'.$mediaFile->type.';base64,'.base64_encode(file_get_contents($mediaFile->file_path_server));
-                    if (isset($_SERVER['HTTP_HOST'])) {
-                        $file_url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$mediaFile->id}/{$mediaFile->security_hash}";
-                    } else {
-                        if (class_exists('erLhcoreClassInstance')) {
-                            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
-                        } else {
-                            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
-                        }
-                        $file_url = $site_address . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$mediaFile->id}/{$mediaFile->security_hash}";
-                    }
+                    $file_url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$mediaFile->id}/{$mediaFile->security_hash}";
                 } else {
                     $file_body = '';
                     if (strpos($file->remote_url,'http://') !== false || strpos($file->remote_url,'https://') !== false) {
                         $file_url = $file->remote_url;
                     } else {
-                        if (isset($_SERVER['HTTP_HOST'])) {
-                            $file_url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . $file->remote_url;
-                        } else {
-                            if (class_exists('erLhcoreClassInstance')) {
-                                $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
-                            } else {
-                                $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
-                            }
-                            $file_url = $site_address . $file->remote_url;
-                        }
+                        $file_url = erLhcoreClassSystem::getHost() . $file->remote_url;;
                     }
                 }
              }
         }
 
diff --git a/lhc_web/lib/core/lhrestapi/lhrestapivalidator.php b/lhc_web/lib/core/lhrestapi/lhrestapivalidator.php
index 3ec4c91bd05..579bc2706de 100644
--- a/lhc_web/lib/core/lhrestapi/lhrestapivalidator.php
+++ b/lhc_web/lib/core/lhrestapi/lhrestapivalidator.php
@@ -711,11 +711,11 @@ class erLhcoreClassRestAPIHandler
             ));
         }
 
         if (in_array('link',$prefillFields)) {
             foreach ($chats as $index => $chat) {
-                $chats[$index]->link = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$chat->id));
+                $chats[$index]->link = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$chat->id));
             }
         }
 
         if (!empty($chats) && in_array('subject',$prefillFields)) {
             $assignedSubjects = erLhAbstractModelSubjectChat::getList(['sort' => 'id ASC', 'limit' => false,'filterin' => ['chat_id' => array_keys($chats)]]);
diff --git a/lhc_web/lib/core/lhxmp/lhxmp.php b/lhc_web/lib/core/lhxmp/lhxmp.php
index 96e8fbce854..a3e0cbdf5a7 100644
--- a/lhc_web/lib/core/lhxmp/lhxmp.php
+++ b/lhc_web/lib/core/lhxmp/lhxmp.php
@@ -245,18 +245,18 @@ class erLhcoreClassXMP {
 					$cfgSite = erConfigClassLhConfig::getInstance();
 					$secretHash = $cfgSite->getSetting( 'site', 'secrethash' );
 					
 					foreach ($emailRecipient as $email) {			
 						$veryfyEmail = 	sha1(sha1($email.$secretHash).$secretHash);
-						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,self::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
+						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
 						$conn->message($email,$messagesParsed);
 					}
 					
 					foreach ($groupRecipients as $email) {
 						list($emailGroup) = explode('/',$email);
 						$veryfyEmail = 	sha1(sha1($emailGroup.$secretHash).$secretHash);
-						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,self::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$emailGroup,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
+						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$emailGroup,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
 						$conn->message($emailGroup,$messagesParsed,'groupchat');						
 					}
 
 					foreach($groupRecipients as $recipient) {					
 						$conn->presence(NULL,'unavailable',$recipient);
@@ -318,11 +318,11 @@ class erLhcoreClassXMP {
 						$cfgSite = erConfigClassLhConfig::getInstance();
 						$secretHash = $cfgSite->getSetting( 'site', 'secrethash' );
 						
 						foreach ($emailRecipient as $email) {
 							$veryfyEmail = 	sha1(sha1($email.$secretHash).$secretHash);
-							$conn->message($email,str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,self::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email, $chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]));
+							$conn->message($email,str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email, $chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]));
 						}
 
 						$conn->disconnect();
 						return true;
 					} catch (Exception $e) {
diff --git a/lhc_web/lib/models/lhabstract/erlhabstractmodelformcollected.php b/lhc_web/lib/models/lhabstract/erlhabstractmodelformcollected.php
index b12c8beba4e..8be43ea652d 100644
--- a/lhc_web/lib/models/lhabstract/erlhabstractmodelformcollected.php
+++ b/lhc_web/lib/models/lhabstract/erlhabstractmodelformcollected.php
@@ -65,11 +65,11 @@ class erLhAbstractModelFormCollected
     public function getFormattedContent()
     {
         $dataCollected = array();
         foreach ($this->content_array as $nameAttr => $contentArray) {
             if (isset($contentArray['definition']['type']) && $contentArray['definition']['type'] == 'file') {
-                $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login') . '/(r)/' . rawurlencode(base64_encode('form/download/' . $this->id . '/' . $nameAttr));
+                $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login') . '/(r)/' . rawurlencode(base64_encode('form/download/' . $this->id . '/' . $nameAttr));
             } elseif (isset($contentArray['definition']['type']) && $contentArray['definition']['type'] == 'checkbox') {
                 $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . ($contentArray['value'] == 1 ? 'Y' : 'N');
             } else {
                 $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . $contentArray['value'];
             }
diff --git a/lhc_web/lib/models/lhabstract/erlhabstractmodelwidgettheme.php b/lhc_web/lib/models/lhabstract/erlhabstractmodelwidgettheme.php
index 91d4a325020..5f9ebb55052 100644
--- a/lhc_web/lib/models/lhabstract/erlhabstractmodelwidgettheme.php
+++ b/lhc_web/lib/models/lhabstract/erlhabstractmodelwidgettheme.php
@@ -258,11 +258,11 @@ class erLhAbstractModelWidgetTheme {
                return $this->$var;
                break;
 
            case 'replace_array':
 
-               $host = '//'.$_SERVER['HTTP_HOST'];
+               $host = erLhcoreClassSystem::getHost();
 
                $this->replace_array = array(
                    'search' => array(
                        '{{host}}',
                        '{{logo_image_url}}',
@@ -307,11 +307,11 @@ class erLhAbstractModelWidgetTheme {
 	   	case 'online_image_url':
 	   	case 'offline_image_url':
 	   	       $attr = str_replace('_url', '', $var);	   	       	   	       
 	   	       $this->$var = false;	   	        
 	   	       if ($this->$attr != ''){
-	   	           $this->$var =  ($this->{$attr.'_path'} != '' ? (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) . '/' . $this->{$attr.'_path'} . $this->$attr;
+	   	           $this->$var =  ($this->{$attr.'_path'} != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) . '/' . $this->{$attr.'_path'} . $this->$attr;
 	   	       }	   	        
 	   	       return $this->$var;
 	   	    break;
 	   		   			   		
 	   	case 'need_help_image_url_img':
@@ -325,11 +325,11 @@ class erLhAbstractModelWidgetTheme {
 	   	case 'restore_image_url_img':
 	   	case 'minimize_image_url_img':	   			 
 	   	        $attr = str_replace('_url_img', '', $var);	   	    
 	   			$this->$var = false;	   		
 	   			if($this->$attr != ''){
-	   				$this->$var = '<img src="'.($this->{$attr.'_path'} != '' ? (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'.$this->{$attr.'_path'} . $this->$attr.'"/>';
+	   				$this->$var = '<img src="'.($this->{$attr.'_path'} != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'.$this->{$attr.'_path'} . $this->$attr.'"/>';
 	   			}
 	   			return $this->$var;
 	   		break;
 
        case 'notification_icon':
diff --git a/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbotbot.php b/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbotbot.php
index ac07759265e..bb87d2ca876 100644
--- a/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbotbot.php
+++ b/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbotbot.php
@@ -87,11 +87,11 @@ class erLhcoreClassModelGenericBotBot {
             case 'has_photo_avatar':
                 return $this->filename != '' || $this->avatar != '';
                 break;
 
             case 'photo_path':
-                $this->photo_path = ($this->filepath != '' ? '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
+                $this->photo_path = ($this->filepath != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
                 return $this->photo_path;
                 break;
 
             case 'file_path_server':
                 return $this->filepath . $this->filename;
diff --git a/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbottrgroup.php b/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbottrgroup.php
index a71a1b91853..cb78b72a273 100644
--- a/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbottrgroup.php
+++ b/lhc_web/lib/models/lhgenericbot/erlhcoreclassmodelgenericbottrgroup.php
@@ -48,11 +48,11 @@ class erLhcoreClassModelGenericBotTrGroup {
             case 'has_photo':
                 return $this->filename != '';
                 break;
 
             case 'photo_path':
-                $this->photo_path = ($this->filepath != '' ? '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
+                $this->photo_path = ($this->filepath != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
                 return $this->photo_path;
                 break;
 
             case 'file_path_server':
                 return $this->filepath . $this->filename;
diff --git a/lhc_web/lib/models/lhuser/erlhcoreclassmodeluser.php b/lhc_web/lib/models/lhuser/erlhcoreclassmodeluser.php
index 297229f7005..a464a6a0e4d 100644
--- a/lhc_web/lib/models/lhuser/erlhcoreclassmodeluser.php
+++ b/lhc_web/lib/models/lhuser/erlhcoreclassmodeluser.php
@@ -118,11 +118,11 @@ class erLhcoreClassModelUser {
 
        	case 'has_photo_avatar':
        	    	return $this->filename != '' || $this->avatar != '';
 
        	case 'photo_path':
-       			$this->photo_path = ($this->filepath != '' ? '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
+       			$this->photo_path = ($this->filepath != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
        			return $this->photo_path;
 
        	case 'file_path_server':
        			return $this->filepath . $this->filename;
 
diff --git a/lhc_web/modules/lhcobrowse/proxycss.php b/lhc_web/modules/lhcobrowse/proxycss.php
index 89097ca00cb..be7adbb1708 100644
--- a/lhc_web/modules/lhcobrowse/proxycss.php
+++ b/lhc_web/modules/lhcobrowse/proxycss.php
@@ -27,11 +27,11 @@ $url = parse_url($base);
 if (!in_array($url['scheme'],['http','https']) || (isset($url['port']) && !in_array($url['port'],[80,443]))) {
     exit;
 }
 
 // Some basic validation
-if (isset($url['host']) && $url['host'] != '' && strpos($_GET['css'], $_SERVER['HTTP_HOST']) === false) {
+if (isset($url['host']) && $url['host'] != '' && strpos($_GET['css'], erLhcoreClassSystem::getHost()) === false) {
 
     $urlCSS = parse_url($_GET['css']);
 
     // Just our attempt to fix CSS, BaseURL, Relative path madness
     if (! isset($urlCSS['host']) || $urlCSS['host'] == '') {
diff --git a/lhc_web/modules/lhcron/test.php b/lhc_web/modules/lhcron/test.php
index 178889ba6ce..97576d025ed 100644
--- a/lhc_web/modules/lhcron/test.php
+++ b/lhc_web/modules/lhcron/test.php
@@ -4,6 +4,8 @@
  *
  * For various testing purposes
  *
  * */
 
+echo erLhcoreClassBBCode::getHost();
+
 ?>
\ No newline at end of file
diff --git a/lhc_web/modules/lhexport/getchat.php b/lhc_web/modules/lhexport/getchat.php
index ebedbcab7c9..b5c64f99899 100644
--- a/lhc_web/modules/lhexport/getchat.php
+++ b/lhc_web/modules/lhexport/getchat.php
@@ -4,10 +4,15 @@ $hash = (string)$Params['user_parameters']['hash'];
 $format = (string)$Params['user_parameters_unordered']['format'] == 'xml' ? 'xml' : 'json';
 
 $hashSecret = erLhcoreClassModelChatConfig::fetch('export_hash')->current_value;
 
 try {
+
+    if (strlen($hashSecret) < 50) {
+        throw new Exception('Export hash to short!');
+    }
+
 	if ( sha1('getchat'.$hashSecret) == $hash ) {
 
 		$chat = erLhcoreClassModelChat::fetch((string)$Params['user_parameters']['chat_id']);
 
 		if ($format =='json') {
diff --git a/lhc_web/modules/lhexport/getcount.php b/lhc_web/modules/lhexport/getcount.php
index 476e44bebb8..09edfe0438e 100644
--- a/lhc_web/modules/lhexport/getcount.php
+++ b/lhc_web/modules/lhexport/getcount.php
@@ -4,10 +4,15 @@ $hash = (string)$Params['user_parameters']['hash'];
 $format = (string)$Params['user_parameters_unordered']['format'] == 'xml' ? 'xml' : 'json';
 
 $hashSecret = erLhcoreClassModelChatConfig::fetch('export_hash')->current_value;
 
 try {
+    
+    if (strlen($hashSecret) < 50) {
+        throw new Exception('Export hash to short!');
+    }
+
 	if ( sha1('getcount'.$hashSecret) == $hash ) {
 
 		$filter = array();
 
 		if (is_array($Params['user_parameters_unordered']['status'])){
diff --git a/lhc_web/modules/lhexport/getlist.php b/lhc_web/modules/lhexport/getlist.php
index 082a9a69f81..ee5d2418e19 100644
--- a/lhc_web/modules/lhexport/getlist.php
+++ b/lhc_web/modules/lhexport/getlist.php
@@ -4,10 +4,15 @@ $hash = (string)$Params['user_parameters']['hash'];
 $format = (string)$Params['user_parameters_unordered']['format'] == 'xml' ? 'xml' : 'json';
 
 $hashSecret = erLhcoreClassModelChatConfig::fetch('export_hash')->current_value;
 
 try {
+    
+    if (strlen($hashSecret) < 50) {
+        throw new Exception('Export hash to short!');
+    }
+
 	if ( sha1('getlist'.$hashSecret) == $hash ) {
 
 		$filter = array();
 
 		if (is_array($Params['user_parameters_unordered']['status'])){
diff --git a/lhc_web/modules/lhform/downloadcollected.php b/lhc_web/modules/lhform/downloadcollected.php
index 081622df80f..c68252ba934 100644
--- a/lhc_web/modules/lhform/downloadcollected.php
+++ b/lhc_web/modules/lhform/downloadcollected.php
@@ -40,11 +40,11 @@ $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($i, 1, erTranslationC
 $i = 2;
 foreach ($items as $item) {	
 	$y = 0;
 	foreach ($form->xls_columns_data as $data) {					
 		if (isset($item->content_array[$data['attr_name']]['definition']['type']) && $item->content_array[$data['attr_name']]['definition']['type'] == 'file') {			
-			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
+			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
 		} else {
 			if (strpos($data['attr_name'], ',') === false){
 				$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, $item->content_array[$data['attr_name']]['value']);
 			} else {
 				$nameParts = explode(',', $data['attr_name']);
diff --git a/lhc_web/modules/lhform/downloaditem.php b/lhc_web/modules/lhform/downloaditem.php
index d4133cf1281..62ec73b8150 100644
--- a/lhc_web/modules/lhform/downloaditem.php
+++ b/lhc_web/modules/lhform/downloaditem.php
@@ -44,11 +44,11 @@ try {
 	// Set data
 	$i = 2;	
 	$y = 0;
 	foreach ($form->xls_columns_data as $data) {
 		if (isset($item->content_array[$data['attr_name']]['definition']['type']) && $item->content_array[$data['attr_name']]['definition']['type'] == 'file') {
-			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
+			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
 		} else {
 			if (strpos($data['attr_name'], ',') === false){
 				$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, $item->content_array[$data['attr_name']]['value']);
 			} else {
 				$nameParts = explode(',', $data['attr_name']);
diff --git a/lhc_web/modules/lhinstall/install.php b/lhc_web/modules/lhinstall/install.php
index ef4af1f28a5..cd7cd862e5d 100644
--- a/lhc_web/modules/lhinstall/install.php
+++ b/lhc_web/modules/lhinstall/install.php
@@ -1436,13 +1436,13 @@ try {
                   `explain` varchar(250) NOT NULL,
                   `hidden` int(11) NOT NULL DEFAULT '0',
                   PRIMARY KEY (`identifier`)
                 ) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
 
-                    $randomHash = erLhcoreClassModelForgotPassword::randomPassword(9);
+                    $randomHash = erLhcoreClassModelForgotPassword::randomPassword(80);
                     $randomHashLength = strlen($randomHash);
-                    $exportHash = erLhcoreClassModelForgotPassword::randomPassword(9);
+                    $exportHash = erLhcoreClassModelForgotPassword::randomPassword(80);
 
                     if (extension_loaded('bcmath')){
                         $geoRow = "('geo_data','a:5:{i:0;b:0;s:21:\"geo_detection_enabled\";i:1;s:22:\"geo_service_identifier\";s:8:\"max_mind\";s:23:\"max_mind_detection_type\";s:7:\"country\";s:22:\"max_mind_city_location\";s:37:\"var/external/geoip/GeoLite2-City.mmdb\";}',0,'',1)";
                     } else {
                         $geoRow = "('geo_data', '', '0', '', '1')";
diff --git a/lhc_web/modules/lhpermission/explorer.php b/lhc_web/modules/lhpermission/explorer.php
index 025e15ff243..22c5f21d154 100644
--- a/lhc_web/modules/lhpermission/explorer.php
+++ b/lhc_web/modules/lhpermission/explorer.php
@@ -19,11 +19,11 @@ if ($Params['user_parameters_unordered']['action'] == 1) {
         if (count($moduleFunctions) > 0) {
             foreach ($moduleFunctions as $keyFunction => $function) {
                 $url = [];
                 if (isset($function['url'])) {
                     foreach ($function['url'] as $urlData) {
-                        $url[] = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('/') . preg_replace('/^lh/', '', $urlData);
+                        $url[] = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('/') . preg_replace('/^lh/', '', $urlData);
                     }
                 }
                 fputcsv($fp, [
                     '[' . $key . '] ' . $Module['name'],
                     $keyFunction,
diff --git a/lhc_web/modules/lhrestapi/fetchchatmessages.php b/lhc_web/modules/lhrestapi/fetchchatmessages.php
index b4414885ad7..02a17f6f3cd 100644
--- a/lhc_web/modules/lhrestapi/fetchchatmessages.php
+++ b/lhc_web/modules/lhrestapi/fetchchatmessages.php
@@ -118,11 +118,11 @@ try {
                     $hash = $parts[1];
                     try {
                         $file = erLhcoreClassModelChatFile::fetch($fileID);
                         if (is_object($file) && $hash == $file->security_hash) {
 
-                            $url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
+                            $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
 
                             $media[] = array(
                                 'id' => $file->id,
                                 'size' => $file->size,
                                 'upload_name' => $file->upload_name,
diff --git a/lhc_web/modules/lhrestapi/generateautologin.php b/lhc_web/modules/lhrestapi/generateautologin.php
index 6508b4f2720..5abcd711da6 100644
--- a/lhc_web/modules/lhrestapi/generateautologin.php
+++ b/lhc_web/modules/lhrestapi/generateautologin.php
@@ -55,11 +55,11 @@ try
             $dataRequestAppend[] = '/(t)/'.rawurlencode($ts);
         }
 
         $hashValidation = sha1($params['secret_hash'].sha1($params['secret_hash'].implode(',', $dataRequest)));
 
-        return $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect("user/autologin") . "/{$hashValidation}".implode('', $dataRequestAppend);
+        return erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect("user/autologin") . "/{$hashValidation}".implode('', $dataRequestAppend);
     }
 
     $requestBody['secret_hash'] = $data['secret_hash'];
 
     erLhcoreClassRestAPIHandler::outputResponse(array(
diff --git a/lhc_web/modules/lhrestapi/loginbytoken.php b/lhc_web/modules/lhrestapi/loginbytoken.php
index a4ec8c38949..e898cf5af1c 100644
--- a/lhc_web/modules/lhrestapi/loginbytoken.php
+++ b/lhc_web/modules/lhrestapi/loginbytoken.php
@@ -30,11 +30,11 @@ try {
             erLhcoreClassUser::instance()->setLoggedUser($userToLogin->id);
             if ($modeAPI == false) {
                 header('Location: ' .erLhcoreClassDesign::baseurldirect('site_admin').'/'.ltrim($r, '/'));
                 exit;
             } else {
-                echo json_encode(array('error' => false, 'msg' => 'Session started', 'url' => erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('site_admin').'/'.ltrim($r,'/')));
+                echo json_encode(array('error' => false, 'msg' => 'Session started', 'url' => erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('site_admin').'/'.ltrim($r,'/')));
                 exit;
             }
         } else {
             throw new Exception('User could not be found!');
         }
diff --git a/lhc_web/modules/lhrestapi/swagger.php b/lhc_web/modules/lhrestapi/swagger.php
index 800f80cd0cc..dfd38782e99 100644
--- a/lhc_web/modules/lhrestapi/swagger.php
+++ b/lhc_web/modules/lhrestapi/swagger.php
@@ -33,11 +33,11 @@ erLhcoreClassChatEventDispatcher::getInstance()->dispatch('restapi.swagger', arr
     'append_paths' => & $append_paths,
     'chats_parameters' => & $chats_parameters));
 
 echo str_replace(
     array('{{base_path}}','{{ts}}','{{host}}','{{append_definitions}}','{{append_paths}}', '{{chats_parameters}}','{{append_elastic_definitions}}','{{append_elastic_mail_definitions}}'),
-    array(erLhcoreClassDesign::baseurldirect(),time(),$_SERVER['HTTP_HOST'], $append_definitions, $append_paths, $chats_parameters,$elastic_definition,$elastic_mail)
+    array(erLhcoreClassDesign::baseurldirect(),time(),str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost()), $append_definitions, $append_paths, $chats_parameters,$elastic_definition,$elastic_mail)
     , $content);
 
 exit;
 
 ?>
\ No newline at end of file
diff --git a/lhc_web/modules/lhuser/forgotpassword.php b/lhc_web/modules/lhuser/forgotpassword.php
index c487cb3a701..49dd3bb8cfe 100644
--- a/lhc_web/modules/lhuser/forgotpassword.php
+++ b/lhc_web/modules/lhuser/forgotpassword.php
@@ -57,11 +57,11 @@ if (isset($_POST['Forgotpassword'])) {
 
 	if (count($Errors) == 0) {
 
 		if (($userID = erLhcoreClassModelUser::fetchUserByEmail($form->Email)) !== false) {
 
-			$host = $_SERVER['HTTP_HOST'];
+			$host = erLhcoreClassSystem::getHost();
 
 			$adminEmail = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_admin_email' );
 
 			$UserData = erLhcoreClassUser::getSession()->load( 'erLhcoreClassModelUser', $userID );
 
diff --git a/lhc_web/modules/lhwidgetrestapi/checkinvitation.php b/lhc_web/modules/lhwidgetrestapi/checkinvitation.php
index 259c4ee70b9..46d7c06efbb 100644
--- a/lhc_web/modules/lhwidgetrestapi/checkinvitation.php
+++ b/lhc_web/modules/lhwidgetrestapi/checkinvitation.php
@@ -125,11 +125,11 @@ if (isset($reopen_chat)) {
             if (isset($userInstance->invitation->design_data_array['mobile_style']) && $userInstance->invitation->design_data_array['mobile_style'] != '') {
 
                 $replaceStyleArray = array();
 
                 for ($i = 1; $i < 5; $i++) {
-                    $replaceStyleArray['{proactive_img_' . $i . '}'] = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . $userInstance->invitation->{'design_data_img_' . $i . '_url'};
+                    $replaceStyleArray['{proactive_img_' . $i . '}'] = erLhcoreClassSystem::getHost() . $userInstance->invitation->{'design_data_img_' . $i . '_url'};
                 }
 
                 $contentCSS = str_replace(array_keys($replaceStyleArray), array_values($replaceStyleArray), $userInstance->invitation->design_data_array['mobile_style']);
                 $contentCSS = str_replace(array("\n", "\r"), '', $contentCSS);
                 $outputResponse['site_css'] = json_encode($contentCSS);
diff --git a/lhc_web/modules/lhwidgetrestapi/screensharesettings.php b/lhc_web/modules/lhwidgetrestapi/screensharesettings.php
index 7f0e3b62790..dfe6e91fc8c 100644
--- a/lhc_web/modules/lhwidgetrestapi/screensharesettings.php
+++ b/lhc_web/modules/lhwidgetrestapi/screensharesettings.php
@@ -2,23 +2,23 @@
 erLhcoreClassRestAPIHandler::setHeaders();
 
 $settings = array(
     'nodejssettings' => array(
         'nodejssocket' => erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value,
-        'nodejshost' => (erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : $_SERVER['HTTP_HOST']),
+        'nodejshost' => (erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())),
         'path' => erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value,
         'secure' => ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1 ? true : false)
     ),
     'auto_share' => (int)erLhcoreClassModelChatConfig::fetch('sharing_auto_allow')->current_value,
-    'cobrowser' => erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js'),
+    'cobrowser' => erLhcoreClassSystem::getHost() . erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js'),
     'nodejsenabled' => (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value,
     'trans' => array(
         'operator_watching' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus', 'Screen shared, click to finish'),
         'start_share' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/screenshare','Start screen share session'),
         'deny' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/screenshare','Deny screen share'),
     ),
-    'url' => erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurlsite() . '/cobrowse/storenodemap/(sharemode)/chat'
+    'url' => erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurlsite() . '/cobrowse/storenodemap/(sharemode)/chat'
 );
 
 erLhcoreClassChatEventDispatcher::getInstance()->dispatch('widgetrestapi.screensharesettings', array('output' => & $settings));
 
 erLhcoreClassRestAPIHandler::outputResponse($settings);
diff --git a/lhc_web/modules/lhwidgetrestapi/settings.php b/lhc_web/modules/lhwidgetrestapi/settings.php
index 7bd060332a3..1e17b3832ff 100644
--- a/lhc_web/modules/lhwidgetrestapi/settings.php
+++ b/lhc_web/modules/lhwidgetrestapi/settings.php
@@ -351,13 +351,13 @@ if ($disableNeedHelp === false && ((isset($theme) && $theme instanceof erLhAbstr
 
         $replaceVars = $theme->replace_array;
 
         if ($theme->need_help_image_url === false) {
             if ((isset($theme->bot_configuration_array['nh_avatar']) && $theme->bot_configuration_array['nh_avatar'] != '')) {
-                $replaceVars['replace'][8] = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] .erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar') . '/' . $theme->bot_configuration_array['nh_avatar'];
+                $replaceVars['replace'][8] = erLhcoreClassSystem::getHost() .erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar') . '/' . $theme->bot_configuration_array['nh_avatar'];
             } else {
-                $replaceVars['replace'][8] = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::design('images/general/operator.png');
+                $replaceVars['replace'][8] = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::design('images/general/operator.png');
             }
         }
 
         $replaceVars['search'][] = '{{need_help_header}}';
         $replaceVars['search'][] = '{{need_help_body}}';
@@ -370,11 +370,11 @@ if ($disableNeedHelp === false && ((isset($theme) && $theme instanceof erLhAbstr
                 '{{need_help_image_url}}',
                 '{{need_help_header}}',
                 '{{need_help_body}}',
             ),
             'replace' => array(
-                '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::design('images/general/operator.png'),
+                erLhcoreClassSystem::getHost() . erLhcoreClassDesign::design('images/general/operator.png'),
                 $translationInstance->getTranslation('chat/getstatus', 'Need help?'),
                 $translationInstance->getTranslation('chat/getstatus', 'Our staff are ready to help!')
             )
         );
     }
@@ -478,17 +478,11 @@ if (isset($gaOptions['ga_enabled']) && $gaOptions['ga_enabled'] == true) {
 
         $outputResponse['ga']['js'] = $gaOptions['ga_js'];
     }
 }
 
-$host = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value;
-
-if ($host == '') {
-    $host = erLhcoreClassBBCode::getHost();
-} else {
-    $host .= '//' . $_SERVER['HTTP_HOST'];
-}
+$host = erLhcoreClassSystem::getHost();
 
 $outputResponse['static'] = array(
     'screenshot' =>  $host . erLhcoreClassDesign::design('js/html2canvas.min.js'). '?v=' . $outputResponse['v'],
     'app' => $host . ((isset($_GET['ie']) && $_GET['ie'] == 'true') ? erLhcoreClassDesign::design('js/widgetv2/react.app.ie.js') . '?v=' . $outputResponse['v'] : erLhcoreClassDesign::design('js/widgetv2/react.app.js') . '?v=' . $outputResponse['v']),
     'vendor' => $host . ((isset($_GET['ie']) && $_GET['ie'] == 'true') ? erLhcoreClassDesign::design('js/widgetv2/vendor.ie.js') . '?v=a2' : erLhcoreClassDesign::design('js/widgetv2/vendor.js') . '?v=a2'),
@@ -504,11 +498,11 @@ $outputResponse['static'] = array(
     'ex_js' => [],
     'ex_cb_js' => []
 );
 
 $outputResponse['chunks_location'] = $host . erLhcoreClassDesign::design('js/widgetv2');
-$outputResponse['domain_lhc'] = $_SERVER['HTTP_HOST'];
+$outputResponse['domain_lhc'] = str_replace(['http://','https://'],'',$host);
 
 erLhcoreClassChatEventDispatcher::getInstance()->dispatch('widgetrestapi.settings', array('output' => & $outputResponse));
 
 erLhcoreClassRestAPIHandler::outputResponse($outputResponse);
 exit();
\ No newline at end of file
diff --git a/lhc_web/modules/lhwidgetrestapi/updatejs.php b/lhc_web/modules/lhwidgetrestapi/updatejs.php
index ddb52a04222..5e1416c64cc 100644
--- a/lhc_web/modules/lhwidgetrestapi/updatejs.php
+++ b/lhc_web/modules/lhwidgetrestapi/updatejs.php
@@ -1,8 +1,8 @@
 <html>
 <head>
-    <script src="//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?t=<?php echo time()?>"></script>
+    <script src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?t=<?php echo time()?>"></script>
     <meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
     <meta http-equiv="cache-control" content="max-age=0" />
     <meta http-equiv="expires" content="0" />
     <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
     <meta http-equiv="pragma" content="no-cache" />
diff --git a/lhc_web/modules/lhxmp/configuration.php b/lhc_web/modules/lhxmp/configuration.php
index cd340bb96d9..d28c956d352 100644
--- a/lhc_web/modules/lhxmp/configuration.php
+++ b/lhc_web/modules/lhxmp/configuration.php
@@ -59,11 +59,11 @@ if ($Params['user_parameters_unordered']['gtalkoauth'] == 'true') {
 	
 	$client->setClientId($data['gtalk_client_id']);
 	$client->setClientSecret($data['gtalk_client_secret']);
 	$client->setApprovalPrompt('force');
 	$client->setAccessType('offline');
-	$client->setRedirectUri(erLhcoreClassXMP::getBaseHost().$_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
+	$client->setRedirectUri(erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
 		
 	if (isset($_GET['code'])) {
 		try {			
 			$client->authenticate();		
 			$data['gtalk_client_token'] = $client->getAccessToken();			
@@ -166,19 +166,19 @@ if ( isset($_POST['StoreXMPGTalkSettings']) || isset($_POST['StoreXMPGTalkSettin
 		// oauth2_client_id, oauth2_client_secret, and register your oauth2_redirect_uri.
 		$client->setClientId($data['gtalk_client_id']);
 		$client->setClientSecret($data['gtalk_client_secret']);
 		$client->setApprovalPrompt('force');
 		$client->setAccessType('offline');
-		$client->setRedirectUri(erLhcoreClassXMP::getBaseHost().$_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
+		$client->setRedirectUri(erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
 			
 		if ( !$client->getAccessToken() ) {
 			header('Location: '.$client->createAuthUrl());
 			exit;
 		}
 	}
 	
-	$tpl->set('updated','done');	
+	$tpl->set('updated','done');
 }
 
 
 if ( isset($_POST['StoreXMPSettings']) || isset($_POST['StoreXMPSettingsTest']) ) {
 
diff --git a/lhc_web/settings/settings.ini.default.php b/lhc_web/settings/settings.ini.default.php
index 8b2d3cbc4eb..a44d2e1a14c 100644
--- a/lhc_web/settings/settings.ini.default.php
+++ b/lhc_web/settings/settings.ini.default.php
@@ -24,10 +24,13 @@ return array (
                     'date_date_hour_format' => 'Y-m-d H:i:s',
                     'default_site_access' => 'eng',
                     'maps_api_key' => false,
                     'default_group' => '',
                     'default_user' => '',
+                    'site_address' => '',
+                    'trusted_host_patterns' => [
+                    ],
                     'extensions' =>
                         array (
                             // 0 => 'customstatus',
                         ),
                     'available_site_access' =>

Vulnerable code:             $randomHash = erLhcoreClassModelForgotPassword::randomPassword(9);
            $exportHash = erLhcoreClassModelForgotPassword::randomPassword(9);
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widgetclosed')?>/<?php echo $invite->hash?>');
                       ' src="<?php if ($invite->custom_iframe_url != '') : ?><?php echo $invite->custom_iframe_url ?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widget')?>/<?php echo $invite->hash?><?php endif;?>"' +                    
         s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('browseoffer/addhit')?>/<?php echo $invite->hash?>');
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'browseoffer/getstatus'+size+id_size_height+topposition+id_timeout+id_show_overlay+id_identifier+id_canreopen+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
    <span class="material-icons user-select-none">vpn_key</span><span><?php echo $chat->id;?></span><button data-success="Copied" class="ml-1 btn btn-xs btn-link text-muted py-1" data-copy="<?php echo (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ?><?php echo erLhcoreClassDesign::baseurl('front/default')?>/(cid)/<?php echo $chat->id?>/#!#chat-id-<?php echo $chat->id?>" onclick="lhinst.copyContent($(this))" type="button"><i class="material-icons">link</i>Copy link</button>
        var invitationURL =  '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
                        $replaceStyleArray['{proactive_img_' . $i . '}'] =  erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . $visitor->invitation->{'design_data_img_' . $i . '_url'};
            var urlInvitation = '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
            <img width="20" height="20" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
    	return "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/startchat<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>"+this.survey_id;
            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatwidgetclosed'+this.getAppendCookieArguments()+'?ts='+Date.now());
        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updateattribute'+this.getAppendCookieArguments(), true);
            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(vid)/'+vid + lh_inst.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+inst.tag+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(tz)/' + tzOffset + this.survey_id + '/(count_page)/1/(vid)/'+vid+'/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+this.tag+this.parseStorageArguments()+this.parseOptionsOnline()+this.parseOptions()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logpageview<?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>/(tz)/'+tzOffset+'/(vid)/' + vid + this.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+'?l='+locationCurrent+this.parseStorageArguments()+this.parseOptionsOnline()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updatejsvars'+this.getAppendCookieArguments(), true);
                 xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logevent'+this.getAppendCookieArguments(), true);
            xhr.open( "GET", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/extendcookie/'+this.cookieDataPers.vid, true);
			        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+inst.lang+'/chat/setnewvid', true);
		        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/html2canvas.min.js');?>');
						         xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/file/storescreenshot'+inst.getAppendCookieArguments(), true);
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/finishsession/(sharemode)/'+lh_inst.sharemode+lh_inst.getAppendCookieArguments());
			        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js');?>');
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckstatus<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(uaction)/'+sender+'/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/refreshcustomfields'+this.getAppendCookieArguments() , true);
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/htmlsnippet/'+messageId+'/'+optionsParts[0]+"/"+optionsParts[1]+'<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
            originDomain !== '<?php echo $_SERVER['HTTP_HOST']?>' &&
    '<?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header'])?><?php endif?><div id="<?php echo $chatCSSPrefix?>_header"><?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header_body'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header_body'])?><?php endif?><?php if ($theme === false || $theme->hide_close == 0) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a><?php endif; ?><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></div>' +
raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;overflow:hidden;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #FFF;font-size: 12px;font-weight: bold;padding-left: 5px;line-height: 20px;} \n#<?php echo $chatCSSPrefix?>_min{float:left;padding:2px;}#<?php echo $chatCSSPrefix?>_remote_window,#<?php echo $chatCSSPrefix?>_close{padding:2px;float:right;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_close:hover,#<?php echo $chatCSSPrefix?>_min:hover,#<?php echo $chatCSSPrefix?>_remote_window:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) { .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position']?>}}";
                              '" id="<?php echo $chatCSSPrefix?>_status-icon-restore" href="#" ><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></a><div id="<?php echo $chatCSSPrefix?>_header"><ul class="<?php echo $chatCSSPrefix?>-cf"><li><a href="#">&#9776;</a><ul class="<?php echo $chatCSSPrefix?>-cf"><?php if ($theme === false || $theme->hide_close == 0) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></li><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a></li><?php endif; ?></ul></li></ul><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a></div>' +
raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSLayoutOptions['container_id']?> .status-icon{display:none;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{display:inline-block;<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon.offline-status-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center center}<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/burger_menu_css.tpl.php')); ?> #<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;max-width: none}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #ffffff;font-size: 12px;font-weight: normal;line-height: 23px;position: absolute;background-color: red;border-radius: 37px;display: inline-block;padding-left: 8px;padding-right: 8px;margin-top: -5px;margin-left: -4px;} \n#<?php echo $chatCSSPrefix?>_min{float:right;padding:2px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($iconsStatuses['restore_image_url'] == false) : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php endif; if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_min:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;	overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) {ul.<?php echo $chatCSSPrefix?>-cf li ul a{padding:8px 14px!important} ul.<?php echo $chatCSSPrefix?>-cf li:hover ul, ul.<?php echo $chatCSSPrefix?>-cf li ul {top: 30px;} .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important}} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{display:none;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position_modern']?>}";
            lh_inst.showStartWindow('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
        lh_inst.showStartWindow('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
        document.getElementById('<?php echo $chatCSSPrefix?>_iframe').contentWindow.location.replace("<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
        document.getElementById('<?php echo $chatCSSPrefix?>_iframe_page').contentWindow.location.replace("<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget/(mode)/embed<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
        xhr.open( "POST", '<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+that.lang+'/notifications/subscribe<?php $theme !== false ? print '/(theme)/' . (is_object($theme) ? $theme->id : $theme) : ''?>' + (subscribe == true ? '/(action)/sub' : '/(action)/unsub') + that.getAppendCookieArguments(), true);
        this.showStartWindow("<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/notifications/read/<?php $theme !== false ? print '/(theme)/'.(is_object($theme) ? $theme->id : $theme) : ''?>/(id)/"+chat_id+"/(hashread)/"+hash+"/(mode)/widget");
    this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
            this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
    	var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background-image:url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>')}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;-moz-box-shadow:<?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);padding:5px 0px 0px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{padding:32px 15px 9px 31px;background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status']?>}}\n";
        var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-invitation-status{display:none;position:absolute;}#<?php echo $chatCSSPrefix?>_status_container.<?php echo $chatCSSPrefix?>_invitation-mode .<?php echo $chatCSSPrefix?>-invitation-status{width: 16px;height:16px;padding: 2px;border-radius: 10px;text-align: center;font-weight: bold;color: #FFF;background-color: red;display: inline-block;}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover_modern']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;padding:5px 0px 0px 5px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position_modern']?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status_modern']?>}}\n";
LHC_API.args = {'lang':'<?php echo $lang?>',mode:'<?php echo $mode?>'<?php (isset($position) && $position == 'api') ? print ",position:'api'" : ''?>,lhc_base_url:'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('/')?>',domain: lhc_domain, wheight:<?php isset($wheight) ? print (int)$wheight : print 450?>, wwidth:<?php isset($wwidth) ? print (int)$wwidth : print 350?>,pheight:520,pwidth:500<?php if (is_array($depId) && !empty($depId)) : ?>,department:[<?php echo implode(',',$depId)?>]<?php endif;?><?php if ($leaveamessage == true) : ?>,leaveamessage:true<?php endif; ?><?php if ($disable_pro_active == true) : ?>,proactive:false<?php else : ?>,check_messages:true<?php endif;?><?php isset($uparams['theme']) & is_numeric($uparams['theme']) ? print ',theme:' . (int)$uparams['theme'] : ''?>};
var date = new Date();po.src = '//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js');?>?v1'+(""+date.getFullYear() + date.getMonth() + date.getDate());
document.getElementById('<?php echo $chatCSSPrefix?>_status_container').innerHTML = '<p class="<?php echo $chatCSSPrefix?>-status-native-'+(this.isOnline == true ? 'online' : 'offline')+'"><a href="#" onclick="return lh_inst.lh_openchatWindow()">'+(this.isOnline == true ? '<img src="<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->online_text !== '') : print htmlspecialchars_decode($theme->online_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is online...')?><?php endif?>' : '<img src="<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->offline_text != '') : print htmlspecialchars_decode($theme->offline_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is offline...')?><?php endif;?>')+'</a></p>';
var imageTooltip = (typeof <?php echo $chatOptionsVariable;?>.opt.nh_image != 'undefined') ? <?php echo $chatOptionsVariable;?>.opt.nh_image : '<?php if ($theme !== false && $theme->need_help_image_url !== false) : print $theme->need_help_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/operator.png');?><?php endif;?>';
            s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidgetclosed')?>/(eclose)/t'+this.getAppendCookieArguments());
            this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidget')?><?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>/(mode)/embed" + (mobileFullHeight === false ? '/(mobile)/false' : '') + this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments();
            <img class="profile-msg-pic" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($chat->bot->avatar)?>" alt="" />
                    <img class="profile-msg-pic" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($userMessage->avatar)?>" alt="" />
                <img class="profile-msg-pic" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
<img width="48" height="48" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
                <img width="48" height="48" src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_chatbox_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" rel="noreferrer" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_faq_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank" rel="noreferrer"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_questionary_title"><a rel="noreferrer" title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme : ''?>/(mode)/embed/(identifier)/"+<?php echo $chatboxOptionsVariablePage;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariablePage;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/embed'+chat_height+id_theme+"';\n"+
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidgetclosed')?>');
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>/(identifier)/"+<?php echo $chatboxOptionsVariable;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariable;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
                              '<div id="lhc_chatbox_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/chatbox.tpl.php')); ?><?php if ($show_content === false) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_chatbox_close"><img src="<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if ($disable_min === false) : ?><a href="#" id="lhc_chatbox_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><?php endif;?></div><div id="lhc_iframe_container">' +
          raw_css = ".lhc-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n.lhc-min{height:35px !important}\n#lhc_container_chatbox * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;font-size:12px\;line-height:100%\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_chatbox img {border:0;}\n#lhc_chatbox_title{float:left;}\n#lhc_chatbox_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_chatbox_close,#lhc_chatbox_min{padding:2px;float:right;}.lhc-min #lhc_chatbox_min{background-image:url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#lhc_chatbox_min{width:14px;height:14px;background:url(<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>) no-repeat center center;}\n\n#lhc_chatbox_close:hover,#lhc_chatbox_min:hover{opacity:0.4}\n#lhc_container_chatbox {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_chatbox iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_chatbox iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_chatbox #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_chatbox{margin-bottom:5px;position:relative;right:0 !important;bottom:0 !important;top:0 !important}#lhc_container_chatbox iframe{width:100% !important}}";
       var raw_css = "#lhc_chatbox_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_chatbox_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/emotion_amazing.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_chatbox_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_chatbox_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;line-height:100%;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_chatbox_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/getstatus'+id_position+top+id_disable_responsive+topposition+widthwidget+id_theme+heightwidget+chat_height+show_content+show_min+dis_min+"';\n"+
var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'chat','lhcbase':'<?php echo (erLhcoreClassSystem::$httpsMode == true ? 'https://' : 'http://').$_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : $_SERVER['HTTP_HOST'])?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'chat_hash':'<?php echo $browse->chat->hash?>','chat_id':<?php echo $browse->chat_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'onlineuser','lhcbase':'<?php echo (erLhcoreClassSystem::$httpsMode == true ? 'https://' : 'http://').$_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value)?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'online_user_hash':'<?php echo $browse->online_user->vid?>','online_user_id':<?php echo $browse->online_user_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
this.cobrowser = new LHCCoBrowser({'formsenabled':formsEnabled,'chat_hash':this.sharehash,'nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : $_SERVER['HTTP_HOST'])?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'trans':{'operator_watching':<?php echo json_encode(htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Screen shared, click to finish'),ENT_QUOTES))?>},'url':'<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/storenodemap/(sharemode)/'+inst.sharemode+inst.getAppendCookieArguments()+'/?url='+encodeURIComponent(location.href.match(/^(.*\/)[^\/]*$/)[1])});
<url><![CDATA[http://<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('chat/single')?>/<?php echo $chat->id?>]]></url>
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/embed'+id_theme+"';\n"+
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
                              '<div id="lhc_faq_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/faq.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_faq_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
          raw_css = "#lhc_container_faq * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_faq img {border:0;}\n#lhc_faq_title{float:left;}\n#lhc_faq_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_faq_close{padding:2px;float:right;}\n#lhc_faq_close:hover{opacity:0.4;}\n#lhc_container_faq {-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;width:490px;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#lhc_container_faq iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_faq iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_faq #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_faq{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;width:100%;}#lhc_container_faq iframe{width:100% !important}}";
       var raw_css = "#lhc_faq_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0;}\n#lhc_faq_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/help.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_faq_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_faq_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_faq_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/getstatus'+id_position+top+topposition+id_theme+id_disable_responsive+"';\n"+
      <input type="text" class="form-control" value="<?php echo erLhcoreClassXMP::getBaseHost(). $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('form/fill')?>/<?php echo $form->id?>">
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('form/formwidget')?>/<?php echo $form_id,$identifier?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'form/embed/'+formid+identifier+"';\n"+
            <?php elseif ($item['type'] == 'file') : $fileReply = erLhcoreClassModelChatFile::fetch($item['content']['payload']); if ($fileReply instanceof erLhcoreClassModelChatFile) : $fileLink = '//'. $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$fileReply->id}/{$fileReply->security_hash}"; ?>
        <input type="text" class="form-control" name="http_host" value="<?php (isset($n_settings['http_host']) && !empty($n_settings['http_host'])) ? print htmlspecialchars($n_settings['http_host']) : print $_SERVER['HTTP_HOST']?>">
        <input type="text" class="form-control" name="icon" value="<?php if (isset($n_settings['icon'])) : ?><?php print htmlspecialchars($n_settings['icon']); else : ?>https://<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
        <input type="text" class="form-control" name="badge" value="<?php if (isset($n_settings['badge'])) : ?><?php print htmlspecialchars($n_settings['badge']); else : ?>https://<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent;
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/embed'+id_theme+'\';'+"\n"+
        s.setAttribute('src','<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidgetclosed')?>');
   		  this.initial_iframe_url = "<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>"+'?URLReferer='+locationCurrent;
                              '<div id="lhc_questionary_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/questionary.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_questionary_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
          raw_css = "#lhc_container_questionary * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_questionary img {border:0;}\n#lhc_questionary_title{float:left;}\n#lhc_questionary_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_questionary_close{padding:2px;float:right;}\n#lhc_questionary_close:hover{opacity:0.4;}\n#lhc_container_questionary {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF;z-index:9990;position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_questionary iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_questionary iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }#lhc_container_questionary #lhc_iframe_container{border: <?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}@media only screen and (max-width : 640px) {#lhc_container_questionary{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;}#lhc_container_questionary iframe{width:100% !important}}";
       var raw_css = "#lhc_questionary_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_questionary_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value?>//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('images/icons/plant.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_questionary_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_questionary_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_questionary_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/getstatus'+id_position+id_disable_responsive+id_show_widget_on_open+top+topposition+widthwidget+id_theme+heightwidget+"';\n"+
<textarea style="width: 100%; height: 180px; font-size: 12px;" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="//'.$_SERVER['HTTP_HOST'].erLhcoreClassDesign::baseurl('chat/getstatus').'"></script>')?></textarea>
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chat/getstatusembed<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_hide_then_offline+id_theme+id_operator+id_show_leave_form+id_department+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
<textarea style="width: 100%; height: 200px; font-size: 11px;" class="form-control" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="http://'.$_SERVER['HTTP_HOST'].erLhcoreClassDesign::baseurl('chat/getstatus').'"></script>')?></textarea>
        'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+(id_detect_language == false ? siteAccess : '\'+_l+\'')+'chat/getstatus<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_internal_popup+id_position+id_ma+id_hide_then_offline+id_disable_online_tracking+id_check_operator_message+top+topposition+id_show_leave_form+id_department+id_operator+id_identifier+id_disable_pro_active_invitations+id_theme+id_product+id_survey+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
                    var baseURL = '<?php echo erLhcoreClassXMP::getBaseHost()?><?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurl('restapi/onlineimage')?>' + department + operator + theme + '?' + onlineText + offlineText + width;
        $('#static-url-generated').val($('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccessStatic +'chat/start'+id_survey_static+id_operator_static+id_fresh_status+id_department_static+id_theme_static+id_identifier_static);
            'var LHC_API = LHC_API||{};'+"\n"+'LHC_API.args = {mode:\''+id_widget_mode+'\',lhc_base_url:\'' + $('#HttpMode').val() + '//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect()?>\',wheight:'+$('#id_widget_height').val()+',wwidth:'+$('#id_widget_width').val()+',pheight:'+$('#id_popup_height').val()+',pwidth:'+$('#id_popup_width').val()+id_operator+id_embed_domain+id_fresh+id_show_leave_form+id_department+id_theme+id_survey+id_widget_position+id_check_messages_operator+id_disable_pro_active_invitations+id_identifier+siteAccess+id_position_placement+'};\n'+
            'po.src = \''+$('#HttpMode').val()+'//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?\'+(""+date.getFullYear() + date.getMonth() + date.getDate());'+"\n"+
        <p class="font-weight-bold">More information</p>
                                <input type="text" class="form-control" readonly="readonly" id="copy-url-<?php echo $i?>" data-original-url="<?php echo erLhcoreClassSystem::$httpsMode == 'true' ? 'https://' : 'http://'?><?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::baseurldirect('/')?>" value="">
    <input type="text" ng-non-bindable class="form-control form-control-sm" id="api-incoming-url" data-base="<?php echo erLhcoreClassXMP::getBaseHost().(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '')?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/" value="<?php echo erLhcoreClassXMP::getBaseHost().(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '')?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/<?php echo htmlspecialchars($item->identifier);?>">
				<input class="form-control" type="text" value="<?php echo htmlspecialchars(erLhcoreClassXMP::getBaseHost().$_SERVER['HTTP_HOST'])?><?php echo erLhcoreClassDesign::baseurl('xmp/configuration')?>/(gtalkoauth)/true" />

       if (isset($_SERVER['HTTP_HOST'])) {
           $site_address = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
       } else if (class_exists('erLhcoreClassInstance')) {
           $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
       } else if (class_exists('erLhcoreClassExtensionLhcphpresque')) {
           $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
       } else {
           $site_address = '';
       }

       return $site_address;

        if (isset($_SERVER['HTTP_HOST'])) {
            $site_address = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
        } else if (class_exists('erLhcoreClassInstance')) {
            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
        } else if (class_exists('erLhcoreClassExtensionLhcphpresque')) {
            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
        } else {
            $site_address = '';
        }

        return $site_address;
            $URL =  (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . erLhcoreClassDesign::baseurldirect('form/formwidget') . '/' . $URL;
                $url = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$item->id));
        $url = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('chat/readchatmail') . '/' . $chat->id . '/' . sha1($secretHash . $chat->hash . $chat->id);
    	$mail->Body = str_replace(array('{email}','{question}','{url_request}','{url_question}'), array($faq->email,$faq->question,erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('faq/view/'.$faq->id)),$faq->url), $sendMail->content);
    		$prefillchat = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$params['chatprefill']->id));
    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
    			$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
    	$mail->Body = str_replace(array('{identifier}','{form_name}','{content}','{ip}','{url_download}','{url_view}'), array($formCollected->identifier,(string)$formCollected->form, $formCollected->form_content, $formCollected->ip, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/downloaditem/'.$formCollected->id)), erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/viewcollected/'.$formCollected->id))), $sendMail->content);
    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,(isset($_SERVER['HTTP_HOST'])) ?  erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
	    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,(isset($_SERVER['HTTP_HOST'])) ?  erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
                (isset($_SERVER['HTTP_HOST']) ? erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . $appendURL : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . $appendURL),
                    (isset($_SERVER['HTTP_HOST']) ? erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . $appendURL : erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value . $appendURL),
    
    			$downloadLink = "<a href=\"http://".$_SERVER['HTTP_HOST'].erLhcoreClassDesign::baseurl('form/download').'/'.self::$collectedObject->id.'/'.self::$collectedObject->hash.'/'.$params['name']."\">Download (".htmlspecialchars($valueContent['name']).")</a>";
                    if (isset($_SERVER['HTTP_HOST'])) {
                        $url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
                    } else {
                        if (class_exists('erLhcoreClassInstance')) {
                            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
                        } else {
                            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
                        }
                        $url = $site_address . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
                    }
                    if (isset($_SERVER['HTTP_HOST'])) {
                        $file_url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$mediaFile->id}/{$mediaFile->security_hash}";
                    } else {
                        if (class_exists('erLhcoreClassInstance')) {
                            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
                        } else {
                            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
                        }
                        $file_url = $site_address . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$mediaFile->id}/{$mediaFile->security_hash}";
                    }
                        if (isset($_SERVER['HTTP_HOST'])) {
                            $file_url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . $file->remote_url;
                        } else {
                            if (class_exists('erLhcoreClassInstance')) {
                                $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
                            } else {
                                $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
                            }
                            $file_url = $site_address . $file->remote_url;
                        }
                $chats[$index]->link = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$chat->id));
						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,self::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,self::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$emailGroup,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
							$conn->message($email,str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,self::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email, $chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]));
                $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login') . '/(r)/' . rawurlencode(base64_encode('form/download/' . $this->id . '/' . $nameAttr));
               $host = '//'.$_SERVER['HTTP_HOST'];
	   	           $this->$var =  ($this->{$attr.'_path'} != '' ? (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) . '/' . $this->{$attr.'_path'} . $this->$attr;
	   				$this->$var = '<img src="'.($this->{$attr.'_path'} != '' ? (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'.$this->{$attr.'_path'} . $this->$attr.'"/>';
                $this->photo_path = ($this->filepath != '' ? '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
                $this->photo_path = ($this->filepath != '' ? '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
       			$this->photo_path = ($this->filepath != '' ? '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
if (isset($url['host']) && $url['host'] != '' && strpos($_GET['css'], $_SERVER['HTTP_HOST']) === false) {
			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
                    $randomHash = erLhcoreClassModelForgotPassword::randomPassword(9);
                    $exportHash = erLhcoreClassModelForgotPassword::randomPassword(9);
                        $url[] = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('/') . preg_replace('/^lh/', '', $urlData);
                            $url = (erLhcoreClassSystem::$httpsMode == true ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
        return $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect("user/autologin") . "/{$hashValidation}".implode('', $dataRequestAppend);
                echo json_encode(array('error' => false, 'msg' => 'Session started', 'url' => erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('site_admin').'/'.ltrim($r,'/')));
    array(erLhcoreClassDesign::baseurldirect(),time(),$_SERVER['HTTP_HOST'], $append_definitions, $append_paths, $chats_parameters,$elastic_definition,$elastic_mail)
			$host = $_SERVER['HTTP_HOST'];
                    $replaceStyleArray['{proactive_img_' . $i . '}'] = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . $userInstance->invitation->{'design_data_img_' . $i . '_url'};
        'nodejshost' => (erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : $_SERVER['HTTP_HOST']),
    'cobrowser' => erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js'),
    'url' => erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurlsite() . '/cobrowse/storenodemap/(sharemode)/chat'
                $replaceVars['replace'][8] = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] .erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar') . '/' . $theme->bot_configuration_array['nh_avatar'];
                $replaceVars['replace'][8] = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value . '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::design('images/general/operator.png');
                '//' . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::design('images/general/operator.png'),
$host = erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value;

if ($host == '') {
    $host = erLhcoreClassBBCode::getHost();
} else {
    $host .= '//' . $_SERVER['HTTP_HOST'];
}
$outputResponse['domain_lhc'] = $_SERVER['HTTP_HOST'];
    <script src="//<?php echo $_SERVER['HTTP_HOST']?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?t=<?php echo time()?>"></script>
	$client->setRedirectUri(erLhcoreClassXMP::getBaseHost().$_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
		$client->setRedirectUri(erLhcoreClassXMP::getBaseHost().$_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
	$tpl->set('updated','done');	
Fixed code:             $randomHash = erLhcoreClassModelForgotPassword::randomPassword(80);
            $exportHash = erLhcoreClassModelForgotPassword::randomPassword(80);
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widgetclosed')?>/<?php echo $invite->hash?>');
                       ' src="<?php if ($invite->custom_iframe_url != '') : ?><?php echo $invite->custom_iframe_url ?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('browseoffer/widget')?>/<?php echo $invite->hash?><?php endif;?>"' +
         s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('browseoffer/addhit')?>/<?php echo $invite->hash?>');
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'browseoffer/getstatus'+size+id_size_height+topposition+id_timeout+id_show_overlay+id_identifier+id_canreopen+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
    <span class="material-icons user-select-none">vpn_key</span><span><?php echo $chat->id;?></span><button data-success="Copied" class="ml-1 btn btn-xs btn-link text-muted py-1" data-copy="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('front/default')?>/(cid)/<?php echo $chat->id?>/#!#chat-id-<?php echo $chat->id?>" onclick="lhinst.copyContent($(this))" type="button"><i class="material-icons">link</i>Copy link</button>
        var invitationURL =  '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
                        $replaceStyleArray['{proactive_img_' . $i . '}'] = erLhcoreClassSystem::getHost() . $visitor->invitation->{'design_data_img_' . $i . '_url'};
            var urlInvitation = '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $tag !== false ? print '/(tag)/' . $tag : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>';
            <img width="20" height="20" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
    	return "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/startchat<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>"+this.survey_id;
            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatwidgetclosed'+this.getAppendCookieArguments()+'?ts='+Date.now());
        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updateattribute'+this.getAppendCookieArguments(), true);
            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(vid)/'+vid + lh_inst.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+inst.tag+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckoperatormessage<?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?>/(tz)/' + tzOffset + this.survey_id + '/(count_page)/1/(vid)/'+vid+'/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+dynamic+'?l='+locationCurrent+this.tag+this.parseStorageArguments()+this.parseOptionsOnline()+this.parseOptions()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logpageview<?php $department !== false ? print '/(department)/'.$department : ''?><?php $identifier !== false ? print '/(identifier)/'.htmlspecialchars($identifier) : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>/(tz)/'+tzOffset+'/(vid)/' + vid + this.survey_id + '/(uactiv)/'+lh_inst.userActive+'/(wopen)/'+lh_inst.timeoutStatusWidgetOpen+'?l='+locationCurrent+this.parseStorageArguments()+this.parseOptionsOnline()+'&dt='+encodeURIComponent(document.title)+'&ts='+Date.now());
        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/updatejsvars'+this.getAppendCookieArguments(), true);
                 xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/logevent'+this.getAppendCookieArguments(), true);
            xhr.open( "GET", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/extendcookie/'+this.cookieDataPers.vid, true);
			        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+inst.lang+'/chat/setnewvid', true);
		        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('js/html2canvas.min.js');?>');
						         xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/file/storescreenshot'+inst.getAppendCookieArguments(), true);
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/finishsession/(sharemode)/'+lh_inst.sharemode+lh_inst.getAppendCookieArguments());
			        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js');?>');
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/chatcheckstatus<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(uaction)/'+sender+'/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/chat/refreshcustomfields'+this.getAppendCookieArguments() , true);
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+this.lang+'/chat/htmlsnippet/'+messageId+'/'+optionsParts[0]+"/"+optionsParts[1]+'<?php $department !== false ? print '/(department)/'.$department : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?><?php $disable_online_tracking === true ? print '/(dot)/true' : ''?><?php $hide_offline == 'true' ? print '/(hide_offline)/true' : ''?>/(status)/' + this.isOnline + this.survey_id + (this.cookieDataPers.vid ? '/(vid)/'+this.cookieDataPers.vid : '')+ hashAppend + hashResume + '/(uactiv)/'+this.userActive+'/(wopen)/'+this.timeoutStatusWidgetOpen + '/(isproactive)/'+this.isProactivePending+'/?ts='+Date.now());
            originDomain !== '<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?>' &&
    '<?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header'])?><?php endif?><div id="<?php echo $chatCSSPrefix?>_header"><?php if ($theme !== false && isset($theme->bot_configuration_array['custom_html_header_body'])) : ?><?php echo str_replace(array("\n","\r"), '',$theme->bot_configuration_array['custom_html_header_body'])?><?php endif?><?php if ($theme === false || $theme->hide_close == 0) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a><?php endif; ?><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></div>' +
raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;overflow:hidden;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #FFF;font-size: 12px;font-weight: bold;padding-left: 5px;line-height: 20px;} \n#<?php echo $chatCSSPrefix?>_min{float:left;padding:2px;}#<?php echo $chatCSSPrefix?>_remote_window,#<?php echo $chatCSSPrefix?>_close{padding:2px;float:right;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_close:hover,#<?php echo $chatCSSPrefix?>_min:hover,#<?php echo $chatCSSPrefix?>_remote_window:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) { .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position']?>}}";
                              '" id="<?php echo $chatCSSPrefix?>_status-icon-restore" href="#" ><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','New messages')?>" id="<?php echo $chatCSSPrefix?>-msg-number"></i></a><div id="<?php echo $chatCSSPrefix?>_header"><ul class="<?php echo $chatCSSPrefix?>-cf"><li><a href="#">&#9776;</a><ul class="<?php echo $chatCSSPrefix?>-cf"><?php if ($theme === false || $theme->hide_close == 0) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="<?php echo $chatCSSPrefix?>_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></li><?php endif;?><?php if (erLhcoreClassModelChatConfig::fetch('disable_popup_restore')->current_value == 0 && ($theme === false || $theme->hide_popup == 0)) : ?><li><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" id="<?php echo $chatCSSPrefix?>_remote_window"><img src="<?php if ($theme !== false && $theme->popup_image_url != '') : ?><?php echo $theme->popup_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/application_double.png');?><?php endif;?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Open in a new window')?>" /></a></li><?php endif; ?></ul></li></ul><a href="#" id="<?php echo $chatCSSPrefix?>_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a></div>' +
raw_css = "#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min {overflow:hidden}#<?php echo $chatCSSLayoutOptions['container_id']?> .status-icon{display:none;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{display:inline-block;<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon.offline-status-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center center}<?php include(erLhcoreClassDesign::designtpl('lhchat/getstatus/burger_menu_css.tpl.php')); ?> #<?php echo $chatCSSPrefix?>_remote_window{padding-left:5px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{min-width:107px} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_iframe_container{display:none} .<?php echo $chatCSSPrefix?>-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed{visibility:hidden;position: fixed;left: -90000px!important;right: auto!important;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-delayed .<?php echo $chatCSSPrefix?>-cf{display:none}\n#<?php echo $chatCSSLayoutOptions['container_id']?> * {line-height:100%;direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;-moz-box-sizing:content-box;padding:0;margin:0;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> img {border:0;max-width: none}\n#<?php echo $chatCSSPrefix?>_header{position:relative;z-index:2147483640;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '17' ?>px;text-align:right;clear:both;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}#<?php echo $chatCSSPrefix?>-msg-number{float: left;color: #ffffff;font-size: 12px;font-weight: normal;line-height: 23px;position: absolute;background-color: red;border-radius: 37px;display: inline-block;padding-left: 8px;padding-right: 8px;margin-top: -5px;margin-left: -4px;} \n#<?php echo $chatCSSPrefix?>_min{float:right;padding:2px;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_min:before{content:url(<?php if ($iconsStatuses['restore_image_url'] == false) : ?><?php echo erLhcoreClassSystem::getHost()?><?php endif; if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#<?php echo $chatCSSPrefix?>_min:before{content: url('<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>'); position: relative;left:0;top;0} #<?php echo $chatCSSPrefix?>_min{width:14px;height:14px;}\n#<?php echo $chatCSSPrefix?>_min:hover{opacity:0.4;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> {background-color:#FFF;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab;max-height: 100%;	overflow: auto;\nz-index:2147483640;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{position:relative;display:block;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n#<?php echo $chatCSSLayoutOptions['container_id']?> iframe.<?php echo $chatCSSPrefix?>-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n@media only screen and (max-device-width : <?php ($theme !== false && $theme->widget_response_width > 0) ? print $theme->widget_response_width : print 992?>px) {ul.<?php echo $chatCSSPrefix?>-cf li ul a{padding:8px 14px!important} ul.<?php echo $chatCSSPrefix?>-cf li:hover ul, ul.<?php echo $chatCSSPrefix?>-cf li ul {top: 30px;} .<?php echo $chatCSSPrefix?>-opened{position: fixed; overflow: hidden; right: 0px; left: 0px; top: 0px; bottom: 0px;} #<?php echo $chatCSSPrefix?>_header{height:30px;} #<?php echo $chatCSSPrefix?>_header a{padding:7px;}#<?php echo $chatCSSLayoutOptions['container_id']?>{position:fixed;left:0!important;right:0!important;bottom:0!important;top:0!important;border:0;border-radius:0}#<?php echo $chatCSSLayoutOptions['container_id']?> #<?php echo $chatCSSPrefix?>_iframe_container{border:0;height: calc(100% - 40px)}#<?php echo $chatCSSLayoutOptions['container_id']?> iframe{width:100% !important;height: 100%!important}} .<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header{display:none;}.<?php echo $chatCSSPrefix?>-min #<?php echo $chatCSSPrefix?>_header a{padding:2px;} #<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;}#<?php echo $chatCSSLayoutOptions['container_id']?>.<?php echo $chatCSSPrefix?>-min{<?php echo $currentPosition['mobile_position_modern']?>}";
            lh_inst.showStartWindow('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
        lh_inst.showStartWindow('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/readoperatormessage')?>/(inv)/<?php echo $invitation->id?><?php $department !== false ? print '/(department)/'.$department : '' ?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?><?php $survey !== false ? print '/(survey)/'.$survey : ''?>/(vid)/<?php echo $vid;?><?php $visitor->invitation_assigned == true ? print '/(playsound)/true' : ''?>/(fullheight)/<?= $fullheight ? 'true' : 'false' ?>',true);
        document.getElementById('<?php echo $chatCSSPrefix?>_iframe').contentWindow.location.replace("<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
        document.getElementById('<?php echo $chatCSSPrefix?>_iframe_page').contentWindow.location.replace("<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/survey/fillwidget/(mode)/embed<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php is_object($theme) ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title));
        xhr.open( "POST", '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+that.lang+'/notifications/subscribe<?php $theme !== false ? print '/(theme)/' . (is_object($theme) ? $theme->id : $theme) : ''?>' + (subscribe == true ? '/(action)/sub' : '/(action)/unsub') + that.getAppendCookieArguments(), true);
        this.showStartWindow("<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/notifications/read/<?php $theme !== false ? print '/(theme)/'.(is_object($theme) ? $theme->id : $theme) : ''?>/(id)/"+chat_id+"/(hashread)/"+hash+"/(mode)/widget");
    this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
            this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>"+this.lang+"/chat/chatwidget<?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?= isset($currentPosition['full_height']) && $currentPosition['full_height'] ?  '/(fullheight)/true' : '/(fullheight)/false' ?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : '' ?>"+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments()+'&dt='+encodeURIComponent(document.title);
    	var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background-image:url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>')}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;-moz-box-shadow:<?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);padding:5px 0px 0px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{padding:32px 15px 9px 31px;background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status']?>}}\n";
        var raw_css = "#<?php echo $chatCSSPrefix?>_status_container.hide-status,#<?php echo $chatCSSPrefix?>_status_container.hide-status-delay{display:none!important;}#<?php echo $chatCSSPrefix?>_status_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site','dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-invitation-status{display:none;position:absolute;}#<?php echo $chatCSSPrefix?>_status_container.<?php echo $chatCSSPrefix?>_invitation-mode .<?php echo $chatCSSPrefix?>-invitation-status{width: 16px;height:16px;padding: 2px;border-radius: 10px;text-align: center;font-weight: bold;color: #FFF;background-color: red;display: inline-block;}\n#<?php echo $chatCSSPrefix?>_status_container .status-icon{<?php echo $currentPosition['border_status_modern']?>;<?php echo $currentPosition['widget_radius_modern']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);-moz-box-shadow:<?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);box-shadow: <?php echo $currentPosition['shadow_modern']?> rgba(50, 50, 50, 0.5);text-decoration:none;height:41px;width:41px;font-weight:bold;color:<?php $theme !== false ? print '#'.$theme->text_color : print '#000' ?>;display:block;padding:10px;background:#<?php $theme !== false ? print $theme->onl_bcolor : print '0c8fc4' ?> url('<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/online.svg');?><?php endif;?>') no-repeat center center}\n#<?php echo $chatCSSPrefix?>_status_container:hover{<?php echo $currentPosition['widget_hover_modern']?>}\n#<?php echo $chatCSSPrefix?>_status_container #offline-icon{background:#888888 url('<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/getstatus/offline.svg');?><?php endif;?>') no-repeat center}\n#<?php echo $chatCSSPrefix?>_status_container{box-sizing: content-box;padding:5px 0px 0px 5px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position_modern']?>;z-index:2147483647;}@media only screen and (max-width : 640px) {#<?php echo $chatCSSPrefix?>_need_help_container{display:none;}#<?php echo $chatCSSPrefix?>_status_container .status-icon{background-position:center center;}#<?php echo $chatCSSPrefix?>_status_container .<?php echo $chatCSSPrefix?>-text-status{display:none} #<?php echo $chatCSSPrefix?>_status_container{<?php echo $currentPosition['mobile_position_status_modern']?>}}\n";
LHC_API.args = {'lang':'<?php echo $lang?>',mode:'<?php echo $mode?>'<?php (isset($position) && $position == 'api') ? print ",position:'api'" : ''?>,lhc_base_url:'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('/')?>',domain: lhc_domain, wheight:<?php isset($wheight) ? print (int)$wheight : print 450?>, wwidth:<?php isset($wwidth) ? print (int)$wwidth : print 350?>,pheight:520,pwidth:500<?php if (is_array($depId) && !empty($depId)) : ?>,department:[<?php echo implode(',',$depId)?>]<?php endif;?><?php if ($leaveamessage == true) : ?>,leaveamessage:true<?php endif; ?><?php if ($disable_pro_active == true) : ?>,proactive:false<?php else : ?>,check_messages:true<?php endif;?><?php isset($uparams['theme']) & is_numeric($uparams['theme']) ? print ',theme:' . (int)$uparams['theme'] : ''?>};
var date = new Date();po.src = '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js');?>?v1'+(""+date.getFullYear() + date.getMonth() + date.getDate());
document.getElementById('<?php echo $chatCSSPrefix?>_status_container').innerHTML = '<p class="<?php echo $chatCSSPrefix?>-status-native-'+(this.isOnline == true ? 'online' : 'offline')+'"><a href="#" onclick="return lh_inst.lh_openchatWindow()">'+(this.isOnline == true ? '<img src="<?php if ($theme !== false && $theme->online_image_url !== false) : print $theme->online_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_green_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->online_text !== '') : print htmlspecialchars_decode($theme->online_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is online...')?><?php endif?>' : '<img src="<?php if ($theme !== false && $theme->offline_image_url !== false) : print $theme->offline_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/user_gray_chat.png');?><?php endif;?>" alt="" /><?php if ($theme !== false && $theme->offline_text != '') : print htmlspecialchars_decode($theme->offline_text,ENT_QUOTES); else : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Live help is offline...')?><?php endif;?>')+'</a></p>';
var imageTooltip = (typeof <?php echo $chatOptionsVariable;?>.opt.nh_image != 'undefined') ? <?php echo $chatOptionsVariable;?>.opt.nh_image : '<?php if ($theme !== false && $theme->need_help_image_url !== false) : print $theme->need_help_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/operator.png');?><?php endif;?>';
            s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidgetclosed')?>/(eclose)/t'+this.getAppendCookieArguments());
            this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/chatwidget')?><?php $leaveamessage == true ? print '/(leaveamessage)/true' : ''?><?php $department !== false ? print '/(department)/'.$department : ''?><?php $theme !== false ? print '/(theme)/'.$theme : ''?><?php $operator !== false ? print '/(operator)/'.$operator : ''?><?php $priority !== false ? print '/(priority)/'.$priority : ''?><?php $bot_id !== null ? print '/(bot_id)/'.$bot_id : ''?><?php $uarguments !== false ? print '/(ua)/'.$uarguments : ''?>/(mode)/embed" + (mobileFullHeight === false ? '/(mobile)/false' : '') + this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.parseOptions()+this.parseStorageArguments();
            <img class="profile-msg-pic" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($chat->bot->avatar)?>" alt="" />
                    <img class="profile-msg-pic" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($userMessage->avatar)?>" alt="" />
                <img class="profile-msg-pic" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
<img width="48" height="48" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($user->avatar)?>" alt="<?php echo htmlspecialchars($user->name_support)?>" />
                <img width="48" height="48" src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar')?>/<?php echo htmlspecialchars($theme->bot_configuration_array['operator_avatar'])?>" alt="" />
<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_chatbox_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" rel="noreferrer" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_faq_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank" rel="noreferrer"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_title"><a title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
<?php if ($theme === false || $theme->show_copyright == 1) : ?><span id="lhc_questionary_title"><a rel="noreferrer" title="<?php $theme !== false && $theme->widget_copyright_url != '' ? print '' : print 'Powered by Live Helper Chat' ?>" href="<?php $theme !== false && $theme->widget_copyright_url != '' ? print htmlspecialchars($theme->widget_copyright_url) : print 'http://livehelperchat.com' ?>" target="_blank"><img src="<?php if ($theme !== false && $theme->copyright_image_url !== false) : print $theme->copyright_image_url; else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/logo_grey.png');?><?php endif;?>" alt="Live Helper Chat" /></a></span><?php endif;?>
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme : ''?>/(mode)/embed/(identifier)/"+<?php echo $chatboxOptionsVariablePage;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariablePage;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/embed'+chat_height+id_theme+"';\n"+
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidgetclosed')?>');
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chatbox/chatwidget')?>/(chat_height)/<?php echo $heightchatcontent;?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>/(identifier)/"+<?php echo $chatboxOptionsVariable;?>.identifier+'/(hashchatbox)/'+<?php echo $chatboxOptionsVariable;?>.hashchatbox+this.getAppendCookieArguments()+'?URLReferer='+locationCurrent+this.getAppendRequestArguments();
                              '<div id="lhc_chatbox_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/chatbox.tpl.php')); ?><?php if ($show_content === false) : ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_chatbox_close"><img src="<?php echo erLhcoreClassSystem::getHost()?><?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a><?php endif;?><?php if ($disable_min === false) : ?><a href="#" id="lhc_chatbox_min" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Minimize/Restore')?>"></a><?php endif;?></div><div id="lhc_iframe_container">' +
          raw_css = ".lhc-no-transition{ -webkit-transition: none !important; -moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}\n.lhc-min{height:35px !important}\n#lhc_container_chatbox * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;font-size:12px\;line-height:100%\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_chatbox img {border:0;}\n#lhc_chatbox_title{float:left;}\n#lhc_chatbox_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_chatbox_close,#lhc_chatbox_min{padding:2px;float:right;}.lhc-min #lhc_chatbox_min{background-image:url(<?php echo erLhcoreClassSystem::getHost()?><?php if ($theme !== false && $theme->restore_image_url != '') : ?><?php echo $theme->restore_image_url;?><?php else : ?><?php echo erLhcoreClassDesign::design('images/icons/restore.png');?><?php endif;?>)}#lhc_chatbox_min{width:14px;height:14px;background:url(<?php if ($theme !== false && $theme->minimize_image_url != '') : ?><?php echo $theme->minimize_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/min.png');?><?php endif;?>) no-repeat center center;}\n\n#lhc_chatbox_close:hover,#lhc_chatbox_min:hover{opacity:0.4}\n#lhc_container_chatbox {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_chatbox iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_chatbox iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_chatbox #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_chatbox{margin-bottom:5px;position:relative;right:0 !important;bottom:0 !important;top:0 !important}#lhc_container_chatbox iframe{width:100% !important}}";
       var raw_css = "#lhc_chatbox_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;font-size:12px;line-height:100%;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_chatbox_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/emotion_amazing.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_chatbox_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_chatbox_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;line-height:100%;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_chatbox_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chatbox/getstatus'+id_position+top+id_disable_responsive+topposition+widthwidget+id_theme+heightwidget+chat_height+show_content+show_min+dis_min+"';\n"+
var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'chat','lhcbase':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost()))?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'chat_hash':'<?php echo $browse->chat->hash?>','chat_id':<?php echo $browse->chat_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
var lhcbrowserOpeator = new LHCCoBrowserOperator(window,document,{'mode':'onlineuser','lhcbase':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('cobrowse/proxycss')?>','httpsmode':<?php echo erLhcoreClassSystem::$httpsMode == true ? 'true' : 'false'?>,'disableiframe':<?php echo erLhcoreClassModelChatConfig::fetch('disable_iframe_sharing')->current_value == 1 ? 'true' : 'false'?>,'disablejs':<?php echo erLhcoreClassModelChatConfig::fetch('disable_js_execution')->current_value == 1 ? 'true' : 'false'?>,options:{opcontrol:$('#status-icon-control'),opscroll:$('#sync-user-scroll'),opmouse:$('#show-operator-mouse'),scroll:$('#scroll-user-window')},'cpos':{w:<?php echo $browse->w?>,wh:<?php echo $browse->wh?>},'cursor':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cursor.png')?>','nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value)?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'online_user_hash':'<?php echo $browse->online_user->vid?>','online_user_id':<?php echo $browse->online_user_id?>, 'base':<?php echo json_encode($browse->url)?>, 'initialize' : <?php echo $browse->initialize != '' ? $browse->initialize : 'null'?>});
this.cobrowser = new LHCCoBrowser({'formsenabled':formsEnabled,'chat_hash':this.sharehash,'nodejssettings':{'nodejssocket':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_sllocation')->current_value)?>,'nodejshost':<?php echo json_encode(erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost()))?>,'path':'<?php echo erLhcoreClassModelChatConfig::fetch('sharing_nodejs_path')->current_value?>','secure':<?php if ((int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_secure')->current_value == 1) : ?>true<?php else : ?>false<?php endif;?>},'nodejsenabled':<?php echo (int)erLhcoreClassModelChatConfig::fetch('sharing_nodejs_enabled')->current_value?>,'trans':{'operator_watching':<?php echo json_encode(htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Screen shared, click to finish'),ENT_QUOTES))?>},'url':'<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurlsite()?>'+lh_inst.lang+'/cobrowse/storenodemap/(sharemode)/'+inst.sharemode+inst.getAppendCookieArguments()+'/?url='+encodeURIComponent(location.href.match(/^(.*\/)[^\/]*$/)[1])});
<url><![CDATA[<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('chat/single')?>/<?php echo $chat->id?>]]></url>
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/embed'+id_theme+"';\n"+
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('faq/faqwidget')?><?php $theme !== false ? print '/(theme)/'.$theme->id : ''?>"+'?URLReferer='+locationCurrent+'&URLModule='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.url)+'&identifier='+encodeURIComponent(<?php echo $faqOptionsVariable;?>.identifier);
                              '<div id="lhc_faq_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/faq.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_faq_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
          raw_css = "#lhc_container_faq * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_faq img {border:0;}\n#lhc_faq_title{float:left;}\n#lhc_faq_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_faq_close{padding:2px;float:right;}\n#lhc_faq_close:hover{opacity:0.4;}\n#lhc_container_faq {-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF\;width:490px;\nz-index:9990;\n position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }\n#lhc_container_faq iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_faq iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }\n#lhc_container_faq #lhc_iframe_container{border:<?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}\n@media only screen and (max-width : 640px) {#lhc_container_faq{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;width:100%;}#lhc_container_faq iframe{width:100% !important}}";
       var raw_css = "#lhc_faq_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0;}\n#lhc_faq_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/help.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_faq_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_faq_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_faq_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'faq/getstatus'+id_position+top+topposition+id_theme+id_disable_responsive+"';\n"+
      <input type="text" class="form-control" value="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('form/fill')?>/<?php echo $form->id?>">
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('form/formwidget')?>/<?php echo $form_id,$identifier?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'form/embed/'+formid+identifier+"';\n"+
            <?php elseif ($item['type'] == 'file') : $fileReply = erLhcoreClassModelChatFile::fetch($item['content']['payload']); if ($fileReply instanceof erLhcoreClassModelChatFile) : $fileLink = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$fileReply->id}/{$fileReply->security_hash}"; ?>
        <input type="text" class="form-control" name="http_host" value="<?php (isset($n_settings['http_host']) && !empty($n_settings['http_host'])) ? print htmlspecialchars($n_settings['http_host']) : print str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?>">
        <input type="text" class="form-control" name="icon" value="<?php if (isset($n_settings['icon'])) : ?><?php print htmlspecialchars($n_settings['icon']); else : ?>https://<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
        <input type="text" class="form-control" name="badge" value="<?php if (isset($n_settings['badge'])) : ?><?php print htmlspecialchars($n_settings['badge']); else : ?>https://<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::design('images/general/logo.png');?><?php endif;?>">
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>/(mode)/embed<?php $theme !== false ? print '/(theme)/'.$theme : ''?>"+'?URLReferer='+locationCurrent;
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/embed'+id_theme+'\';'+"\n"+
        s.setAttribute('src','<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidgetclosed')?>');
   		  this.initial_iframe_url = "<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('questionary/votingwidget')?>"+'?URLReferer='+locationCurrent;
                              '<div id="lhc_questionary_header"><?php include(erLhcoreClassDesign::designtpl('lhchat/widget_brand/questionary.tpl.php')); ?><a href="#" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" id="lhc_questionary_close"><img src="<?php if ($theme !== false && $theme->close_image_url != '') : ?><?php echo $theme->close_image_url;?><?php else : ?><?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/cancel.png');?><?php endif;?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" alt="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus','Close')?>" /></a></div><div id="lhc_iframe_container">' +
          raw_css = "#lhc_container_questionary * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial\;line-height:100%\;font-size:12px\;box-sizing: content-box\;-moz-box-sizing:content-box;padding:0;margin:0;}\n#lhc_container_questionary img {border:0;}\n#lhc_questionary_title{float:left;}\n#lhc_questionary_header{position:relative;z-index:9990;height:<?php ($theme !== false && $theme->header_height > 0) ? print $theme->header_height : print '15' ?>px;overflow:hidden;background-color:#<?php $theme !== false ? print $theme->header_background : print '525252' ?>;text-align:right;clear:both;padding:<?php ($theme !== false && $theme->header_padding > 0) ? print $theme->header_padding : print '5' ?>px;}\n#lhc_questionary_close{padding:2px;float:right;}\n#lhc_questionary_close:hover{opacity:0.4;}\n#lhc_container_questionary {overflow: hidden;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;background-color:#FFF;z-index:9990;position: fixed;<?php echo $currentPosition['position_body']?>;-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-moz-user-select:none; -khtml-user-drag:element;cursor: move;cursor: -moz-grab;cursor: -webkit-grab; }\n#lhc_container_questionary iframe{position:relative;display:block;transition-property: height;transition-duration: 0.4s;-webkit-transition: height 0.4s ease-in-out;transition: height 0.4s;}\n#lhc_container_questionary iframe.lhc-loading{\nbackground: #FFF url(<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/general/loading.gif');?>) no-repeat center center; }#lhc_container_questionary #lhc_iframe_container{border: <?php ($theme !== false && $theme->widget_border_width > 0) ? print $theme->widget_border_width : print '1' ?>px solid #<?php $theme !== false ? print $theme->widget_border_color : print 'cccccc' ?>;border-top: 0;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;overflow: hidden;}@media only screen and (max-width : 640px) {#lhc_container_questionary{margin-bottom:5px;position:relative;right:0;bottom:0;top:0;}#lhc_container_questionary iframe{width:100% !important}}";
       var raw_css = "#lhc_questionary_container * {direction:<?php (erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language') == '') ? print 'ltr;text-align:left;' : print 'rtl;text-align:right;'; ?>;font-family:arial;line-height:100%;font-size:12px;box-sizing: content-box;zoom:1;margin:0;padding:0}\n#lhc_questionary_container .status-icon{text-decoration:none;font-size:12px;font-weight:bold;color:#<?php $theme !== false ? print $theme->text_color : print '000' ?>;display:block;padding:<?php echo $currentPosition['padding_text']?>;background:url('<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('images/icons/plant.png');?>') no-repeat <?php echo $currentPosition['background_position']?> center}\n#lhc_questionary_container:hover{<?php echo $currentPosition['widget_hover']?>}\n#lhc_questionary_container{box-sizing: content-box;<?php echo $currentPosition['widget_radius']?>-webkit-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);-moz-box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);box-shadow: <?php echo $currentPosition['shadow']?> rgba(50, 50, 50, 0.17);<?php echo $currentPosition['border_widget']?>;padding:5px 0px 3px 5px;width:190px;font-family:arial;font-size:12px;transition: 1s;position:fixed;<?php echo $currentPosition['position']?>;background-color:#<?php $theme !== false ? print $theme->onl_bcolor : print 'f6f6f6' ?>;z-index:9989;}\n<?php if ($noresponse == false) : ?>@media only screen and (max-width : 640px) {#lhc_questionary_container{position:relative;top:0;right:0;bottom:0;left:0;width:auto;border-radius:2px;box-shadow:none;border:1px solid #e3e3e3;margin-bottom:5px;}}\n<?php endif;?>";
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'questionary/getstatus'+id_position+id_disable_responsive+id_show_widget_on_open+top+topposition+widthwidget+id_theme+heightwidget+"';\n"+
<textarea style="width: 100%; height: 180px; font-size: 12px;" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="' . erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/getstatus').'"></script>')?></textarea>
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccess+'chat/getstatusembed<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_hide_then_offline+id_theme+id_operator+id_show_leave_form+id_department+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
<textarea style="width: 100%; height: 200px; font-size: 11px;" class="form-control" id="HMLTContent"><?php echo htmlspecialchars('<script type="text/javascript" src="'. erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/getstatus') .'"></script>')?></textarea>
        'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+(id_detect_language == false ? siteAccess : '\'+_l+\'')+'chat/getstatus<?php isset($userArgument) ? print $userArgument : ''?>'+uaArguments+id_internal_popup+id_position+id_ma+id_hide_then_offline+id_disable_online_tracking+id_check_operator_message+top+topposition+id_show_leave_form+id_department+id_operator+id_identifier+id_disable_pro_active_invitations+id_theme+id_product+id_survey+'?r=\'+referrer+\'&l=\'+location;'+"\n"+
                    var baseURL = '<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurl('restapi/onlineimage')?>' + department + operator + theme + '?' + onlineText + offlineText + width;
        $('#static-url-generated').val($('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>'+siteAccessStatic +'chat/start'+id_survey_static+id_operator_static+id_fresh_status+id_department_static+id_theme_static+id_identifier_static);
            'var LHC_API = LHC_API||{};'+"\n"+'LHC_API.args = {mode:\''+id_widget_mode+'\',lhc_base_url:\'' + $('#HttpMode').val() + '//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurldirect()?>\',wheight:'+$('#id_widget_height').val()+',wwidth:'+$('#id_widget_width').val()+',pheight:'+$('#id_popup_height').val()+',pwidth:'+$('#id_popup_width').val()+id_operator+id_embed_domain+id_fresh+id_show_leave_form+id_department+id_theme+id_survey+id_widget_position+id_check_messages_operator+id_disable_pro_active_invitations+id_identifier+siteAccess+id_position_placement+'};\n'+
            'po.src = \''+$('#HttpMode').val()+'//<?php echo str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?\'+(""+date.getFullYear() + date.getMonth() + date.getDate());'+"\n"+
        <p class="font-weight-bold"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Status/security checks')?></p>
        <ul>
            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong secret hash')?> -
            <?php if (strlen(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'secrethash' )) < 50) : ?>
                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Weak')?></span>
            <?php else : ?>
                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong')?></span>
            <?php endif; ?>
                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#secret-hash"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
            </li>
            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong export hash')?> -
            <?php if (strlen(erLhcoreClassModelChatConfig::fetch('export_hash')->current_value) < 50) : ?>
                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Weak')?></span>
            <?php else : ?>
                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Strong')?></span>
            <?php endif; ?>
                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#export-hash"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
            </li>
            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Trusted host')?> -
            <?php if (!is_array(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false )) || empty(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false ))) : ?>
                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','not set')?></span>
            <?php else : ?>
                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','set')?></span>
            <?php endif; ?>
                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#trusted-hosts-and-site-address"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
            </li>
            <li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','Site address')?> -
            <?php if (!erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_address', false )) : ?>
                <span class="badge badge-danger"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','not set')?></span>
            <?php else : ?>
                <span class="badge badge-success"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','set')?> - <?php echo htmlspecialchars(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_address', false )); ?></span>
            <?php endif; ?>
                <a target="_blank" href="https://doc.livehelperchat.com/docs/security#trusted-hosts-and-site-address"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></a>
            </li>
        </ul>

        <p class="font-weight-bold"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/update','More information')?></p>
                                <input type="text" class="form-control" readonly="readonly" id="copy-url-<?php echo $i?>" data-original-url="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('/')?>" value="">
    <input type="text" ng-non-bindable class="form-control form-control-sm" id="api-incoming-url" data-base="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/" value="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::baseurldirect('webhooks/incoming')?>/<?php echo htmlspecialchars($item->identifier);?>">
				<input class="form-control" type="text" value="<?php echo htmlspecialchars(erLhcoreClassSystem::getHost())?><?php echo erLhcoreClassDesign::baseurl('xmp/configuration')?>/(gtalkoauth)/true" />
        return erLhcoreClassSystem::getHost();
        return erLhcoreClassSystem::getHost();
            $URL = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('form/formwidget') . '/' . $URL;
                $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$item->id));
        $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('chat/readchatmail') . '/' . $chat->id . '/' . sha1($secretHash . $chat->hash . $chat->id);
    	$mail->Body = str_replace(array('{email}','{question}','{url_request}','{url_question}'), array($faq->email,$faq->question,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('faq/view/'.$faq->id)),$faq->url), $sendMail->content);
    		$prefillchat = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$params['chatprefill']->id));
    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
    			$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{user_name}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{country}','{city}'), array($surveyContent, ($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->user_name,$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,erLhcoreClassIPDetect::getIP(),(string)$chat->department, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$chat->country_name,$chat->city), $sendMail->content);
    	$mail->Body = str_replace(array('{identifier}','{form_name}','{content}','{ip}','{url_download}','{url_view}'), array($formCollected->identifier,(string)$formCollected->form, $formCollected->form_content, $formCollected->ip, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/downloaditem/'.$formCollected->id)), erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/viewcollected/'.$formCollected->id))), $sendMail->content);
    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
	    		$mail->Body = str_replace(array('{survey}','{chat_duration}','{waited}','{created}','{user_left}','{chat_id}','{phone}','{name}','{email}','{message}','{additional_data}','{url_request}','{ip}','{department}','{url_accept}','{operator}','{country}','{city}'), array($surveyContent,($chat->chat_duration > 0 ? $chat->chat_duration_front : '-'), ($chat->wait_time > 0 ? $chat->wait_time_front : '-'), $chat->time_created_front, ($chat->user_closed_ts > 0 && $chat->user_status == 1 ? $chat->user_closed_ts_front : '-'),$chat->id,$chat->phone,$chat->nick,$chat->email,$messagesContent,$additional_data,$chat->referrer,$chat->ip,(string)$chat->department,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$receiver,$operator,$chat->country_name,$chat->city), $sendMail->content);
                erLhcoreClassSystem::getHost() . $appendURL,
                    erLhcoreClassSystem::getHost() . $appendURL,

    public static function validHttpHost($host) {
        return substr_count($host, '.') <= 100
            && substr_count($host, ':') <= 100
            && preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)
            && self::isTrustedHost($host);
    }

    // Borrowed from Drupal
    public static function isTrustedHost($host) {
        $trusted_host_patterns = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false);
        if (PHP_SAPI !== 'cli' && is_array($trusted_host_patterns) && !empty($trusted_host_patterns)) {
            foreach ($trusted_host_patterns as $pattern) {
                $pattern = sprintf('{%s}i', str_replace('}', '\\}', $pattern));
                if (preg_match($pattern, $host)) {
                    return true;
                }
            }
            return false;
        }
        return false;
    }

    public static function getHost() {

        static $site_address = null;

        if ($site_address !== null) {
            return $site_address;
        }

        if (isset($_SERVER['HTTP_HOST']) && self::validHttpHost($_SERVER['HTTP_HOST'])) {
            $site_address = (erLhcoreClassSystem::$httpsMode == true || erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value == 'https:' ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ;
        } else if (class_exists('erLhcoreClassInstance')) {
            $site_address = 'https://' . erLhcoreClassInstance::$instanceChat->address . '.' . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'seller_domain');
        } else if (($site_address = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_address', false)) && $site_address != '') {
            return $site_address;
        } else if (class_exists('erLhcoreClassExtensionLhcphpresque')) {
            $site_address = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionLhcphpresque')->settings['site_address'];
        } elseif (isset($_SERVER['HTTP_HOST']) && (!is_array(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false)) || empty(erConfigClassLhConfig::getInstance()->getSetting( 'site', 'trusted_host_patterns', false)))) {
            $site_address = (erLhcoreClassSystem::$httpsMode == true || erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value == 'https:' ? 'https:' : 'http:') . '//' . $_SERVER['HTTP_HOST'] ; // trust only if match array not set
        } else {
            $site_address = 'http://localhost'; // We could not determine any valid host
        }

        return $site_address;
    }

            $db->query('SET GLOBAL innodb_strict_mode = 0;');
    			$downloadLink = "<a href=\"".erLhcoreClassSystem::getHost().erLhcoreClassDesign::baseurl('form/download').'/'.self::$collectedObject->id.'/'.self::$collectedObject->hash.'/'.$params['name']."\">Download (".htmlspecialchars($valueContent['name']).")</a>";
                    $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";;
                    $file_url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$mediaFile->id}/{$mediaFile->security_hash}";
                        $file_url = erLhcoreClassSystem::getHost() . $file->remote_url;;
                $chats[$index]->link = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$chat->id));
						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
						$messagesParsed = str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$emailGroup,$chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]);
							$conn->message($email,str_replace(array('{messages}','{url_accept}','{chat_id}','{user_name}','{department}'), array($messagesContent,erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('chat/accept').'/'.erLhcoreClassModelChatAccept::generateAcceptLink($chat).'/'.$veryfyEmail.'/'.$email, $chat->id,$chat->user_name,(string)$chat->department),$data[$templateMessage]));
                $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login') . '/(r)/' . rawurlencode(base64_encode('form/download/' . $this->id . '/' . $nameAttr));
               $host = erLhcoreClassSystem::getHost();
	   	           $this->$var =  ($this->{$attr.'_path'} != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) . '/' . $this->{$attr.'_path'} . $this->$attr;
	   				$this->$var = '<img src="'.($this->{$attr.'_path'} != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'.$this->{$attr.'_path'} . $this->$attr.'"/>';
                $this->photo_path = ($this->filepath != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
                $this->photo_path = ($this->filepath != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
       			$this->photo_path = ($this->filepath != '' ? erLhcoreClassSystem::getHost() . erLhcoreClassSystem::instance()->wwwDir() : erLhcoreClassSystem::instance()->wwwImagesDir() ) .'/'. $this->filepath . $this->filename;
if (isset($url['host']) && $url['host'] != '' && strpos($_GET['css'], erLhcoreClassSystem::getHost()) === false) {
echo erLhcoreClassBBCode::getHost();


    if (strlen($hashSecret) < 50) {
        throw new Exception('Export hash to short!');
    }

    
    if (strlen($hashSecret) < 50) {
        throw new Exception('Export hash to short!');
    }

    
    if (strlen($hashSecret) < 50) {
        throw new Exception('Export hash to short!');
    }

			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
			$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($y, $i, erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('user/login').'/(r)/'.rawurlencode(base64_encode('form/download/'.$item->id.'/'.$data['attr_name'])));
                    $randomHash = erLhcoreClassModelForgotPassword::randomPassword(80);
                    $exportHash = erLhcoreClassModelForgotPassword::randomPassword(80);
                        $url[] = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('/') . preg_replace('/^lh/', '', $urlData);
                            $url = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('file/downloadfile') . "/{$file->id}/{$hash}";
        return erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect("user/autologin") . "/{$hashValidation}".implode('', $dataRequestAppend);
                echo json_encode(array('error' => false, 'msg' => 'Session started', 'url' => erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurldirect('site_admin').'/'.ltrim($r,'/')));
    array(erLhcoreClassDesign::baseurldirect(),time(),str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost()), $append_definitions, $append_paths, $chats_parameters,$elastic_definition,$elastic_mail)
			$host = erLhcoreClassSystem::getHost();
                    $replaceStyleArray['{proactive_img_' . $i . '}'] = erLhcoreClassSystem::getHost() . $userInstance->invitation->{'design_data_img_' . $i . '_url'};
        'nodejshost' => (erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value != '' ? erLhcoreClassModelChatConfig::fetch('sharing_nodejs_socket_host')->current_value : str_replace(['http://','https://'],'',erLhcoreClassSystem::getHost())),
    'cobrowser' => erLhcoreClassSystem::getHost() . erLhcoreClassDesign::designJS('js/cobrowse/compiled/cobrowse.visitor.min.js'),
    'url' => erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurlsite() . '/cobrowse/storenodemap/(sharemode)/chat'
                $replaceVars['replace'][8] = erLhcoreClassSystem::getHost() .erLhcoreClassDesign::baseurldirect('widgetrestapi/avatar') . '/' . $theme->bot_configuration_array['nh_avatar'];
                $replaceVars['replace'][8] = erLhcoreClassSystem::getHost() . erLhcoreClassDesign::design('images/general/operator.png');
                erLhcoreClassSystem::getHost() . erLhcoreClassDesign::design('images/general/operator.png'),
$host = erLhcoreClassSystem::getHost();
$outputResponse['domain_lhc'] = str_replace(['http://','https://'],'',$host);
    <script src="<?php echo erLhcoreClassSystem::getHost()?><?php echo erLhcoreClassDesign::design('js/widgetv2/index.js')?>?t=<?php echo time()?>"></script>
	$client->setRedirectUri(erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
		$client->setRedirectUri(erLhcoreClassSystem::getHost() . erLhcoreClassDesign::baseurl('xmp/configuration').'/(gtalkoauth)/true');
	$tpl->set('updated','done');
                    'site_address' => '',
                    'trusted_host_patterns' => [
                    ],