/*
 * u.fastThank.forum.js
 * Copyright http://javascript.ucoz.net/ 
 * By Bogggdan
 * version: 1.0 (beta test)
 * date: 27.05.2010
 */




function thankPost(uid,id,type){new _uWnd('post',(type?"?????????????":"?????")+' ?? ????',200,200,{fadetype:1,fadespeed:444,fadeclosetype:1,fadeclosespeed:666,icon:(type?"http://javascript.ucoz.net/i/c/1.png":"http://javascript.ucoz.net/i/c/0.png"),align:'left'},'<fieldset id="fdset"><legend>????????</legend><input type="checkbox" id="repC" checked="1"><label for="repC">'+(type?"????????":"????????")+' ?????????</label><br><input type="checkbox" id="adwC" checked="1"><label for="adwC">??????? ???????</label><center><input type="button" value="??????????" id="clickPost_d" onclick="postThank('+uid+', '+id+', '+type+')"></center></fieldset>')}function postThank(uid,id,type){if($("#repC").is(":checked")==false&&$("#adwC").is(":checked")==false){alert('?????? ?? ???????');return}var goodAdw=[27,28,29,30,51,52,53,54,55,25];var badAdw=[46,47,48,49,50];$("#clickPost_d").attr({disabled:true});if($("#repC").is(":checked")){$("#repC").replaceWith("<img src='http://javascript.ucoz.net/upload/icons/load.gif' style='border:0;cursor:help' align='absmiddle' title='????????' id='repCl'> ");$.get("/index/23-"+uid,function(d){$.post("/index",{a:23,t:1,s:uid,act:(type?2:1),ref:location.href+"#"+id,reason:"???? "+(type?'????':'?????')+" ?? ???? ????????? ?? ??????.",ssid:$('input[name="ssid"]',$('cmd[p="content"]',d).text()).val()},function(rep){var errRep=$('<div/>').html($(rep).text()).find('.myWinLoadSF').attr('title');if(errRep){$("#repCl").replaceWith("<img src='http://s40.ucoz.net/.s/img/icon/er.png' style='border:0;cursor:help' align='absmiddle' title='"+errRep+"'> ")}else{$("#repCl").replaceWith("<img src='http://javascript.ucoz.net/upload/icons/ok.png' style='border:0;cursor:help' align='absmiddle' title='????????? ????????'> ")}})})}if($("#adwC").is(":checked")){$("#adwC").replaceWith("<img src='http://javascript.ucoz.net/upload/icons/load.gif' style='border:0;cursor:help' align='absmiddle' title='????????' id='adwCl'> ");$.post("/index",{comment:"???? ??????? ?? ???? ????????? ?? ??????.",a:55,t:1,s:uid,c:(type?goodAdw[Math.round(Math.random()*goodAdw.length)]:badAdw[Math.round(Math.random()*badAdw.length)])},function(wrd){var adwErr=$('<span/>').html($(wrd).text()).find('.myWinError').html();if(adwErr){$("#adwCl").replaceWith("<img src='http://s40.ucoz.net/.s/img/icon/er.png' style='border:0;cursor:help' align='absmiddle' title='"+adwErr+"'> ")}else{$("#adwCl").replaceWith("<img src='http://javascript.ucoz.net/upload/icons/ok.png' style='border:0;cursor:help' align='absmiddle' title='??????? ???????'> ")}})}}