<footer class="container-fluid">
    <div class="row">
        <div class="container">
            <?php if (!is_page('98')): ?>
            <div class="row">
                <div class="contect_details col-md-12">
                    <div class="row">
                        <?php
                        $EmailAddress=get_field('email_address','options');
                        $EmailIcon=get_field('email_address_icon','options');
                        if (!empty($EmailAddress) && !empty($EmailIcon)): ?>
                            <div class="col-md-4">
                                <?= $EmailIcon; ?>
                                <a href="tel:<?= $EmailAddress; ?>"><?= $EmailAddress; ?></a>
                            </div>
                        <?php endif; ?>
                        <?php
                        $PhoneNumber=get_field('phone_number','options');
                        $Phoneicon=get_field('phone_icon','options');
                        if (!empty($PhoneNumber) && !empty($Phoneicon)): ?>
                            <div class="col-md-4">
                                <?= $Phoneicon; ?>
                                <a href="tel:<?= $PhoneNumber; ?>"><?= $PhoneNumber; ?></a>
                            </div>
                        <?php endif; ?>
                        <?php
                        $Address=get_field('address','options');
                        $address_icon=get_field('address_icon','options');
                        $map_url=get_field('map_url','options');
                        if (!empty($Address) && !empty($address_icon)): ?>
                            <div class="col-md-4">
                                <?= $address_icon; ?>
                                <a href="<?= $map_url; ?>" target="_blank"><?= $Address; ?></a>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <?php endif; ?>
            <div class="row">
                <div class="col-md-10 col-md-offset-1">
                    <div class="row m_t_50 m_b_50">
                        <div class="col-md-5 col-sm-5 col-xs-12">
                            <?php 
                            $footer_logo = get_field('footer_logo','options');
                            if( !empty($footer_logo) ): ?>
                                <a href="<?= site_url() ?>">
                                    <img src="<?php echo $footer_logo['url']; ?>" alt="<?php echo $footer_logo['alt']; ?>" class="img-responsive" />
                                </a>
                            <?php endif; ?>
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-12">
                            <div class="row footer_menus">
                                <div class="col-md-4 col-sm-4 col-xs-12">
                                    <?php dynamic_sidebar('sidebar-1'); ?>
                                </div>
                                <div class="col-md-4 col-sm-4 col-xs-12">
                                    <?php dynamic_sidebar('sidebar-2'); ?>
                                </div>
                                <div class="col-md-4 col-sm-4 col-xs-12">
                                    <?php dynamic_sidebar('sidebar-3'); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row m_t_50 credit">
                        <div class="col-md-6"><?php the_field('copyright','options'); ?></div>
                        <div class="col-md-6">
                            <?php
                            wp_nav_menu(
                                array(
                                    'menu' => false,
                                    'theme_location' => 'footer_menu',
                                    'link_before' => false,
                                    'link_after' => false,
                                    'menu_class' => false,
                                    'menu_id' => false,
                                    'container' => false,
                                )
                            );
                            ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</footer>
<?php wp_footer(); ?>
<script>
    // Define your locations: HTML content for the info window, latitude, longitude
    var locations = [
        <?php
        if( have_rows('page_content') ):
            while ( have_rows('page_content') ) : the_row();
                if( get_row_layout() == 'our_mission_with_map' ): ?>
                <?php if( have_rows('locations') ):
                    while ( have_rows('locations') ) : the_row(); ?>
                        ['<h4><?php the_sub_field('omwm_lc_title'); ?></h4>', <?php the_sub_field('omwm_lc_latitude'); ?>, <?php the_sub_field('omwm_lc_longitude'); ?>],
                    <?php endwhile;
                    endif;
                    wp_reset_postdata();
                endif;
                if( get_row_layout() == 'investment_module_with_map' ): ?>
                    <?php if( have_rows('imwm_locations') ):
                        while ( have_rows('imwm_locations') ) : the_row(); ?>
                        ['<h4><?php the_sub_field('imwm_lc_title'); ?></h4>', <?php the_sub_field('imwm_lc_latitude'); ?>, <?php the_sub_field('imwm_lc_longitude'); ?>],
                        <?php endwhile;
                    endif;
                    wp_reset_postdata();
                endif;
            endwhile;
        endif; ?>

    ];
    var styledMapType = new google.maps.StyledMapType(
        [
            {
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#f5f5f5"
                    }
                ]
            },
            {
                "elementType": "labels.icon",
                "stylers": [
                    {
                        "visibility": "off"
                    }
                ]
            },
            {
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#616161"
                    }
                ]
            },
            {
                "elementType": "labels.text.stroke",
                "stylers": [
                    {
                        "color": "#f5f5f5"
                    }
                ]
            },
            {
                "featureType": "administrative.land_parcel",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#bdbdbd"
                    }
                ]
            },
            {
                "featureType": "poi",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#eeeeee"
                    }
                ]
            },
            {
                "featureType": "poi",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#757575"
                    }
                ]
            },
            {
                "featureType": "poi.park",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#e5e5e5"
                    }
                ]
            },
            {
                "featureType": "poi.park",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#9e9e9e"
                    }
                ]
            },
            {
                "featureType": "road",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#ffffff"
                    }
                ]
            },
            {
                "featureType": "road.arterial",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#757575"
                    }
                ]
            },
            {
                "featureType": "road.highway",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#dadada"
                    }
                ]
            },
            {
                "featureType": "road.highway",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#616161"
                    }
                ]
            },
            {
                "featureType": "road.local",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#9e9e9e"
                    }
                ]
            },
            {
                "featureType": "transit.line",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#e5e5e5"
                    }
                ]
            },
            {
                "featureType": "transit.station",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#eeeeee"
                    }
                ]
            },
            {
                "featureType": "water",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#cad6d4"
                    }
                ]
            },
            {
                "featureType": "water",
                "elementType": "labels.text.fill",
                "stylers": [
                    {
                        "color": "#9e9e9e"
                    }
                ]
            }
        ],
        {name: 'Styled Map'});
    // Setup the different icons and shadows
    //var iconURLPrefix = 'http://maps.google.com/mapfiles/ms/icons/';

    var icons = [
        'https://nikunj.creativamotions.com/bendercompanies/wp-content/uploads/2019/05/google-pin.png'
    ]
    var iconsLength = icons.length;

    var infowindow = new google.maps.InfoWindow({
        maxWidth: 160
    });
    var map = new google.maps.Map(document.getElementById('map'), {
        center: {lat: 41.8781136, lng: -87.6297982},
        zoom: 6,
		scrollwheel: false,
        navigationControl: false,
        mapTypeControl: false,
        scaleControl: false,
        draggable: false,
        mapTypeControl: false,
        streetViewControl: false,
		disableDefaultUI: true,
        panControl: false,
        mapTypeControlOptions: {
            mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain',
                'styled_map']
        }
    });

    map.mapTypes.set('styled_map', styledMapType);
    map.setMapTypeId('styled_map');
    var markers = new Array();

    var iconCounter = 0;

    // Add the markers and infowindows to the map
    for (var i = 0; i < locations.length; i++) {
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(locations[i][1], locations[i][2]),
            map: map,
            icon: icons[iconCounter]
        });

        markers.push(marker);

        google.maps.event.addListener(marker, 'click', (function(marker, i) {
            return function() {
                infowindow.setContent(locations[i][0]);
                infowindow.open(map, marker);
            }
        })(marker, i));

        iconCounter++;
        // We only have a limited number of possible icon colors, so we may have to restart the counter
        if(iconCounter >= iconsLength) {
            iconCounter = 0;
        }
    }

    function autoCenter() {
        //  Create a new viewpoint bound
        var bounds = new google.maps.LatLngBounds();
        //  Go through each...
        for (var i = 0; i < markers.length; i++) {
            bounds.extend(markers[i].position);
        }
        //  Fit these bounds to the map
        map.fitBounds(bounds);
    }

</script>

<script type="text/javascript">

    jQuery(document).ready(function() {
		
			jQuery(document).on('click', 'a[href^="#"]', function (event) {
    event.preventDefault();

    jQuery('html, body').animate({
        scrollTop: $($.attr(this, 'href')).offset().top-120
    }, 500);
});  
		
        jQuery('html,body').animate({
				scrollTop: $(window.location.hash).offset().top-120
			});
    });
    
</script>
</body>
</html>