'use strict';

$(function() {


  /*
  |--------------------------------------------------------------------------
  | Configure your website
  |--------------------------------------------------------------------------
  |
  | We provided several configuration variables for your ease of development.
  | Read their complete description and modify them based on your need.
  |
  */
 
  thesaas.config({

    /*
    |--------------------------------------------------------------------------
    | Google API Key
    |--------------------------------------------------------------------------
    |
    | Here you may specify your Google API key if you need to use Google Maps
    | in your application
    |
    | https://developers.google.com/maps/documentation/javascript/get-api-key
    |
    */

    googleApiKey: '',

    /*
    |--------------------------------------------------------------------------
    | Google Analytics Tracking
    |--------------------------------------------------------------------------
    |
    | If you want to use Google Analytics, you can specify your Tracking ID in
    | this option. Your key would be a value like: UA-12345678-9
    |
    */

    googleAnalyticsId: '',

    /*
    |--------------------------------------------------------------------------
    | Google reCAPTCHA
    |--------------------------------------------------------------------------
    |
    | reCAPTCHA protects you against spam and other types of automated abuse.
    | Please signup for an API key pair and insert your `Site key` value to the
    | following variable.
    |
    | http://www.google.com/recaptcha/admin
    |
    */

    reCaptchaSiteKey:  '',

    // See available languages: https://developers.google.com/recaptcha/docs/language
    reCaptchaLanguage: '',

    /*
    |--------------------------------------------------------------------------
    | Smooth Scroll
    |--------------------------------------------------------------------------
    |
    | If true, the browser's scrollbar moves smoothly on scroll and gives your
    | visitor a better experience for scrolling.
    |
    */
   
    smoothScroll: true,

  });





  /*
  |--------------------------------------------------------------------------
  | Custom Javascript code
  |--------------------------------------------------------------------------
  |
  | Now that you configured your website, you can write additional Javascript
  | code below this comment. You might want to add more plugins and initialize
  | them in this file.
  |
  */



  $(".myselect").select2();

  // window.onscroll = function () { fix_sidebar() };

  // var sidebar = document.getElementById("sidebar");
  // var sticky = sidebar.offsetTop ;

  // function fix_sidebar() {
  //   if (window.pageYOffset > sticky) {
  //     sidebar.classList.add("fixed");
  //   } else {
  //     sidebar.classList.remove("fixed");
  //   }
  // }

  // window.onscroll = function () { fixsidebar() };

  //   var sidebar = $('.sidebar'),
  //   scroll = $(window).scrollTop();

  //   function fixsidebar(){
  //   if (scroll >= 100) sidebar.addClass('fixed');
  //   else sidebar.removeClass('fixed');
  //   }

  $(window).scroll(function () {
    var sticky = $('.sidebar'),
      scroll = $(window).scrollTop();

    if (scroll >= 500) sticky.addClass('fixed');
    else sticky.removeClass('fixed');
  });

});


