/**
  * Theme Js file.
**/

jQuery('document').ready(function($){
  setTimeout(function () {
    jQuery(".loader").fadeOut("slow");
  },1000);
});

jQuery(function($){
  $(window).scroll(function() {
    if ($(this).scrollTop() >= 50) {
      $('#return-to-top').fadeIn(200);
    } else {
      $('#return-to-top').fadeOut(200);
    }
  });
  $('#return-to-top').click(function() {
    $('body,html').animate({
      scrollTop : 0
    }, 500);
  });
});

// ===== Mobile responsive Menu ====

function holiday_vacation_menu_open_nav() {
  jQuery(".sidenav").addClass('open');
}
function holiday_vacation_menu_close_nav() {
  jQuery(".sidenav").removeClass('open');
}

jQuery(window).scroll(function() {
  var data_sticky = jQuery('.headerbox').attr('data-sticky');

  if (data_sticky == "true") {
    if (jQuery(this).scrollTop() > 1){
      jQuery('.headerbox').addClass("stick_head");
    } else {
      jQuery('.headerbox').removeClass("stick_head");
    }
  }
});

 jQuery('document').ready(function(){
  jQuery(".kksr-legend").html(function() {
    var text1 = jQuery(this).text().trim().split(" ");
    var third = text1[0];
    var fourth = text1[1];
    var updatedText1 = `<span class='star_rating'>${third}</span>`;
    text1.splice(0, 1);
    text1.splice(0, 0, updatedText1);
    var updatedText2 = `<span class='rating_text'>${fourth}</span>`;
    text1.splice(1, 1);
    text1.splice(1, 0, updatedText2);
    return text1.join(" ");
  });
  });
(function ($) {
  
  // Some script here
  $('.kksr-legend').text(function () {
    return $(this).text().replace('vote', 'review');
  });
  
 })(jQuery);



