var already;
function none(){return;}
function getvki(r){
if(r.session){
VK.api("getProfiles",{uids:r.session.mid,fields:"photo,hash"},getvkus);
mCss('.tdf','paddingLeft','15px');
}else if(giD('upform'))VK.Widgets.Auth("ulogin", {onAuth:getvki});
}
function getvkus(r){
var vkln=r['response'][0].first_name+" "+r['response'][0].last_name;
if(giD('upform'))giD('upform').author.value=vkln;
giD('helloid').innerHTML=', '+vkln+'!';
giD('uim').src=r['response'][0].photo;
giD('uim').style.display='block';
if(giD('usessid'))giD('usessid').value='vk'+r['response'][0].uid;
}
function adC(n,lc,d,s){jUrlF('_comsave.php?num='+n+'&id='+pid+'&comm='+encodeURIComponent(lc)+'&date='+encodeURIComponent(d)+'&'+Math.random()*999+'&post',none);}
VK.init({apiId: 2017991});
function mCss(myclass, element, value) {var CSSRules;if (document.all){CSSRules = 'rules';}else if (document.getElementById){CSSRules = 'cssRules';}for (var i = 0; i < document.styleSheets[0][CSSRules].length; i++) {if (document.styleSheets[0][CSSRules][i].selectorText == myclass) {document.styleSheets[0][CSSRules][i].style[element] = value;}}}
function locate(a){jUrlF('http://vedruss.info/_regions.php?r='+a,none);}
function pricecheck(a){giD('price').style.background=((a)?"url(/css/shtrih.gif) repeat":"#FFF");giD('price').disabled=((a)?"disabled":"");}
if (screen.width<1280){mCss('.hbody','width','145px');mCss('h3','width','130px');}
function typer(){var hb=giD('locator');giD('helpb').value=hb.value;if(hb.value.length<3)giD('helpb').innerHTML='&nbsp;';if(!already&&hb.value.length>=3){jUrlF('http://vedruss.info/_regions.php?t='+encodeURIComponent(hb.value)+'&'+Math.ceil(Math.random()*999),none);setTimeout('already=false;',500);already=true;}}
function saver(){if (giD('point').value.length<3){alert('Сначала введите название населённого пункта'); return;}a=prompt('Если все параметры вы ввели корректно, тогда укажите название для этого места.\nНапример: \n\nпоселение "Ковчег"\n   или\n клуб "Чистые сердца"\n   и т.д.');if(a){loc='http://vedruss.info/_regions.php?pid='+giD('poselid').value+'&r0='+giD('sub0').value+(giD('reg3')?'&r1='+giD('reg3').value:'')+(giD('reg4')?'&r2='+giD('reg4').value:'')+'&p='+encodeURIComponent(giD('point').value)+'&a='+encodeURIComponent(giD('addr').value)+'&s='+encodeURIComponent(a);jUrlF(loc+'&'+Math.ceil(Math.random()*999),none);}}
