WS_waitscreen = true;

window.onload = function(){
    
    document.getElementsByClassName('pageCnt')[0].style.visibility="visible"
    // Window Load
    var waitScreen = document.getElementById("waitScreen");
    document.body.removeChild(waitScreen);
    WS_waitscreen = false;
    
    document.getElementById('cancel-button').addEventListener("click", function(){
        gotoPage('login','main','')
    }); 
    
    document.getElementById('accept-button').addEventListener("click", function(){
        var scroll = document.getElementsByClassName('scroll-box')[0];
        if(scroll.scrollTop >= scroll.scrollHeight - scroll.offsetHeight - 20){
            gotoPage('register','register-data','')
        }else{
            document.getElementById('e').innerHTML = 'Debe leer los Términos y Condiciones';
        }
    }); 
    document.getElementById('termdown').addEventListener("click", function(){
        //window.open(globalurl+'/img/termandconditions.pdf', '_blank');
        gotoNewPage('register','termsandconditions')
    }); 
    termsLoad()
    
    //Mostrar HTML cargado
    esconderHTML(false);
    
}

function termsLoad(){
    callWS("GET", "terms/load", { } , response);
        
    function response(status, rsp){
        switch(status){
            case 200:
                document.getElementById('text').innerHTML = JSON.parse(rsp).terms
                break;
            default:
                break;
        }
    }    
}