<?php
echo $this->headScript()
        ->prependFile($this->basePath() . '/js/jquery.ihavecookies.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/slyder.js')
        ->prependFile($this->basePath() . '/js/libs/fullcalendar.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/jssor.slider-21.1.5.min.js')
        ->prependFile($this->basePath() . '/js/custom/sightseeing.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/common.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        //->prependFile($this->basePath() . '/js/libs/clockface.js')
        ->prependFile($this->basePath() . '/js/libs/jquery.timepicker.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/custom/base.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        //->prependFile($this->basePath() . '/js/custom/local-hire.js')
        ->prependFile($this->basePath() . '/js/libs/mloading.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/load-modal-content.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/analytics.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/selectize.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/selecttag.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/wow.min.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/calendar.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/bootstrap-clockpicker.min.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/bootstrap-slider.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/bootstrap.min.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/jquery.flexisel.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/jquery.image-crop.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/jquery.tooltip.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/jquery-ui.js', $type = 'text/javascript', $attrs = ['defer' => 'defer'])
        ->prependFile($this->basePath() . '/js/libs/jquery.min.js');
?>
<?php echo $this->inlineScript() ?>

<script type="text/javascript">
    document.onreadystatechange = function() { 
        if (document.readyState !== "complete") { 
            document.querySelector("body").style.visibility = "hidden"; 
            document.querySelector("#loader").style.visibility = "visible"; 
        } else { 
            document.querySelector("#loader").style.display = "none"; 
            document.querySelector("body").style.visibility = "visible"; 
        } 
    };
    var link = "<?php echo $this->url('cms-pages', ['page-type' => 'cms', 'page' => 'privacy-policy']); ?>";
    var options = {
        title: 'Accept Cookies & Privacy Policy?',
        message: 'There are no cookies used on this site, but if there were this message could be customised to provide more details. Click the <strong>accept</strong> button below to see the optional callback in action...',
        delay: 0,
        expires: 1,
        link: link,
        onAccept: function () {
            var myPreferences = $.fn.ihavecookies.cookie();
            console.log('Yay! The following preferences were saved...');
            console.log(myPreferences);
        },
        uncheckBoxes: true,
        acceptBtnLabel: 'Accept Cookies',
        moreInfoLabel: 'More information',
        cookieTypesTitle: 'Select which cookies you want to accept',
        fixedCookieTypeLabel: 'Essential',
        fixedCookieTypeDesc: 'These are essential for the website to work correctly.'
    }

    $(document).ready(function () {
        $('body').ihavecookies(options);
        if ($.fn.ihavecookies.preference('marketing') === true) {
            console.log('This should run because marketing is accepted.');
        }
        $('#ihavecookiesBtn').on('click', function () {
            $('body').ihavecookies(options, 'reinit');
        });
        $(document).on('click', '#close-cooki', function () {
            $('#gdpr-cookie-message').css('display', 'none');
        });
    });

</script>

<!--Start of Tawk.to Script-->
<script type="text/javascript">
    var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date();
    (function () {
        var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
        s1.async = true;
        s1.src = 'https://embed.tawk.to/5d94b35bdb28311764d6ee58/default';
        s1.charset = 'UTF-8';
        s1.setAttribute('crossorigin', '*');
        s0.parentNode.insertBefore(s1, s0);
    })();
</script>
<!--End of Tawk.to Script-->
</body>
</html>