<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var Messenger=new Class({Implements:[Options,Events],options:{"targetId":0,"editorName":"message","messagesDiv":"messages","contactlistDiv":"contactlist","postButton":"messenger-post","reloadDelay":5000,"clReloadDelay":30000,"ngcPath":"","ngcHost":""},reloading:false,initialize:function(options){this.setOptions(options);$(this.options.postButton).addEvent("click",function(event){event.stop();this.add()}.bind(this));this.ngcReload.periodical(this.options.reloadDelay,this);this.clReload.periodical(this.options.clReloadDelay,this);this.setClistEvents();this.scrollFx=new Fx.Scroll($(this.options.messagesDiv),{duration:0,wait:false});this.scrollFx.toBottom();this.processLinks()},add:function(){var message=this.getEditorText();var data={'targetId':this.options.targetId,'message':message};$("error-message").addClass("hide");run_ajax('messenger','post',data,'messengerCallback','messenger-loader')},ngcReload:function(){if(this.reloading==false){try{ngmc(this.options.ngcHost,this.options.ngcPath)}catch(e){this.reload()}}},reload:function(){if(this.reloading==false){this.reloading=true;var data={'targetId':this.options.targetId};run_ajax('messenger','reload',data,'messengerCallback')}},clReload:function(){run_ajax('messenger','contactlist',{},'messengerCallback')},processResponse:function(response){if(response.action=='post'){if(response.error&gt;""){$("error-message").set("html",response.error).removeClass("hide")}else{this.setMessages(response.code);this.setEditorText("")}}if(response.action=='reload'){if(response.code&gt;""){this.setMessages(response.code)}this.reloading=false}if(response.action=="clReload"){if(response.code&gt;""){this.updateContactList(response.code)}}},setTarget:function(id){this.options.targetId=id},setClistEvents:function(){return true},updateContactList:function(code){$(this.options.contactlistDiv).set("html",code);this.setClistEvents()},setMessages:function(code){$(this.options.messagesDiv).set("html",code);this.scrollFx.toBottom();this.processLinks();return true},processLinks:function(){$$("#"+this.options.messagesDiv+" a").each(function(item){if(item.get("target")==null){item.set("target","_blank")}});return true},getEditorText:function(){if(typeof(FCKeditorAPI)!='undefined'){var editor=FCKeditorAPI.GetInstance(this.options.editorName);if(editor){return editor.GetXHTML()}}if($(this.options.editorName)){return $(this.options.editorName).get("value")}return""},setEditorText:function(text){if(typeof(FCKeditorAPI)!='undefined'){var editor=FCKeditorAPI.GetInstance(this.options.editorName);if(editor){editor.SetData(text);return true}}if($(this.options.editorName)){$(this.options.editorName).set("value",text);return true}return false}});function messengerCallback(response){var response=JSON.decode(response);messenger.processResponse(response)}; var Messenger=new Class({Implements:[Options,Events],options:{"targetId":0,"editorName":"message","messagesDiv":"messages","contactlistDiv":"contactlist","postButton":"messenger-post","reloadDelay":5000,"clReloadDelay":30000,"ngcPath":"","ngcHost":""},reloading:false,initialize:function(options){this.setOptions(options);$(this.options.postButton).addEvent("click",function(event){event.stop();this.add()}.bind(this));this.ngcReload.periodical(this.options.reloadDelay,this);this.clReload.periodical(this.options.clReloadDelay,this);this.setClistEvents();this.scrollFx=new Fx.Scroll($(this.options.messagesDiv),{duration:0,wait:false});this.scrollFx.toBottom();this.processLinks()},add:function(){var message=this.getEditorText();var data={'targetId':this.options.targetId,'message':message};$("error-message").addClass("hide");run_ajax('messenger','post',data,'messengerCallback','messenger-loader')},ngcReload:function(){if(this.reloading==false){try{ngmc(this.options.ngcHost,this.options.ngcPath)}catch(e){this.reload()}}},reload:function(){if(this.reloading==false){this.reloading=true;var data={'targetId':this.options.targetId};run_ajax('messenger','reload',data,'messengerCallback')}},clReload:function(){run_ajax('messenger','contactlist',{},'messengerCallback')},processResponse:function(response){if(response.action=='post'){if(response.error&gt;""){$("error-message").set("html",response.error).removeClass("hide")}else{this.setMessages(response.code);this.setEditorText("")}}if(response.action=='reload'){if(response.code&gt;""){this.setMessages(response.code)}this.reloading=false}if(response.action=="clReload"){if(response.code&gt;""){this.updateContactList(response.code)}}},setTarget:function(id){this.options.targetId=id},setClistEvents:function(){return true},updateContactList:function(code){$(this.options.contactlistDiv).set("html",code);this.setClistEvents()},setMessages:function(code){$(this.options.messagesDiv).set("html",code);this.scrollFx.toBottom();this.processLinks();return true},processLinks:function(){$$("#"+this.options.messagesDiv+" a").each(function(item){if(item.get("target")==null){item.set("target","_blank")}});return true},getEditorText:function(){if(typeof(FCKeditorAPI)!='undefined'){var editor=FCKeditorAPI.GetInstance(this.options.editorName);if(editor){return editor.GetXHTML()}}if($(this.options.editorName)){return $(this.options.editorName).get("value")}return""},setEditorText:function(text){if(typeof(FCKeditorAPI)!='undefined'){var editor=FCKeditorAPI.GetInstance(this.options.editorName);if(editor){editor.SetData(text);return true}}if($(this.options.editorName)){$(this.options.editorName).set("value",text);return true}return false}});function messengerCallback(response){var response=JSON.decode(response);messenger.processResponse(response)}; window.addEvent('domready',function(){if($("addfriend-btn")){$("addfriend-btn").addEvent('click',function(event){event.stop();new StickyWinModal({content:StickyWin.ui('Ð”Ð¾Ð±Ð°Ð²Ð¸Ñ‚ÑŒ Ð² Ð´Ñ€ÑƒÐ·ÑŒÑ',$("friendform"),{width:'400px',buttons:[{text:'Ð”Ð¾Ð±Ð°Ð²Ð¸Ñ‚ÑŒ',onClick:function(){friendId=$("friendform").get("rel").toInt();friendText=$("ff-text").value;$("ff-text").value="";if(!($("ff-textarea").hasClass("hide")))$("ff-textarea").addClass("hide");ajax_add_friend(friendId,friendText)}},{text:'ÐžÑ‚Ð¼ÐµÐ½Ð°',onClick:function(){}}]})})})}if($("ff-show-textarea")){$("ff-show-textarea").addEvent("click",function(event){event.stop();$("ff-textarea").removeClass("hide")})}if($("ff-hide-textarea")){$("ff-hide-textarea").addEvent("click",function(event){event.stop();$("ff-textarea").addClass("hide")})}if($("delfriend-btn")){$("delfriend-btn").addEvent('click',function(event){event.stop();new StickyWinModal({content:StickyWin.ui('Ð£Ð´Ð°Ð»Ð¸Ñ‚ÑŒ Ð¸Ð· Ð´Ñ€ÑƒÐ·ÐµÐ¹',$("friendform-remove"),{width:'400px',buttons:[{text:'Ð£Ð´Ð°Ð»Ð¸Ñ‚ÑŒ',onClick:function(){friendId=$("friendform").get("rel").toInt();ajax_remove_friend(friendId)}},{text:'ÐžÑ‚Ð¼ÐµÐ½Ð°',onClick:function(){}}]})})})}});function ajax_add_friend(friendId,text){run_ajax('friends','add_friend',{'id':friendId,'text':text},'add_friend_handle','friendform-loading-img')}function add_friend_handle(resp){var resp=JSON.decode(resp);var content="&lt;div style=\"padding: 20px;\"&gt;"+resp.message+"&lt;/div&gt;";new StickyWinModal({content:StickyWin.ui('Ð”Ð¾Ð±Ð°Ð²Ð¸Ñ‚ÑŒ Ð² Ð´Ñ€ÑƒÐ·ÑŒÑ',content,{width:'400px',buttons:[{text:'Ð—Ð°ÐºÑ€Ñ‹Ñ‚ÑŒ',onClick:function(){}}]})})}function ajax_remove_friend(friendId){run_ajax('friends','remove_friend',{'id':friendId},'remove_friend_handle','none')}function remove_friend_handle(resp){var resp=JSON.decode(resp);var content="&lt;div style=\"padding: 20px;\"&gt;"+resp.message+"&lt;/div&gt;";new StickyWinModal({content:StickyWin.ui('Ð£Ð´Ð°Ð»Ð¸Ñ‚ÑŒ Ð¸Ð· Ð´Ñ€ÑƒÐ·ÐµÐ¹',content,{width:'400px',buttons:[{text:'Ð—Ð°ÐºÑ€Ñ‹Ñ‚ÑŒ',onClick:function(){}}]})})}</pre></body></html>