<script type="text/javascript">
function aWards(nickname,id){new _uWnd('sendGifts','Подарить подарок',300,100,{align:0,shadow:0,close:1,autosize:1,maxh:300,minh:100,resize:0,oncontent:function(){
$.get('/index/55-'+id,function(data){
$('td', $('cmd[p="content"]', data).text()).each(function() {
number = $(this).attr('onclick').toString().split('-')[2].substr(0,2).replace(/"/,'');
$('#str').append("<img src="+$(this).find('img').attr('src')+" alt="+number+" class='uAwards_new'>")
});
$('.uAwards_new').click(function(){
$('#upbody').hide();$('#downbody').show();
addgifts = $(this).attr('alt');
$('#divImgA').html("<img src="+$(this).attr('src')+">");
$.get('/index/55-1-'+number,function(data){
$('#frm735', $('cmd[p="content"]', data).text()).each(function() {
seckey = $(this).find('input[name="seckey"]').val();
$('.capcode').html('<img src='+$(this).find('#secuImg').attr('src')+' id="clickclick" align="absmiddle" style="cursor:pointer;">');
reloadcap = $(this).find('#secuImg').attr('onclick');
if(seckey == undefined){$('#Acode').hide()}else{}
$('#clickclick').click(reloadcap);
});
$('#buttonSend').click(function() {
$('.Astat').html('<img src="/loadgen.gif" >');
var ssid = $('input[name="ssid"]', data).val();
$.post('/index/', {a: '55',t:'1',s:id,comment:$('#messGiftsVal').val(),c:addgifts,seckey:seckey,code:$('#sCodeA').val()}, function(response){
res = $(response).text();
if(res.indexOf('Вручить')!=-1){$('.Astat').html('<img src="/.s/img/icon/er.png">');_uWnd.alert('<center><font color="red">Вручить награду вы сможете через </b>24 часа</b></font></center>', 'Ошибка',{w:300, h:70});return;}
if(res.indexOf('Не заполнено')!=-1){$('.Astat').html('<img src="/.s/img/icon/er.png">');_uWnd.alert('<center><font color="red">Не заполнено поле </b>Сообщение</b></font></center>', 'Ошибка',{w:300, h:70});return;}
if(res.indexOf('безопасности')!=-1){$('.Astat').html('<img src="/.s/img/icon/er.png">');_uWnd.alert('<center><font color="red">Неверно введён </b>Код безопасности</b></font></center>', 'Ошибка',{w:300, h:70});$('#clickclick').click();return;}
if(res.indexOf('Доступ')!=-1){$('.Astat').html('<img src="/.s/img/icon/er.png">');}
else{$('.Astat').html('<img src="/.s/img/icon/ok.png">');_uWnd.alert('<center><font color="blue">Награда успешно </b>подарена</b></font></center>', 'Успешно',{w:300, h:70});_uWnd.close('sendGifts')}
});
});
});
setInterval("_uWnd.getbyname('sendGifts').checksize()",500);
});
});
}}, '<div id="upbody"><fieldset><legend>Выберите подарок для отправки</legend><div id="str"></div></fieldset></div><div id="downbody" style="display:none;"><fieldset><div align="right"><a href="javascript://" style="text-decoration:none;" onclick="aWards(\'$_USERNAME$\',\'$_USER_ID$\')">« Назад</a></div></fieldset><fieldset><table width="100%"><tr><td align="left" valign="top"><div id="divImgA"></div></td><td width="100%" align="left" valign="top"><textarea style="width:100%;height:45px;" id="messGiftsVal"></textarea></td></tr></table></fieldset><fieldset id="Acode"><div style="text-align:right"><input id="sCodeA" type="text" autocomplete="off" name="code" style="font-size:20px;padding:4px;width:60px; type="text"> <span class="capcode"></span></div></fieldset><fieldset><table width="100%"><tr><td align="left" valign="top"><div class="Astat"></div></td><td width="35%" align="right" valign="top"><table border="0" style="display:inline-block;" id="showButton" cellpadding="0" cellspacing="0" onmousedown="this.className=\'downBtn\'" onmouseover="this.className=\'overBtn\'" onmouseout="this.className=\'outBtn\'"><tr><td class="myBtnLeft"><img alt="" border="0" src="http://s1.ucoz.net/img/1px.gif"/></td><td class="myBtnCenter"><div class="myBtnCont x-unselectable" unselectable="on"><a href="javascript://" id="buttonSend"><b>Подарить</b></a> </div> </td><td class="myBtnRight"><img alt="" border="0" src="http://s1.ucoz.net/img/1px.gif"/></td></tr></table></td></tr></table></fieldset></div>' )
setInterval("_uWnd.getbyname('sendGifts').checksize()",500);
}
</script>
<style>
.uAwards_new{padding:3px;cursor:pointer;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;}
.uAwards_new:hover{padding:3px;background:#FFF;cursor:pointer;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;}
</style>