var sendMessPost = {
init: function (a, b) {
$('#messages' + a).hide(function(){
$('#messpost' + a).html('<div id="postmess'+a+'"><div id="ajaxmess'+a+'"></div><textarea id="textarea' + a + '" id="message" rows="5" cols="80"></textarea><br /><input type="button" onclick="sendMessPost.post($(\'#textarea' + a + '\').val(),\'' + b + '\',\'' + a + '\');return false" value="Отправить"> <input type="button" onclick="sendMessPost.close(\''+a+'\');return false" value="Отмена"></div>').fadeIn()
});},post: function (a, b, c) {
$('#ajaxmess' + c).html('<img src="http://src.ucoz.net/img/ma/m/i1.gif" border="0" align="absmiddle" /> Передача данных...').fadeIn();
$.post('/index/',{a: 18,message: a,s: b,subject: ((a.length > 25) ? a.substr(0, 25) + '...': a)},function(d){
var success = $('cmd[p="innerHTML"]', d).text().match(/<font[^<>]*>(.+)<\/font>/i)[1];
$('#ajaxmess' + c).html(success);
if(success.match(/отправлено/)) setTimeout(function(){sendMessPost.close(c)},1000);});
},close: function(a){$('#postmess'+a).hide(function(){$('#messages'+a).show()})}
};

function sendRep(a,b,c,d){
$.get('/index/23-'+a,function(q) {
$.post('/index/', {a: 23,t: 1,s: a,act:c,ref: d,reason: b,ssid: $('input[name="ssid"]', $('cmd[p="content"]', q).text()).val()}, function(u) {
alert($('cmd', u).text().match(/<div class="(.*)">/)[1]=='myWinLoadSD' ? 'Большое вам спасибо, автору будет приятно что он не зря потратил свое драгоценное время.' : 'Ошибка')
});
});
}

