(function(a){function b(){var b="";for(i=0;i<5;i++)b+=Math.ceil(Math.random()*15).toString(16);return b}function c(b,a,m,d,f){b[a]?m.apply(d):(f=f||0,f<1E3&&setTimeout(function(){c(b,a,m,d,f+1)},0))}function e(b){setTimeout(function(){var m=document.createElement("script");m.type="text/javascript";m.src=b||a.fastXDM.helperUrl;c(document,"body",function(){document.getElementsByTagName("HEAD")[0].appendChild(m)})},0)}function g(b,a){f.loaded?b.apply(a,[f]):d.push([a,b])}function j(){f.loaded=!0;for(var b=
d.length;b--;)d[b][1].apply(d[b][0],[f])}function l(b,a){g(function(m){var d=m.json.parse(b);if(d[0]){d[1]||(d[1]=[]);for(m=d[1].length;m--;)if(d[1][m]._func){var f=d[1][m]._func;d[1][m]=function(){var b=Array.prototype.slice.call(arguments);b.unshift("_func"+f);a.callMethod.apply(a,b)}}setTimeout(function(){if(!a.methods[d[0]])throw Error("fastXDM: Method "+d[0]+" is undefined");a.methods[d[0]].apply(a,d[1])},0)}})}function m(b,a){for(var d in a)b[d]&&typeof b[d]=="object"?m(b[d],a[d]):b[d]=a[d]}
if(!a.fastXDM){var n={},d=[],f={};a.fastXDM={_id:0,helperUrl:"http://userapi.com/js/api/xdmHelper.js?2",Server:function(d,m){this.methods=d||{};this.id=a.fastXDM._id++;this.filter=m;this.key=b();this.methods["%init%"]=this.methods.__fxdm_i=function(){a.fastXDM.run(this.id);if(this.methods.onInit)this.methods.onInit()};this.frameName="fXD"+this.key;this.server=!0;n[this.key]=[l,this]},Client:function(b){this.methods=b||{};this.id=a.fastXDM._id++;a.fastXDM.run(this.id);if(window.name.indexOf("fXD")==
0)this.key=window.name.substr(3);else throw Error("Wrong window.name property.");this.caller=window.parent;n[this.key]=[l,this];this.client=!0;a.fastXDM.on("helper",function(){a.fastXDM.onClientStart(this)},this);g(function(b){b.send(this,b.json.stringify(["%init%"]));var a=this.methods;setTimeout(function(){if(a.onInit)a.onInit()},0)},this)},onMessage:function(b){if(!b.data)return!1;var a=b.data.substr(0,5);if(n[a]){var d=n[a][1];if(d&&(!d.filter||d.filter(b.origin)))n[a][0](b.data.substr(6),d)}},
setJSON:function(b){f.json=b},getJSON:function(b){if(!b)return f.json;g(function(a){b(a.json)})},setEnv:function(b){for(i in b)f[i]=b[i];j()},_q:{},on:function(b,a,d){this._q[b]||(this._q[b]=[]);this._q[b]==-1?a.apply(d):this._q[b].push([a,d])},run:function(b){var a=(this._q[b]||[]).length;if(this._q[b]&&a>0)for(var d=0;d<a;d++)this._q[b][d][0].apply(this._q[b][d][1]);this._q[b]=-1},waitFor:c};a.fastXDM.Server.prototype.start=function(b,d){if(b.contentWindow)this.caller=b.contentWindow,this.frame=
b,a.fastXDM.on("helper",function(){a.fastXDM.onServerStart(this)},this);else{var m=this,d=d||0;d<50&&setTimeout(function(){m.start.apply(m,[b,d+1])},100)}};a.fastXDM.Server.prototype.append=function(b,a){var d=document.createElement("DIV");d.innerHTML='<iframe name="'+this.frameName+'" />';var f=d.firstChild,c=this;setTimeout(function(){f.frameBorder="0";a&&m(f,a);b.insertBefore(f,b.firstChild);c.start(f)},0);return f};a.fastXDM.Client.prototype.callMethod=a.fastXDM.Server.prototype.callMethod=function(){for(var b=
Array.prototype.slice.call(arguments),d=b.shift(),m=b.length;m--;)if(typeof b[m]=="function"){this.funcsCount=(this.funcsCount||0)+1;var f=b[m],n="_func"+this.funcsCount;this.methods[n]=function(){f.apply(this,arguments);delete this.methods[n]};b[m]={_func:this.funcsCount}}c(this,"caller",function(){a.fastXDM.on(this.id,function(){g(function(a){a.send(this,a.json.stringify([d,b]))},this)},this)},this)};a.JSON&&typeof a.JSON=="object"&&a.JSON.parse&&a.JSON.stringify&&a.JSON.stringify({a:[1,2,3]}).replace(/ /g,
"")=='{"a":[1,2,3]}'?f.json={parse:a.JSON.parse,stringify:a.JSON.stringify}:a.fastXDM._needJSON=!0;a.postMessage?(f.protocol="p",f.send=function(b,a){b.caller.postMessage(b.key+":"+a,"*")},a.addEventListener?a.addEventListener("message",a.fastXDM.onMessage,!1):a.attachEvent("onmessage",a.fastXDM.onMessage),a.fastXDM._needJSON?(a.fastXDM._onlyJSON=!0,e()):j()):e()}})(window);if(!window.VK)window.VK={};
if(!VK.MD5)VK.MD5=function(a){var b=function(b,a){var d=(b&65535)+(a&65535);return(b>>16)+(a>>16)+(d>>16)<<16|d&65535},c=function(b,a){return b<<a|b>>>32-a},e=function(a,e,d,f,g,h,j){return b(c(b(b(a,e&d|~e&f),b(g,j)),h),e)},g=function(a,e,d,f,g,h,j){return b(c(b(b(a,e&f|d&~f),b(g,j)),h),e)},j=function(a,e,d,f,g,h,j){return b(c(b(b(a,e^d^f),b(g,j)),h),e)},l=function(a,e,d,f,g,h,j){return b(c(b(b(a,d^(e|~f)),b(g,j)),h),e)};return function(b){for(var a="",d,f=0,e=b.length;f<e;f++)d=b.charCodeAt(f),
a+="0123456789abcdef".charAt(d>>>4&15)+"0123456789abcdef".charAt(d&15);return a}(function(a){var c=Array(a.length>>2),d,f;for(d=0,f=c.length;d<f;d++)c[d]=0;for(d=0,f=a.length*8;d<f;d+=8)c[d>>5]|=(a.charCodeAt(d/8)&255)<<d%32;var o=a.length*8,a=1732584193;d=-271733879;f=-1732584194;var h=271733878,r,s,p;c[o>>5]|=128<<o%32;c[(o+64>>>9<<4)+14]=o;for(var k=0,q=c.length;k<q;k+=16)o=a,r=d,s=f,p=h,a=e(a,d,f,h,c[k+0],7,-680876936),h=e(h,a,d,f,c[k+1],12,-389564586),f=e(f,h,a,d,c[k+2],17,606105819),d=e(d,f,
h,a,c[k+3],22,-1044525330),a=e(a,d,f,h,c[k+4],7,-176418897),h=e(h,a,d,f,c[k+5],12,1200080426),f=e(f,h,a,d,c[k+6],17,-1473231341),d=e(d,f,h,a,c[k+7],22,-45705983),a=e(a,d,f,h,c[k+8],7,1770035416),h=e(h,a,d,f,c[k+9],12,-1958414417),f=e(f,h,a,d,c[k+10],17,-42063),d=e(d,f,h,a,c[k+11],22,-1990404162),a=e(a,d,f,h,c[k+12],7,1804603682),h=e(h,a,d,f,c[k+13],12,-40341101),f=e(f,h,a,d,c[k+14],17,-1502002290),d=e(d,f,h,a,c[k+15],22,1236535329),a=g(a,d,f,h,c[k+1],5,-165796510),h=g(h,a,d,f,c[k+6],9,-1069501632),
f=g(f,h,a,d,c[k+11],14,643717713),d=g(d,f,h,a,c[k+0],20,-373897302),a=g(a,d,f,h,c[k+5],5,-701558691),h=g(h,a,d,f,c[k+10],9,38016083),f=g(f,h,a,d,c[k+15],14,-660478335),d=g(d,f,h,a,c[k+4],20,-405537848),a=g(a,d,f,h,c[k+9],5,568446438),h=g(h,a,d,f,c[k+14],9,-1019803690),f=g(f,h,a,d,c[k+3],14,-187363961),d=g(d,f,h,a,c[k+8],20,1163531501),a=g(a,d,f,h,c[k+13],5,-1444681467),h=g(h,a,d,f,c[k+2],9,-51403784),f=g(f,h,a,d,c[k+7],14,1735328473),d=g(d,f,h,a,c[k+12],20,-1926607734),a=j(a,d,f,h,c[k+5],4,-378558),
h=j(h,a,d,f,c[k+8],11,-2022574463),f=j(f,h,a,d,c[k+11],16,1839030562),d=j(d,f,h,a,c[k+14],23,-35309556),a=j(a,d,f,h,c[k+1],4,-1530992060),h=j(h,a,d,f,c[k+4],11,1272893353),f=j(f,h,a,d,c[k+7],16,-155497632),d=j(d,f,h,a,c[k+10],23,-1094730640),a=j(a,d,f,h,c[k+13],4,681279174),h=j(h,a,d,f,c[k+0],11,-358537222),f=j(f,h,a,d,c[k+3],16,-722521979),d=j(d,f,h,a,c[k+6],23,76029189),a=j(a,d,f,h,c[k+9],4,-640364487),h=j(h,a,d,f,c[k+12],11,-421815835),f=j(f,h,a,d,c[k+15],16,530742520),d=j(d,f,h,a,c[k+2],23,-995338651),
a=l(a,d,f,h,c[k+0],6,-198630844),h=l(h,a,d,f,c[k+7],10,1126891415),f=l(f,h,a,d,c[k+14],15,-1416354905),d=l(d,f,h,a,c[k+5],21,-57434055),a=l(a,d,f,h,c[k+12],6,1700485571),h=l(h,a,d,f,c[k+3],10,-1894986606),f=l(f,h,a,d,c[k+10],15,-1051523),d=l(d,f,h,a,c[k+1],21,-2054922799),a=l(a,d,f,h,c[k+8],6,1873313359),h=l(h,a,d,f,c[k+15],10,-30611744),f=l(f,h,a,d,c[k+6],15,-1560198380),d=l(d,f,h,a,c[k+13],21,1309151649),a=l(a,d,f,h,c[k+4],6,-145523070),h=l(h,a,d,f,c[k+11],10,-1120210379),f=l(f,h,a,d,c[k+2],15,
718787259),d=l(d,f,h,a,c[k+9],21,-343485551),a=b(a,o),d=b(d,r),f=b(f,s),h=b(h,p);c=[a,d,f,h];a="";d=0;for(f=c.length*32;d<f;d+=8)a+=String.fromCharCode(c[d>>5]>>>d%32&255);return a}(function(a){for(var b="",c=-1,f=a.length,e,g;++c<f;)e=a.charCodeAt(c),g=c+1<f?a.charCodeAt(c+1):0,55296<=e&&e<=56319&&56320<=g&&g<=57343&&(e=65536+((e&1023)<<10)+(g&1023),c++),e<=127?b+=String.fromCharCode(e):e<=2047?b+=String.fromCharCode(192|e>>>6&31,128|e&63):e<=65535?b+=String.fromCharCode(224|e>>>12&15,128|e>>>6&
63,128|e&63):e<=2097151&&(b+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|e&63));return b}(a)))};VK.extend=function(a,b,c){for(var e in b)if(c||typeof a[e]==="undefined")a[e]=b[e];return a};
if(VK.xdConnectionCallbacks)setTimeout(function(){for(var a;a=VK.xdConnectionCallbacks.pop();)a()},0),VK.Widgets=!1;else{VK.extend(VK,{_apiId:null,_session:null,_userStatus:"unknown",_domain:{main:"http://vkontakte.ru/",api:"http://api.vkontakte.ru/",apiPath:"api.php"},_path:{login:"login.php",proxy:"fxdm_proxy_.html"},_rootId:"vk_api_transport",_nameTransportPath:"",xdReady:!1,access:{FRIENDS:2,PHOTOS:4,AUDIO:8,VIDEO:16,MATCHES:32,QUESTIONS:64,WIKI:128}},!0);VK.init=function(a){var b;if(!a.apiId)throw"VK.init() called without an apiId";
VK._apiId=a.apiId;if(a.vk)VK._domain.main="http://vk.com/";if(a.onlyWidgets)return!0;if(a.nameTransportPath&&a.nameTransportPath!="")VK._nameTransportPath=a.nameTransportPath;b=document.getElementById(VK._rootId);if(!b)b=document.createElement("div"),b.id=VK._rootId,a=document.getElementsByTagName("body")[0],a.insertBefore(b,a.childNodes[0]);b.style.position="absolute";b.style.top="-10000px";if(a=VK.Cookie.load())VK.Auth._loadState="loaded",VK.Auth.setSession(a,a?"connected":"unknown")};if(!VK.Cookie)VK.Cookie=
{_domain:null,load:function(){var a=document.cookie.match("\\bvk_app_"+VK._apiId+"=([^;]*)\\b"),b;if(a)b=this.decode(a[1]),b.expire=parseInt(b.expire,10),VK.Cookie._domain="."+window.location.hostname;return b},setRaw:function(a,b,c){var e;e="vk_app_"+VK._apiId+"="+a+"";e+=a&&b==0?"":"; expires="+(new Date(b*1E3)).toGMTString();e+="; path=/";e+=c?"; domain=."+c:"";document.cookie=e;this._domain=c},set:function(a){a?this.setRaw(this.encode(a),a.expire,window.location.hostname):this.clear()},clear:function(){this.setRaw("",
0,this._domain)},encode:function(a){var b=[],c;for(c in a)c!="user"&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));b.sort();return b.join("&")},decode:function(a){var b={},a=a.split("&"),c,e;for(c=0;c<a.length;c++)(e=a[c].split("=",2))&&e[0]&&(b[decodeURIComponent(e[0])]=decodeURIComponent(e[1]));return b}};if(!VK.Api)VK.Api={_headId:null,_callbacks:{},ie6_7:function(){if(!VK.Api.ieTested)VK.Api.isIE6_7=navigator.userAgent.match(/MSIE [6|7]/i),VK.Api.ieTested=!0;return VK.Api.isIE6_7},
attachScript:function(a){if(!VK.Api._headId)VK.Api._headId=document.getElementsByTagName("head")[0];var b=document.createElement("script");b.type="text/javascript";b.setAttribute("encoding","UTF-8");b.src=a;VK.Api._headId.appendChild(b)},checkMethod:function(a,b,c,e){var g=a.toLowerCase();if(g=="wall.post"||g=="activity.set"){var j=g=="activity.set"?b.text:b.message,j="http://vkontakte.ru/apps.php?act=a_prepare_post&widget=1&aid="+parseInt(VK._apiId)+"&text="+encodeURIComponent(j);g=="wall.post"&&
(j+="&owner_id="+parseInt(b.owner_id||0)+"&attachment="+(b.attachment||""));VK.Util.Box(j,[460,220],{proxy:function(g,j){j?c({error:j}):(b.method_access=g,VK.Api.call(a,b,c,e))}}).show();return!1}return!0},call:function(a,b,c,e){var g=b||{},j,l;if(typeof g!="object"||typeof c!="function")return!1;if(b.method_access||b.method_force||VK.Api.checkMethod(a,b,c,e))if(e||(e=0),VK.Auth._loadState!="loaded"){var m=function(d){d&&d.session&&(VK.Observer.unsubscribe("auth.loginStatus",m),VK.Api.call(a,b,c))};
VK.Observer.subscribe("auth.loginStatus",m);VK.Auth.getLoginStatus()}else{VK.extend(g,{api_id:VK._apiId,v:"3.0",format:"JSON",method:a},!0);if(VK.Api.queryLength(g)<1500&&!VK.Api.ie6_7()){for(var n=!1,d=parseInt(Math.random()*1E7);VK.Api._callbacks[d];)d=parseInt(Math.random()*1E7);g.callback="VK.Api._callbacks["+d+"]"}else n=!0;VK.extend(g,{sig:this.sign(g),sid:VK._session?VK._session.sid:""},!0);j=VK.Cookie.encode(g);l=function(f){if(f.error&&(f.error.error_code==3||f.error.error_code==4||f.error.error_code==
5)){if(e>3)return!1;var g=function(d){VK.Observer.unsubscribe("auth.sessionChange",g);delete b.sid;delete b.sig;d.session&&VK.Api.call(a,b,c,e+1)};VK.Observer.subscribe("auth.sessionChange",g);VK.Auth.getLoginStatus()}else c(f);n||delete VK.Api._callbacks[d]};n?VK.xdReady?VK.XDM.remote.callMethod("apiCall",j,l):(VK.Observer.subscribe("xdm.init",function(){VK.XDM.remote.callMethod("apiCall",j,l)}),VK.XDM.init()):(VK.Api._callbacks[d]=l,VK.Api.attachScript(VK._domain.api+VK._domain.apiPath+"?"+j))}},
sign:function(a){var b,c=[],e;for(b in a)c.push(b.toString());c.sort();e=VK._session?VK._session.mid:0;for(b=0;b<c.length;b++)e+=c[b]+"="+a[c[b]];e+=VK._session?VK._session.secret:"";return VK.MD5(e)},queryLength:function(a){var b=100;for(i in a)b+=i.length+encodeURIComponent(a.i).length+1;return b}},VK.api=function(a,b,c){VK.Api.call(a,b,c)};if(!VK.Auth)VK.Auth={popup:null,lsCb:{},setSession:function(a,b,c){var e=!VK._session&&a,g=VK._session&&!a,j=VK._session&&a&&VK._session.mid!=a.mid,l=e||g||
VK._session&&a&&VK._session.sid!=a.sid,m=b!=VK._userStatus,n={session:a,status:b,settings:c};VK._session=a;VK._userStatus=b;VK.Cookie.set(a);(l||m||j)&&setTimeout(function(){m&&VK.Observer.publish("auth.statusChange",n);(g||j)&&VK.Observer.publish("auth.logout",n);if(e||j)VK.xdReady&&VK.XDM.remote.init(VK._apiId,a,b),VK.Observer.publish("auth.login",n);l&&VK.Observer.publish("auth.sessionChange",n)},0);return n},login:function(a,b){var c;if(!VK._apiId)return!1;c=VK._domain.main+VK._path.login+"?app="+
VK._apiId+"&layout=openapi";b&&parseInt(b)>0&&(c+="&settings="+b);VK.Observer.unsubscribe("auth.onLogin");VK.Observer.subscribe("auth.onLogin",a);VK.UI.popup({width:554,height:287,url:c});var e=function(){VK.Auth.getLoginStatus(function(b){VK.Observer.publish("auth.onLogin",b);VK.Observer.unsubscribe("auth.onLogin")},!0)};VK.UI.popupOpened=!0;var g=function(){if(!VK.UI.popupOpened)return!1;try{if(!VK.UI.active.top)return VK.UI.popupOpened=!1,e(),!0}catch(b){return VK.UI.popupOpened=!1,e(),!0}setTimeout(g,
100)};setTimeout(g,100)},logout:function(a){VK.Auth.revokeGrants(a)},revokeGrants:function(a){var b=function(c){VK.Observer.unsubscribe("auth.statusChange",b);a&&a(c)};VK.Observer.subscribe("auth.statusChange",b);VK._session&&VK._session.sid&&VK.Api.attachScript("https://login.vk.com/?act=openapi&aid="+parseInt(VK._apiId)+"&location="+encodeURIComponent(window.location.hostname)+"&do_logout=1&sid="+VK._session.sid);VK.Cookie.clear()},getSession:function(){return VK._session},getLoginStatus:function(a,
b){if(VK._apiId){if(a)if(!b&&VK.Auth._loadState=="loaded"){a({status:VK._userStatus,session:VK._session});return}else VK.Observer.subscribe("auth.loginStatus",a);if(b||VK.Auth._loadState!="loading"){VK.Auth._loadState="loading";for(var c=parseInt(Math.random()*1E7);VK.Auth.lsCb[c];)c=parseInt(Math.random()*1E7);VK.Auth.lsCb[c]=function(a){VK.Auth._loadState="loaded";if(a&&a.auth){var c={mid:a.user.id,sid:a.sid,secret:a.secret,expire:a.expire,sig:a.sig};if(b)c.user=a.user;a="connected"}else c=null,
a="unknown",VK.Cookie.clear();VK.Auth.setSession(c,a);VK.Observer.publish("auth.loginStatus",{session:c,status:a});VK.Observer.unsubscribe("auth.loginStatus")};VK.Api.attachScript("https://login.vk.com/?act=openapi&aid="+parseInt(VK._apiId)+"&location="+encodeURIComponent(window.location.hostname)+"&rnd="+c)}}}}}
if(!VK.UI)VK.UI={active:null,_buttons:[],popup:function(a){var b=typeof window.screenY!="undefined"?window.screenY:window.screenTop,c=typeof window.outerHeight!="undefined"?window.outerHeight:document.body.clientHeight-22,e=a.width,g=a.height,j=parseInt((typeof window.screenX!="undefined"?window.screenX:window.screenLeft)+((typeof window.outerWidth!="undefined"?window.outerWidth:document.body.clientWidth)-e)/2,10),b=parseInt(b+(c-g)/2.5,10);this.active=window.open(a.url,"vk_openapi","width="+e+",height="+
g+",left="+j+",top="+b)},button:function(a){var b="";typeof a=="string"&&(a=document.getElementById(a));this._buttons.push(a);index=this._buttons.length-1;b='<table cellspacing="0" cellpadding="0" id="openapi_UI_'+index+'" onmouseover="VK.UI._change(1, '+index+');" onmouseout="VK.UI._change(0, '+index+');" onmousedown="VK.UI._change(2, '+index+');" onmouseup="VK.UI._change(1, '+index+');" style="cursor: pointer; border: 0px; font-family: tahoma; font-size: 10px;"><tr style="vertical-align: middle"><td></td><td><div style="border: 1px solid #3b6798;"><div style="border: 1px solid #5c82ab; border-top-color: #7e9cbc; background-color: #6d8fb3; color: #fff; text-shadow: 0px 1px #45688E; height: 15px; padding: 2px 4px 0px 6px;">&#1042;&#1086;&#1081;&#1090;&#1080;</div></div></td><td><div style="background: url('+
VK._domain.main+'images/btns.png) 0px -42px no-repeat; width: 21px; height: 21px"></div></td><td><div style="border: 1px solid #3b6798;"><div style="border: 1px solid #5c82ab; border-top-color: #7e9cbc; background-color: #6d8fb3; color: #fff; text-shadow: 0px 1px #45688E; height: 15px; padding: 2px 6px 0px 4px;">&#1050;&#1086;&#1085;&#1090;&#1072;&#1082;&#1090;&#1077;</div></div></td><td></td></tr></table>';a.innerHTML=b;a.style.width=a.childNodes[0].offsetWidth+"px"},_change:function(a,b){for(var c=
document.getElementById("openapi_UI_"+b).rows[0],e=[c.cells[1].firstChild.firstChild,c.cells[3].firstChild.firstChild],g=0;g<2;++g){var j=e[g];if(a==0)j.style.backgroundColor="#6D8FB3",j.style.borderTopColor="#7E9CBC",j.style.borderLeftColor=j.style.borderRightColor=j.style.borderBottomColor="#5C82AB";else if(a==1)j.style.backgroundColor="#84A1BF",j.style.borderTopColor="#92ACC7",j.style.borderLeftColor=j.style.borderRightColor=j.style.borderBottomColor="#7293B7";else if(a==2)j.style.backgroundColor=
"#6688AD",j.style.borderBottomColor="#7495B8",j.style.borderLeftColor=j.style.borderRightColor=j.style.borderTopColor="#51779F"}e=[c.cells[0].firstChild,c.cells[4].firstChild];for(g=0;g<2;++g)if(j=e[g])if(a==0)j.style.backgroundPosition="-21px -"+(42+g*21)+"px";else if(a==1)j.style.backgroundPosition="-23px -"+(42+g*21)+"px";else if(a==2)j.style.backgroundPosition="-25px -"+(42+g*21)+"px";if(a==0||a==2)c.cells[2].firstChild.style.backgroundPosition="0px -42px";else if(a==1)c.cells[2].firstChild.style.backgroundPosition=
"0px -63px"}};
if(!VK.XDM)VK.XDM={remote:null,init:function(){if(this.remote)return!1;var a=VK._domain.api+VK._path.proxy;this.remote=new fastXDM.Server({onInit:function(){VK.XDM.remote.callMethod("init",VK._apiId,VK._session,VK._userStatus);VK.xdReady=!0;VK.Observer.publish("xdm.init")},setSession:{isVoid:!0,method:function(a,c){VK.Auth.setSession(a,c)}},alert:{isVoid:!0,method:function(a){alert(a)}}});this.remote.append(document.getElementById(VK._rootId),{src:a})},xdHandler:function(a){try{eval("VK."+a)}catch(b){}}};
if(!VK.Observer)VK.Observer={_subscribers:function(){if(!this._subscribersMap)this._subscribersMap={};return this._subscribersMap},publish:function(a){var b=Array.prototype.slice.call(arguments),a=b.shift(),c=this._subscribers()[a],e,g;if(c)for(e=0,g=c.length;e<g;e++)c[e]!=null&&c[e].apply(this,b)},subscribe:function(a,b){var c=this._subscribers();if(typeof b!="function")return!1;c[a]?c[a].push(b):c[a]=[b]},unsubscribe:function(a,b){var c=this._subscribers()[a],e,g;if(!c)return!1;if(typeof b=="function")for(e=
0,g=c.length;e<g;e++)c[e]==b&&(c[e]=null);else delete this._subscribers()[a]}};
if(!VK.Widgets)VK.Widgets={},VK.Widgets.count=0,VK.Widgets.RPC={},VK.Widgets.publish=function(){VK.Observer.publish.apply(VK.Observer,arguments)},VK.Widgets.loading=function(a,b){a.style.background=b?'url("http://vk.com/images/upload.gif") center center no-repeat transparent':"none"},VK.Widgets.Comments=function(a,b,c){var e=VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");var b=b||{},g=function(){l.callMethod("mouseUp");return!1},j=function(a){l.callMethod("mouseMove",
{screenY:a.screenY})},l=VK.Widgets._constructor("widget_comments.php",a,b,{limit:b.limit||10,page:c||0,status_publish:b.autoPublish===void 0?1:b.autoPublish,attach:b.attach===void 0?"*":b.attach?b.attach:"",height:b.height||0,norealtime:b.norealtime?1:0,url:b.pageUrl||e.url,title:b.pageTitle||e.title,description:b.pageDescription||e.description,image:b.pageImage||e.image},{showBox:function(a,c){VK.Util.Box((b.base_domain||"http://vkontakte.ru/")+a,[c.width,c.height],{proxy:function(){l.callMethod.apply(l,
arguments)}}).show()},startDrag:function(){cursorBack=window.document.body.style.cursor;window.document.body.style.cursor="pointer";VK.Util.addEvent("mousemove",j);VK.Util.addEvent("mouseup",g)},stopDrag:function(){window.document.body.style.cursor=cursorBack;VK.Util.removeEvent("mousemove",j);VK.Util.removeEvent("mouseup",g)}},{startHeight:"133px",minWidth:300,width:"100%"})[2];b.onChange&&(VK.Observer.subscribe("widgets.comments.new_comment",b.onChange),VK.Observer.subscribe("widgets.comments.delete_comment",
b.onChange))},VK.Widgets.Recommended=function(a,b){VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");var b=b||{},c={limit:b.limit||5,max:b.max||0,sort:b.sort||"friend_likes",verb:b.verb||0,period:b.period||"week",target:b.target||"parent"};VK.Widgets._constructor("widget_recommended.php",a,b,c,{},{startHeight:90+c.limit*30+"px",minWidth:150,width:"100%"})},VK.Widgets.Like=function(a,b,c){function e(a){if((h||a)&&o&&f&&o&&!(f.style.display!="none"&&f.style.visibility!=
"hidden")){var a=b.getScrollTop?b.getScrollTop():document.body.scrollTop||document.documentElement.scrollTop||0,c=VK.Util.getXY(p),e=d?0:c[1];a>c[1]-120&&b.tooltipPos!="top"||l=="vertical"||b.tooltipPos=="bottom"?(f.style.top=e+n+2+"px",o.callMethod("show",!1)):(f.style.top=e-125+"px",o.callMethod("show",!0));VK.Util.ss(f,{left:(d?0:c[0])-(l=="vertical"||l=="mini"?36:2)+"px",display:"block",visibility:"visible"});h=!0}}function g(a){if((!h||a)&&o)o.callMethod("hide"),q.callMethod("hide"),setTimeout(function(){f.style.display=
"none"},400)}var j=VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");b=VK.extend(b||{},{allowTransparency:!0});(b.type=="button"||b.type=="vertical"||b.type=="mini")&&delete b.width;var l=b.type=="full"||b.type=="button"||b.type=="vertical"||b.type=="mini"?b.type:"full",m=l=="full"?Math.max(200,b.width||350):l=="button"?180:l=="mini"?100:41,n=l=="vertical"?51:l=="full"?23:22,d=b.ttHere||!1,a=VK.Widgets._constructor("widget_like.php",a,b,{page:c||0,url:b.pageUrl||
j.url,type:l,verb:b.verb==1?1:0,title:b.pageTitle||j.title,description:b.pageDescription||j.description,image:b.pageImage||j.image},{initTooltip:function(a){o=new fastXDM.Server({onInit:a?function(){e(!0)}:function(){},proxy:function(){q.callMethod.apply(q,arguments)},showBox:function(a,c){VK.Util.Box((b.base_domain||"http://vkontakte.ru/")+a,[c.width,c.height],{proxy:function(){o.callMethod.apply(o,arguments)}}).show()},statsBox:function(){g(!0);s=VK.Util.Box(k.src+"&act=a_stats_box",[498,442]);
s.show()}});f=o.append(d?p:document.body,{src:k.src+"&act=a_share_tooltip",scrolling:"no",allowTransparency:!0,id:k.id+"_tt",style:{position:"absolute",padding:0,display:"block",visibility:"hidden",border:"0",width:"206px",height:"127px",zIndex:5E3,overflow:"hidden"}});p.onmouseover=f.onmouseover=function(){h=!0};p.onmouseout=f.onmouseout=function(){clearTimeout(r);h=!1;r=setTimeout(function(){g()},200)}},showTooltip:e,hideTooltip:g,showBox:function(a,c){VK.Util.Box((b.base_domain||"http://vkontakte.ru/")+
a,[c.width,c.height],{proxy:function(){q.callMethod.apply(q,arguments)}}).show()},proxy:function(){o&&o.callMethod.apply(o,arguments)}},{startHeight:n+"px",minWidth:m}),f,o,h=!1,r,s,p=a[0],k=a[1],q=a[2];VK.Util.ss(p,{height:n+"px",width:m+"px",position:"relative",clear:"both"});VK.Util.ss(k,{height:n+"px",width:m+"px",overflow:"hidden",zIndex:150})},VK.Widgets.Poll=function(a,b,c){var e=VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");if(!c)throw Error("No poll id passed");
b=b||{};VK.Widgets._constructor("widget_poll.php",a,b,{poll_id:c,url:b.pageUrl||e.url||location.href,title:b.pageTitle||e.title,description:b.pageDescription||e.description},{},{startHeight:"133px",minWidth:300,width:"100%"})},VK.Widgets.PagePoll=function(a,b,c){var e=VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");b=b||{};VK.Widgets._constructor("al_widget_poll.php",a,b,{page:c||0,norealtime:b.norealtime?1:0,poll_id:b.pollId||"",page:c||"",url:b.pageUrl||
e.url||location.href,title:b.pageTitle||e.title,description:b.pageDescription||e.description},{},{startHeight:"133px",minWidth:300,width:"100%"})},VK.Widgets.Donate=function(a,b,c){if(!c)throw Error("No merchant_id passed");c={merchant_id:c,mode:b.mode?"1":"0",users:b.users?"1":"0",test_mode:b.test_mode?"1":"0",text:b.text?"1":"0"};if(!b.width)b.width=200;VK.Widgets._constructor("widget_donate.php",a,b,c,{},{minWidth:200,width:"200",startHeight:80})},VK.Widgets.Community=VK.Widgets.Group=function(a,
b,c){function e(){j.callMethod("mouseUp");return!1}function g(a){j.callMethod("mouseMove",{screenY:a.screenY});return!1}var c=parseInt(c),j;if(!c)throw Error("No group_id passed");b.mode=parseInt(b.mode).toString();c={gid:c,mode:b.mode?b.mode:"0"};if(!b.width)b.width=200;if(b.wall)c.wall=b.wall;if(!b.height)b.height=290;var l;j=VK.Widgets._constructor("widget_community.php",a,b,c,{showBox:function(a,c){VK.Util.Box((b.base_domain||"http://vkontakte.ru/")+a,[c.width,c.height],{proxy:function(){rpc.callMethod.apply(rpc,
arguments)}}).show()},startDrag:function(){l=window.document.body.style.cursor;window.document.body.style.cursor="pointer";VK.Util.addEvent("mousemove",g);VK.Util.addEvent("mouseup",e)},stopDrag:function(){window.document.body.style.cursor=l;VK.Util.removeEvent("mousemove",g);VK.Util.removeEvent("mouseup",e)},auth:function(){VK.Auth.login(null,1)}},{minWidth:120,width:"200",height:"290",startHeight:200})[2]},VK.Widgets.Auth=function(a,b){VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");
if(!b.width)b.width=200;type=b.type?1:0;VK.Widgets._constructor("widget_auth.php",a,b,{},{makeAuth:function(a){if(a.session)VK.Auth._loadState="loaded",VK.Auth.setSession(a.session,"connected"),VK.Observer.publish("auth.loginStatus",{session:a.session,status:"connected"}),VK.Observer.unsubscribe("auth.loginStatus");if(b.onAuth)b.onAuth(a);else{var e=b.authUrl?b.authUrl:window.location.href;e+=e.indexOf("?")==-1?"?":"&";var g=[],j;for(j in a)j!="session"&&g.push(j+"="+decodeURIComponent(a[j]));window.location.href=
e+g.join("&")}}},{startHeight:80})},VK.Widgets._constructor=function(a,b,c,e,g,j){var c=c||{},j=j||{},g=g||{},l=c.base_domain||"http://vkontakte.ru",m=document.getElementById(b),n=++VK.Widgets.count,b=c.width=="auto"?m.clientWidth||"100%":parseInt(c.width);c.height?(e.height=c.height,m.height=c.height):m.height=(j.startHeight||200)+"px";b=b?Math.max(j.minWidth||200,Math.min(1E4,b))+"px":"100%";if(!e.url)e.url=c.pageUrl||location.href.replace(/#.*$/,"");a=l+"/"+a+"?app="+(VK._apiId||"0")+"&width="+
b;VK._iframeAppWidget&&(e.iframe_app=1);for(i in e)i=="title"&&e[i].length>80&&(e[i]=e[i].substr(0,80)+"..."),i=="description"&&e[i].length>160&&(e[i]=e[i].substr(0,160)+"..."),l=typeof e[i]=="number"?e[i]:encodeURIComponent(e[i]),a+="&"+i+"="+l;m.style.width=b;VK.Widgets.loading(m,!0);g.publish=VK.Widgets.publish;g.onInit=function(){VK.Widgets.loading(m,!1);if(g.onReady)g.onReady()};g.resize=function(a){m.style.height=a+"px";var b=document.getElementById("vkwidget"+n);if(b)b.style.height=a+"px"};
VK.Widgets.RPC[n]=new fastXDM.Server(g,function(a){if(!a)return!0;a=a.toLowerCase();return a.indexOf(".vkontakte.ru")!=-1||a.indexOf("/vkontakte.ru")!=-1||a.indexOf(".vk.com")!=-1||a.indexOf("/vk.com")!=-1});c=VK.Widgets.RPC[n].append(m,{src:a,width:b,height:j.startHeight||"100%",scrolling:"no",id:"vkwidget"+n,allowTransparency:c.allowTransparency||!1,style:{overflow:"hidden"}});return[m,c,VK.Widgets.RPC[n]]};
VK.Util={getPageData:function(){if(!VK._pData){var a=document.getElementsByTagName("meta"),b={},c=["description","title","url","image","app_id"],e,g;for(g in a)if(a[g].getAttribute&&a[g].getAttribute&&((e=a[g].getAttribute("name"))||(e=a[g].getAttribute("property"))))for(var j in c)if(e==c[j]||e=="og:"+c[j]||e=="vk:"+c[j])b[c[j]]=a[g].content;if(b.app_id&&!VK._apiId)VK._apiId=b.app_id;b.title=b.title||document.title||"";b.description=b.description||"";b.image=b.image||"";if(!b.url&&VK._iframeAppWidget&&
VK._apiId)b.url="/app"+VK._apiId,VK._browserHash&&(b.url+=VK._browserHash);a=location.href.replace(/#.*$/,"");if(!b.url||!b.url.indexOf(a))b.url=a;VK._pData=b}return VK._pData},getXY:function(a){if(a&&a!=void 0){var b=0,c=0;if(a.offsetParent){do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent)}return[b,c]}},Box:function(a,b,c){var c=c||{},e=new fastXDM.Server(VK.extend(c,{onInit:function(){g.style.background="transparent"},hide:function(){g.style.display="none"},destroy:function(){delete e;
try{g.src="about: blank;"}catch(a){}g.parentNode.removeChild(g)},resize:function(a,c){b[0]=a;b[1]=c;VK.Util.ss(g,{width:b[0]+"px",height:b[1]+"px"});j()}},!0)),g=e.append(document.body,{src:a,scrolling:"no",allowTransparency:!0,style:{position:"absolute",left:"50%",zIndex:1002,background:"http://vkontakte.ru/images/upload.gif center center no-repeat transparent",padding:"0",border:"0",width:b[0]+"px",height:b[1]+"px",overflow:"hidden"}}),j=function(a,c){var c=Math.min(1E3,c||(window.innerHeight?window.innerHeight:
document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.offsetHeight)),a=a||Math.max(parseInt(window.pageYOffset)||0,document.documentElement.scrollTop,document.body.scrollTop),e=Math.max(0,a+(c-b[1])/3);VK.Util.ss(g,{top:e+"px",margin:"0 0 0 "+-b[0]/2+"px"})};return{show:function(a,b){j(a,b);g.style.display="block"},hide:function(){g.style.display="none"},iframe:g,rpc:e}},addEvent:function(a,b){window.document.addEventListener?window.document.addEventListener(a,
b,!1):window.document.attachEvent&&window.document.attachEvent("on"+a,b)},removeEvent:function(a,b){window.document.removeEventListener?window.document.removeEventListener(a,b,!1):window.document.detachEvent&&window.document.detachEvent("on"+a,b)},ss:function(a,b){VK.extend(a.style,b,!0)}};window.vkAsyncInit&&setTimeout(vkAsyncInit,0);
