function gotoTop(){
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}

function loadScreen() {
    var popup = document.getElementsByClassName("popupLoad")[0];
    
    var style = document.createElement('style');
    document.head.appendChild(style);
    gotoTop();
    style.sheet.insertRule(`.popupLoad {position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: ${window.screen.height <= 635 ? "auto" : '100%'};
        background-color: rgba(0,0,0,0.5); display:flex; align-items: center;
        ${window.screen.height <= 635 ? 'padding: 10px 0px;' : null}}`);
    
    document.body.style.overflow = window.screen.height <= 635 ? "scroll" : "hidden";
        
    popup.innerHTML = `
    <div class="loaded">
        <div class="loaderWrapper">
            <div class="loader"></div>
        </div>
    </div>`;
}

function closeLoad() {
    var popup = document.getElementsByClassName("popupLoad")[0];
    var style = document.createElement('style');
    document.head.appendChild(style);
    
    style.sheet.insertRule(`.popupLoad {display: none}`);
        document.body.style.overflow = "auto";
}

function showHide(id){
    let inputPass = document.getElementById(id);
    
    inputPass.type === "password" ? inputPass.type = "text" : inputPass.type = "password";
}