﻿//uCoz alert

window.alert=function(text){_uWnd.alert(text,'',{w:230,h:80,tm:6000})}



//favorite

favorite={add:function(title,url,uid){$('#favSt').html('<img src="/misc/themes/Grey/none.gif" class="ajaxs" title="Добавление..." />');$.get('/board/0-0-'+uid+'-0-17?'+77*Math.random(),function(p){ch=$('span.favorite',p).length;ch2=$('span.favorite',p).text().indexOf(title)}),setTimeout(function(){if(ch>50){favorite.error('Превышен допустимый лимит')}else{if(ch2!==-1){favorite.error('Такая закладка уже существует!')}else{$.get('/board/1-0-0-0-1?'+66*Math.random(),function(i){$.post('/board/1-0-0-0-1',{a:$('input[name="a"]',i).val(),numa:$('input[name="numa"]',i).val(),ssid:$('input[name="ssid"]',i).val(),title:title,brief:url,ocat:1}),favorite.ok()})}}},500)},remote:function(a){eval(('_entrRem('+a.split('entrRem(')[1].split(')')[0]+')').replace('Вы подтверждаете удаление?','Удалить закладку?'))},ok:function(){$('#favSt').html('<img src="/misc/themes/Grey/none.gif" class="favOk" title="Закладка успешно добавлена!" alt="Добавлено">')},error:function(errorText){$('#favSt').html('<img src="/misc/themes/Grey/none.gif" class="favEr" title="'+errorText+'" alt="Ошибка">');alert(errorText)}}



//remote

function _RCremote(c,a,b,d,e){if(!_RCremote[c]&&confirm(d)){_RCremote[c]=1;document.getElementById(c).style="background:url('"+b+"')";_uPostForm("",{url:a,success:alert(e)})}}
