function open_prebooksItems1(){
$('.preblock_hs_itm1_passive').addClass('preblock_hs_itm1_active');
$('.preblock_hs_itm1_passive').removeClass('preblock_hs_itm1_passive');
};
function close_prebooksItems1(){
$('.preblock_hs_itm1_active').addClass('preblock_hs_itm1_passive');
$('.preblock_hs_itm1_active').removeClass('preblock_hs_itm1_active');
};
function open_prebooksItems2(){
$('.preblock_hs_itm2_passive').addClass('preblock_hs_itm2_active');
$('.preblock_hs_itm2_passive').removeClass('preblock_hs_itm2_passive');
};
function close_prebooksItems2(){
$('.preblock_hs_itm2_active').addClass('preblock_hs_itm2_passive');
$('.preblock_hs_itm2_active').removeClass('preblock_hs_itm2_active');
};
function click_hs_itm1(){
$('.hs_itm1').click(function(){
openprebook();
open_prebooksItems1();
close_prebooksItems2();
close_prebooksItems3();
});
};
function click_hs_itm2(){
$('.hs_itm2').click(function(){
openprebook();
open_prebooksItems2();
close_prebooksItems1();
close_prebooksItems3();
});
};
function apply_classes(selector, add, remove) {
var el = document.querySelector(selector);
if (el) {
el.classList.add(add);
el.classList.remove(remove);
}
}
function open_prebooksItems1() {
apply_classes('.preblock_hs_itm1_passive', 'preblock_hs_itm1_active', 'preblock_hs_itm1_passive');
}
function close_prebooksItems1() {
apply_classes('.preblock_hs_itm1_active', 'preblock_hs_itm1_passive', 'preblock_hs_itm1_active');
}
function open_prebooksItems2() {
apply_classes('.preblock_hs_itm2_passive', 'preblock_hs_itm2_active', 'preblock_hs_itm2_passive');
}
function close_prebooksItems2() {
apply_classes('.preblock_hs_itm2_active', 'preblock_hs_itm2_passive', 'preblock_hs_itm2_active');
}
function click_hs_itm1(){
document.querySelector('.hs_itm1').addEventListener("click", function() {
openprebook();
open_prebooksItems1();
close_prebooksItems2();
close_prebooksItems3();
});
};
function click_hs_itm2(){
document.querySelector('.hs_itm2').addEventListener("click", function() {
openprebook();
open_prebooksItems2();
close_prebooksItems1();
close_prebooksItems3();
});
};
function addClass(findElems, addClass){
let elems = document.querySelectorAll(findElems)
for (let elem of elems){
elem.classList.add(addClass)
}
};
function removeClass(findElems, delClass){
let elems = document.querySelectorAll(findElems)
for (let elem of elems){
elem.classList.remove(delClass)
}
};