WS_waitscreen = true;
numofrec = 8
currencies = {};
offsetGlobal = 0;
var type = 2

function start() {

    // Call Entry 
    setLang()

    if (screen.width <= 700) {
        numofrec = '100'
    }


    document.getElementById('seeAll').addEventListener("change", function () {
        var req = {
            'sessionid': sessionStorage.getItem('sessionid'),
            'filter': document.getElementById("search").value,
            'numofrec': numofrec,
            'order': -1,
            'type': getType(),
            'status': document.getElementById('seeAll').value,
            'offset': 0
        };
        messagesList(req, '');
    })


    // Session Update


    document.getElementById("iconSearch").addEventListener("click", function () {
        var filter = document.getElementById("search").value;
        if (filter == null || filter == undefined) {
            filter = '';
        }
        //Se desmarca la pagina anterior
        var pSel = document.getElementsByClassName("pSelect");
        if (pSel.length > 0) pSel[0].classList.remove("pSelect");

        //Colocamos la pagina 1
        var page1 = document.getElementsByClassName("pages")[0];
        if (page1 != undefined) {
            page1.classList.add("pSelect");
        }

        var sessionId = sessionStorage.getItem('sessionid');
        var numofrecords = numofrec;

        var req = {
            'sessionid': sessionStorage.getItem('sessionid'),
            'filter': document.getElementById("search").value,
            'numofrec': numofrec,
            'order': -1,
            'type': getType(),
            'status': document.getElementById('seeAll').value,
            'offset': 0
        };
        messagesList(req, '')
    });

    // Event to input search
    document.getElementById("search").addEventListener("change", function () {
        var filter = document.getElementById("search").value;
        if (filter == null || filter == undefined) {
            filter = '';
        }

        //Se desmarca la pagina anterior
        var pSel = document.getElementsByClassName("pSelect");
        if (pSel.length > 0) pSel[0].classList.remove("pSelect");

        //Colocamos la pagina 1
        var page1 = document.getElementsByClassName("pages")[0];
        if (page1 != undefined) {
            page1.classList.add("pSelect");
        }

        var sessionId = sessionStorage.getItem('sessionid');
        var numofrecords = numofrec;

        var req = {
            'sessionid': sessionStorage.getItem('sessionid'),
            'filter': document.getElementById("search").value,
            'numofrec': numofrec,
            'order': -1,
            'type': getType(),
            'status': document.getElementById('seeAll').value,
            'offset': 0
        };
        messagesList(req, '')
    });

    document.getElementsByClassName('pageCnt')[0].style.display = "table";

    document.getElementById('write').addEventListener("click", function () {
        document.getElementsByClassName('newMessage')[0].style.display = "table"
    });

    document.getElementById('cancelMessage').addEventListener("click", function () {
        document.getElementsByClassName('newMessage')[0].style.display = "none"
        document.getElementById('textareaMessage').value = ""
    });

    document.getElementById('sendMessageServ').addEventListener("click", function () {
        if (document.getElementById('selectNewMessage').value == "-1") {
            putError()
        } else {
            messagesSend()
        }
    });

    document.addEventListener('change', function (evt) {
        if (document.getElementById('selectNewMessage').value != "-1") {
            cleanError()
        }
    })

    document.addEventListener('click', function (evt) {
        if (evt.target.className === 'clickClose') {
            document.getElementsByClassName('detailMessage')[0].style.display = "none"
        }
    })

    document.getElementById('detailButtonAccept').addEventListener("click", function () {
        document.getElementsByClassName('detailMessage')[0].style.display = "none"
    });

    // Tab 1 Recibidos
    document.getElementById('received').addEventListener("click", function () {
        type = 2
        openTabFiat('received', 'tabReceived')
    });

    // Tab 2 Enviados
    document.getElementById('sent').addEventListener("click", function (e) {
        //e.preventDefault();
        //return false;
        type = 1
        openTabFiat('sent', 'tabSent');
    });

    document.getElementById('received').dispatchEvent(new Event("click"));

    messagesDepartments()
    esconderHTML(false);

}

function putError() {
    document.getElementById('errorMessage').innerHTML = lang == 'esp' ? 'Seleccione un destinatario' : 'Select a destination'
}

function cleanError() {
    document.getElementById('errorMessage').innerHTML = ''
}

function getType() {
    return document.getElementsByClassName("tablinksDepFiat")[0].classList.contains('active') ? 2 : 1;
}

function openTabFiat(name, nametab) {
    var i, tabcontent, tablinks;
    tabcontent = document.getElementsByClassName("tabDepFiatContent");

    tablinks = document.getElementsByClassName("tablinksDepFiat");
    for (i = 0; i < tablinks.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" active", "");
    }
    document.getElementById(name).className += " active";

    var req = {
        'sessionid': sessionStorage.getItem('sessionid'),
        'filter': document.getElementById("search").value,
        'numofrec': numofrec,
        'order': -1,
        'type': getType(),
        'status': document.getElementById('seeAll').value,
        'offset': 0
    };
    messagesList(req, '');
}

/*
var waitScreen = document.getElementById("waitScreen");
waitScreen.style.opacity = 0;
setTimeout(function(){
    document.body.removeChild(document.getElementById("waitScreen"));
},600);
WS_waitscreen = false;
*/

function logout() {
    var sessionid = sessionStorage.getItem('sessionid');
    var req = {
        'sessionid': sessionid,
    }

    callWS('GET', 'login/logout', req, response);

    function response(status, rsp) {
        switch (status) {
            case 200:
                sessionStorage.removeItem('sessionid')
                gotoPage('login', 'main', '')
                break;
            case 400:
                break;
            case 401:
                expiredSession('logout');
                break;
            case 500:
                break;
            default:
                break;
        }
    }
}

function expiredSession(reason) {

    // 'balanceCurrencies'  'balanceAccounts'
    if (reason == 'logout') {
        gotoPage('login', 'main', '');
    } else {
        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") {

                var filter = document.getElementById("search").value;
                if (filter == null || filter == undefined) {
                    filter = '';
                }
                var req = {
                    'sessionid': sessionStorage.getItem('sessionid'),
                    'filter': document.getElementById("search").value,
                    'numofrec': numofrec,
                    'order': -1,
                    'type': getType(),
                    'status': document.getElementById('seeAll').value,
                    'offset': 0
                };
                if (screen.width > 700) {
                    for (i = 0; i < document.getElementsByClassName('pages').length; i++) {
                        if (document.getElementsByClassName('pages')[i].classList.contains('pSelect')) {
                            req.offset = i * numofrec
                        }
                    }
                } else {
                    req.offset = 0
                }
                messagesList(req, '')

                clearInterval(countdown)
            }
        }
    }
}



function messagesDepartments() {
    req = {
        'sessionid': sessionStorage.getItem('sessionid')
    }
    callWS('GET', 'messages/departments', req, response);
    function response(status, rsp) {
        switch (status) {
            case 200:
                departments = JSON.parse(rsp);
                addOptions(departments);
                break;
            case 400:
                break;
            case 401:
                expiredSession('');
                break;
            case 402:
                break;
            case 403:
                break;
            case 500:
                break;
            default:
                break;
        }
    }
}

function messagesSend() {
    req = {
        'sessionid': sessionStorage.getItem('sessionid'),
        'departmentid': document.getElementById('selectNewMessage').value,
        'msg': document.getElementById('textareaMessage').value
    }
    callWS('GET', 'messages/send', req, response);
    function response(status, rsp) {
        switch (status) {
            case 200:
                document.getElementsByClassName('newMessage')[0].style.display = "none"
                document.getElementById('textareaMessage').value = ""

                var req = {
                    'sessionid': sessionStorage.getItem('sessionid'),
                    'filter': document.getElementById("search").value,
                    'numofrec': numofrec,
                    'order': -1,
                    'type': getType(),
                    'status': document.getElementById('seeAll').value,
                    'offset': 0
                };


                messagesList(req, 'send')
                break;
            case 400:
                break;
            case 401:
                expiredSession('');
                break;
            case 402:
                break;
            case 403:
                break;
            case 500:
                break;
            default:
                break;
        }
    }
}

function addOptions(array) {
    removeOptions()
    var selector = document.getElementById('selectNewMessage');
    var opcion = document.createElement("option");
    opcion.text = getLangById('deldest')[lang]
    opcion.value = '-1'
    opcion.disabled = true;
    selector.add(opcion);
    for (var i in array.records) {
        var opcion = document.createElement("option");
        opcion.text = array.records[i].dsc;
        opcion.value = array.records[i].id
        selector.add(opcion);
    }

    document.getElementById('selectNewMessage').value = "-1"

    var req = {
        'sessionid': sessionStorage.getItem('sessionid'),
        'filter': document.getElementById("search").value,
        'numofrec': numofrec,
        'order': -1,
        'type': getType(),
        'status': document.getElementById('seeAll').value,
        'offset': 0
    };

    loopMessages()

    //messagesList(req,'initial')
}

function loopMessages() {
    var req = {
        'sessionid': sessionStorage.getItem('sessionid'),
        'filter': document.getElementById("search").value,
        'numofrec': numofrec,
        'order': -1,
        'type': getType(),
        'status': document.getElementById('seeAll').value,
        'offset': offsetGlobal
    };

    messagesListLoop(req)
}

function messagesListLoop(req) {
    callWSWithoutWS('GET', 'messages/list', req, response);
    function response(status, rsp) {
        switch (status) {
            case 200:
                messageDraw(JSON.parse(rsp))

                setTimeout(function () {
                    var req2 = {
                        'sessionid': sessionStorage.getItem('sessionid'),
                        'filter': document.getElementById("search").value,
                        'numofrec': numofrec,
                        'order': -1,
                        'type': getType(),
                        'status': document.getElementById('seeAll').value,
                        'offset': offsetGlobal
                    };
                    messagesListLoop(req2)
                }, 30 * 1000);
                break;
            case 400:
                break;
            case 401:
                expiredSession('');
                break;
            case 402:
                break;
            case 403:
                break;
            case 500:
                break;
            default:
                break;
        }
    }
}

function removeOptions() {
    if (screen.width > 700) {
    } else {
        x = document.getElementById('selectNewMessage')
        var i, L = x.options.length - 1;
        for (i = L; i >= 0; i--) {
            x.remove(i);
        }
    }
}

function messagesList(req, reason) {
    callWS('GET', 'messages/list', req, response);
    function response(status, rsp) {
        switch (status) {
            case 200:
                messageDraw(JSON.parse(rsp))
                break;
            case 400:
                break;
            case 401:
                expiredSession('balanceAccounts');
                break;
            case 402:
                break;
            case 403:
                break;
            case 500:
                break;
            default:
                break;
        }
    }
}

function messageDraw(rsp) {
    getEntryForMessage(sessionStorage.getItem('sessionid'))
    var tbl;
    var node;
    var error;
    var header;
    if (screen.width > 700) {
        tbl = document.getElementById('tabReceived')
        node = tbl.children[1].cloneNode(true);
        error = tbl.children[0].cloneNode(true);
        tbl.innerHTML = "";
        tbl.appendChild(error);
    } else {
        tbl = document.getElementById('tabReceived')
        node = tbl.children[1].cloneNode(true);
        error = tbl.children[0].cloneNode(true);
        tbl.innerHTML = "";
        tbl.appendChild(error);
    }

    var tmp = null; tmp = node.cloneNode(true);
    if ((rsp.numofrecords == 0)) {
        var ele = null;
        ele = tmp.cloneNode(true);
        ele.style.display = "none";
        tbl.appendChild(ele);

        document.getElementById("noCurrencieDefine").style.display = "flex";
        document.getElementById('noCurrencieDefine').style.justifyContent = "center";
        document.getElementById('noCurrencieDefine').classList.add('rowImpar')
        document.getElementById("msgInTable").innerHTML = getLangById("notBalances")[lang];
        document.getElementById("paginator").style.display = "none";

    } else {
        for (var i = 0; i < rsp.records.length; i++) {
            document.getElementById('noCurrencieDefine').style.display = "none"

            if (screen.width > 700) {
                document.getElementById("paginator").style.display = "table";
                var ele = null;
                ele = tmp.cloneNode(true);
                ele.style.display = "table";

                var arrayMessage = rsp.records[i].message.split("<br>", 2);

                ele.children[0].children[0].children[0].innerHTML = rsp.records[i].date.formatted
                ele.children[1].children[0].children[0].innerHTML = rsp.records[i].ref.dsc
                ele.children[2].children[0].children[0].innerHTML = ""//rsp.records[i].message
                ele.classList.remove('rowImpar')
                ele.classList.remove('rowPar')

                for (var z = 0; z < arrayMessage.length; z++) {
                    ele.children[2].children[0].children[0].innerHTML += arrayMessage[z] + '<br>'
                }

                ele.children[0].children[0].children[0].style.fontWeight = "200"
                ele.children[1].children[0].children[0].style.fontWeight = "200"

                if (rsp.records[i].readed) {
                    ele.classList.add('rowImpar')

                } else {
                    ele.classList.add('rowPar')
                    ele.children[0].children[0].children[0].style.fontWeight = "bold"
                    ele.children[1].children[0].children[0].style.fontWeight = "bold"
                }

                ele.setAttribute("id", rsp.records[i].id);

                ele.children[0].children[0].addEventListener("click", function () {
                    openDetailMessage(this.parentNode.parentNode)
                });
                ele.children[1].children[0].addEventListener("click", function () {
                    openDetailMessage(this.parentNode.parentNode)
                });
                ele.children[2].children[0].addEventListener("click", function () {
                    openDetailMessage(this.parentNode.parentNode)
                });

                tbl.appendChild(ele);
            } else {
                document.getElementById('noCurrencieDefine').style.display = "none"
                document.getElementById("paginator").style.display = "none";
                var ele = null;
                ele = tmp.cloneNode(true);
                ele.style.display = "table";
                ele.children[0].children[0].children[0].innerHTML = rsp.records[i].date.formatted
                ele.children[1].children[0].children[0].innerHTML = rsp.records[i].ref.dsc
                ele.children[2].children[0].children[0].innerHTML = rsp.records[i].message

                ele.classList.remove('rowImpar')
                ele.classList.remove('rowPar')

                ele.children[0].children[0].children[0].style.fontWeight = "200"
                ele.children[1].children[0].children[0].style.fontWeight = "200"

                if (rsp.records[i].readed) {
                    ele.classList.add('rowImpar')


                } else {
                    ele.classList.add('rowPar')
                    ele.children[0].children[0].children[0].style.fontWeight = "bold"
                    ele.children[1].children[0].children[0].style.fontWeight = "bold"
                }

                ele.setAttribute("id", rsp.records[i].id);

                ele.children[0].children[0].addEventListener("click", function () {
                    openDetailMessage(this.parentNode.parentNode)
                });
                ele.children[1].children[0].addEventListener("click", function () {
                    openDetailMessage(this.parentNode.parentNode)
                });
                ele.children[2].children[0].addEventListener("click", function () {
                    openDetailMessage(this.parentNode.parentNode)
                });
                tbl.appendChild(ele);
            }

        }
        //document.getElementById('movVESBalance').innerHTML = rsp.total.formatted
        drawPags(rsp.numofrecords, "numbersPaginator", rsp.records.length);
    }
}

function drawPags(numofrecords, tbl, recordsAct) {
    var pages;
    if (screen.width > 700) {
        pages = Math.ceil(numofrecords / numofrec);
    } else {
        pages = 1
    }
    var numbersPaginator = document.getElementById(tbl);
    var lastPag = 0;
    if (numbersPaginator.getElementsByClassName("pSelect").length > 0) {
        lastPag = numbersPaginator.getElementsByClassName("pSelect")[0].getAttribute("data-page");
    }
    numbersPaginator.innerHTML = "";
    for (let k = 0; k < pages; k++) {
        var p = document.createElement("div");
        p.classList.add("pages", "roboto-regular");
        p.innerHTML = k + 1;
        p.dataset.page = k + 1;
        if (lastPag == 0 && k == 0) p.classList.add("pSelect");//Se selecciona la p芍gina 1
        else if (lastPag !== 0 && (lastPag - 1) == k) p.classList.add("pSelect");

        p.addEventListener("click", function () {
            //Se desmarca la pagina anterior
            var pSel = document.getElementsByClassName("pSelect");
            if (pSel.length > 0) pSel[0].classList.remove("pSelect");

            //Se actualiza la pagina seleccionada
            this.classList.add("pSelect");

            //Se repinta el listado desde el offset seleccionado
            var filter = document.getElementById("search").value;

            if (filter == null || filter == undefined) {
                filter = '';
            }
            var offset = (this.innerHTML - 1) * recordsAct;
            offsetGlobal = (this.innerHTML - 1) * recordsAct;
            var sessionId = sessionStorage.getItem('sessionid');
            var numofrecords = numofrec;

            var req = {
                'sessionid': sessionStorage.getItem('sessionid'),
                'filter': filter,
                'numofrec': numofrec,
                'order': -1,
                'type': getType(),
                'status': document.getElementById('seeAll').value,
                'offset': offset
            };
            messagesList(req, '')

            //LoadOrders(filter, offset, sessionId, numofrecords, currencyid);
        });
        p.style.cursor = "pointer";
        numbersPaginator.appendChild(p);

    }
    //Asignacion de eventos validar que se lo se haga una vez
    if (numbersPaginator.getAttribute("arrowsEvent") == "false") {
        var leftArrow = numbersPaginator.previousElementSibling;
        var rightArrow = numbersPaginator.nextElementSibling;
        //Evento flecha izquierda
        leftArrow.addEventListener("click", function () {
            var pSel = document.getElementsByClassName("pSelect");
            if (pSel.length > 0) {
                //Si el elemento anterior al seleccionado es una pagina
                if (pSel[0].previousElementSibling != null && pSel[0].previousElementSibling.classList.contains("pages")) {
                    var last = pSel[0];
                    pSel[0].previousElementSibling.classList.add("pSelect");
                    last.classList.remove("pSelect");
                    //Se repinta el listado desde el offset seleccionado
                    var filter = document.getElementById("search").value;

                    if (filter == null || filter == undefined) {
                        filter = '';
                    }
                    var offset = (parseFloat(document.getElementsByClassName("pSelect")[0].innerHTML) - 1) * recordsAct;
                    offsetGlobal = (this.innerHTML - 1) * recordsAct;
                    var sessionId = sessionStorage.getItem('sessionid');
                    var numofrecords = numofrec;
                    var req = {
                        'sessionid': sessionStorage.getItem('sessionid'),
                        'filter': filter,
                        'numofrec': numofrec,
                        'order': -1,
                        'type': getType(),
                        'status': document.getElementById('seeAll').value,
                        'offset': offset
                    };
                    messagesList(req, '')

                    //LoadOrders(filter, offset, order, numofrecords, sessionId, daterange, type, pairid, status);
                }
            }
        });

        //Evento flecha derecha
        rightArrow.addEventListener("click", function () {
            var pSel = document.getElementsByClassName("pSelect");
            if (pSel.length > 0) {
                //Si el elemento anterior al seleccionado es una pagina
                if (pSel[0].nextElementSibling != null && pSel[0].nextElementSibling.classList.contains("pages")) {
                    pSel[0].nextElementSibling.classList.add("pSelect");
                    pSel[0].classList.remove("pSelect");

                    //Se repinta el listado desde el offset seleccionado
                    var filter = document.getElementById("search").value;

                    if (filter == null || filter == undefined) {
                        filter = '';
                    }
                    var offset = (parseFloat(document.getElementsByClassName("pSelect")[0].innerHTML) - 1) * recordsAct;
                    offsetGlobal = (this.innerHTML - 1) * recordsAct;
                    var sessionId = sessionStorage.getItem('sessionid');
                    var numofrecords = numofrec;

                    var req = {
                        'sessionid': sessionStorage.getItem('sessionid'),
                        'filter': filter,
                        'numofrec': numofrec,
                        'order': -1,
                        'type': getType(),
                        'status': document.getElementById('seeAll').value,
                        'offset': offset
                    };
                    messagesList(req, '')

                    //LoadOrders(filter, offset, order, numofrecords, sessionId, daterange, type, pairid, status);
                }
            }
        });

        //Evento flecha doble


        //Evento flecha doble derecha

        numbersPaginator.setAttribute("arrowsEvent", true);
    }

}

function openDetailMessage(element) {
    var req = {
        'sessionid': sessionStorage.getItem('sessionid'),
        'id': element.getAttribute('id')
    }

    messagesEntry(req)
}

function messagesEntry(req) {
    callWS('GET', 'messages/entry', req, response);
    function response(status, rsp) {
        switch (status) {
            case 200:

                document.getElementById('detailOperations').children[0].innerHTML = JSON.parse(rsp).entry.ref.dsc
                document.getElementById('detailDate').children[0].innerHTML = JSON.parse(rsp).entry.date.formatted
                document.getElementById('detailText').children[0].innerHTML = ''
                if (JSON.parse(rsp).entry.email) {
                    document.getElementById('detailText').children[0].innerHTML = getLangById('sendemail')[lang]
                }
                if (JSON.parse(rsp).entry.sms) {
                    document.getElementById('detailText').children[0].innerHTML = getLangById('sendsms')[lang]
                }
                if (JSON.parse(rsp).entry.email && JSON.parse(rsp).entry.sms) {
                    document.getElementById('detailText').children[0].innerHTML = getLangById('sendboth')[lang]
                }
                document.getElementById('detailMessage').children[0].innerHTML = JSON.parse(rsp).entry.message

                var req2 = {
                    'sessionid': sessionStorage.getItem('sessionid'),
                    'filter': document.getElementById("search").value,
                    'numofrec': numofrec,
                    'order': -1,
                    'type': getType(),
                    'status': document.getElementById('seeAll').value,
                    'offset': offsetGlobal
                };
                messagesList(req2)
                document.getElementsByClassName('detailMessage')[0].style.display = "table"

                break;
            case 400:
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                break;
            default:
                break;
        }
    }
}

function getEntry(sessionid) {
    callWS("GET", "users/entry", { 'sessionid': sessionid }, response);

    function response(status, rsp) {
        switch (status) {
            case 200:
                if (JSON.parse(rsp).notifications > 0) {
                    document.getElementById('messageNotification').style.display = "table"
                    document.getElementById('messageNotification').children[0].innerHTML = JSON.parse(rsp).notifications
                } else {
                    document.getElementById('messageNotification').style.display = "none"
                    document.getElementById('messageNotification').children[0].innerHTML = ""
                }
                view = JSON.parse(rsp).entry.view
                entrydata = (JSON.parse(rsp).entry)
                putName(entrydata);
                break;
            case 204:
                break;
            case 400:
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
    }
}

function getEntryForMessage(sessionid) {
    callWSWithoutWS("GET", "users/entry", { 'sessionid': sessionid }, response);

    function response(status, rsp) {
        switch (status) {
            case 200:
                if (JSON.parse(rsp).notifications > 0) {
                    document.getElementById('messageNotification').style.display = "table"
                    document.getElementById('messageNotification').children[0].innerHTML = JSON.parse(rsp).notifications
                } else {
                    document.getElementById('messageNotification').style.display = "none"
                    document.getElementById('messageNotification').children[0].innerHTML = ""
                }
                break;
            case 204:
                break;
            case 400:
                break;
            case 401:
                expiredSession();
                break;
            case 500:
                // Error
                break;
            default:
                break;
        }
    }
}

function putName(entrydata) {
    var name;
    if (entrydata.company) {
        if (entrydata.company.name.value == "" || entrydata.company.name.value == null) {
            name = entrydata.usr
        } else {
            name = entrydata.company.name.value
        }
    }
    else if (entrydata.person) {
        if (entrydata.person.firstname.value == "" || entrydata.person.firstname.value == null) {
            name = entrydata.usr
        } else {
            name = entrydata.person.firstname.value + ' ' + entrydata.person.firstlastname.value
        }
    }
    document.getElementById('headname').innerHTML = name
    document.getElementById('name2').innerHTML = name
}

function setLang() {

    addFooter()

    lang = sessionStorage.getItem('lang');

    /* inner HTML */
    setWordLanginnerHTML('home', 'home');
    setWordLanginnerHTML('balance', 'balance');
    setWordLanginnerHTML('preferences', 'preferences');
    setWordLanginnerHTML('homeR', 'home');
    setWordLanginnerHTML('balanceR', 'balance');
    setWordLanginnerHTML('preferencesR', 'preferences');
    setWordLanginnerHTML('langIcon', 'langIcon');
    setWordLanginnerHTML('titleBalance', 'balanceSheet');
    setWordLanginnerHTML('labelSearch', 'search');
    setWordLanginnerHTML('currencyLabelMov', 'currency');
    setWordLanginnerHTML('balanceLabelMov', 'balance');
    setWordLanginnerHTML('lastOperationLabelMov', 'lastOperation');
    setWordLanginnerHTML('percentagesLabelMov', 'percentages');
    setWordLanginnerHTML('expressedInLabelMov', 'expressedIn');
    setWordLanginnerHTML('trasnferLabelMov', 'transfer');
    setWordLanginnerHTML('depositLabelMov', 'deposit');
    setWordLanginnerHTML('withdrawLabelMov', 'withdraw');
    setWordLanginnerHTML('currencyLabelMovR', 'currency');
    setWordLanginnerHTML('balanceLabelMovR', 'balance');
    setWordLanginnerHTML('lastOperationMovR', 'lastOperation');
    setWordLanginnerHTML('percentageMovR', 'percentages');
    setWordLanginnerHTML('expressedInLabelMovR', 'expressedInR');
    setWordLanginnerHTML('expressInRMov', 'expressedInRTable');
    setWordLanginnerHTML('ts', 'ts');
    setWordLanginnerHTML('completeLater', 'completeLater');
    setWordLanginnerHTML('completeLaterAccept', 'completeThen');
    setWordLanginnerHTML('completeLaterCancel', 'cancel');
    setWordLanginnerHTML('expired1', 'expired1');
    setWordLanginnerHTML('expired2', 'expired2');
    setWordLanginnerHTML('expSessionButton', 'continue')
    setWordLanginnerHTML('MovLabelBTC', 'movementsSpan');
    setWordLanginnerHTML('statBTC', 'status');
    setWordLanginnerHTML('datBTC', 'date');
    setWordLanginnerHTML('desBTC', 'description');
    setWordLanginnerHTML('canBTC', 'quantity');
    setWordLanginnerHTML('AvaMovLabel', 'AVAILABLE');
    setWordLanginnerHTML('defMovLabel', 'DEFERRED');
    setWordLanginnerHTML('comMovLabel', 'COMMITTED');
    setWordLanginnerHTML('movBTCBack', 'BACK');
    setWordLanginnerHTML('LabelFiatMov', 'movementsSpan');
    setWordLanginnerHTML('fiatLabelMov', 'status');
    setWordLanginnerHTML('datVES', 'date');
    setWordLanginnerHTML('fiatLabelDes', 'description');
    setWordLanginnerHTML('amountVES', 'quantity');
    setWordLanginnerHTML('AvaMovLabelF', 'AVAILABLE');
    setWordLanginnerHTML('defMovLabelF', 'DEFERRED');
    setWordLanginnerHTML('comMovLabelF', 'COMMITTED');
    setWordLanginnerHTML('movVESBack', 'BACK');
    setWordLanginnerHTML('comisionFiatDetailsLabel', 'fees');
    setWordLanginnerHTML('movDetailFiatAmountLabel', 'netTotal');
    setWordLanginnerHTML('movDetailFiatAccountLabel', 'destinationAccount');
    setWordLanginnerHTML('movDetailFiatDateLabel', 'date');
    setWordLanginnerHTML('resend', 'seeVoucher');
    setWordLanginnerHTML('detailFiatButton', 'TOACCEPT');
    setWordLanginnerHTML('accountAttentionTitle', 'attention');
    setWordLanginnerHTML('amountValidationText', 'notHaveAcc');
    setWordLanginnerHTML('acceptNoAccount', 'TOACCEPT');
    setWordLanginnerHTML('seeAll0', 'seeAll0');
    setWordLanginnerHTML('seeAll1', 'seeAll1');
    setWordLanginnerHTML('seeAll2', 'seeAll2');
    setWordLanginnerHTML('received', 'received');
    setWordLanginnerHTML('sent', 'sent');
    setWordLangPlaceHolder('textareaMessage', 'textareaMessage');


    setWordLanginnerHTML('cancelMessage', 'cancel');
    setWordLanginnerHTML('sendMessageServ', 'sentword');
    setWordLanginnerHTML('write', 'write');
    setWordLanginnerHTML('newMessageTit', 'newMessageTit');
    setWordLanginnerHTML('detailMessageTit', 'detailMessageTit');
    setWordLanginnerHTML('detailButtonAccept', 'TOACCEPT');



    getEntry(sessionStorage.getItem('sessionid'));

}






