<!DOCTYPE html>
<html lang="en">

{%- include head/index.html -%}

<body>
    {%- include header/index.html -%}


    {% if page.url == '/' %}

    {% include section/home.html %}

    {% else %}

    {% include section/home2.html %}

    {% endif %}

    {% include section/feature.html %}



    {%- if dataToShow.faqList -%}
    {%- if dataToShow.faqList.first.Question !='' -%}
    {% include section/news.html %}
    {% endif %}
    {% endif %}


    {%- if page.letter -%}
    {%- include WordPointTables/table.html -%}
    {%- endif -%}

    {% include adBlocker/adBlocker.html %}
    {%- include share/socialshare.html -%}
    {%- include Rating/rating.html -%}

    {%- assign langen = "en" -%}
    {%- if site.data[folder][langen][file].categories -%}
    {% assign categories= site.data[folder][langen][file].categories %}
    {%- else -%}
    {% assign categories= page.categories %}
    {%- endif -%}
    {%- if site.data[folder][langen][file].tags -%}
    {% assign tags= site.data[folder][langen][file].tags %}
    {%- else -%}
    {% assign tags= page.tags %}
    {%- endif -%}
    {%- if categories.size> 0 or tags.size>0-%}
    {%- include section/related_categories_post.html -%}
    {%- else -%}
    {%- include section/recent_posts.html -%}
    {% endif %}

    {%- include footer/index.html -%}

    {%- include script.html -%}


    {%- if page.language -%}
    <script>
        const select_dropDown2 = document.querySelector(".select_dropDown2")
        select_dropDown2[0].style.display = "none"
        select_dropDown2[1].style.display = "none"
        select_dropDown2[2].style.display = "none"
        select_dropDown2[3].style.display = "none"
    </script>
    {%- endif -%}


    <script>
        let letterCloseButton = document.querySelector('.letter-close-button')
        let txtBox = document.querySelector('.txtBox')
        let focusBorder = document.querySelector('.focus-border')
        txtBox.focus()

        txtBox.addEventListener('input', (e) => {
            if (e.target.value === "") {
                letterCloseButton.classList.remove("close_ltr_icon")
            }
            else {
                letterCloseButton.classList.add("close_ltr_icon")
            }

            focusBorder.classList.remove("focus-border")
            e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
            let rangeOfBlankTile = '{{ page.blanktilerange }}'
            if (rangeOfBlankTile === "") {
                rangeOfBlankTile = 5
            }
            e.target.value = e.target.value.replace(/ /g, '?')
            let data = []
            data = e.target.value.split('').filter((i) => i === '?')
            // console.log(data.length)
            // console.log(rangeOfBlankTile)
            if (data.length > rangeOfBlankTile) {
                e.target.value = e.target.value.replace(/\?$/, '')
            }
        })

        letterCloseButton.addEventListener("click", () => {
            txtBox.value = ""
            letterCloseButton.classList.remove("close_ltr_icon")
        })
    </script>
</body>

</html>