WS_waitscreen = true;
var requiredLevelData = [];
//Decimales montos a formatear
var decimCoin = 2;
window.onload = function(){
    
    // Call Entry
    getOcupations()
    
    // Go to Register Residence Data
    document.getElementById('previous-button').addEventListener("click", function(){
        gotoPage('register','regPersonRes',{ 'sessionid' : getParameterByName('sessionid') })
    });
    
    // Go to Register Images
    document.getElementById('next-button').addEventListener("click", function(){
        //gotoPage('register','regPersonImg','');
        verifyData()
    });
    
    // Remove red errors 
    document.getElementsByTagName('body')[0].addEventListener("click", function(){
        if (document.getElementById('economic').value !== ''){
            noError('economic','eeconomic')
            document.getElementById('eeconomic').style.display = 'none'
        }
        if (document.getElementById('independent').value !== ''){
            noError('independent','eindependent')
            document.getElementById('eindependent').style.display = 'none'
        }
        if (document.getElementById('politician').value !== ''){
            noError('politician','epolitician')
            document.getElementById('epolitician').style.display = 'none'
        }
        if (document.getElementById('profession').value !== ''){
            noError('profession','eprofession')
            document.getElementById('eprofession').style.display = 'none'
        }
        if (document.getElementById('polName').value !== ''){
            noError('polName','epolName')
            document.getElementById('epolName').style.display = 'none'
        }
        if (document.getElementById('polPosition').value !== ''){
            noError('polPosition','epolPosition')
            document.getElementById('epolPosition').style.display = 'none'
        }
        if (document.getElementById('polCountry').value !== ''){
            noError('polCountry','epolCountry')
            document.getElementById('epolCountry').style.display = 'none'
        }
        if (document.getElementById('polDocument').value !== ''){
            noError('polDocument','epolDocument')
            document.getElementById('epolDocument').style.display = 'none'
        }
        if (document.getElementById('occupation').value !== ''){
            noError('occupation','eoccupation')
            document.getElementById('eoccupation').style.display = 'none'
        }
        if (document.getElementById('income').value !== '0.00'){
            noError('income','eincome')
            document.getElementById('eincome').style.display = 'none'
        }
        if (document.getElementById('heritage').value !== '0.00'){
            noError('heritage','eheritage')
            document.getElementById('eheritage').style.display = 'none'
        }
    });
    
    // Later
    document.getElementById('later-button').addEventListener("click", function(){
        document.getElementsByClassName('completeLater')[0].style.display = 'table'
    });
    
    document.getElementById('completeLaterAccept').addEventListener("click", function(){
        gotoPage('dashboard','home', { 'sessionid' : getParameterByName('sessionid') })
    });
    
    document.getElementById('completeLaterCancel').addEventListener("click", function(){
        document.getElementsByClassName('completeLater')[0].style.display = 'none'
    });
    
    //Funcion en el main para dar formato a campos
    var fields = ["income", "heritage"];
    formatAmount(fields);
    /*
    var format = ["amount", "amount"];
    formatFields2(fields,format);*/
    
    // Persona Politicamente Expuesta
    document.getElementById('politician').addEventListener("change", function(){
        if (document.getElementById('politician').value == 1){
            console.log('hola')
            addPolitician()
        }
        else{
            deletePolitician()
        }
    }); 
    document.getElementById('occupation').addEventListener("change", function(){
        /*if (document.getElementById('occupation').value != ''){
            document.getElementById('occupation').parentNode.children[1].style.display="none"
        }*/
    });
    document.getElementById('company').addEventListener("change", function(){
        if (document.getElementById('company').value != ''){
            document.getElementById('company').parentNode.children[2].style.display="none"
        }else{
            document.getElementById('company').parentNode.children[2].style.display="block"
        }
    });
    
    // Session Update
    document.getElementById('expSessionButton').addEventListener("click",function(){
        var req = {
            'sessionid': getParameterByName('sessionid')
        }
        sessionUpdate(req)
    })
    
    //Mostrar HTML cargado
    esconderHTML(false);
}

var occupations;


function verifyData(){
    var ocupation = document.getElementById('occupation');
    var economicact = document.getElementById('economic');
    var politicalexp = document.getElementById('politician');
    var indepmerch = document.getElementById('independent');
    var company = document.getElementById('company');
    var anualincome = document.getElementById('income');
    var patrimony = document.getElementById('heritage');
    var profession = document.getElementById('profession');
    var affiliationbody = document.getElementById('polName');
    var positionheld = document.getElementById('polPosition');
    var pepcountryid = document.getElementById('polCountry');
    var peprelatedid = document.getElementById('polDocument');
    var req = {
        "sessionid" : getParameterByName('sessionid'),
        "ocupation" : ocupation.value,
        "economicact": economicact.value,
        "politicalexp" : politicalexp.value,
        "indepmerch": indepmerch.value,
        "company" : capitalize(company.value),
        "anualincome": anualincome.getAttribute("dataNumber"),
        "patrimony" : patrimony.getAttribute("dataNumber"),
        "profession" : capitalize(profession. value),
        'affiliationbody' : "",
        "positionheld" : "",
        "pepcountryid": null,
        "peprelatedid" : null,
        "step" : 3
    }
    if( (economicact.value=='' && requiredLevelData.includes(economicact.getAttribute('dataname'))) || 
        (indepmerch.value=='' && requiredLevelData.includes(indepmerch.getAttribute('dataname'))) || 
        (politicalexp.value=='' && requiredLevelData.includes(politicalexp.getAttribute('dataname'))) ||
        (profession.value=='' && requiredLevelData.includes(profession.getAttribute('dataname'))) ||
        (ocupation.value=='' && requiredLevelData.includes(ocupation.getAttribute('dataname'))) ||
        ((anualincome.value=='' || anualincome.value=='0.00') && requiredLevelData.includes(anualincome.getAttribute('dataname'))) ||
        ((patrimony.value=='' || patrimony.value=='0.00') && requiredLevelData.includes(patrimony.getAttribute('dataname')))
      ){
        if (economicact.value=='' && requiredLevelData.includes(economicact.getAttribute('dataname'))){
            error('economic','eeconomic',getLangById('usersUpdateperson1')[lang]);
            document.getElementById('eeconomic').style.display = 'block'
        }
        if (indepmerch.value=='' && requiredLevelData.includes(indepmerch.getAttribute('dataname'))){
            error('independent','eindependent',getLangById('usersUpdateperson2')[lang]);
            document.getElementById('eindependent').style.display = 'block'
        }
        if (politicalexp.value=='' && requiredLevelData.includes(politicalexp.getAttribute('dataname'))){
            error('politician','epolitician',getLangById('usersUpdateperson2')[lang]);
            document.getElementById('epolitician').style.display = 'block'
        }
        if (profession.value=='' && requiredLevelData.includes(profession.getAttribute('dataname'))){
            error('profession','eprofession',getLangById('usersUpdateperson3')[lang]);
            document.getElementById('eprofession').style.display = 'block'
        }
        if (ocupation.value=='' && requiredLevelData.includes(ocupation.getAttribute('dataname'))){
            error('occupation','eoccupation',getLangById('usersUpdateperson2')[lang]);
            document.getElementById('eoccupation').style.display = 'block'
        }
        if ((anualincome.value=='' || anualincome.value=='0.00') && requiredLevelData.includes(anualincome.getAttribute('dataname'))){
            error('income','eincome',getLangById('usersUpdateperson4')[lang]);
            document.getElementById('eincome').style.display = 'block'
        }
        if ((patrimony.value=='' || patrimony.value=='0.00') && requiredLevelData.includes(patrimony.getAttribute('dataname'))){
            error('heritage','eheritage',getLangById('usersUpdateperson5')[lang]);
            document.getElementById('eheritage').style.display = 'block'
        }
        
        if( politicalexp.value==1 ){
            if( (affiliationbody.value=='') || 
                (positionheld.value=='') || 
                (pepcountryid.value=='') || 
                (peprelatedid.value=='')
              ){
                if (affiliationbody.value==''){
                    error('polName','epolName',getLangById('usersUpdateperson6')[lang]);
                    document.getElementById('epolName').style.display = 'block'
                }
                if (positionheld.value==''){
                    error('polPosition','epolPosition',getLangById('usersUpdateperson7')[lang]);
                    document.getElementById('epolPosition').style.display = 'block'
                }
                if (pepcountryid.value==''){
                    error('polCountry','epolCountry',getLangById('usersUpdateperson8')[lang]);
                    document.getElementById('epolCountry').style.display = 'block'
                }
                if (peprelatedid.value==''){
                    error('polDocument','epolDocument',getLangById('usersUpdateperson9')[lang]);
                    document.getElementById('epolDocument').style.display = 'block'
                }
                return;
            }
            
        }
        return;
    }
    
    if( politicalexp.value==1 ){
        if( (affiliationbody.value=='') || 
            (positionheld.value=='') || 
            (pepcountryid.value=='') || 
            (peprelatedid.value=='')
          ){
            if (affiliationbody.value==''){
                error('polName','epolName',getLangById('usersUpdateperson6')[lang]);
                document.getElementById('epolName').style.display = 'block'
            }
            if (positionheld.value==''){
                error('polPosition','epolPosition',getLangById('usersUpdateperson7')[lang]);
                document.getElementById('epolPosition').style.display = 'block'
            }
            if (pepcountryid.value==''){
                error('polCountry','epolCountry',getLangById('usersUpdateperson8')[lang]);
                document.getElementById('epolCountry').style.display = 'block'
            }
            if (peprelatedid.value==''){
                error('polDocument','epolDocument',getLangById('usersUpdateperson9')[lang]);
                document.getElementById('epolDocument').style.display = 'block'
            }
            return;
        }
        else{
            var req = {
                "sessionid" : getParameterByName('sessionid'),
                "ocupation" : ocupation.value,
                "economicact": economicact.value,
                "politicalexp" : politicalexp.value,
                "indepmerch": indepmerch.value,
                "company" : capitalize(company.value),
                "anualincome": anualincome.getAttribute("dataNumber"),
                "patrimony" : patrimony.getAttribute("dataNumber"),
                "profession" : capitalize(profession. value),
                'affiliationbody' : capitalize(affiliationbody.value),
                "positionheld" : capitalize(positionheld.value),
                "pepcountryid": pepcountryid.value,
                "peprelatedid" : peprelatedid.value,
                "step" : 3
            }
            updatePerson(req)
        }
    }else{
        updatePerson(req)
    }

    console.log(req)

}

function updatePerson(req){
    callWS("POST", "users/updateperson", req, response);
    console.log(req)
    console.log(status)
    function response(status, rsp){
        switch(status){
            case 200:
                // Ok
                gotoPage('register','regPersonImg',{ 'sessionid' : getParameterByName('sessionid') })
                break;
            case 204:
                break;
            case 400:
                // Parametros incorrectos
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
        console.log(status)
        console.log(rsp)
    }  
}
    
function getEntry(sessionid){
    console.log('entry')
    callWS("GET", "users/entry", { 'sessionid' : sessionid}, response);
        
    function response(status, rsp){
        switch(status){
            case 200:
                console.log(JSON.parse(rsp))
                requiredLevelData = JSON.parse(rsp).requiredLevel ? (JSON.parse(rsp).requiredLevel).split(',') : []
                levels = JSON.parse(rsp).entry.levels
                console.log(requiredLevelData)
                console.log(levels)
                
                document.getElementById('economic').value = JSON.parse(rsp).entry.person.economicalactivity.value;
                setStatus('economicIcon',JSON.parse(rsp).entry.person.economicalactivity,'economic')
                document.getElementById('economic').setAttribute('dataname',JSON.parse(rsp).entry.person.economicalactivity.update)
                
                if (JSON.parse(rsp).entry.person.independentdealer.value == null){
                    document.getElementById('independent').value = ''
                }else{
                    document.getElementById('independent').value = JSON.parse(rsp).entry.person.independentdealer.value;   
                }
                setStatus('independentIcon',JSON.parse(rsp).entry.person.independentdealer,'independent')
                document.getElementById('independent').setAttribute('dataname',JSON.parse(rsp).entry.person.independentdealer.update)
                
                document.getElementById('occupation').value = JSON.parse(rsp).entry.person.ocupation.value;
                setStatus('occupationIcon',JSON.parse(rsp).entry.person.ocupation,'occupation')
                document.getElementById('occupation').setAttribute('dataname',JSON.parse(rsp).entry.person.ocupation.update)
                
                document.getElementById('company').value = JSON.parse(rsp).entry.person.company.value;
                setStatus('companyIcon',JSON.parse(rsp).entry.person.company,'company')
                document.getElementById('company').setAttribute('dataname',JSON.parse(rsp).entry.person.company.update)
                
                if(JSON.parse(rsp).entry.person.anualincome.number != 0){
                    var val = (Math.round((JSON.parse(rsp).entry.person.anualincome.number)*100)/100).toFixed(2)
                }else{
                    var val = ''
                }
                document.getElementById('income').value = val;
                
                document.getElementById('income').dispatchEvent(new Event("focusout"));
                setStatus('incomeIcon',JSON.parse(rsp).entry.person.anualincome,'income')
                document.getElementById('income').setAttribute('dataname',JSON.parse(rsp).entry.person.anualincome.update)
                
                if(JSON.parse(rsp).entry.person.patrimony.number != 0){
                    var val = (Math.round((JSON.parse(rsp).entry.person.anualincome.number)*100)/100).toFixed(2)
                }else{
                    var val = ''
                }
                document.getElementById('heritage').value = val;
                document.getElementById('heritage').dispatchEvent(new Event("focusout"));
                setStatus('heritageIcon',JSON.parse(rsp).entry.person.patrimony,'heritage')
                document.getElementById('heritage').setAttribute('dataname',JSON.parse(rsp).entry.person.patrimony.update)
                
                document.getElementById('profession').value = JSON.parse(rsp).entry.person.profession.value
                setStatus('professionIcon',JSON.parse(rsp).entry.person.profession,'profession')
                document.getElementById('profession').setAttribute('dataname',JSON.parse(rsp).entry.person.profession.update)
                
                if (JSON.parse(rsp).entry.person.politicalexposed .value== null){
                    document.getElementById('politician').value =''
                }else{
                    document.getElementById('politician').value = JSON.parse(rsp).entry.person.politicalexposed.value;   
                }
                setStatus('politicianIcon',JSON.parse(rsp).entry.person.politicalexposed,'politician')
                document.getElementById('politician').setAttribute('dataname',JSON.parse(rsp).entry.person.politicalexposed.update)
                
                document.getElementById('polName').value = JSON.parse(rsp).entry.person.affiliationbody.value; 
                setStatus('polNameIcon',JSON.parse(rsp).entry.person.affiliationbody,'polName')
                document.getElementById('polName').setAttribute('dataname',JSON.parse(rsp).entry.person.affiliationbody.update)
                
                document.getElementById('polPosition').value = JSON.parse(rsp).entry.person.positionheld.value; 
                setStatus('polPositionIcon',JSON.parse(rsp).entry.person.positionheld,'polPosition')
                document.getElementById('polPosition').setAttribute('dataname',JSON.parse(rsp).entry.person.positionheld.update)
                
                if (JSON.parse(rsp).entry.person.pepcountryid.value == 0){
                    document.getElementById('polCountry').value = ''
                }else{
                    document.getElementById('polCountry').value = JSON.parse(rsp).entry.person.pepcountryid.value
                }; 
                setStatus('polCountryIcon',JSON.parse(rsp).entry.person.pepcountryid,'polCountry')
                document.getElementById('polCountry').setAttribute('dataname',JSON.parse(rsp).entry.person.pepcountryid.update)
                
                document.getElementById('polDocument'). value = JSON.parse(rsp).entry.person.peprelatedid.value ==  "null" ? '' : JSON.parse(rsp).entry.person.peprelatedid.value; 
                setStatus('polDocumentIcon',JSON.parse(rsp).entry.person.peprelatedid,'polDocument')
                document.getElementById('polDocument').setAttribute('dataname',JSON.parse(rsp).entry.person.peprelatedid.update)
                
                if(document.getElementById('politician').value == 1){
                    addPolitician()
                }
                
                setLevels(levels)
                document.getElementsByClassName('pageCnt')[0].style.visibility="visible"
                // Window Load
                var waitScreen = document.getElementById("waitScreen");
                document.body.removeChild(document.getElementById("waitScreen"));
                WS_waitscreen = false;
                break;
            case 204:
                break;
            case 400:
                // Parametros incorrectos
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
        //console.log(status)
        //console.log(rsp)
    }    
}

function addOptions(domElement, array) {
    console.log(array)
    var selector = document.getElementsByName(domElement)[0];
    var firstOopcion = document.createElement("option");
    firstOopcion.disabled = true;
    firstOopcion.text = lang == 'esp' ? 'Selecciona' : 'Select'
    firstOopcion.value =''
    firstOopcion.selected = true
    selector.add(firstOopcion)
    for (countrie in array.records) {
        if (array.records[countrie].id > 0){
            var opcion = document.createElement("option");
            opcion.text = array.records[countrie].dsc;
            opcion.value = array.records[countrie].id
            selector.add(opcion);
        }
    }
    // First Time
    //getEntry(getParameterByName('sessionid'))
}

    
function getOcupations(){
    
    var req = {
        "sessionid": getParameterByName('sessionid')
    }
        
    callWS("GET", "additional/ocupations", req, response);
        
    function response(status, rsp){
        switch(status){
            case 200:
                occupations = JSON.parse(rsp);
                addOptions("occupation", occupations)
                //getEntry(getParameterByName('sessionid'))
                getCountries()
                break;
            case 204:
                break;
            case 400:
                // Parametros incorrectos
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
    }    
}

function getEconomicActs(){
    
    var req = {
        "sessionid": getParameterByName('sessionid')
    }
        
    callWS("GET", "additional/economicacts", req, response);
        
    function response(status, rsp){
        switch(status){
            case 200:
                economic = JSON.parse(rsp);
                addOptions("economic", economic)
                setLang()
                break;
            case 204:
                break;
            case 400:
                // Parametros incorrectos
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
    }    
}

function addPolitician(){
    document.getElementById('politicianForm').style.display = 'block'
}

function deletePolitician(){
    document.getElementById('politicianForm').style.display = 'none'
}
var countries = '';
function getCountries(){
    var req = {
        "sessionid": getParameterByName('sessionid')
    }
        
    callWS("GET", "demographics/countries", req, response);
        
    function response(status, rsp){
        switch(status){
            case 200:
                countries = JSON.parse(rsp);
                addOptions("polCountry", countries)
                //getEntry(getParameterByName('sessionid'))
                getEconomicActs()
                break;
            case 204:
                break;
            case 400:
                // Parametros incorrectos
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
    }    
}


// name A: classIcon
// name B : BD
// nameC: nameInput
function setStatus(nameA,nameB,nameC){
    if(nameB.valid == -1){
        document.getElementById(nameA).classList.add("iconRed")
        document.getElementById(nameA).classList.add("fas")
        document.getElementById(nameA).classList.add("fa-times-circle")
    }
    else if (nameB.valid == 0){
        document.getElementById(nameA).classList.add("iconYellow")
        document.getElementById(nameA).classList.add("fas")
        document.getElementById(nameA).classList.add("fa-pause-circle")
    }
    else if (nameB.valid == 1){
        console.log('entro',nameC)
        document.getElementById(nameA).classList.add("iconGreen")
        document.getElementById(nameA).classList.add("fas")
        document.getElementById(nameA).classList.add("fa-check-circle")
        document.getElementById(nameC).disabled = true;
        document.getElementById(nameC).style.cursor = 'default'
        if(document.getElementById(nameC).tagName != 'SELECT'){
            document.getElementById(nameC).style.backgroundColor = 'white'
        }
    }
    document.getElementById(nameC).classList.add("inputElement")
}

function expiredSession(){
    document.getElementsByClassName('expired')[0].style.display = "table"
    WS_waitscreen = false;
    var seconds = 30;
    var countdown = setInterval(countDown, 1000);
    
    function countDown(){
        seconds--;
        if(seconds == 0){
            if(document.getElementsByClassName('expired')[0].style.display == "table"){
                gotoPage('login','main','');
                clearInterval(countdown);
            }
        }
        if(document.getElementsByClassName('expired')[0].style.display == "none"){
            clearInterval(countdown)
        }
    }
}

function sessionUpdate(req){
    callWS('GET', 'session/update', req, response);
    function response(status, rsp){
        console.log('session/update')
        console.log(JSON.parse(rsp));
        console.log(status) 
        switch(status){
            case 200:
                document.getElementsByClassName('expired')[0].style.display = "none"
                break;
            case 400:
                break;
            case 401:
                expiredSession();
                break;
            case 402:
                break;
            case 403:
                break;
            case 500:
                break;
            default:
                break;
        }
    }   
}


function setLevels(levels){
    console.log(levels)
    levels1 = levels[1].basicRequired.split(',')
    levels2 = levels[2].basicRequired.split(',')
    levels3 = levels[3].basicRequired.split(',')
    console.log(document.getElementsByClassName('inputElement'))
    console.log(document.getElementsByClassName('inputElement').length)
    for(var i = 0; i < document.getElementsByClassName('inputElement').length ; i++){
        if(levels1.includes(document.getElementsByClassName('inputElement')[i].getAttribute('dataname'))){
            if(!document.getElementsByClassName('inputElement')[i].previousElementSibling.children[0]){
                document.getElementsByClassName('inputElement')[i].previousElementSibling.innerHTML += '<span style="font-size: 90%; color: #7D8B9E;" class="roboto-bold"> (1) </span>'   
            }
        }
        else if(levels2.includes(document.getElementsByClassName('inputElement')[i].getAttribute('dataname'))){
            if(!document.getElementsByClassName('inputElement')[i].previousElementSibling.children[0]){
                document.getElementsByClassName('inputElement')[i].previousElementSibling.innerHTML += '<span style="font-size: 90%; color: #4287CE;" class="roboto-bold"> (2) </span>'   
            }
        }
        else if(levels3.includes(document.getElementsByClassName('inputElement')[i].getAttribute('dataname'))){
            if(!document.getElementsByClassName('inputElement')[i].previousElementSibling.children[0]){
                document.getElementsByClassName('inputElement')[i].previousElementSibling.innerHTML += '<span style="font-size: 90%; color: rgb(1, 42, 63);" class="roboto-bold"> (3) </span>'
            }
        }
    }
}

function setLang(){
    
    lang = localStorage.getItem('lang');
    
    /* inner HTML */
    setWordLanginnerHTML('regperson1','regperson1');
    setWordLanginnerHTML('regperson2','regperson2');
    setWordLanginnerHTML('regperson3','regperson3');
    setWordLanginnerHTML('regperson4','regperson4');
    setWordLanginnerHTML('regperson5','regperson5');
    setWordLanginnerHTML('regperson6','regperson6');
    setWordLanginnerHTML('regTitle','regperson3');
    setWordLanginnerHTML('professionLabel','profession');
    setWordLanginnerHTML('economicLabel','economic');
    setWordLanginnerHTML('independentLabel','independent');
    setWordLanginnerHTML('occupationLabel','occupation');
    setWordLanginnerHTML('companyLabel','company');
    setWordLanginnerHTML('companyLabelOptional','optional');
    setWordLanginnerHTML('incomeLabel','annualincome');
    setWordLanginnerHTML('heritageLabel','patrimony');
    setWordLanginnerHTML('politicalPerson','personpol');
    setWordLanginnerHTML('polNameLabel','polName');
    setWordLanginnerHTML('polPositionLabel','polJob');
    setWordLanginnerHTML('polCountryLabel','polCountry');
    setWordLanginnerHTML('polDocumentLabel','polId');
    setWordLanginnerHTML('requiredLevel1','requiredLevel1');
    setWordLanginnerHTML('requiredLevel2','requiredLevel2');
    setWordLanginnerHTML('requiredLevel3','requiredLevel3');
    setWordLanginnerHTML('previous-button','goBack');
    setWordLanginnerHTML('later-button','completeThen');
    setWordLanginnerHTML('next-button','continue');
    setWordLanginnerHTML('ts','ts');
    setWordLanginnerHTML('completeLater','completeLater');
    setWordLanginnerHTML('completeLaterAccept','completeThen');
    setWordLanginnerHTML('completeLaterCancel','cancel');
    setWordLanginnerHTML('expired1','expired1');
    setWordLanginnerHTML('expired2','expired2');
    setWordLanginnerHTML('expSessionButton','continue');
    
    /*Placeholder*/
    setWordLangPlaceHolder('profession','profession');
    setWordLangPlaceHolder('company','company');
    setWordLangPlaceHolder('polName','name');
    setWordLangPlaceHolder('polPosition','job');
    setWordLangPlaceHolder('polDocument','id');
    
    /* Select */
    setWordLanginnerHTML('independentSelectsSel','select');
    setWordLanginnerHTML('independentYes','yes');
    setWordLanginnerHTML('independentNo','no');
    setWordLanginnerHTML('politicalPersonSelectSel','select');
    setWordLanginnerHTML('politicalPersonSelectYes','yes');
    setWordLanginnerHTML('politicalPersonSelectNo','no');
    
    getEntry(getParameterByName('sessionid'));

}

