
function show_inf_carrier (el) {
    event.preventDefault()
    let form = el.closest("div[name='form_carrier']")
    let finish_form = form.children
    let form_open = finish_form[0].children
    let ph_1 = form_open[0]
    let em_1 = form_open[1]

    let btn_open_chat = finish_form[1]
    let els = [ph_1.querySelectorAll(".el_for_open_el")[0],em_1.querySelectorAll(".el_for_open_el")[0]]
    // let iter_lists = 0
    for (let i = 0;i < els.length;i++){
        els[i].classList.toggle("active")
        // iter_lists++
    }
    // let btn_open_chat = finish_form[3]

    // ph_1.parentElement.children[2].classList.toggle("active");
    // ph_1.classList.toggle("active");
    // em_1.classList.toggle("active");
    // try {
    //     ph_2.parentElement.children[1].classList.toggle("active");
    // } catch {
    //     // p
    // }

    // em_2.parentElement.children[1].classList.toggle("active");
    btn_open_chat.classList.toggle("active")
    if (el.style.display === "none"){
        el.style.display = ""
    } else {
        el.style.display = "none"
    }

    // let els = document.querySelectorAll(".el_for_open_el")
    // for (let i = 0;i < els.length;i++){
    //     els[i].classList.toggle("active")
    // }
    // el.style.display = "none"
    // el.previousElementSibling.classList.toggle("active")

    // el.classList.toggle("hide")

}

function open_chat (user_id){
    event.preventDefault()
    let host = window.location.origin
    let user_id_ = user_id.toString()
    let href = host + '/ru/profile/page/chat/' + user_id_
    // window.location.href = host + '/profile/chat/' + user_id
    window.location.replace(href)
}