<div
    {% if dom_id %}id="{{ dom_id }}"{% endif %}
    {% if ajax_url and page_type == 'profile' %}data-ajax-url="{{ ajax_url }}" onclick="select_tab_profile(this,'{{ ajax_url }}'{% if owner_type %},'{{ owner_type }}'{% endif %})"{% else %}onclick="clickONTHEAPROfileBTN(this)"{% endif %}
    {% if page_name == sel_page_name %}
        class="selected"
    {% endif %} >

    <img class="svg" src="{{ img_path }}" />
    {% if page_type and page_type == 'profile' or not sel_page_name %}

        {% if sel_page_name == 'logout' %}
        	<a href="/profile/logout/" class="text_btn_profile logout">
                <span class="logout_span">
        {% else %}
            <span class="text_btn_profile">
        {% endif %}
    {% else %}
        {% if sel_page_name == 'logout' %}
        	<a href="/profile/logout/" class="text_btn_profile logout">
                <span class="logout_span">
        {% elif sel_page_name != 'logoout' %}
        	<a onclick="changeHrefCl(this)" data-href="{% url "profile_page" sel_page_name %}" class="text_btn_profile">
        {% endif %}
    {% endif %}
            {{ title }}
            {% if sel_page_name == 'chat' %}
                <div class="icon_unread_messages" style="padding-top: 0;position:relative;top: 4px;">
                    <div class="cost-messages-in-user-tab-messenger">
                        <span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0;position:relative;top: -6px"></span>
                    </div>
                </div>
            {% endif %}
    {% if page_type and page_type == 'profile' or not sel_page_name %}
        {% if sel_page_name == 'logout' %}
                </span>
            </a>
        {% else %}
            </span>
        {% endif %}

    {% else %}
        </a>
    {% endif %}
</div>