 





<!--New -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/jquery/jquery-3.6.0.min.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/aos/aos.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/bootstrap-touchspin/jquery.bootstrap-touchspin.js"></script>
<!-- <script src="<?php echo base_url() . "public/"; ?>assets/vendors/fancybox/jquery.fancybox.js"></script> -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/isotope/isotope.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/jarallax/jarallax.min.js"></script>
<!-- <script src="<?php echo base_url() . "public/"; ?>assets/vendors/jquery-ajaxchimp/jquery.ajaxchimp.min.js"></script> -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/jquery-appear/jquery.appear.min.js"></script>
<!-- <script src="<?php echo base_url() . "public/"; ?>assets/vendors/jquery-magnific-popup/jquery.magnific-popup.min.js"></script> -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/jquery-ui/jquery-ui.js"></script>
<!-- <script src="<?php echo base_url() . "public/"; ?>assets/vendors/jquery-validate/jquery.validate.min.js"></script> -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/nice-select/jquery.nice-select.min.js"></script>
<!-- <script src="<?php echo base_url() . "public/"; ?>assets/vendors/odometer/odometer.min.js"></script> -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/swiper/swiper.min.js"></script>
<!-- <script src="<?php echo base_url() . "public/"; ?>assets/vendors/timepicker/timepicker.js"></script> -->
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/vegas/vegas.min.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/wow/wow.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/slick/slick.js"></script>
 <!-- Gsap JS files -->

 <script src="<?php echo base_url() . "public/"; ?>assets/vendors/gsap/gsap.js"></script>   
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/gsap/ScrollTrigger.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/gsap/SplitText.js"></script>

<script src="<?php echo base_url() . "public/"; ?>assets/vendors/extra-scripts/extra-scripts.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/marquee/marquee.min.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/curved-text/jquery.circleType.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/curved-text/jquery.lettering.min.js"></script>
<script src="<?php echo base_url() . "public/"; ?>assets/vendors/curved-text/jquery.fittext.js"></script>
<!-- Jquery Validation -->
<script src="<?php echo base_url() . "public/"; ?>js/jquery.validate.min.js"></script>
<script src="<?php echo base_url() . "public/"; ?>js/additional-methods.min.js"></script>













<?php
// Map section names to one or more JS file URLs
$jsMap = [
    // Local single file path
    'owl-carousel'   => base_url('public/assets/vendors/owl-carousel/owl.carousel.min.js'),

    // Local multiple files path for a single component
    // 'owl-carousel' => [
    //     base_url('public/assets/vendors/owl-carousel/owl.carousel.min.js'),
    //     base_url('public/assets/vendors/owl-carousel/owl.carousel.plugins.min.js'),
    // ],

    'home_page' => [
        base_url('public/assets/vendors/countdown/jquery.countdown.min.js'),
    ],

    // External / CDN file path
    // 'datepicker' => 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js',
];

// Loop and include
if (!empty($section) && is_array($section)) {
    foreach ($section as $jsKey) {
        if (isset($jsMap[$jsKey])) {
            $files = (array) $jsMap[$jsKey]; // Cast to array for single/multiple
            foreach ($files as $file) {
                echo '<script src="' . $file . '"></script>' . "\n";
            }
        }
    }
}
?>

<!-- Template js -->
<script src="<?php echo base_url() . "public/"; ?>assets/js/custom.js"></script>


<!--New End -->

<script>
    function getLocation() {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(showPosition, retryGetLocation, {
                timeout: 10000
            });
        }
    }

    function retryGetLocation() {
        $.get("https://ip-api.com/json/<?php echo $_SERVER["REMOTE_ADDR"]; ?>", function(data) {
            // alert("s");
            $("#userInfo").html("User Info :" + data.city + ", " + data.country);
        });
    }

    function showPosition(position) {

        xmlhttp = new XMLHttpRequest();
        xmlhttp.open("GET", "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + position.coords.latitude + "," + position.coords.longitude + "&sensor=true", false);
        xmlhttp.send();
        var address = JSON.parse(xmlhttp.responseText);
        var add = address.results[0].formatted_address;
        var value = add.split(",");
        count = value.length;
        country = value[count - 1];
        state = value[count - 2];
        city = value[count - 3];
        $("#userInfo").html("User Info :" + city + ", " + state + ", " + country);

    }

    $(document).ready(function() {
        $("#locationSpan").html($("#locationDrpDwn").find(":selected").text());

        $('#locationDrpDwn,#ddquickLocation').on('change', function() {
            var option = $(this).find('option:selected');
            var text = option.html().trim(); // get the current option text
            var updatedText = text.replace(/\s+/g, '_'); // replace all spaces with underscores
            location.href = '<?php echo base_url() ?>' + updatedText;
        });

    });

    // Subscribe Newsletter Form
    $(document).ready(function() {
        const $form = $('#sn_form');

        $form.validate({
            rules: {
                sn_email: {
                    required: true,
                    email: true
                }
            },
            messages: {
                sn_email: {
                    required: "Please enter email address",
                    email: "Please enter a valid email address"
                }
            },
            errorElement: 'div',
            errorPlacement: function(error, element) {
                error.addClass('invalid-feedback');
                error.insertAfter(element);
            },
            highlight: function(element) {
                $(element).addClass('is-invalid');
            },
            unhighlight: function(element) {
                $(element).removeClass('is-invalid');
            }
        });
    });

    $(document).ready(function() {
        // Add smooth scrolling to all links
        $("a").on('click', function(event) {

            // Make sure this.hash has a value before overriding default behavior
            if (this.hash !== "") {
                // Prevent default anchor click behavior
                event.preventDefault();

                // Store hash
                var hash = this.hash;

                // Using jQuery's animate() method to add smooth page scroll
                // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
                $('html, body').animate({
                    scrollTop: $(hash).offset().top
                }, 800, function() {

                    // Add hash (#) to URL when done scrolling (default click behavior)
                    window.location.hash = hash;
                });
            } // End if
        });
    });
</script>




		
		