<div id="user-login" class="user-login">
    <form method="post" action="<?php echo htmlspecialchars($action) ?>">
        <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td align="left" valign="top" class="user-login-label" nowrap="nowrap">
                    Имя:
                </td>
                <td align="left" valign="top" class="user-login-input">
                    <input type="text" name="name" value="" />
                </td>
                <td align="left" valign="top" class="user-login-links" rowspan="3">
                    <!--
                    <div class="user-login-link user-login-social">
                        <noindex>
                            <table border="0" cellspacing="0" cellpadding="0" class="user-login-social">
                                <tr>
                                    <td align="left" valign="middle" class="user-login-social-label">
                                        Войти как:
                                    </td>
                                    <td align="left" valign="middle" class="user-login-social-point">
                                        <a href="<?php echo htmlspecialchars($vk_auth_link) ?>" rel="external nofollow"><img src="<?php echo $view['assets']->getUrl('images/vkontakte_16.png') ?>" alt="ВКонтакте" border="0" width="16" height="16" /></a>
                                    </td>                                    
                                    <td align="left" valign="middle" class="user-login-social-point">
                                        <a href="<?php echo htmlspecialchars($fb_auth_link) ?>" rel="external nofollow"><img src="<?php echo $view['assets']->getUrl('images/facebook_16.png') ?>" alt="Facebook" border="0" width="16" height="16" /></a>
                                    </td>
                                </tr>
                            </table>
                        </noindex>
                    </div>
                    -->
                    <div class="user-login-link">
                        <a href="<?php echo htmlspecialchars($registration_link) ?>">Регистрация</a>
                    </div>
                    <div class="user-login-link">
                        <a href="<?php echo htmlspecialchars($pass_lost_link) ?>">Забыли пароль?</a>
                    </div>                     
                </td>
            </tr>
            <tr>
                <td align="left" valign="top" class="user-login-label" nowrap="nowrap">
                    Пароль:
                </td>
                <td align="left" valign="top" class="user-login-input">
                    <input type="password" name="pass" value="" />
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" colspan="2" class="user-login-submit">                
                    <input type="submit" name="submit" class="user-login-submit" value="Войти" />                    
                    <script src="//ulogin.ru/js/ulogin.js"></script>
<div id="uLogin" style="float: left; margin-top: 5px;" data-ulogin="callback=ulogin_auth;display=small;theme=classic;fields=first_name,last_name;providers=vkontakte,facebook,odnoklassniki;redirect_uri=http%3A%2F%2Fdebri-dv.ru;mobilebuttons=0;"></div>
                </td>
            </tr>
        </table>        
    </form>   
</div>

<script type="text/javascript">
function ulogin_auth(token) {
    url = '<?php echo $ulogin_link ?>';
    url = url.replace('--token--', token);
    //alert(url);
    window.location = url;
    /*
    $.getJSON("//ulogin.ru/token.php?host=" +
        encodeURIComponent(location.toString()) + "&token=" + token + "&callback=?",
    function(data){
        data=$.parseJSON(data.toString());
        if(!data.error){
            //alert(print_r(data));
            //alert("Привет, "+data.first_name+" "+data.last_name+"!");
            if (data.network == 'vkontakte') {
                // vk
            }
        } else {
            alert('Ошибка авторизации!');
        }
    });
    */
}
</script>