//var function init call
var initReady = function(){
  //function run
	calMatchHeight();
  scrollHeader();
  scrollDetailTitle();
  menuMobileExpand();
  megaMenuExpand();
  expandSearch();
  templateSlider3Col();
  templateSlider5Col();
  jsScrollContent();
  categorySlider();
  sliderText();
  sidebarScroll();
  shareScroll();
  pageCopyClick();
  jsScrollContent();
  bookListClick();
};
var initLoad = function(){
  //function run
};
var initResize = function(){
  //function run
};

//document ready before js
$(document).ready(function(){

  //js autoload when document ready
  initReady();

});

//window load all before js
$(window).on("load", function (e) {

  //js autoload when window load
  initLoad();

});

//window resize before js
$(window).resize(function() {

  //js autoload when window resize
  initResize();

});

//js go top
$(function () {
  $(document).ready(function(){
    //var viewportGlobal = $(window).width();
    if( $('.js-gotop').length > 0 ){
      $(window).scroll(function () {
        if ($(this).scrollTop() > 150) {
          $('.js-gotop').fadeIn();
        } else {
          $('.js-gotop').fadeOut();
        }
      });
      $('.js-gotop').click(function(e){
        e.preventDefault();
        $("html, body").animate({scrollTop: $('body').offset().top}, 700);
      });
    }
  });
});