text: /* JS */
  
  
  /* Navigation */
  
  $(document).ready(function(){
  
    $(window).resize(function()
    {
      if($(window).width() >= 765){
        $(".sidebar .sidebar-inner").slideDown(350);
      }
      else{
        $(".sidebar .sidebar-inner").slideUp(350); 
      }
    });
  
  });
  
  $(document).ready(function(){
  
    $(".has_submenu > a").click(function(e){
      e.preventDefault();
      var menu_li = $(this).parent("li");
      var menu_ul = $(this).next("ul");
  
      if(menu_li.hasClass("open")){
        menu_ul.slideUp(350);
        menu_li.removeClass("open")
      }
      else{
        $(".navi > li > ul").slideUp(350);
        $(".navi > li").removeClass("open");
        menu_ul.slideDown(350);
        menu_li.addClass("open");
      }
    });
  
  });
  
  $(document).ready(function(){
    $(".sidebar-dropdown a").on('click',function(e){
        e.preventDefault();
  
        if(!$(this).hasClass("dropy")) {
          // hide any open menus and remove all other classes
          $(".sidebar .sidebar-inner").slideUp(350);
          $(".sidebar-dropdown a").removeClass("dropy");
          
          // open our new menu and add the dropy class
          $(".sidebar .sidebar-inner").slideDown(350);
          $(this).addClass("dropy");
        }
        
        else if($(this).hasClass("dropy")) {
          $(this).removeClass("dropy");
          $(".sidebar .sidebar-inner").slideUp(350);
        }
    });
  
  });
  
  /* Widget close */
  
  $('.wclose').click(function(e){
    e.preventDefault();
    var $wbox = $(this).parent().parent().parent();
    $wbox.hide(100);
  });
  
  /* Widget minimize */
  
    $('.wminimize').click(function(e){
      e.preventDefault();
      var $wcontent = $(this).parent().parent().next('.widget-content');
      if($wcontent.is(':visible')) 
      {
        $(this).children('i').removeClass('icon-chevron-up');
        $(this).children('i').addClass('icon-chevron-down');
      }
      else 
      {
        $(this).children('i').removeClass('icon-chevron-down');
        $(this).children('i').addClass('icon-chevron-up');
      }            
      $wcontent.toggle(500);
    }); 
  
  /* Calendar */
  
    $(document).ready(function() {
    
      var date = new Date();
      var d = date.getDate();
      var m = date.getMonth();
      var y = date.getFullYear();
      
      $('#calendar').fullCalendar({
        header: {
          left: 'prev',
          center: 'title',
          right: 'month,agendaWeek,agendaDay,next'
        },
        editable: true,
        events: [
          {
            title: 'All Day Event',
            start: new Date(y, m, 1),
            backgroundColor: '#FFB848',
            borderColor: '#FFB848'
          },
          {
            title: 'Long Event',
            start: new Date(y, m, d-5),
            end: new Date(y, m, d-2),
            backgroundColor: '#94B86E',
            borderColor: '#94B86E'
          },
          {
            id: 999,
            title: 'Repeating Event',
            start: new Date(y, m, d-3, 16, 0),
            allDay: false,
            backgroundColor: '#E25856',
            borderColor: '#E25856'
          },
          {
            id: 999,
            title: 'Repeating Event',
            start: new Date(y, m, d+4, 16, 0),
            allDay: false,
            backgroundColor: '#94B86E',
            borderColor: '#94B86E'
          },
          {
            title: 'Meeting',
            start: new Date(y, m, d, 10, 30),
            allDay: false
          },
          {
            title: 'Lunch',
            start: new Date(y, m, d, 12, 0),
            end: new Date(y, m, d, 14, 0),
            allDay: false,
            backgroundColor: '#555555',
            borderColor: '#555555'
          },
          {
            title: 'Birthday Party',
            start: new Date(y, m, d+1, 19, 0),
            end: new Date(y, m, d+1, 22, 30),
            allDay: false,
            backgroundColor: '#852B99',
            borderColor: '#852B99'
          },
          {
            title: 'Click for Google',
            start: new Date(y, m, 28),
            end: new Date(y, m, 29),
            url: 'http://google.com/',
            backgroundColor: '#FFB848',
            borderColor: '#FFB848'
          }
        ]
      });
      
    });
  
  /* Progressbar animation */
  
      setTimeout(function(){
  
          $('.progress-animated .progress-bar').each(function() {
              var me = $(this);
              var perc = me.attr("data-percentage");
  
              //TODO: left and right text handling
  
              var current_perc = 0;
  
              var progress = setInterval(function() {
                  if (current_perc>=perc) {
                      clearInterval(progress);
                  } else {
                      current_perc +=1;
                      me.css('width', (current_perc)+'%');
                  }
  
                  me.text((current_perc)+'%');
  
              }, 600);
  
          });
  
      },600);
  
  /* Slider */
  
      $(function() {
          // Horizontal slider
          $( "#master1, #master2" ).slider({
              value: 60,
              orientation: "horizontal",
              range: "min",
              animate: true
          });
  
          $( "#master4, #master3" ).slider({
              value: 80,
              orientation: "horizontal",
              range: "min",
              animate: true
          });        
  
          $("#master5, #master6").slider({
              range: true,
              min: 0,
              max: 400,
              values: [ 75, 200 ],
              slide: function( event, ui ) {
                  $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
              }
          });
  
  
          // Vertical slider 
          $( "#eq > span" ).each(function() {
              // read initial values from markup and remove that
              var value = parseInt( $( this ).text(), 10 );
              $( this ).empty().slider({
                  value: value,
                  range: "min",
                  animate: true,
                  orientation: "vertical"
              });
          });
      });
  
  
  
  /* Support */
  
  $(document).ready(function(){
    $("#slist a").click(function(e){
       e.preventDefault();
       $(this).next('p').toggle(200);
    });
  });
  
  /* Scroll to Top */
  
  
    $(".totop").hide();
  
    $(function(){
      $(window).scroll(function(){
        if ($(this).scrollTop()>300)
        {
          $('.totop').slideDown();
        } 
        else
        {
          $('.totop').slideUp();
        }
      });
  
      $('.totop a').click(function (e) {
        e.preventDefault();
        $('body,html').animate({scrollTop: 0}, 500);
      });
  
    });
  
  /* jQuery Notification (Gritter) */
  
  $(document).ready(function(){
  
      /* Auto notification */
  
      setTimeout(function() {
  
          var unique_id = $.gritter.add({
              // (string | mandatory) the heading of the notification
              title: 'Howdy! User',
              // (string | mandatory) the text inside the notification
              text: 'Today you got some messages and new members. Please check it out!',
              // (string | optional) the image to display on the left
              image: './img/user-big.jpg',
              // (bool | optional) if you want it to fade out on its own or just sit there
              sticky: false,
              // (int | optional) the time you want it to be alive for before fading out
              time: '',
              // (string | optional) the class name you want to apply to that specific message
              class_name: 'gritter-custom'
          });
  
          // You can have it return a unique id, this can be used to manually remove it later using
          setTimeout(function () {
              $.gritter.remove(unique_id, {
                  fade: true,
                  speed: 'slow'
              });
          }, 10000);
  
      }, 4000);
  
  
      /* On click notification. Refer ui.html file */
  
      /* Regulat notification */
      $(".notify").click(function(e){
  
          e.preventDefault();
          var unique_id = $.gritter.add({
              // (string | mandatory) the heading of the notification
              title: 'Howdy! User',
              // (string | mandatory) the text inside the notification
              text: 'Today you got some messages and new members. Please check it out!',
              // (string | optional) the image to display on the left
              image: './img/user-big.jpg',
              // (bool | optional) if you want it to fade out on its own or just sit there
              sticky: false,
              // (int | optional) the time you want it to be alive for before fading out
              time: '',
              // (string | optional) the class name you want to apply to that specific message
              class_name: 'gritter-custom'
          });
  
          // You can have it return a unique id, this can be used to manually remove it later using
          setTimeout(function () {
              $.gritter.remove(unique_id, {
                  fade: true,
                  speed: 'slow'
              });
          }, 6000);
  
      });
  
      /* Sticky notification */
      $(".notify-sticky").click(function(e){
  
          e.preventDefault();
          var unique_id = $.gritter.add({
              // (string | mandatory) the heading of the notification
              title: 'Howdy! User',
              // (string | mandatory) the text inside the notification
              text: 'Today you got some messages and new members. Please check it out!',
              // (string | optional) the image to display on the left
              image: './img/user-big.jpg',
              // (bool | optional) if you want it to fade out on its own or just sit there
              sticky: false,
              // (int | optional) the time you want it to be alive for before fading out
              time: '',
              // (string | optional) the class name you want to apply to that specific message
              class_name: 'gritter-custom'
          });
  
      });
  
      /* Without image notification */
      $(".notify-without-image").click(function(e){
  
          e.preventDefault();
          var unique_id = $.gritter.add({
              // (string | mandatory) the heading of the notification
              title: 'Howdy! User',
              // (string | mandatory) the text inside the notification
              text: 'Today you got some messages and new members. Please check it out!',
              // (bool | optional) if you want it to fade out on its own or just sit there
              sticky: false,
              // (int | optional) the time you want it to be alive for before fading out
              time: '',
              // (string | optional) the class name you want to apply to that specific message
              class_name: 'gritter-custom'
          });
  
      });
  
      /* Remove notification */
  
      $(".notify-remove").click(function(){
  
          $.gritter.removeAll();
          return false;
  
      });
  
  
  });
  
  
  /* Date picker */
  
    $(function() {
      $('#datetimepicker1').datetimepicker({
        pickTime: false
      });
    });
  
  
  
     $(function() {
      $('#datetimepicker2').datetimepicker({
        pickDate: false
      });
    });
  
  
    $(function() {
      $( "#todaydate" ).datepicker();
    });
  
  
  
  /* CL Editor */
  
  $(".cleditor").cleditor({
      width: "auto",
      height: "auto"
  });
  
  /* Modal fix */
  
  $('.modal').appendTo($('body'));
  
  
  /* Notification box */
  
  
  $('.slide-box-head').click(function() {
      var $slidebtn=$(this);
      var $slidebox=$(this).parent().parent();
      if($slidebox.css('right')=="-252px"){
        $slidebox.animate({
          right:0
        },500);
        $slidebtn.children("i").removeClass().addClass("icon-chevron-right");
      }
      else{
        $slidebox.animate({
          right:-252
        },500);
        $slidebtn.children("i").removeClass().addClass("icon-chevron-left");
      }
  }); 
  
  
  $('.sclose').click(function(e){
    e.preventDefault();
    var $wbox = $(this).parent().parent().parent();
    $wbox.hide(0);
  });
  
  
    $('.sminimize').click(function(e){
      e.preventDefault();
      var $wcontent = $(this).parent().parent().next('.slide-content');
      if($wcontent.is(':visible')) 
      {
        $(this).children('i').removeClass('icon-chevron-down');
        $(this).children('i').addClass('icon-chevron-up');
      }
      else 
      {
        $(this).children('i').removeClass('icon-chevron-up');
        $(this).children('i').addClass('icon-chevron-down');
      }            
      $wcontent.toggle(0);
    });
  
  
  $(document).ready(function(){
      /*Horizontal slider init*/
      $('#horiz_container_outer').horizontalScroll();
  
      /*Sidebar slider init*/
  
      var width = $(document).width();
      if (width > 767) {
          $('.sidebar-inner').slimScroll({
              distance: '0px',
              height: '97%',
              size: '4px',
              wheelStep: 1
          });
      }
  
      /* Pretty Photo for Gallery*/
  
      $("a.prettyPhoto").prettyPhoto();
      $("a[rel^='prettyPhoto']").prettyPhoto();
  
      /* Slim Scroll for the LOGS */
      $('div.logs-list').slimScroll({
          distance: '0px',
          color: '#777',
          height: '300px',
          wheelStep: 1
      });
  });
  
  $(window).load(function(){
      $( 'body' ).trigger( 'click' );
      setTimeout(function(){
          $('.containerk').addClass('no-border');
          $('.navbar').addClass('nav-border');
      }, 600);
  });
  /*Projects Drop down init and code */
  $('.project-switcher-btn').click(function(e){
      e.preventDefault();
      $('.pdd').addClass('pdd-visible');
      $(this).parent().toggleClass("open");
      var $container = $('#horiz_container_outer');
      var parentPosition = $container.parent().position();
      var containerHeight = ( parentPosition.top > 1) ? '-200px' : '48px';
      $container.slideToggle();
      $('#scrollbar').removeAttr('style');
      $('#scrollbar').toggleClass('sb-invisible');
  });
  
  /* Hide Projects Drop down if other element clicked */
  $('body').click(function(event) {
      var $myelem = $('.project-switcher-btn');
      var $container = $('#horiz_container_outer');
      if ((!$(event.target).closest($myelem).length)&&(!$(event.target).closest($container).length)) {
          $myelem.parent().removeClass("open");
          $container.slideUp();
          $('#scrollbar').addClass('sb-invisible');
      };
  
  });
  
  /*Close Sidebar Search block*/
  $('.sidebar-search-results i.close').on('click', function(e) {
     e.preventDefault();
     $(this).parent().slideUp();
  });
  /*Open Sidebar Search block*/
  $('.sidebar-search button.submit').on('click', function(e) {
      e.preventDefault();
      var $myelem = $('.sidebar-search-results');
      $myelem.slideDown();
  });
  
  /*Toggle Statistics block*/
  $('.statistics-toggle').on('click', function(e) {
      e.preventDefault();
      $('div.statistics').slideToggle();
  });
  
  