var nowLocal=new Date();var localTime=Math.floor(nowLocal.getTime()/1000);function SyncWithServerTime(b){if(b){var a=Math.floor(localTime-b);document.cookie="e107_tdOffset="+a+"; path=/";document.cookie="e107_tdSetTime="+(localTime-a)+"; path=/"}var d="e107_tzOffset=";var c=nowLocal.getTimezoneOffset();document.cookie=d+c+"; path=/"}var ns6=0;if(document.getElementById&&!document.all){ns6=1}var agtbrw=navigator.userAgent.toLowerCase();var operaaa=(agtbrw.indexOf("opera")!=-1);var head="display:''";var folder="";function expandit(c,b){if(document.getElementById(c)){folder=document.getElementById(c).style}else{if(ns6==1||operaaa==true){folder=c.nextSibling.nextSibling.style}else{folder=document.all[c.sourceIndex+1].style}}if(folder.display=="none"){folder.display=""}else{folder.display="none"}if(b){var a=b.split(",");for(i=0;i<a.length;i++){a[i]=a[i].replace(/^\s*(.*)/,"$1");a[i]=a[i].replace(/(.*?)\s*$/,"$1");if(document.getElementById(a[i])){hidden=document.getElementById(a[i]).style;if(hidden.display==""){hidden.display="none"}}}}}function urljump(a){top.window.location=a}function setInner(b,a){document.getElementById(b).innerHTML=a}function jsconfirm(a){return confirm(a)}function insertext(c,a,b){document.getElementById(a).value=c;if(b){document.getElementById(b).style.display="none"}}function appendtext(c,a,b){document.getElementById(a).value+=c;document.getElementById(a).focus();if(b){document.getElementById(b).style.display="none"}}function open_window(c,b,a){if("full"==b){pwindow=window.open(c)}else{if(b){mywidth=b}else{mywidth=600}if(a){myheight=a}else{myheight=400}pwindow=window.open(c,"Name","top=100,left=100,resizable=yes,width="+mywidth+",height="+myheight+",scrollbars=yes,menubar=yes")}pwindow.focus()}function ejs_preload(a,c){var d=c.split(",");for(ejs_loadall=0;ejs_loadall<d.length;ejs_loadall++){var b=new Image();b.src=a+d[ejs_loadall]}}function textCounter(b,a){a.value=b.value.length}function openwindow(){opener=window.open("htmlarea/index.php","popup","top=50,left=100,resizable=no,width=670,height=520,scrollbars=no,menubar=no");opener.focus()}function setCheckboxes(a,f,c){var e=(typeof(document.forms[a].elements[c])!="undefined")?document.forms[a].elements[c]:document.forms[a].elements[c];if(document.getElementById(a)){if(c){var e=(typeof(document.getElementById(a).elements[c])!="undefined")?document.getElementById(a).elements[c]:document.getElementById(a).elements[c]}else{var e=document.getElementById(a)}}var b=(typeof(e.length)!="undefined")?e.length:0;if(b){for(var d=0;d<b;d++){e[d].checked=f}}else{e.checked=f}return true}var ref=""+escape(top.document.referrer);var colord=window.screen.colorDepth;var res=window.screen.width+"x"+window.screen.height;var eself=document.location;function storeCaret(a){e107_selectedInputArea=a}function addtext(p,e){if(!window.e107_selectedInputArea){return}var m=e107_selectedInputArea;var h=false;var n="";var a="";if(e!=true){var l=p.split("][",2);if(l[0]==p){n=p}else{n=l[0]+"]";a="["+l[1]}}else{n=p}if(document.selection){h=document.selection.createRange().text;m.focus();if(h){document.selection.createRange().text=n+h+a}else{document.selection.createRange().text=n+a}h="";m.blur();m.focus();return}var d=m.scrollTop;var k=m.textLength;var c=m.selectionStart;var o=m.selectionEnd;if(o<=2&&typeof(k)!="undefined"){o=k}var g=(m.value).substring(0,c);var f=(m.value).substring(c,o);var b=(m.value).substring(o,k);var j=c+n.length+f.length+a.length;m.value=g+n+f+a+b;m.focus();m.selectionStart=j;m.selectionEnd=j;m.scrollTop=d;return}function help(b,a){if(a){document.getElementById(a).value=b}else{if(document.getElementById("dataform")){document.getElementById("dataform").helpb.value=b}}}function externalLinks(){if(!document.getElementsByTagName){return}var c=document.getElementsByTagName("a");for(var b=0;b<c.length;b++){var a=c[b];if(a.getAttribute("href")&&a.getAttribute("rel")=="external"){a.target="_blank"}}}function eover(a,b){a.className=b}var e107_dupCounter=1;function duplicateHTML(b,c,g){if(document.getElementById(b)){e107_dupCounter++;var f=document.getElementById(b).nodeName;var e=document.createElement("input");var j=document.createElement("br");e.type="button";e.value="x";e.className="button";e.onclick=function(){this.parentNode.parentNode.removeChild(this.parentNode)};var h=document.getElementById(c);var a=document.getElementById(b).cloneNode(true);var d=document.createElement(f);d.appendChild(a);d.value="";d.appendChild(e);d.appendChild(j);if(g){newid=g+e107_dupCounter;d.innerHTML=d.innerHTML.replace(new RegExp(g,"g"),newid);d.id=newid}h.appendChild(d)}}function preview_image(c,e,b){var a;var d=c+"_prev";a=document.getElementById(c).value;if(a){document.getElementById(d).src=e+a}else{document.getElementById(d).src=b}return};if(navigator.platform=="Win32"&&navigator.appName=="Microsoft Internet Explorer"&&window.attachEvent){window.attachEvent("onload",fnLoadPngs)}function fnLoadPngs(){var b=navigator.appVersion.match(/MSIE (\d+\.\d+)/,"");var g=(b!=null&&Number(b[1])>=5.5&&Number(b[1])<7);for(var d=document.images.length-1,c=null;(c=document.images[d]);d--){if(g&&c.src.match(/\.png$/i)!=null){fnFixPng(c);c.attachEvent("onpropertychange",fnPropertyChanged)}}var a=document.getElementsByTagName("input");for(var d=a.length-1,f=null;(f=a[d]);d--){if(f.type=="image"){if(f.src.match(/\.png$/i)!=null){fnFixPng(f);f.attachEvent("onpropertychange",fnPropertyChanged)}}}}function fnPropertyChanged(){if(window.event.propertyName=="src"){var a=window.event.srcElement;if(!a.src.match(/\/files\/sleight_img\.gif$/i)){a.filters.item(0).src=a.src;a.src="/files/sleight_img.gif"}}}function fnFixPng(a){var b=a.src;a.style.width=a.width+"px";a.style.height=a.height+"px";a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='scale')";a.src="/files/sleight_img.gif"};
	(function(l){if(l.fastXDM){return}var c={};var d=[];var f={};function a(){var m="";for(i=0;i<5;i++){m+=Math.ceil(Math.random()*15).toString(16)}return m}function e(p,q,o,m,n){if(p[q]){o.apply(m)}else{n=n||0;if(n<1000){setTimeout(function(){e(p,q,o,m,n+1)},0)}}}function g(m){setTimeout(function(){var n=document.createElement("script");n.type="text/javascript";n.src=m||l.fastXDM.helperUrl;e(document,"body",function(){document.getElementsByTagName("HEAD")[0].appendChild(n)})},0)}function b(n,m){if(f.loaded){n.apply(m,[f])}else{d.push([m,n])}}function k(){f.loaded=true;var m=d.length;while(m--){d[m][1].apply(d[m][0],[f])}}function j(n,m){b(function(p){var r=p.json.parse(n);if(r[0]){if(!r[1]){r[1]=[]}var o=r[1].length;while(o--){if(r[1][o]._func){var q=r[1][o]._func;r[1][o]=function(){var s=Array.prototype.slice.call(arguments);s.unshift("_func"+q);m.callMethod.apply(m,s)}}}setTimeout(function(){if(!m.methods[r[0]]){throw Error("fastXDM: Method "+r[0]+" is undefined")}m.methods[r[0]].apply(m,r[1])},0)}})}l.fastXDM={_id:0,helperUrl:"http://userapi.com/js/api/xdmHelper.js",Server:function(m,n){this.methods=m||{};this.id=l.fastXDM._id++;this.filter=n;this.key=a();this.methods["%init%"]=this.methods.__fxdm_i=function(){l.fastXDM.run(this.id);if(this.methods.onInit){this.methods.onInit()}};this.frameName="fXD"+this.key;this.server=true;c[this.key]=[j,this]},Client:function(m){this.methods=m||{};this.id=l.fastXDM._id++;l.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;c[this.key]=[j,this];this.client=true;l.fastXDM.on("helper",function(){l.fastXDM.onClientStart(this)},this);b(function(o){o.send(this,o.json.stringify(["%init%"]));var n=this.methods;setTimeout(function(){if(n.onInit){n.onInit()}},0)},this)},onMessage:function(o){if(!o.data){return false}var n=o.data.substr(0,5);if(c[n]){var m=c[n][1];if(m&&(!m.filter||m.filter(o.origin))){c[n][0](o.data.substr(6),m)}}},setJSON:function(m){f.json=m},getJSON:function(m){if(!m){return f.json}b(function(n){m(n.json)})},setEnv:function(m){for(i in m){f[i]=m[i]}k()},_q:{},on:function(o,m,n){if(!this._q[o]){this._q[o]=[]}if(this._q[o]==-1){m.apply(n)}else{this._q[o].push([m,n])}},run:function(o){var m=(this._q[o]||[]).length;if(this._q[o]&&m>0){for(var n=0;n<m;n++){this._q[o][n][0].apply(this._q[o][n][1])}}this._q[o]=-1},waitFor:e};l.fastXDM.Server.prototype.start=function(o,n){if(o.contentWindow){this.caller=o.contentWindow;this.frame=o;l.fastXDM.on("helper",function(){l.fastXDM.onServerStart(this)},this)}else{var m=this;n=n||0;if(n<50){setTimeout(function(){m.start.apply(m,[o,n+1])},100)}}};function h(o,n){for(var m in n){if(o[m]&&typeof(o[m])=="object"){h(o[m],n[m])}else{o[m]=n[m]}}}l.fastXDM.Server.prototype.append=function(o,n){var q=document.createElement("DIV");q.innerHTML='<iframe name="'+this.frameName+'" />';var p=q.firstChild;var m=this;setTimeout(function(){p.frameBorder="0";if(n){h(p,n)}o.insertBefore(p,o.firstChild);m.start(p)},0);return p};l.fastXDM.Client.prototype.callMethod=l.fastXDM.Server.prototype.callMethod=function(){var m=Array.prototype.slice.call(arguments);var q=m.shift();var n=m.length;while(n--){if(typeof(m[n])=="function"){this.funcsCount=(this.funcsCount||0)+1;var o=m[n];var p="_func"+this.funcsCount;this.methods[p]=function(){o.apply(this,arguments);delete this.methods[p]};m[n]={_func:this.funcsCount}}}e(this,"caller",function(){l.fastXDM.on(this.id,function(){b(function(r){r.send(this,r.json.stringify([q,m]))},this)},this)},this)};if(l.JSON&&typeof(l.JSON)=="object"&&l.JSON.parse&&l.JSON.stringify&&l.JSON.stringify({a:[1,2,3]}).replace(/ /g,"")=='{"a":[1,2,3]}'){f.json={parse:l.JSON.parse,stringify:l.JSON.stringify}}else{l.fastXDM._needJSON=true}if(l.postMessage){f.protocol="p";f.send=function(m,n){m.caller.postMessage(m.key+":"+n,"*")};if(l.addEventListener){l.addEventListener("message",l.fastXDM.onMessage,false)}else{l.attachEvent("onmessage",l.fastXDM.onMessage)}if(l.fastXDM._needJSON){l.fastXDM._onlyJSON=true;g()}else{k()}}else{g()}})(window);if(!window.VK){window.VK={}}if(!VK.MD5){VK.MD5=function(o){var s=function(d,a){var b=(d&65535)+(a&65535),c=(d>>16)+(a>>16)+(b>>16);return(c<<16)|(b&65535)},v=function(b,a){return(b<<a)|(b>>>(32-a))},r=function(a,d,e,f,b,c){return s(v(s(s(d,a),s(f,c)),b),e)},B=function(e,f,a,b,g,c,d){return r((f&a)|((~f)&b),e,f,g,c,d)},u=function(e,f,a,b,g,c,d){return r((f&b)|(a&(~b)),e,f,g,c,d)},z=function(e,f,a,b,g,c,d){return r(f^a^b,e,f,g,c,d)},p=function(e,f,a,b,g,c,d){return r(a^(f|(~b)),e,f,g,c,d)},A=function(e,k){var f=1732584193,g=-271733879,h=-1732584194,j=271733878,a,b,c,d;e[k>>5]|=128<<((k)%32);e[(((k+64)>>>9)<<4)+14]=k;for(var l=0,m=e.length;l<m;l+=16){a=f;b=g;c=h;d=j;f=B(f,g,h,j,e[l+0],7,-680876936);j=B(j,f,g,h,e[l+1],12,-389564586);h=B(h,j,f,g,e[l+2],17,606105819);g=B(g,h,j,f,e[l+3],22,-1044525330);f=B(f,g,h,j,e[l+4],7,-176418897);j=B(j,f,g,h,e[l+5],12,1200080426);h=B(h,j,f,g,e[l+6],17,-1473231341);g=B(g,h,j,f,e[l+7],22,-45705983);f=B(f,g,h,j,e[l+8],7,1770035416);j=B(j,f,g,h,e[l+9],12,-1958414417);h=B(h,j,f,g,e[l+10],17,-42063);g=B(g,h,j,f,e[l+11],22,-1990404162);f=B(f,g,h,j,e[l+12],7,1804603682);j=B(j,f,g,h,e[l+13],12,-40341101);h=B(h,j,f,g,e[l+14],17,-1502002290);g=B(g,h,j,f,e[l+15],22,1236535329);f=u(f,g,h,j,e[l+1],5,-165796510);j=u(j,f,g,h,e[l+6],9,-1069501632);h=u(h,j,f,g,e[l+11],14,643717713);g=u(g,h,j,f,e[l+0],20,-373897302);f=u(f,g,h,j,e[l+5],5,-701558691);j=u(j,f,g,h,e[l+10],9,38016083);h=u(h,j,f,g,e[l+15],14,-660478335);g=u(g,h,j,f,e[l+4],20,-405537848);f=u(f,g,h,j,e[l+9],5,568446438);j=u(j,f,g,h,e[l+14],9,-1019803690);h=u(h,j,f,g,e[l+3],14,-187363961);g=u(g,h,j,f,e[l+8],20,1163531501);f=u(f,g,h,j,e[l+13],5,-1444681467);j=u(j,f,g,h,e[l+2],9,-51403784);h=u(h,j,f,g,e[l+7],14,1735328473);g=u(g,h,j,f,e[l+12],20,-1926607734);f=z(f,g,h,j,e[l+5],4,-378558);j=z(j,f,g,h,e[l+8],11,-2022574463);h=z(h,j,f,g,e[l+11],16,1839030562);g=z(g,h,j,f,e[l+14],23,-35309556);f=z(f,g,h,j,e[l+1],4,-1530992060);j=z(j,f,g,h,e[l+4],11,1272893353);h=z(h,j,f,g,e[l+7],16,-155497632);g=z(g,h,j,f,e[l+10],23,-1094730640);f=z(f,g,h,j,e[l+13],4,681279174);j=z(j,f,g,h,e[l+0],11,-358537222);h=z(h,j,f,g,e[l+3],16,-722521979);g=z(g,h,j,f,e[l+6],23,76029189);f=z(f,g,h,j,e[l+9],4,-640364487);j=z(j,f,g,h,e[l+12],11,-421815835);h=z(h,j,f,g,e[l+15],16,530742520);g=z(g,h,j,f,e[l+2],23,-995338651);f=p(f,g,h,j,e[l+0],6,-198630844);j=p(j,f,g,h,e[l+7],10,1126891415);h=p(h,j,f,g,e[l+14],15,-1416354905);g=p(g,h,j,f,e[l+5],21,-57434055);f=p(f,g,h,j,e[l+12],6,1700485571);j=p(j,f,g,h,e[l+3],10,-1894986606);h=p(h,j,f,g,e[l+10],15,-1051523);g=p(g,h,j,f,e[l+1],21,-2054922799);f=p(f,g,h,j,e[l+8],6,1873313359);j=p(j,f,g,h,e[l+15],10,-30611744);h=p(h,j,f,g,e[l+6],15,-1560198380);g=p(g,h,j,f,e[l+13],21,1309151649);f=p(f,g,h,j,e[l+4],6,-145523070);j=p(j,f,g,h,e[l+11],10,-1120210379);h=p(h,j,f,g,e[l+2],15,718787259);g=p(g,h,j,f,e[l+9],21,-343485551);f=s(f,a);g=s(g,b);h=s(h,c);j=s(j,d)}return[f,g,h,j]},w=function(c){var d="",b=-1,e=c.length,f,a;while(++b<e){f=c.charCodeAt(b);a=b+1<e?c.charCodeAt(b+1):0;if(55296<=f&&f<=56319&&56320<=a&&a<=57343){f=65536+((f&1023)<<10)+(a&1023);b++}if(f<=127){d+=String.fromCharCode(f)}else{if(f<=2047){d+=String.fromCharCode(192|((f>>>6)&31),128|(f&63))}else{if(f<=65535){d+=String.fromCharCode(224|((f>>>12)&15),128|((f>>>6)&63),128|(f&63))}else{if(f<=2097151){d+=String.fromCharCode(240|((f>>>18)&7),128|((f>>>12)&63),128|((f>>>6)&63),128|(f&63))}}}}}return d},x=function(c){var d=Array(c.length>>2),a,b;for(a=0,b=d.length;a<b;a++){d[a]=0}for(a=0,b=c.length*8;a<b;a+=8){d[a>>5]|=(c.charCodeAt(a/8)&255)<<(a%32)}return d},q=function(c){var d="";for(var a=0,b=c.length*32;a<b;a+=8){d+=String.fromCharCode((c[a>>5]>>>(a%32))&255)}return d},y=function(a){return q(A(x(a),a.length*8))},t=function(d){var a="0123456789abcdef",e="",f;for(var b=0,c=d.length;b<c;b++){f=d.charCodeAt(b);e+=a.charAt((f>>>4)&15)+a.charAt(f&15)}return e};return t(y(w(o)))}}VK.extend=function(d,c,a){for(var b in c){if(a||typeof d[b]==="undefined"){d[b]=c[b]}}return d};if(!VK.xdConnectionCallbacks){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:false,access:{FRIENDS:2,PHOTOS:4,AUDIO:8,VIDEO:16,MATCHES:32,QUESTIONS:64,WIKI:128}},true);VK.init=function(c){var a,b;if(!c.apiId){throw"VK.init() called without an apiId"}VK._apiId=c.apiId;if(c.vk){VK._domain.main="http://vk.com/"}if(c.onlyWidgets){return true}if(c.nameTransportPath&&c.nameTransportPath!=""){VK._nameTransportPath=c.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";var d=VK.Cookie.load();if(d){VK.Auth._loadState="loaded";VK.Auth.setSession(d,d?"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(d,b,c){var a;a="vk_app_"+VK._apiId+"="+d+"";a+=(d&&b==0?"":"; expires="+new Date(b*1000).toGMTString());a+="; path=/";a+=(c?"; domain=."+c:"");document.cookie=a;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(c){var b=[],a;for(a in c){if(a!="user"){b.push(encodeURIComponent(a)+"="+encodeURIComponent(c[a]))}}b.sort();return b.join("&")},decode:function(e){var d={},b=e.split("&"),a,c;for(a=0;a<b.length;a++){c=b[a].split("=",2);if(c&&c[0]){d[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}}return d}}}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=true}return VK.Api.isIE6_7},attachScript:function(b){if(!VK.Api._headId){VK.Api._headId=document.getElementsByTagName("head")[0]}var a=document.createElement("script");a.type="text/javascript";a.setAttribute("encoding","UTF-8");a.src=b;VK.Api._headId.appendChild(a)},checkMethod:function(h,g,b,c){var a=h.toLowerCase();if(a=="wall.post"||a=="activity.set"){var f=(a=="activity.set")?g.text:g.message;var e="http://vkontakte.ru/apps.php?act=a_prepare_post&widget=1&aid="+parseInt(VK._apiId)+"&text="+encodeURIComponent(f);if(a=="wall.post"){e+="&owner_id="+parseInt(g.owner_id||0)+"&attachment="+(g.attachment||"")}var d=VK.Util.Box(e,[460,220],{proxy:function(k,j){if(j){b({error:j})}else{g.method_access=k;VK.Api.call(h,g,b,c)}}});d.show();return false}return true},call:function(a,f,e,b){var j=f||{},k,g;if(typeof j!="object"||typeof e!="function"){return false}if(!f.method_access&&!f.method_force&&!VK.Api.checkMethod(a,f,e,b)){return}if(!b){b=0}if(VK.Auth._loadState!="loaded"){var d=function(l){if(l&&l.session){VK.Observer.unsubscribe("auth.loginStatus",d);VK.Api.call(a,f,e)}};VK.Observer.subscribe("auth.loginStatus",d);VK.Auth.getLoginStatus();return}VK.extend(j,{api_id:VK._apiId,v:"3.0",format:"JSON",method:a},true);if(VK.Api.queryLength(j)<1500&&!VK.Api.ie6_7()){var h=false;var c=parseInt(Math.random()*10000000);while(VK.Api._callbacks[c]){c=parseInt(Math.random()*10000000)}j.callback="VK.Api._callbacks["+c+"]"}else{var h=true}VK.extend(j,{sig:this.sign(j),sid:VK._session?VK._session.sid:""},true);k=VK.Cookie.encode(j);g=function(m){if(m.error&&(m.error.error_code==3||m.error.error_code==4||m.error.error_code==5)){if(b>3){return false}var l=function(n){VK.Observer.unsubscribe("auth.sessionChange",l);delete f.sid;delete f.sig;if(n.session){VK.Api.call(a,f,e,b+1)}};VK.Observer.subscribe("auth.sessionChange",l);VK.Auth.getLoginStatus()}else{e(m)}if(!h){delete VK.Api._callbacks[c]}};if(h){if(VK.xdReady){VK.XDM.remote.callMethod("apiCall",k,g)}else{VK.Observer.subscribe("xdm.init",function(){VK.XDM.remote.callMethod("apiCall",k,g)});VK.XDM.init()}}else{VK.Api._callbacks[c]=g;VK.Api.attachScript(VK._domain.api+VK._domain.apiPath+"?"+k)}},sign:function(d){var b,c=[],a;for(b in d){c.push(b.toString())}c.sort();a=VK._session?VK._session.mid:0;for(b=0;b<c.length;b++){a+=c[b]+"="+d[c[b]]}a+=VK._session?VK._session.secret:"";return VK.MD5(a)},queryLength:function(b){var a=100;for(i in b){a+=i.length+encodeURIComponent(b.i).length+1}return a}};VK.api=function(c,b,a){VK.Api.call(c,b,a)}}if(!VK.Auth){VK.Auth={popup:null,lsCb:{},setSession:function(f,c,a){var h=!VK._session&&f,j=VK._session&&!f,g=VK._session&&f&&VK._session.mid!=f.mid,d=h||j||(VK._session&&f&&VK._session.sid!=f.sid),e=c!=VK._userStatus,b={session:f,status:c,settings:a};VK._session=f;VK._userStatus=c;VK.Cookie.set(f);if(d||e||g){setTimeout(function(){if(e){VK.Observer.publish("auth.statusChange",b)}if(j||g){VK.Observer.publish("auth.logout",b)}if(h||g){if(VK.xdReady){VK.XDM.remote.init(VK._apiId,f,c)}VK.Observer.publish("auth.login",b)}if(d){VK.Observer.publish("auth.sessionChange",b)}},0)}return b},login:function(a,d){var e,b;if(!VK._apiId){return false}e=window.location.protocol+"//"+window.location.hostname;b=VK._domain.main+VK._path.login+"?app="+VK._apiId+"&layout=openapi";if(d&&parseInt(d)>0){b+="&settings="+d}VK.Observer.unsubscribe("auth.onLogin");VK.Observer.subscribe("auth.onLogin",a);VK.UI.popup({width:554,height:287,url:b});var f=function(){VK.Auth.getLoginStatus(function(g){VK.Observer.publish("auth.onLogin",g);VK.Observer.unsubscribe("auth.onLogin")},true)};VK.UI.popupOpened=true;var c=function(){if(!VK.UI.popupOpened){return false}try{if(!VK.UI.active.top){VK.UI.popupOpened=false;f();return true}}catch(g){VK.UI.popupOpened=false;f();return true}setTimeout(c,100)};setTimeout(c,100)},logout:function(a){if(!VK._session||!VK._session.sid){a();return true}VK.Auth._logoutCb=function(b){if(b==2){VK.Auth.setSession(null,"unknown");VK.Auth.getLoginStatus(function(c){if(c.session){VK.Auth.logout(a)}},true)}else{a()}};VK.Api.attachScript(VK._domain.main+"logout.php?openapi=1&app="+parseInt(VK._apiId)+"&mid="+VK._session.mid+"&sid="+VK._session.sid+"&rnd="+parseInt(Math.random()*10000));VK.Auth.setSession(null,"unknown");VK.Cookie.clear()},revokeGrants:function(a){var b=function(c){VK.Observer.unsubscribe("auth.statusChange",b);if(a){a(c)}};VK.Observer.subscribe("auth.statusChange",b);if(VK._session&&VK._session.sid){VK.Api.attachScript("http://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,c){if(!VK._apiId){return}if(a){if(!c&&VK.Auth._loadState=="loaded"){a({status:VK._userStatus,session:VK._session});return}else{VK.Observer.subscribe("auth.loginStatus",a)}}if(!c&&VK.Auth._loadState=="loading"){return}VK.Auth._loadState="loading";var b=parseInt(Math.random()*10000000);while(VK.Auth.lsCb[b]){b=parseInt(Math.random()*10000000)}VK.Auth.lsCb[b]=function(e){VK.Auth._loadState="loaded";if(e&&e.auth){var f={mid:e.user.id,sid:e.sid,secret:e.secret,expire:e.expire,sig:e.sig};if(c){f.user=e.user}var d="connected"}else{var f=null;var d="unknown"}VK.Auth.setSession(f,d);VK.Observer.publish("auth.loginStatus",{session:f,status:d});VK.Observer.unsubscribe("auth.loginStatus")};VK.Api.attachScript("http://login.vk.com/?act=openapi&aid="+parseInt(VK._apiId)+"&location="+encodeURIComponent(window.location.hostname)+"&rnd="+b)}}}}else{setTimeout(function(){var a;while(a=VK.xdConnectionCallbacks.pop()){a()}},0);VK.Widgets=false}if(!VK.UI){VK.UI={active:null,_buttons:[],popup:function(k){var e=typeof window.screenX!="undefined"?window.screenX:window.screenLeft,c=typeof window.screenY!="undefined"?window.screenY:window.screenTop,j=typeof window.outerWidth!="undefined"?window.outerWidth:document.body.clientWidth,g=typeof window.outerHeight!="undefined"?window.outerHeight:(document.body.clientHeight-22),a=k.width,h=k.height,d=parseInt(e+((j-a)/2),10),f=parseInt(c+((g-h)/2.5),10),b=("width="+a+",height="+h+",left="+d+",top="+f);this.active=window.open(k.url,"vk_openapi",b)},button:function(c,b){var a="";if(typeof c=="string"){c=document.getElementById(c)}this._buttons.push(c);index=this._buttons.length-1;a=('<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>');c.innerHTML=a;c.style.width=c.childNodes[0].offsetWidth+"px"},_change:function(e,b){var f=document.getElementById("openapi_UI_"+b).rows[0];var a=[f.cells[1].firstChild.firstChild,f.cells[3].firstChild.firstChild];for(var c=0;c<2;++c){var d=a[c];if(e==0){d.style.backgroundColor="#6D8FB3";d.style.borderTopColor="#7E9CBC";d.style.borderLeftColor=d.style.borderRightColor=d.style.borderBottomColor="#5C82AB"}else{if(e==1){d.style.backgroundColor="#84A1BF";d.style.borderTopColor="#92ACC7";d.style.borderLeftColor=d.style.borderRightColor=d.style.borderBottomColor="#7293B7"}else{if(e==2){d.style.backgroundColor="#6688AD";d.style.borderBottomColor="#7495B8";d.style.borderLeftColor=d.style.borderRightColor=d.style.borderTopColor="#51779F"}}}}var a=[f.cells[0].firstChild,f.cells[4].firstChild];for(var c=0;c<2;++c){var d=a[c];if(d){if(e==0){d.style.backgroundPosition="-21px -"+(42+c*21)+"px"}else{if(e==1){d.style.backgroundPosition="-23px -"+(42+c*21)+"px"}else{if(e==2){d.style.backgroundPosition="-25px -"+(42+c*21)+"px"}}}}}if(e==0||e==2){f.cells[2].firstChild.style.backgroundPosition="0px -42px"}else{if(e==1){f.cells[2].firstChild.style.backgroundPosition="0px -63px"}}}}}if(!VK.XDM){VK.XDM={remote:null,init:function(){if(this.remote){return false}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=true;VK.Observer.publish("xdm.init")},setSession:{isVoid:true,method:function(c,b){VK.Auth.setSession(c,b)}},alert:{isVoid:true,method:function(b){alert(b)}}});this.remote.append(document.getElementById(VK._rootId),{src:a})},xdHandler:function(code){try{eval("VK."+code)}catch(e){}}}}if(!VK.Observer){VK.Observer={_subscribers:function(){if(!this._subscribersMap){this._subscribersMap={}}return this._subscribersMap},publish:function(a){var c=Array.prototype.slice.call(arguments),a=c.shift(),e=this._subscribers()[a],d,b;if(!e){return}for(d=0,b=e.length;d<b;d++){if(e[d]!=null){e[d].apply(this,c)}}},subscribe:function(a,b){var c=this._subscribers();if(typeof b!="function"){return false}if(!c[a]){c[a]=[b]}else{c[a].push(b)}},unsubscribe:function(a,d){var e=this._subscribers()[a],c,b;if(!e){return false}if(typeof d=="function"){for(c=0,b=e.length;c<b;c++){if(e[c]==d){e[c]=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(b,a){b.style.background=a?'url("http://vk.com/images/upload.gif") center center no-repeat transparent':"none"};VK.Widgets.Comments=function(c,a,f){var e=VK.Util.getPageData();if(!VK._apiId){throw Error("VK not initialized. Please use VK.init")}a=a||{};var h={limit:a.limit||10,page:f||0,status_publish:a.autoPublish===undefined?1:a.autoPublish,attach:a.attach===undefined?"*":(a.attach?a.attach:""),url:a.pageUrl||e.url,title:a.pageTitle||e.title,description:a.pageDescription||e.description};var b=VK.Widgets._constructor("widget_comments.php",c,a,h,{showBox:function(j,k){var l=VK.Util.Box((a.base_domain||"http://vkontakte.ru/")+j,[k.width,k.height],{proxy:function(){g.callMethod.apply(g,arguments)}});l.show()},commentsNum:a.onNumberUpdate||function(){},onChange:a.onChange||function(){}},{startHeight:"133px",minWidth:300,width:"100%"}),d=b[1],g=b[2]};VK.Widgets.Like=function(k,c,g){var j=VK.Util.getPageData();if(!VK._apiId){throw Error("VK not initialized. Please use VK.init")}c=VK.extend(c||{},{allowTransparency:true});if(c.type=="button"||c.type=="vertical"||c.type=="mini"){delete c.width}var d=(c.type=="full"||c.type=="button"||c.type=="vertical"||c.type=="mini")?c.type:"full",o=d=="full"?Math.max(200,c.width||350):(d=="button"?180:(d=="mini"?100:41)),n=d=="vertical"?51:(d=="full"?23:22),r={page:g||0,url:c.pageUrl||j.url,type:d,verb:c.verb==1?1:0,title:c.pageTitle||j.title,description:c.pageDescription||j.description},a=c.ttHere||false,t=VK.Widgets._constructor("widget_like.php",k,c,r,{initTooltip:function(v){s=new fastXDM.Server({onInit:v?function(){b(true)}:function(){},proxy:function(){m.callMethod.apply(m,arguments)},statsBox:function(w){h(true);f=VK.Util.Box(q.src+"&act=a_stats_box",[498,442]);f.show()}});e=s.append(a?l:document.body,{src:q.src+"&act=a_share_tooltip",scrolling:"no",allowTransparency:true,id:q.id+"_tt",style:{position:"absolute",padding:0,display:"block",visibility:"hidden",border:"0",width:"206px",height:"127px",zIndex:5000,overflow:"hidden"}});l.onmouseover=e.onmouseover=function(){p=true};l.onmouseout=e.onmouseout=function(){clearTimeout(u);p=false;u=setTimeout(function(){h()},200)}},showTooltip:b,hideTooltip:h,proxy:function(){if(s){s.callMethod.apply(s,arguments)}},onChange:c.onChange||function(){}},{startHeight:n+"px",minWidth:o}),e,s,p=false,u,f,l=t[0],q=t[1],m=t[2];VK.Util.ss(l,{height:n+"px",width:o+"px",position:"relative",clear:"both"});VK.Util.ss(q,{height:n+"px",width:o+"px",overflow:"hidden",zIndex:150});function b(x){if((!p&&!x)||!s){return}if(!e||!s||e.style.display!="none"&&e.style.visibility!="hidden"){return}var y=c.getScrollTop?c.getScrollTop():(document.body.scrollTop||document.documentElement.scrollTop||0),w=VK.Util.getXY(l),v=a?0:w[1];if(y>w[1]-120&&c.tooltipPos!="top"||d=="vertical"||c.tooltipPos=="bottom"){e.style.top=(v+n+2)+"px";s.callMethod("show",false)}else{e.style.top=(v-125)+"px";s.callMethod("show",true)}VK.Util.ss(e,{left:((a?0:w[0])-(d=="vertical"||d=="mini"?36:2))+"px",display:"block",visibility:"visible"});p=true}function h(v){if((p&&!v)||!s){return}s.callMethod("hide");m.callMethod("hide");setTimeout(function(){e.style.display="none"},400)}};VK.Widgets.Poll=function(b,a,e){var c=VK.Util.getPageData();if(!VK._apiId){throw Error("VK not initialized. Please use VK.init")}if(!e){throw Error("No poll id passed")}a=a||{};var d={poll_id:e,url:a.pageUrl||c.url||location.href,title:a.pageTitle||c.title,description:a.pageDescription||c.description};VK.Widgets._constructor("widget_poll.php",b,a,d,{},{startHeight:"133px",minWidth:300,width:"100%"})};VK.Widgets.Donate=function(b,a,d){if(!d){throw Error("No merchant_id passed")}var c={merchant_id:d,mode:(a.mode)?"1":"0",users:(a.users)?"1":"0",test_mode:(a.test_mode)?"1":"0",text:(a.text)?"1":"0"};if(!a.width){a.width=200}VK.Widgets._constructor("widget_donate.php",b,a,c,{},{minWidth:200,width:"200",startHeight:80})};VK.Widgets.Group=function(b,a,c){c=parseInt(c);if(!c){throw Error("No group_id passed")}var d={gid:c,mode:(a.mode)?"1":"0"};if(!a.width){a.width=200}if(!a.height){a.height=290}VK.Widgets._constructor("widget_groups.php",b,a,d,{auth:function(){VK.Auth.login(null,1)}},{minWidth:200,width:"200",height:"290",startHeight:200})};VK.Widgets.Auth=function(b,a){var c=VK.Util.getPageData();if(!VK._apiId){throw Error("VK not initialized. Please use VK.init")}if(!a.width){a.width=200}if(a.type){type=1}else{type=0}VK.Widgets._constructor("widget_auth.php",b,a,{},{makeAuth:function(f){if(f.session){VK.Auth._loadState="loaded";VK.Auth.setSession(f.session,"connected");VK.Observer.publish("auth.loginStatus",{session:f.session,status:"connected"});VK.Observer.unsubscribe("auth.loginStatus")}if(a.onAuth){a.onAuth(f)}else{if(a.authUrl){var d=a.authUrl}else{var d=window.location.href}if(d.indexOf("?")==-1){d+="?"}else{d+="&"}var g=[];for(var e in f){if(e!="session"){g.push(e+"="+decodeURIComponent(f[e]))}}window.location.href=d+g.join("&")}}},{startHeight:80})};VK.Widgets._constructor=function(k,b,o,e,c,f){o=o||{};f=f||{};c=c||{};var m=o.base_domain||"http://vkontakte.ru";var l=++VK.Widgets.count;var d=parseInt(o.width);var j=document.getElementById(b),h;if(o.height){e.height=o.height;j.height=o.height}else{j.height=(f.startHeight||200)+"px"}d=d?(Math.max(f.minWidth||200,Math.min(10000,d))+"px"):"100%";if(!e.url){e.url=o.pageUrl||location.href.replace(/#.*$/,"")}var a=m+"/"+k+"?app="+(VK._apiId||"0")+"&width="+d;if(VK._iframeAppWidget){e.iframe_app=1}for(i in e){if(i=="title"&&e[i].length>80){e[i]=e[i].substr(0,80)+"..."}if(i=="description"&&e[i].length>160){e[i]=e[i].substr(0,160)+"..."}if(typeof(e[i])=="number"){var n=e[i]}else{var n=encodeURIComponent(e[i])}a+="&"+i+"="+n}j.style.width=d;VK.Widgets.loading(j,true);c.publish=VK.Widgets.publish;c.onInit=function(){VK.Widgets.loading(j,false);if(c.onReady){c.onReady()}};c.resize=function(r,p){j.style.height=r+"px";var q=document.getElementById("vkwidget"+l);if(q){q.style.height=r+"px"}};VK.Widgets.RPC[l]=new fastXDM.Server(c,function(p){if(!p){return true}p=p.toLowerCase();return(p.indexOf(".vkontakte.ru")!=-1||p.indexOf("/vkontakte.ru")!=-1||p.indexOf(".vk.com")!=-1||p.indexOf("/vk.com")!=-1)});var g=VK.Widgets.RPC[l].append(j,{src:a,width:d,height:f.startHeight||"100%",scrolling:"no",id:"vkwidget"+l,allowTransparency:o.allowTransparency||false,style:{overflow:"hidden"}});return[j,g,VK.Widgets.RPC[l]]}}VK.Util={getPageData:function(){if(!VK._pData){var f=document.getElementsByTagName("meta"),c={},d=["image","description","title","url","image","app_id"],e;for(var b in f){if(!f[b].getAttribute){continue}if(f[b].getAttribute&&((e=f[b].getAttribute("name"))||(e=f[b].getAttribute("property")))){for(var a in d){if(e==d[a]||e=="og:"+d[a]||e=="vk:"+d[a]){c[d[a]]=f[b].content}}}}if(c.app_id&&!VK._apiId){VK._apiId=c.app_id}c.title=c.title||document.title||"";c.description=c.description||"";if(!c.url&&VK._iframeAppWidget&&VK._apiId){c.url="/app"+VK._apiId;if(VK._browserHash){c.url+=VK._browserHash}}c.url=c.url||location.href.replace(/#.*$/,"");VK._pData=c}return VK._pData},getXY:function(c){if(!c||c==undefined){return}var b=0,a=0;if(c.offsetParent){do{b+=c.offsetLeft;a+=c.offsetTop}while(c=c.offsetParent)}return[b,a]},Box:function(g,d,f,a){f=f||{};var e=new fastXDM.Server(VK.extend(f,{onInit:function(){b.style.background="transparent"},hide:function(){b.style.display="none"},destroy:function(){delete e;try{b.src="about: blank;"}catch(h){}b.parentNode.removeChild(b)},resize:function(j,k){d[0]=j;d[1]=k;VK.Util.ss(b,{width:d[0]+"px",height:d[1]+"px"});c()}},true)),b=e.append(document.body,{src:g,scrolling:"no",allowTransparency:true,style:{position:"absolute",left:"50%",zIndex:1002,background:"http://vkontakte.ru/images/upload.gif center center no-repeat transparent",padding:"0",border:"0",width:d[0]+"px",height:d[1]+"px",overflow:"hidden"}}),c=function(k,h){h=Math.min(1000,h||(window.innerHeight?window.innerHeight:(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.offsetHeight)));k=k||Math.max(parseInt(window.pageYOffset)||0,document.documentElement.scrollTop,document.body.scrollTop);var j=Math.max(0,k+(h-d[1])/3);VK.Util.ss(b,{top:j+"px",margin:"0 0 0 "+(-d[0]/2)+"px"})};return{show:function(j,h){c(j,h);b.style.display="block"},hide:function(){b.style.display="none"},iframe:b,rpc:e}},ss:function(a,b){VK.extend(a.style,b,true)}};if(window.vkAsyncInit){setTimeout(vkAsyncInit,0)};
