<!--  BEGIN chatstack.com Live Chat HTML Code //-->
<script type="text/javascript">
    var LiveHelpSettings = {};
    LiveHelpSettings.server = '<?php echo(preg_replace('#^https?://|/#', '', Mage::getBaseUrl())); ?>';
    LiveHelpSettings.embedded = true;
<?php
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
  $customer = Mage::getSingleton('customer/session')->getCustomer();
  $name = $customer->getName();
  $email = $customer->getEmail();
?>
    LiveHelpSettings.name = '<?php echo($name); ?> ?>';
    LiveHelpSettings.email = '<?php echo($email); ?> ?>';
    LiveHelpSettings.custom = 'Magento';
<?php
}
?>
    (function(d, undefined) {
        // JavaScript
        var LiveHelp = d.createElement('script'); LiveHelp.type = 'text/javascript'; LiveHelp.async = true;
        LiveHelp.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + LiveHelpSettings.server + '/livehelp/scripts/js.min.js';
        var s = d.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(LiveHelp, s);
    })(document);
</script>
<!--  END chatstack.com Live Chat HTML Code //-->
