$(document).ready(function(){
$("select[name='modopt']").before("<input type='button' value='Тему в архив' onclick='OptTheme(2)'> ");
});

function OpenOptTheme () 
{new _uWnd('optTheme', 'Опции модератора', 198, 180, {align: 'left', autosize: true, fadespeed: 510, fadeclosespeed: 250}, '<br><center><input type="button" value="В Архив" onclick="OptTheme(2)"></center>');}; 
function FidTid () {return location.href.split('/')[4].split('-')[0]+'-'+location.href.split('/')[4].split('-')[1];}; function IconWnd (s) {return 'http://ujs.3dn.ru/i/1/'+s+'.png';}; 
function OptTheme (a) { if ( a == 1 ) {_uWnd.reload('optTheme','<br><center>Закрываем тему...</center>'); _uWnd.setTitle('optTheme','Закрываем тему'); $.get('/forum/' + FidTid() + '-0-22-1', function(){_uWnd.reload('optTheme','<br><center>Тема закрыта</center>'); _uWnd.setTitle('optTheme','Тема закрыта'); setTimeout(function(){ _uWnd.close("optTheme"); } , 1200);});}; 
if ( a == 2 ) {new _uWnd('moveTheme', 'В архив', 500, 300, {autosize: 1,  oncontent:function(){$("#reasonMoveThm").focus()}}, '<fieldset><legend>Причина перемещения темы в архив</legend><textarea rows="10" style="width:100%" id="reasonMoveThm"></textarea></fieldset><center><input type="button" value="Переместить в архив" id="clickMoveThm" onclick="moveTheme()"></center>'); }}; 
function moveTheme () {$("#clickMoveThm").attr({value: "Подождите...", disabled: 1 }); $("#reasonMoveThm").attr("disabled", 1); var thisForum = $(".forumNamesBar .forumBar:eq(2)").html(); var thisFhref = $(".forumNamesBar .forumBar:eq(2)").attr("href"); var a = $("#reasonMoveThm").val() ? 
$("#reasonMoveThm").val() : "Причина не указана."; var m = "Данная тема была перемещена из раздела [url=" + thisFhref + "]" + thisForum + "[/url].\n\nПричина перемещения:\n" + a + ""; 
$.post("/forum/", {p: 0, a: 7, jkd428: 1, jkd498: 1, message: m, ahtml: 0, frmt: 1, smiles_on: 1, signature_on: 1, subscribe: 0, fid: location.href.split('/')[4].split('-')[0], tid: location.href.split('/')[4].split('-')[1], ssid: $("input[name='ssid']").val()}, function () {$.get("/forum/" + FidTid() + "-0-20-1", function (e) {$.post("/forum/", {name: $('input[name="name"]', $('cmd[p="content"]', e).text()).val(), description: $('input[name="description"]', $('cmd[p="content"]', e).text()).val(), nfid: _nfid, a: 20, fid: location.href.split('/')[4].split('-')[0], tt: 1, t: 1, tid: location.href.split('/')[4].split('-')[1]}, function(){ setTimeout(function(){ _uWnd.close("moveThemeTT"); } , 1200);_uWnd.reload('moveTheme','<br><center>Тема перемещена.<br><br><input type="button" name="Refresh" value="Закрыть это окно и обновить" onclick="javascript:history.go(0)"><br><br></center>').checksize(); _uWnd.setTitle('moveTheme','Тема перемещена'); });});});}
