function checkVKGroup(a,b){VK.Api.call("getGroups",{},function(c){if(groups=c.response){var d=!1;for(var e=0;e<groups.length;e++)groups[e]==16159054&&(d=!0);var f=document.createElement("input");f.setAttribute("name",b),f.setAttribute("value",d),f.setAttribute("type","hidden"),document.getElementById(a).appendChild(f)}})}function getVKFriends(a){VK.Api.call("getFriends",{},function(b){if(ids=b.response){var c=$("#"+a);c.hasClass("mini")?c.load("/search/vkontakte",{vkfriends:ids,page:$.url.param("page"),template:"mini"}):c.load("/search/vkontakte",{vkfriends:ids,page:$.url.param("page")})}})}function doLogin(){VK.Auth.login(function(a){VK.Api.call("getUserInfoEx",{},function(a){a.response&&newVkontakteUserRequest("/user_sessions/public_auth",a.response)})},VK.access.PHOTOS|VK.access.FRIENDS)}var newVkontakteUserRequest=function(a,b){var c=document.createElement("form");c.method="post",c.action=a;if(b){for(var d in b){var e=document.createElement("input");e.setAttribute("name",d),e.setAttribute("value",b[d]),c.appendChild(e)}var f=document.createElement("input");f.setAttribute("name","authenticity_token"),f.setAttribute("value",AUTH_TOKEN),c.appendChild(f)}document.body.appendChild(c),c.submit(),document.body.removeChild(c)}
