<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="{$path}/_assets/global/plugins/respond.min.js"></script>
<script src="{$path}/_assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
<script src="{$path}/_assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<!--<script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyD4saBT04W6hCXtK5uwxBDsupssHpPhyFk&libraries=places&v=3"></script>-->
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="{$path}/_assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->

<script src="{$path}/_assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/jquery-validation/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/jquery-validation/js/additional-methods.min.js"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery.pulsate.min.js" type="text/javascript"></script>
<!--script src="{$path}/_assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script-->
<script src="{$path}/_assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>
<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
<!--script src="{$path}/_assets/global/plugins/fullcalendar/fullcalendar.min.js" type="text/javascript"></script-->
<script src="{$path}/_assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/jquery-multi-select/js/jquery.multi-select.js"></script>
<script src="{$path}/_assets/global/plugins/jquery-nestable/jquery.nestable-rtl.js"></script>

<script src="{$path}/_assets/global/plugins/dropzone/dropzone.min.js" type="text/javascript"></script>

<!--script type="text/javascript" src="{$path}/_assets/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/datatables/extensions/Scroller/js/dataTables.scroller.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script-->

<script src="{$path}/_assets/global/scripts/datatable.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/datatables/datatables.min.js" type="text/javascript"></script>
<script src="{$path}/_assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js" type="text/javascript"></script>


<script src="{$path}/_assets/global/plugins/bootstrap-toastr/toastr.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/printpart/jQuery.print.js"></script>

<!-- islamic -->
<link rel="stylesheet" href="{$path}/_assets/global/plugins/calislamic/redmond.calendars.picker.css">
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.plugin.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.calendars.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.calendars.picker.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.calendars.plus.min.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.calendars.islamic.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.calendars-ar.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/calislamic/jquery.calendars.islamic-ar.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/ckeditor/ckeditor.js"></script>

<!--maps -->

<!--<script type="text/javascript" src="{$path}/_assets/global/plugins/geomaps/markerwithlabel_packed.js"></script>-->
<script type="text/javascript" src="{$path}/_assets/global/plugins/geomaps/custom-map.js"></script>
<script type="text/javascript" src="{$path}/_assets/global/plugins/geomaps/custom.js"></script>


<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="{$path}/_assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/layout/scripts/quick-sidebar.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/layout/scripts/demo.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/layout/scripts/jscolor.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/pages/scripts/index.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/pages/scripts/login.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/pages/scripts/components-dropdowns.js"></script>
<script src="{$path}/_assets/admin/pages/scripts/components-pickers.js" type="text/javascript"></script>
<script src="{$path}/_assets/admin/layout/scripts/custom.js"></script><!-- custom js at end of files -->
<script src="{$path}/_assets/custom/custom.js"></script><!-- custom js at end of files -->
<!-- END PAGE LEVEL SCRIPTS -->
<script>
    jQuery(document).ready(function () {
        Metronic.init(); // init metronic core componets
        Layout.init(); // init layout
        QuickSidebar.init(); // init quick sidebar
        Demo.init(); // init demo features
        Index.init();
        //Index.initDashboardDaterange();
        // Index.initJQVMAP(); // init index page's custom scripts
        //Index.initCalendar(); // init index page's custom scripts
        //Index.initCharts(); // init index page's custom scripts
        //Index.initChat();
        //Index.initMiniCharts();
        //Tasks.initDashboardWidget();
        Login.init();
        //ComponentsDropdowns.init();
        awcustomjs.init();//at the end of all files
        customjs.init();


    });
</script>

{literal}
<script>
//    var _latitude;
//    var _longitude;
//    if ($('#latitude').val().length <= 0) {
//        _latitude = 24.51818280365295;
//    } else {
//        _latitude = $('#latitude').val();
//    }
//
//    if ($('#longitude').val().length <= 0) {
//        _longitude = 39.56970123291012;
//    } else {
//        _longitude = $('#longitude').val();
//    }
//
//    var hosturl = $('#hosturl').val();
//    if ($('#submit-map').length) {
//        google.maps.event.addDomListener(window, 'load', initSubmitMap(_latitude, _longitude));
//    }
//    function initSubmitMap(_latitude, _longitude) {
//        var mapCenter = new google.maps.LatLng(_latitude, _longitude);
//        var mapOptions = {
//            zoom: 3,
//            center: mapCenter,
//            disableDefaultUI: false,
//            //scrollwheel: false,
//            styles: mapStyles
//        };
//
//        var mapElement = document.getElementById('submit-map');
//        var map = new google.maps.Map(mapElement, mapOptions);
//        var marker = new MarkerWithLabel({
//            position: mapCenter,
//            map: map,
//            icon: hosturl + '/views/aw_ar/_assets/global/plugins/geomaps/marker.png',
//            labelAnchor: new google.maps.Point(50, 0),
//            draggable: true
//        });
//        $('#submit-map').removeClass('fade-map');
//        google.maps.event.addListener(marker, "mouseup", function (event) {
//            var latitude = this.position.lat();
//            var longitude = this.position.lng();
//            $('#latitude').val(this.position.lat());
//            $('#longitude').val(this.position.lng());
//
//            var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + $('#latitude').val() + '%2C' + $('#longitude').val() + '&language=en';
//            $.getJSON(GEOCODING).done(function (location) {
//                var countis = location.results.length;
//                for ($i = 1; $i < countis; $i++) {
//                    if (location.results[0].address_components[$i].types[0] == 'country') {
//                        $('#country').val(location.results[0].address_components[$i].long_name);
//                    }
//                }
//                /*$('#country').val(location.results[0].address_components[5].long_name);
//                 $('#state').html(location.results[0].address_components[4].long_name);
//                 $('#city').html(location.results[0].address_components[2].long_name);
//                 $('#address').html(location.results[0].formatted_address);*/
//            });
//
//        });
//
////      Autocomplete
//        var input = /** @type {HTMLInputElement} */(document.getElementById('address-map'));
//        var autocomplete = new google.maps.places.Autocomplete(input);
//        autocomplete.bindTo('bounds', map);
//        google.maps.event.addListener(autocomplete, 'place_changed', function () {
//            var place = autocomplete.getPlace();
//            if (!place.geometry) {
//                return;
//            }
//            if (place.geometry.viewport) {
//                map.fitBounds(place.geometry.viewport);
//            } else {
//                map.setCenter(place.geometry.location);
//                map.setZoom(3);
//            }
//            marker.setPosition(place.geometry.location);
//            marker.setVisible(true);
//            $('#latitude').val(marker.getPosition().lat());
//            $('#longitude').val(marker.getPosition().lng());
//            var address = '';
//            if (place.address_components) {
//                address = [
//                    (place.address_components[0] && place.address_components[0].short_name || ''),
//                    (place.address_components[1] && place.address_components[1].short_name || ''),
//                    (place.address_components[2] && place.address_components[2].short_name || '')
//                ].join(' ');
//            }
//
//            var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + $('#latitude').val() + '%2C' + $('#longitude').val() + '&language=en';
//            $.getJSON(GEOCODING).done(function (location) {
//                var countis = location.results.length;
//                for ($i = 1; $i < countis; $i++) {
//                    if (location.results[0].address_components[$i].types[0] == 'country') {
//                        $('#country').val(location.results[0].address_components[$i].long_name);
//                    }
//                }
//                /*$('#country').val(location.results[0].address_components[5].long_name);
//                 $('#state').html(location.results[0].address_components[4].long_name);
//                 $('#city').html(location.results[0].address_components[2].long_name);
//                 $('#address').html(location.results[0].formatted_address);*/
//            });
//
//        });
//
//    }
//
//    function success(position) {
//        initSubmitMap(position.coords.latitude, position.coords.longitude);
//        $('#latitude').val(position.coords.latitude);
//        $('#longitude').val(position.coords.longitude);
//    }
//
//    $('.geo-location').on("click", function () {
//        if (navigator.geolocation) {
//            $('#submit-map').addClass('fade-map');
//            navigator.geolocation.getCurrentPosition(success);
//        } else {
//            error('Geo Location is not supported');
//        }
//    });
//
//
//
//    /*************** region *************************/
//    if ($('#submit-map-region').length) {
//        google.maps.event.addDomListener(window, 'load', initSubmitMapr(_latitude, _longitude));
//    }
//    function initSubmitMapr(_latitude, _longitude) {
//        var mapCenter = new google.maps.LatLng(_latitude, _longitude);
//        var mapOptions = {
//            zoom: 8,
//            center: mapCenter,
//            disableDefaultUI: false,
//            //scrollwheel: false,
//            styles: mapStyles
//        };
//
//        var mapElement = document.getElementById('submit-map-region');
//        var map = new google.maps.Map(mapElement, mapOptions);
//        var marker = new MarkerWithLabel({
//            position: mapCenter,
//            map: map,
//            icon: hosturl + '/views/aw_ar/_assets/global/plugins/geomaps/marker.png',
//            labelAnchor: new google.maps.Point(50, 0),
//            draggable: true
//        });
//        $('#submit-map-region').removeClass('fade-map');
//        google.maps.event.addListener(marker, "mouseup", function (event) {
//            var latitude = this.position.lat();
//            var longitude = this.position.lng();
//            $('#latitude').val(this.position.lat());
//            $('#longitude').val(this.position.lng());
//
//            var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + $('#latitude').val() + '%2C' + $('#longitude').val() + '&language=en';
//            $.getJSON(GEOCODING).done(function (location) {
//                console.log(location);
//                var countis = location.results.length;
//                for ($i = 1; $i < countis; $i++) {
//                    if (location.results[0].address_components[$i].types[0] == "administrative_area_level_2") {
//                        $('#region').val(location.results[0].address_components[$i].long_name);
//                    } else {
//                        if (location.results[0].address_components[$i].types[0] == "locality") {
//                            $('#region').val(location.results[0].address_components[$i].long_name);
//                        }
//                    }
//                    /*if (location.results[0].address_components[$i].types[0] == "locality") {
//                     $('#region').val(location.results[0].address_components[$i].long_name);
//                     }*/
//                }
//                /*$('#country').val(location.results[0].address_components[5].long_name);
//                 $('#state').html(location.results[0].address_components[4].long_name);
//                 $('#city').html(location.results[0].address_components[2].long_name);
//                 $('#address').html(location.results[0].formatted_address);*/
//            });
//
//        });
//
////      Autocomplete
//        var input = /** @type {HTMLInputElement} */(document.getElementById('address-map-region'));
//        var autocomplete = new google.maps.places.Autocomplete(input);
//        autocomplete.bindTo('bounds', map);
//        google.maps.event.addListener(autocomplete, 'place_changed', function () {
//            var place = autocomplete.getPlace();
//            if (!place.geometry) {
//                return;
//            }
//            if (place.geometry.viewport) {
//                map.fitBounds(place.geometry.viewport);
//            } else {
//                map.setCenter(place.geometry.location);
//                map.setZoom(8);
//            }
//            marker.setPosition(place.geometry.location);
//            marker.setVisible(true);
//            $('#latitude').val(marker.getPosition().lat());
//            $('#longitude').val(marker.getPosition().lng());
//            var address = '';
//            if (place.address_components) {
//                address = [
//                    (place.address_components[0] && place.address_components[0].short_name || ''),
//                    (place.address_components[1] && place.address_components[1].short_name || ''),
//                    (place.address_components[2] && place.address_components[2].short_name || '')
//                ].join(' ');
//            }
//
//            var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + $('#latitude').val() + '%2C' + $('#longitude').val() + '&language=en';
//            $.getJSON(GEOCODING).done(function (location) {
//                var countis = location.results.length;
//                for ($i = 1; $i < countis; $i++) {
//                    if (location.results[0].address_components[$i].types[0] == "administrative_area_level_2") {
//                        $('#region').val(location.results[0].address_components[$i].long_name);
//                    } else {
//                        if (location.results[0].address_components[$i].types[0] == "locality") {
//                            $('#region').val(location.results[0].address_components[$i].long_name);
//                        }
//                    }
//                }
//                /*$('#country').val(location.results[0].address_components[5].long_name);
//                 $('#state').html(location.results[0].address_components[4].long_name);
//                 $('#city').html(location.results[0].address_components[2].long_name);
//                 $('#address').html(location.results[0].formatted_address);*/
//            });
//
//        });
//
//    }











</script>
{/literal}

<!-- END JAVASCRIPTS -->
</body>

<!-- END BODY -->

</html>