text: $(function () {
      skinChanger();
      activateNotificationAndTasksScroll();
  
      setSkinListHeightAndScroll(true);
      setSettingListHeightAndScroll(true);
      $(window).resize(function () {
          setSkinListHeightAndScroll(false);
          setSettingListHeightAndScroll(false);
      });
  });
  //Skin changer
  function skinChanger() {
      $('.right-sidebar .demo-choose-skin li').on('click', function () {
          var $body = $('body');
          var $this = $(this);
  
          var existTheme = $('.right-sidebar .demo-choose-skin li.active').data('theme');
          $('.right-sidebar .demo-choose-skin li').removeClass('active');
          $body.removeClass('theme-' + existTheme);
          $this.addClass('active');
  
          $body.addClass('theme-' + $this.data('theme'));
      });
  }
  //Skin tab content set height and show scroll
  function setSkinListHeightAndScroll(isFirstTime) {
      var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());
      var $el = $('.demo-choose-skin');
  
      if (!isFirstTime){
        $el.slimScroll({ destroy: true }).height('auto');
        $el.parent().find('.slimScrollBar, .slimScrollRail').remove();
      }
  
      $el.slimscroll({
          height: height + 'px',
          color: 'rgba(0,0,0,0.5)',
          size: '6px',
          alwaysVisible: false,
          borderRadius: '0',
          railBorderRadius: '0'
      });
  }
  //Setting tab content set height and show scroll
  function setSettingListHeightAndScroll(isFirstTime) {
      var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());
      var $el = $('.right-sidebar .demo-settings');
  
      if (!isFirstTime){
        $el.slimScroll({ destroy: true }).height('auto');
        $el.parent().find('.slimScrollBar, .slimScrollRail').remove();
      }
  
      $el.slimscroll({
          height: height + 'px',
          color: 'rgba(0,0,0,0.5)',
          size: '6px',
          alwaysVisible: false,
          borderRadius: '0',
          railBorderRadius: '0'
      });
  }
  //Activate notification and task dropdown on top right menu
  function activateNotificationAndTasksScroll() {
      $('.navbar-right .dropdown-menu .body .menu').slimscroll({
          height: '254px',
          color: 'rgba(0,0,0,0.5)',
          size: '4px',
          alwaysVisible: false,
          borderRadius: '0',
          railBorderRadius: '0'
      });
  }
  //Helper Functions For Ajax Calls
  function notify($title , $type , $time = 5000 , $position = 'topLeft'){
      iziToast.show({
          title: $title,
          color: $type,
          zindex: 9060,
          timeout: $time,
          position: $position
      });
  }
  function toggleLoader() {
      $(".page-loader-wrapper").fadeToggle();
  }
  function hideLoader() {
      $(".page-loader-wrapper").fadeOut();
  }
  function isEmpty(value) {
      return typeof value == 'string' && !value.trim() || typeof value == 'undefined' || value === null;
  }
  function hasNumber(value) {
      return /\d/.test(value);
  }
  function isNumber(value) {
      return $.isNumeric(value);
  }
  function isEmail(email) {
      var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
      return regex.test(email);
  }
  function isDate(dateString) {
      var regEx = /^\d{4}\/\d{2}\/\d{2}$/;
      if(!dateString.match(regEx)) return false;  // Invalid format
      var d = new Date(dateString);
      if(Number.isNaN(d.getTime())) return false; // Invalid date
      return true;
  }
  function reloadPage($time) {
      setTimeout(function(){
          location.reload();
      } , $time);
  }
  function redirectPage($redirect , $time = 2000) {
      setTimeout(function(){
          window.location.href = $redirect;
      } , $time);
  }
  function UUID() {
      return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
          var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
          return v.toString(16);
      });
  }
  
  
  $(document).on('click',".fileManagerHandler" , function(e){
      e.preventDefault();
      $inputId = $(this).attr('data-target-id');
      $url = "";
      /*$url += "http://koofadesign.ir/";*/
      $url += "http://localhost:8080/KoofaDesign/";
      $url += 'media/responsivefilemanager/filemanager/dialog.php?type=2&field_id=";' +$inputId +'&akey=gWgMQVkXcjpKgkcr&fldr=';
      $(".fileManagerFrame").attr('src' , $url);
      $('.fileManagerFrame').on('load', function(){
      });
  });
  
  //Google Analiytics ======================================================================================
  /*addLoadEvent(loadTracking);
  var trackingId = 'UA-30038099-6';
  
  function addLoadEvent(func) {
      var oldonload = window.onload;
      if (typeof window.onload != 'function') {
          window.onload = func;
      } else {
          window.onload = function () {
              oldonload();
              func();
          }
      }
  }
  function loadTracking() {
      (function (i, s, o, g, r, a, m) {
          i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
              (i[r].q = i[r].q || []).push(arguments)
          }, i[r].l = 1 * new Date(); a = s.createElement(o),
          m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
      })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
  
      ga('create', trackingId, 'auto');
      ga('send', 'pageview');
  }*/
  //========================================================================================================
  