<script type="text/javascript" src="https://vk.com/js/api/openapi.js?161"></script>
<script type="text/javascript">
VK.init({apiId: #####});
</script>
<!-- VK Widget -->
<div id="vk_auth"></div>
<script type="text/javascript">
VK.Widgets.Auth("vk_auth", {"onAuth":"function(data) {alert(\'user \'+data[\'uid\']+\' authorized\');}"});
</script>