text: $().ready(function() {
      $sidebar = $('.sidebar');
      $sidebar_img_container = $sidebar.find('.sidebar-background');
  
      $full_page = $('.full-page');
  
      $sidebar_responsive = $('body > .navbar-collapse');
  
      window_width = $(window).width();
  
      // Init Datetimepicker
  
      if ($("#datetimepicker").length != 0) {
          $('.datetimepicker').datetimepicker({
              icons: {
                  time: "fa fa-clock-o",
                  date: "fa fa-calendar",
                  up: "fa fa-chevron-up",
                  down: "fa fa-chevron-down",
                  previous: 'fa fa-chevron-left',
                  next: 'fa fa-chevron-right',
                  today: 'fa fa-screenshot',
                  clear: 'fa fa-trash',
                  close: 'fa fa-remove'
              }
          });
  
          $('.datepicker').datetimepicker({
              format: 'MM/DD/YYYY',
              icons: {
                  time: "fa fa-clock-o",
                  date: "fa fa-calendar",
                  up: "fa fa-chevron-up",
                  down: "fa fa-chevron-down",
                  previous: 'fa fa-chevron-left',
                  next: 'fa fa-chevron-right',
                  today: 'fa fa-screenshot',
                  clear: 'fa fa-trash',
                  close: 'fa fa-remove'
              }
          });
  
          $('.timepicker').datetimepicker({
              //          format: 'H:mm',    // use this format if you want the 24hours timepicker
              format: 'h:mm A', //use this format if you want the 12hours timpiecker with AM/PM toggle
              icons: {
                  time: "fa fa-clock-o",
                  date: "fa fa-calendar",
                  up: "fa fa-chevron-up",
                  down: "fa fa-chevron-down",
                  previous: 'fa fa-chevron-left',
                  next: 'fa fa-chevron-right',
                  today: 'fa fa-screenshot',
                  clear: 'fa fa-trash',
                  close: 'fa fa-remove'
              }
          });
  
      };
      fixed_plugin_open = $('.sidebar .sidebar-wrapper .nav li.active a p').html();
  
      if (window_width > 767 && fixed_plugin_open == 'Dashboard') {
          if ($('.fixed-plugin .dropdown').hasClass('show-dropdown')) {
              $('.fixed-plugin .dropdown').addClass('show');
          }
  
      }
  
      $('.fixed-plugin a').click(function(event) {
          // Alex if we click on switch, stop propagation of the event, so the dropdown will not be hide, otherwise we set the  section active
          if ($(this).hasClass('switch-trigger')) {
              if (event.stopPropagation) {
                  event.stopPropagation();
              } else if (window.event) {
                  window.event.cancelBubble = true;
              }
          }
      });
  
      $('.fixed-plugin .background-color span').click(function() {
          $(this).siblings().removeClass('active');
          $(this).addClass('active');
  
          var new_color = $(this).data('color');
  
          if ($sidebar.length != 0) {
              $sidebar.attr('data-color', new_color);
          }
  
          if ($full_page.length != 0) {
              $full_page.attr('filter-color', new_color);
          }
  
          if ($sidebar_responsive.length != 0) {
              $sidebar_responsive.attr('data-color', new_color);
          }
      });
  
      $('.fixed-plugin .img-holder').click(function() {
          $full_page_background = $('.full-page-background');
  
          $(this).parent('li').siblings().removeClass('active');
          $(this).parent('li').addClass('active');
  
  
          var new_image = $(this).find("img").attr('src');
  
          if ($sidebar_img_container.length != 0 && $('.switch-sidebar-image input:checked').length != 0) {
              $sidebar_img_container.fadeOut('fast', function() {
                  $sidebar_img_container.css('background-image', 'url("' + new_image + '")');
                  $sidebar_img_container.fadeIn('fast');
              });
          }
  
          if ($full_page_background.length != 0 && $('.switch-sidebar-image input:checked').length != 0) {
              var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src');
  
              $full_page_background.fadeOut('fast', function() {
                  $full_page_background.css('background-image', 'url("' + new_image_full_page + '")');
                  $full_page_background.fadeIn('fast');
              });
          }
  
          if ($('.switch-sidebar-image input:checked').length == 0) {
              var new_image = $('.fixed-plugin li.active .img-holder').find("img").attr('src');
              var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src');
  
              $sidebar_img_container.css('background-image', 'url("' + new_image + '")');
              $full_page_background.css('background-image', 'url("' + new_image_full_page + '")');
          }
  
          if ($sidebar_responsive.length != 0) {
              $sidebar_responsive.css('background-image', 'url("' + new_image + '")');
          }
      });
  
      $('.switch-image input').on("switchChange.bootstrapSwitch", function() {
  
          $full_page_background = $('.full-page-background');
  
          $input = $(this);
  
          if ($input.is(':checked')) {
              if ($sidebar_img_container.length != 0) {
                  $sidebar_img_container.fadeIn('fast');
                  $sidebar.attr('data-image', '#');
              }
  
              if ($full_page_background.length != 0) {
                  $full_page_background.fadeIn('fast');
                  $full_page.attr('data-image', '#');
              }
  
              background_image = true;
          } else {
              if ($sidebar_img_container.length != 0) {
                  $sidebar.removeAttr('data-image');
                  $sidebar_img_container.fadeOut('fast');
              }
  
              if ($full_page_background.length != 0) {
                  $full_page.removeAttr('data-image', '#');
                  $full_page_background.fadeOut('fast');
              }
  
              background_image = false;
          }
      });
  
      $('.switch-mini input').on("switchChange.bootstrapSwitch", function() {
          $body = $('body');
  
          $input = $(this);
  
          if (lbd.misc.sidebar_mini_active == true) {
              $('body').removeClass('sidebar-mini');
              lbd.misc.sidebar_mini_active = false;
  
              if (isWindows) {
                  $('.sidebar .sidebar-wrapper').perfectScrollbar();
              }
  
          } else {
  
              $('.sidebar .collapse').collapse('hide').on('hidden.bs.collapse', function() {
                  $(this).css('height', 'auto');
              });
  
              if (isWindows) {
                  $('.sidebar .sidebar-wrapper').perfectScrollbar('destroy');
              }
  
              setTimeout(function() {
                  $('body').addClass('sidebar-mini');
  
                  $('.sidebar .collapse').css('height', 'auto');
                  lbd.misc.sidebar_mini_active = true;
              }, 300);
          }
  
          // we simulate the window Resize so the charts will get updated in realtime.
          var simulateWindowResize = setInterval(function() {
              window.dispatchEvent(new Event('resize'));
          }, 180);
  
          // we stop the simulation of Window Resize after the animations are completed
          setTimeout(function() {
              clearInterval(simulateWindowResize);
          }, 1000);
  
      });
  
      $('.switch-nav input').on("switchChange.bootstrapSwitch", function() {
          $nav = $('nav.navbar').first();
  
          $nav.toggleClass("navbar-fixed");
  
          // if($nav.hasClass('navbar-fixed')){
          //     $nav.removeClass('navbar-fixed').prependTo('.main-panel');
          // } else {
          //     $nav.prependTo('.wrapper').addClass('navbar-fixed');
          // }
  
      });
  
  
  });
  
  type = ['primary', 'info', 'success', 'warning', 'danger'];
  
  demo = {
      initPickColor: function() {
          $('.pick-class-label').click(function() {
              var new_class = $(this).attr('new-class');
              var old_class = $('#display-buttons').attr('data-class');
              var display_div = $('#display-buttons');
              if (display_div.length) {
                  var display_buttons = display_div.find('.btn');
                  display_buttons.removeClass(old_class);
                  display_buttons.addClass(new_class);
                  display_div.attr('data-class', new_class);
              }
          });
      },
  
      checkFullPageBackgroundImage: function() {
          $page = $('.full-page');
          image_src = $page.data('image');
  
          if (image_src !== undefined) {
              image_container = '<div class="full-page-background" style="background-image: url(' + image_src + ') "/>'
              $page.append(image_container);
          }
      },
  
      initLBDWizard: function() {
          // Code for the Validator
          var $validator = $('#wizardForm').validate({
              rules: {
                  email: {
                      required: true,
                      email: true,
                      minlength: 5
                  },
                  first_name: {
                      required: false,
                      minlength: 5
                  },
                  last_name: {
                      required: false,
                      minlength: 5
                  },
                  website: {
                      required: true,
                      minlength: 5,
                      url: true
                  },
                  framework: {
                      required: false,
                      minlength: 4
                  },
                  cities: {
                      required: true
                  },
                  price: {
                      number: true
                  }
              },
              highlight: function(element) {
                  $(element).closest('.form-group').removeClass('has-success').addClass('has-error');
              },
              success: function(element) {
                  $(element).closest('.form-group').removeClass('has-error').addClass('has-success');
              },
  
              // errorPlacement: function(error, element) {
              //     $(element).parent('div').addClass('has-danger');
              //  }
          });
  
          // Wizard Initialization
          $('.card-wizard').bootstrapWizard({
              'tabClass': 'nav nav-pills',
              'nextSelector': '.btn-next',
              'previousSelector': '.btn-previous',
  
              onNext: function(tab, navigation, index) {
                  var $valid = $('#wizardForm').valid();
                  if (!$valid) {
                      $validator.focusInvalid();
                      return false;
                  }
              },
  
              onInit: function(tab, navigation, index) {
                  //check number of tabs and fill the entire row
                  var $total = navigation.find('li').length;
                  var $wizard = navigation.closest('.card-wizard');
  
                  $first_li = navigation.find('li:first-child a').html();
                  $moving_div = $('<div class="moving-tab">' + $first_li + '</div>');
                  $('.card-wizard .wizard-navigation').append($moving_div);
  
                  refreshAnimation($wizard, index);
  
                  $('.moving-tab').css('transition', 'transform 0s');
              },
  
              onTabClick: function(tab, navigation, index) {
                  var $valid = $('#wizardForm').valid();
  
                  if (!$valid) {
                      return false;
                  } else {
                      return true;
                  }
              },
  
              onTabShow: function(tab, navigation, index) {
                  var $total = navigation.find('li').length;
                  var $current = index + 1;
  
                  var $wizard = navigation.closest('.card-wizard');
  
                  // If it's the last tab then hide the last button and show the finish instead
                  if ($current >= $total) {
                      $($wizard).find('.btn-next').hide();
                      $($wizard).find('.btn-finish').show();
                  } else {
                      $($wizard).find('.btn-next').show();
                      $($wizard).find('.btn-finish').hide();
                  }
  
                  button_text = navigation.find('li:nth-child(' + $current + ') a').html();
  
                  setTimeout(function() {
                      $('.moving-tab').text(button_text);
                  }, 150);
  
                  var checkbox = $('.footer-checkbox');
  
                  if (!index == 0) {
                      $(checkbox).css({
                          'opacity': '0',
                          'visibility': 'hidden',
                          'position': 'absolute'
                      });
                  } else {
                      $(checkbox).css({
                          'opacity': '1',
                          'visibility': 'visible'
                      });
                  }
  
                  refreshAnimation($wizard, index);
              }
          });
  
  
          // Prepare the preview for profile picture
          $("#wizard-picture").change(function() {
              readURL(this);
          });
  
          $('[data-toggle="wizard-radio"]').click(function() {
              wizard = $(this).closest('.card-wizard');
              wizard.find('[data-toggle="wizard-radio"]').removeClass('active');
              $(this).addClass('active');
              $(wizard).find('[type="radio"]').removeAttr('checked');
              $(this).find('[type="radio"]').attr('checked', 'true');
          });
  
          $('[data-toggle="wizard-checkbox"]').click(function() {
              if ($(this).hasClass('active')) {
                  $(this).removeClass('active');
                  $(this).find('[type="checkbox"]').removeAttr('checked');
              } else {
                  $(this).addClass('active');
                  $(this).find('[type="checkbox"]').attr('checked', 'true');
              }
          });
  
          $('.set-full-height').css('height', 'auto');
  
          //Function to show image before upload
  
          function readURL(input) {
              if (input.files && input.files[0]) {
                  var reader = new FileReader();
  
                  reader.onload = function(e) {
                      $('#wizardPicturePreview').attr('src', e.target.result).fadeIn('slow');
                  }
                  reader.readAsDataURL(input.files[0]);
              }
          }
  
          $(window).resize(function() {
              $('.card-wizard').each(function() {
                  $wizard = $(this);
  
                  index = $wizard.bootstrapWizard('currentIndex');
                  refreshAnimation($wizard, index);
  
                  $('.moving-tab').css({
                      'transition': 'transform 0s'
                  });
              });
          });
  
          function refreshAnimation($wizard, index) {
              $total = $wizard.find('.nav li').length;
              $li_width = 100 / $total;
  
              total_steps = $wizard.find('.nav li').length;
              move_distance = $wizard.width() / total_steps;
              index_temp = index;
              vertical_level = 0;
  
              mobile_device = $(document).width() < 600 && $total > 3;
  
              if (mobile_device) {
                  move_distance = $wizard.width() / 2;
                  index_temp = index % 2;
                  $li_width = 50;
              }
  
              $wizard.find('.nav li').css('width', $li_width + '%');
  
              step_width = move_distance;
              move_distance = move_distance * index_temp;
  
              $current = index + 1;
  
              if ($current == 1 || (mobile_device == true && (index % 2 == 0))) {
                  move_distance -= 8;
              } else if ($current == total_steps || (mobile_device == true && (index % 2 == 1))) {
                  move_distance += 8;
              }
  
              if (mobile_device) {
                  vertical_level = parseInt(index / 2);
                  vertical_level = vertical_level * 38;
              }
  
              $wizard.find('.moving-tab').css('width', step_width);
              $('.moving-tab').css({
                  'transform': 'translate3d(' + move_distance + 'px, ' + vertical_level + 'px, 0)',
                  'transition': 'all 0.5s cubic-bezier(0.29, 1.42, 0.79, 1)'
  
              });
          }
      },
  
      initSliders: function() {
          // Sliders for demo purpose in refine cards section
          var slider = document.getElementById('sliderRegular');
  
          noUiSlider.create(slider, {
              start: 40,
              connect: [true, false],
              range: {
                  min: 0,
                  max: 100
              }
          });
  
          var slider2 = document.getElementById('sliderDouble');
  
          noUiSlider.create(slider2, {
              start: [20, 60],
              connect: true,
              range: {
                  min: 0,
                  max: 100
              }
          });
      },
  
      initCharts: function() {
  
          /*  **************** 24 Hours Performance - single line ******************** */
  
          var dataPerformance = {
              labels: ['6pm', '9pm', '11pm', '2am', '4am', '8am', '2pm', '5pm', '8pm', '11pm', '4am'],
              series: [
                  [1, 6, 8, 7, 4, 7, 8, 12, 16, 17, 14, 13]
              ]
          };
  
          var optionsPerformance = {
              showPoint: false,
              lineSmooth: true,
              height: "260px",
              axisX: {
                  showGrid: false,
                  showLabel: true
              },
              axisY: {
                  offset: 40,
              },
              low: 0,
              high: 16
          };
  
          Chartist.Line('#chartPerformance', dataPerformance, optionsPerformance);
  
  
  
          /*  **************** NASDAQ: AAPL - single line with points ******************** */
  
          var dataStock = {
              labels: ['\'07', '\'08', '\'09', '\'10', '\'11', '\'12', '\'13', '\'14', '\'15'],
              series: [
                  [22.20, 34.90, 42.28, 51.93, 62.21, 80.23, 62.21, 82.12, 102.50, 107.23]
              ]
          };
  
          var optionsStock = {
              lineSmooth: false,
              height: "260px",
              axisY: {
                  offset: 40,
                  labelInterpolationFnc: function(value) {
                      return '$' + value;
                  }
  
              },
              low: 10,
              high: 110,
              classNames: {
                  point: 'ct-point ct-green',
                  line: 'ct-line ct-green'
              }
          };
  
          Chartist.Line('#chartStock', dataStock, optionsStock);
  
  
  
          /*  **************** Users Behaviour - Multiple Lines ******************** */
  
  
          var dataSales = {
              labels: ['\'06', '\'07', '\'08', '\'09', '\'10', '\'11', '\'12', '\'13', '\'14', '\'15'],
              series: [
                  [287, 385, 490, 554, 586, 698, 695, 752, 788, 846, 944],
                  [67, 152, 143, 287, 335, 435, 437, 539, 542, 544, 647],
                  [23, 113, 67, 190, 239, 307, 308, 439, 410, 410, 509]
              ]
          };
  
          var optionsSales = {
              lineSmooth: false,
              axisY: {
                  offset: 40
              },
              low: 0,
              high: 1000
          };
  
  
          Chartist.Line('#chartBehaviour', dataSales, optionsSales);
  
  
  
          /*  **************** Public Preferences - Pie Chart ******************** */
  
          var dataPreferences = {
              series: [
                  [25, 30, 20, 25]
              ]
          };
  
          var optionsPreferences = {
              donut: true,
              donutWidth: 40,
              startAngle: 0,
              total: 100,
              showLabel: false,
              axisX: {
                  showGrid: false,
                  offset: 0
              },
              height: 245
          };
  
          Chartist.Pie('#chartPreferences', dataPreferences, optionsPreferences);
  
          Chartist.Pie('#chartPreferences', {
              labels: ['62%', '32%', '6%'],
              series: [62, 32, 6]
          });
  
  
          /*  **************** Views  - barchart ******************** */
  
          var dataViews = {
              labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
              series: [
                  [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]
              ]
          };
  
          var optionsViews = {
              seriesBarDistance: 10,
              classNames: {
                  bar: 'ct-bar ct-azure'
              },
              axisX: {
                  showGrid: false
              }
          };
  
          var responsiveOptionsViews = [
              ['screen and (max-width: 640px)', {
                  seriesBarDistance: 5,
                  axisX: {
                      labelInterpolationFnc: function(value) {
                          return value[0];
                      }
                  }
              }]
          ];
  
          Chartist.Bar('#chartViews', dataViews, optionsViews, responsiveOptionsViews);
  
  
  
          var data = {
              labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
              series: [
                  [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895],
                  [412, 243, 280, 580, 453, 353, 300, 364, 368, 410, 636, 695]
              ]
          };
  
          var options = {
              seriesBarDistance: 10,
              axisX: {
                  showGrid: false
              },
              height: "245px"
          };
  
          var responsiveOptions = [
              ['screen and (max-width: 640px)', {
                  seriesBarDistance: 5,
                  axisX: {
                      labelInterpolationFnc: function(value) {
                          return value[0];
                      }
                  }
              }]
          ];
  
          Chartist.Bar('#chartActivity', data, options, responsiveOptions);
  
      },
  
      initDocumentationCharts: function() {
          /* ----------==========     Daily Sales Chart initialization For Documentation    ==========---------- */
  
          dataDailySalesChart = {
              labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
              series: [
                  [12, 17, 7, 17, 23, 18, 38]
              ]
          };
  
          optionsDailySalesChart = {
              lineSmooth: Chartist.Interpolation.cardinal({
                  tension: 0
              }),
              low: 0,
              high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
              chartPadding: {
                  top: 0,
                  right: 0,
                  bottom: 0,
                  left: 0
              },
          }
  
          var dailySalesChart = new Chartist.Line('#dailySalesChart', dataDailySalesChart, optionsDailySalesChart);
  
          // lbd.startAnimationForLineChart(dailySalesChart);
      },
  
      initVectorMap: function() {
          var mapData = {
              "AU": 760,
              "BR": 550,
              "CA": 120,
              "DE": 1300,
              "FR": 540,
              "GB": 690,
              "GE": 200,
              "IN": 200,
              "RO": 600,
              "RU": 300,
              "US": 2920,
          };
  
          $('#worldMap').vectorMap({
              map: 'world_mill_en',
              backgroundColor: "transparent",
              zoomOnScroll: false,
              regionStyle: {
                  initial: {
                      fill: '#e4e4e4',
                      "fill-opacity": 0.9,
                      stroke: 'none',
                      "stroke-width": 0,
                      "stroke-opacity": 0
                  }
              },
  
              series: {
                  regions: [{
                      values: mapData,
                      scale: ["#AAAAAA", "#444444"],
                      normalizeFunction: 'polynomial'
                  }]
              },
          });
      },
  
      initFullCalendar: function() {
          $calendar = $('#fullCalendar');
  
          today = new Date();
          y = today.getFullYear();
          m = today.getMonth();
          d = today.getDate();
  
          $calendar.fullCalendar({
              header: {
                  left: 'title',
                  center: 'month,agendaWeek,agendaDay',
                  right: 'prev,next,today'
              },
              defaultDate: today,
              selectable: true,
              selectHelper: true,
              // titleFormat: {
              //     month: 'MMMM YYYY', // September 2015
              //     week: "MMMM D YYYY", // September 2015
              //     day: 'D MMM, YYYY'  // Tuesday, Sep 8, 2015
              // },
              views: {
                  // week:{ titleFormat: "DD MMMM YYYY" },
                  month: {
                      titleFormat: 'MMMM YYYY'
                  }, // September 2015
                  week: {
                      titleFormat: "MMMM D YYYY"
                  }, // September 2015
                  day: {
                      titleFormat: 'D MMM, YYYY'
                  } // Tuesday, Sep 8, 2015
              },
              select: function(start, end) {
  
                  // on select we show the Sweet Alert modal with an input
                  swal({
                      title: 'Create an Event',
                      html: '<br><input class="form-control" placeholder="Event Title" id="input-field">',
                      showCancelButton: true,
                      closeOnConfirm: true
                  }, function() {
  
                      var eventData;
                      event_title = $('#input-field').val();
  
                      if (event_title) {
                          eventData = {
                              title: event_title,
                              start: start,
                              end: end
                          };
                          $calendar.fullCalendar('renderEvent', eventData, true); // stick? = true
                      }
  
                      $calendar.fullCalendar('unselect');
  
                  });
              },
              editable: true,
              eventLimit: true, // allow "more" link when too many events
  
  
              // color classes: [ event-blue | event-azure | event-green | event-orange | event-red ]
              events: [{
                      title: 'All Day Event',
                      start: new Date(y, m, 1)
                  },
                  {
                      id: 999,
                      title: 'Repeating Event',
                      start: new Date(y, m, d - 4, 6, 0),
                      allDay: false,
                      className: 'event-blue'
                  },
                  {
                      id: 999,
                      title: 'Repeating Event',
                      start: new Date(y, m, d + 3, 6, 0),
                      allDay: false,
                      className: 'event-blue'
                  },
                  {
                      title: 'Meeting',
                      start: new Date(y, m, d - 1, 10, 30),
                      allDay: false,
                      className: 'event-green'
                  },
                  {
                      title: 'Lunch',
                      start: new Date(y, m, d + 7, 12, 0),
                      end: new Date(y, m, d + 7, 14, 0),
                      allDay: false,
                      className: 'event-red'
                  },
                  {
                      title: 'LBD Launch',
                      start: new Date(y, m, d - 2, 12, 0),
                      allDay: true,
                      className: 'event-azure'
                  },
                  {
                      title: 'Birthday Party',
                      start: new Date(y, m, d + 1, 19, 0),
                      end: new Date(y, m, d + 1, 22, 30),
                      allDay: false,
                  },
                  {
                      title: 'Click for Creative Tim',
                      start: new Date(y, m, 21),
                      end: new Date(y, m, 22),
                      url: 'http://www.creative-tim.com/',
                      className: 'event-orange'
                  },
                  {
                      title: 'Click for Google',
                      start: new Date(y, m, 23),
                      end: new Date(y, m, 23),
                      url: 'http://www.creative-tim.com/',
                      className: 'event-orange'
                  }
              ]
          });
      },
  
      initDashboardPageCharts: function() {
  
          var dataPreferences = {
              series: [
                  [25, 30, 20, 25]
              ]
          };
  
          var optionsPreferences = {
              donut: true,
              donutWidth: 40,
              startAngle: 0,
              total: 100,
              showLabel: false,
              axisX: {
                  showGrid: false
              }
          };
  
          Chartist.Pie('#chartEmail', dataPreferences, optionsPreferences);
  
          Chartist.Pie('#chartEmail', {
              labels: ['53%', '36%', '11%'],
              series: [53, 36, 11]
          });
  
  
          var dataSales = {
              labels: ['9:00AM', '12:00AM', '3:00PM', '6:00PM', '9:00PM', '12:00PM', '3:00AM', '6:00AM'],
              series: [
                  [287, 385, 490, 492, 554, 586, 698, 695, 752, 788, 846, 944],
                  [67, 152, 143, 240, 287, 335, 435, 437, 539, 542, 544, 647],
                  [23, 113, 67, 108, 190, 239, 307, 308, 439, 410, 410, 509]
              ]
          };
  
          var optionsSales = {
              lineSmooth: false,
              low: 0,
              high: 800,
              showArea: true,
              height: "245px",
              axisX: {
                  showGrid: false,
              },
              lineSmooth: Chartist.Interpolation.simple({
                  divisor: 3
              }),
              showLine: false,
              showPoint: false,
              fullWidth: false
          };
  
          var responsiveSales = [
              ['screen and (max-width: 640px)', {
                  axisX: {
                      labelInterpolationFnc: function(value) {
                          return value[0];
                      }
                  }
              }]
          ];
  
          var chartHours = Chartist.Line('#chartHours', dataSales, optionsSales, responsiveSales);
  
          // lbd.startAnimationForLineChart(chartHours);
  
          var data = {
              labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
              series: [
                  [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895],
                  [412, 243, 280, 580, 453, 353, 300, 364, 368, 410, 636, 695]
              ]
          };
  
          var options = {
              seriesBarDistance: 10,
              axisX: {
                  showGrid: false
              },
              height: "245px"
          };
  
          var responsiveOptions = [
              ['screen and (max-width: 640px)', {
                  seriesBarDistance: 5,
                  axisX: {
                      labelInterpolationFnc: function(value) {
                          return value[0];
                      }
                  }
              }]
          ];
  
          var chartActivity = Chartist.Bar('#chartActivity', data, options, responsiveOptions);
  
          // lbd.startAnimationForBarChart(chartActivity);
  
          // /* ----------==========     Daily Sales Chart initialization    ==========---------- */
          //
          // dataDailySalesChart = {
          //     labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
          //     series: [
          //         [12, 17, 7, 17, 23, 18, 38]
          //     ]
          // };
          //
          // optionsDailySalesChart = {
          //     lineSmooth: Chartist.Interpolation.cardinal({
          //         tension: 0
          //     }),
          //     low: 0,
          //     high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
          //     chartPadding: { top: 0, right: 0, bottom: 0, left: 0},
          // }
          //
          // var dailySalesChart = Chartist.Line('#dailySalesChart', dataDailySalesChart, optionsDailySalesChart);
  
          // lbd.startAnimationForLineChart(dailySalesChart);
  
          //
          //
          // /* ----------==========     Completed Tasks Chart initialization    ==========---------- */
          //
          // dataCompletedTasksChart = {
          //     labels: ['12am', '3pm', '6pm', '9pm', '12pm', '3am', '6am', '9am'],
          //     series: [
          //         [230, 750, 450, 300, 280, 240, 200, 190]
          //     ]
          // };
          //
          // optionsCompletedTasksChart = {
          //     lineSmooth: Chartist.Interpolation.cardinal({
          //         tension: 0
          //     }),
          //     low: 0,
          //     high: 1000, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
          //     chartPadding: { top: 0, right: 0, bottom: 0, left: 0}
          // }
          //
          // var completedTasksChart = new Chartist.Line('#completedTasksChart', dataCompletedTasksChart, optionsCompletedTasksChart);
          //
          // // start animation for the Completed Tasks Chart - Line Chart
          // lbd.startAnimationForLineChart(completedTasksChart);
          //
          //
          // /* ----------==========     Emails Subscription Chart initialization    ==========---------- */
          //
          // var dataEmailsSubscriptionChart = {
          //   labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
          //   series: [
          //     [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]
          //
          //   ]
          // };
          // var optionsEmailsSubscriptionChart = {
          //     axisX: {
          //         showGrid: false
          //     },
          //     low: 0,
          //     high: 1000,
          //     chartPadding: { top: 0, right: 5, bottom: 0, left: 0}
          // };
          // var responsiveOptions = [
          //   ['screen and (max-width: 640px)', {
          //     seriesBarDistance: 5,
          //     axisX: {
          //       labelInterpolationFnc: function (value) {
          //         return value[0];
          //       }
          //     }
          //   }]
          // ];
          // var emailsSubscriptionChart = Chartist.Bar('#emailsSubscriptionChart', dataEmailsSubscriptionChart, optionsEmailsSubscriptionChart, responsiveOptions);
          //
          // //start animation for the Emails Subscription Chart
          // lbd.startAnimationForBarChart(emailsSubscriptionChart);
  
      },
  
  
  
      initSmallGoogleMaps: function() {
  
          // Regular Map
          var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
          var mapOptions = {
              zoom: 8,
              center: myLatlng,
              scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
          }
  
          var map = new google.maps.Map(document.getElementById("regularMap"), mapOptions);
  
          var marker = new google.maps.Marker({
              position: myLatlng,
              title: "Regular Map!"
          });
  
          marker.setMap(map);
  
  
          // Custom Skin & Settings Map
          var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
          var mapOptions = {
              zoom: 13,
              center: myLatlng,
              scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
              disableDefaultUI: true, // a way to quickly hide all controls
              zoomControl: true,
              styles: [{
                  "featureType": "water",
                  "stylers": [{
                      "saturation": 43
                  }, {
                      "lightness": -11
                  }, {
                      "hue": "#0088ff"
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "hue": "#ff0000"
                  }, {
                      "saturation": -100
                  }, {
                      "lightness": 99
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "geometry.stroke",
                  "stylers": [{
                      "color": "#808080"
                  }, {
                      "lightness": 54
                  }]
              }, {
                  "featureType": "landscape.man_made",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "color": "#ece2d9"
                  }]
              }, {
                  "featureType": "poi.park",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "color": "#ccdca1"
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "labels.text.fill",
                  "stylers": [{
                      "color": "#767676"
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "labels.text.stroke",
                  "stylers": [{
                      "color": "#ffffff"
                  }]
              }, {
                  "featureType": "poi",
                  "stylers": [{
                      "visibility": "off"
                  }]
              }, {
                  "featureType": "landscape.natural",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "visibility": "on"
                  }, {
                      "color": "#b8cb93"
                  }]
              }, {
                  "featureType": "poi.park",
                  "stylers": [{
                      "visibility": "on"
                  }]
              }, {
                  "featureType": "poi.sports_complex",
                  "stylers": [{
                      "visibility": "on"
                  }]
              }, {
                  "featureType": "poi.medical",
                  "stylers": [{
                      "visibility": "on"
                  }]
              }, {
                  "featureType": "poi.business",
                  "stylers": [{
                      "visibility": "simplified"
                  }]
              }]
  
          }
  
          var map = new google.maps.Map(document.getElementById("customSkinMap"), mapOptions);
  
          var marker = new google.maps.Marker({
              position: myLatlng,
              title: "Custom Skin & Settings Map!"
          });
  
          marker.setMap(map);
  
  
  
          // Satellite Map
          var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
          var mapOptions = {
              zoom: 3,
              scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
              center: myLatlng,
              mapTypeId: google.maps.MapTypeId.SATELLITE
          }
  
          var map = new google.maps.Map(document.getElementById("satelliteMap"), mapOptions);
  
          var marker = new google.maps.Marker({
              position: myLatlng,
              title: "Satellite Map!"
          });
  
          marker.setMap(map);
  
  
      },
  
      initFullScreenGoogleMap: function() {
          var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
          var mapOptions = {
              zoom: 13,
              center: myLatlng,
              scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
              styles: [{
                  "featureType": "water",
                  "stylers": [{
                      "saturation": 43
                  }, {
                      "lightness": -11
                  }, {
                      "hue": "#0088ff"
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "hue": "#ff0000"
                  }, {
                      "saturation": -100
                  }, {
                      "lightness": 99
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "geometry.stroke",
                  "stylers": [{
                      "color": "#808080"
                  }, {
                      "lightness": 54
                  }]
              }, {
                  "featureType": "landscape.man_made",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "color": "#ece2d9"
                  }]
              }, {
                  "featureType": "poi.park",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "color": "#ccdca1"
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "labels.text.fill",
                  "stylers": [{
                      "color": "#767676"
                  }]
              }, {
                  "featureType": "road",
                  "elementType": "labels.text.stroke",
                  "stylers": [{
                      "color": "#ffffff"
                  }]
              }, {
                  "featureType": "poi",
                  "stylers": [{
                      "visibility": "off"
                  }]
              }, {
                  "featureType": "landscape.natural",
                  "elementType": "geometry.fill",
                  "stylers": [{
                      "visibility": "on"
                  }, {
                      "color": "#b8cb93"
                  }]
              }, {
                  "featureType": "poi.park",
                  "stylers": [{
                      "visibility": "on"
                  }]
              }, {
                  "featureType": "poi.sports_complex",
                  "stylers": [{
                      "visibility": "on"
                  }]
              }, {
                  "featureType": "poi.medical",
                  "stylers": [{
                      "visibility": "on"
                  }]
              }, {
                  "featureType": "poi.business",
                  "stylers": [{
                      "visibility": "simplified"
                  }]
              }]
  
          }
          var map = new google.maps.Map(document.getElementById("map"), mapOptions);
  
          var marker = new google.maps.Marker({
              position: myLatlng,
              title: "Hello World!"
          });
  
          // To add the marker to the map, call setMap();
          marker.setMap(map);
      },
  
      showNotification: function(from, align) {
          color = Math.floor((Math.random() * 4) + 1);
  
          $.notify({
              icon: "nc-icon nc-app",
              message: "Selamat Datang di <b>Aplikasi Perizinan Online</b> - hadir untuk memudahkan :)"
  
          }, {
              type: type[color],
              timer: 8000,
              placement: {
                  from: from,
                  align: align
              }
          });
      },
  
      // Sweet Alerts
  
      showSwal: function(type) {
          if (type == 'basic') {
              swal("Here's a message!");
  
          } else if (type == 'title-and-text') {
              swal("Here's a message!", "It's pretty, isn't it?")
  
          } else if (type == 'success-message') {
              swal("Good job!", "You clicked the button!", "success")
  
          } else if (type == 'warning-message-and-confirmation') {
              swal({
                  title: "Are you sure?",
                  text: "You will not be able to recover this imaginary file!",
                  type: "warning",
                  showCancelButton: true,
                  confirmButtonClass: "btn btn-info btn-fill",
                  confirmButtonText: "Yes, delete it!",
                  cancelButtonClass: "btn btn-danger btn-fill",
                  closeOnConfirm: false,
              }, function() {
                  swal("Deleted!", "Your imaginary file has been deleted.", "success");
              });
  
          } else if (type == 'warning-message-and-cancel') {
              swal({
                  title: "Are you sure?",
                  text: "You will not be able to recover this imaginary file!",
                  type: "warning",
                  showCancelButton: true,
                  confirmButtonText: "Yes, delete it!",
                  cancelButtonText: "No, cancel plx!",
                  closeOnConfirm: false,
                  closeOnCancel: false
              }, function(isConfirm) {
                  if (isConfirm) {
                      swal("Deleted!", "Your imaginary file has been deleted.", "success");
                  } else {
                      swal("Cancelled", "Your imaginary file is safe :)", "error");
                  }
              });
  
          } else if (type == 'custom-html') {
              swal({
                  title: 'HTML example',
                  html: 'You can use <b>bold text</b>, ' +
                      '<a href="http://github.com">links</a> ' +
                      'and other HTML tags'
              });
  
          } else if (type == 'auto-close') {
              swal({
                  title: "Auto close alert!",
                  text: "I will close in 2 seconds.",
                  timer: 2000,
                  showConfirmButton: false
              });
          } else if (type == 'input-field') {
              swal({
                      title: 'Input something',
                      html: '<p><input id="input-field" class="form-control">',
                      showCancelButton: true,
                      closeOnConfirm: false,
                      allowOutsideClick: false
                  },
                  function() {
                      swal({
                          html: 'You entered: <strong>' +
                              $('#input-field').val() +
                              '</strong>'
                      });
                  })
          }
      }
  
  
  
  }