var apolasttextarea = 'mchatMsgF'; // Переменная, которая служит для отлова автивного поля для вставки смайлов $(document).ready(function() { $('* textarea').click(function() { apolasttextarea = $(this).attr('id'); // При клике по текстовым полям переписываем переменную с глобальным id }); }); // Главная функция вызова ajax окна function apogetsmiles() { new _uWnd('aposmiler', 'Смайлы', 400, 250, {autosize:0, resize:0, oncontent:function() { $.get('/index/35', function(aposmiles) { $('.xw-hdr-text').html('Смайлы') $('#smileshere').html($('cmd[p="content"]', aposmiles).text()); aposmileclick(); }); }}, '
'); } // Функция клика по смайлам function aposmileclick() { $('#smileshere').html($('#smileshere').find('img').each(function() { $(this).attr('onclick', 'aposmilequote(\'' + $(this).attr('src') + '\')') })); $('#smileshere').find('img').each(function() { $(this).prependTo('#smileshere'); }); for(i=0;i<21;i++) { $('#smileshere img').eq(i).attr('style', 'margin:5px').appendTo('#aposhere'); } $('#aposhere').append('