MGCCbEvoNS.already_editing=0;MGCCbEvoNS.edit_chatid=0;MGCCbEvoNS.edit_previous_content=null;MGCCbEvoNS.edit_content=null;MGCCbEvoNS.username=null;MGCCbEvoNS.report_chatid=0;MGCCbEvoNS.delete_chat=function(a){dojo.xhrPost({url:this.jsloc+"mgc_cb_evo_ajax.php",handleAs:"xml",preventCache:true,content:{securitytoken:SECURITYTOKEN,action:"ajax_delete_chat",chatid:a},error:function(b){console.error("Error: ",b)},load:dojo.hitch(this,"wait_delete_chat")});return false};MGCCbEvoNS.wait_delete_chat=function(delete_chat_answer_xml){if(delete_chat_answer_xml){xmlresult=delete_chat_answer_xml.getElementsByTagName("answer_result")[0].firstChild.nodeValue;eval(xmlresult)}};MGCCbEvoNS.edit_chat=function(a){if(this.already_editing==0){this.already_editing=1;clearTimeout(this.refresh_timeout);clearTimeout(this.refreshPM_timeout);this.edit_chatid=a;MGCCbEvoNS.edit_previous_content=dojo.byId("cspan_"+this.edit_chatid).innerHTML;dojo.xhrPost({url:this.jsloc+"mgc_cb_evo_ajax.php",handleAs:"xml",preventCache:true,content:{securitytoken:SECURITYTOKEN,action:"ajax_edit_getchat",chatid:this.edit_chatid},error:function(b){console.error("Error: ",b)},load:dojo.hitch(this,"wait_edit_chat_getcontent")})}else{this.show_dialog(phrase_already_editing,"")}};MGCCbEvoNS.wait_edit_chat_getcontent=function(c){if(c){edit_content=c.getElementsByTagName("chat_content")[0].firstChild.nodeValue;if(edit_content!=""){this.edit_content=edit_content;if(this.char_limit>0){dojo.byId("cspan_"+this.edit_chatid).innerHTML='<input type="text" id="chatedit" value="'+PHP.htmlspecialchars(this.edit_content)+'" class="bginput" style="width: 75%" maxlength="500" onkeyup="MGCCbEvoNS.check_char_limit(this,1);" /> <input type="text" id="mgc_cb_evo_edit_char_counter" class="primary full textbox" value="'+this.char_limit+'" style="vertical-align: middle;" size="2" readonly="readonly" />';MGCCbEvoNS.check_char_limit(dojo.byId("chatedit"),1)}else{dojo.byId("cspan_"+this.edit_chatid).innerHTML='<input type="text" id="chatedit" value="'+PHP.htmlspecialchars(this.edit_content)+'" class="bginput" style="width: 75%" maxlength="500" />'}dojo.byId("chatedit").focus();dojo.byId("chatedit").select();dojo.byId("chatedit").onblur=function a(){MGCCbEvoNS.edit_chat_save()};dojo.byId("chatedit").onkeypress=function b(f){var d;if(f&&f.which){f=f;d=f.which}else{f=event;d=f.keyCode}if(d==13){MGCCbEvoNS.edit_chat_save()}}}else{this.show_dialog(phrase_edit_forbidden,"")}}};MGCCbEvoNS.edit_chat_save=function(){if(this.already_editing){dojo.xhrPost({url:this.jsloc+"mgc_cb_evo_ajax.php",handleAs:"xml",preventCache:true,content:{securitytoken:SECURITYTOKEN,action:"ajax_save_edit",chatid:this.edit_chatid,chat:PHP.urlencode(dojo.byId("chatedit").value)},error:function(a){console.error("Error: ",a)},load:dojo.hitch(this,"wait_edit_chat_save")})}};MGCCbEvoNS.wait_edit_chat_save=function(edit_chat_save_answer_xml){if(edit_chat_save_answer_xml){edit_result=edit_chat_save_answer_xml.getElementsByTagName("edit_result")[0].firstChild.nodeValue;this.already_editing=0;if(edit_result==1){if(this.pm_tabs_on&&this.pm_active_tab!=0){this.chatbox_pm_refresh()}else{this.chatbox_refresh("forced")}}else{dojo.byId("cspan_"+this.edit_chatid).innerHTML=this.edit_previous_content;eval(edit_result)}}};MGCCbEvoNS.set_name=function(a){if(a!=null&&PHP.trim(a)!=""){this.username=a;this.send_chat()}else{this.show_dialog(phrase_error_name,"")}};MGCCbEvoNS.send_chat=function(){if(this.ask_anonymous_name&&this.username==null){this.show_promptdialog(phrase_enter_name,"","MGCCbEvoNS.set_name");return false}if(this.input_prompt_msg){this.remove_chat_prompt();return false}if(this.inactive_mode_on){clearTimeout(this.inactive_timeout);this.inactive_timeout=setTimeout("activate_idle_chatbox()",this.inactive_mode_delay)}if(this.already_sending){this.show_dialog(phrase_error_chat_in_process,"")}else{this.already_sending=1;if(this.pm_tabs_on&&MGCCbEvoNS.pm_active_tab!=0){chat="/pm uid "+MGCCbEvoNS.pm_active_tab+" "+dojo.byId("mgc_cb_evo_input").value}else{chat=dojo.byId("mgc_cb_evo_input").value}if(this.ask_anonymous_name){this.send_chat_post(chat,this.username)}else{this.send_chat_post(chat,"")}}return false};MGCCbEvoNS.send_chat_post=function(a,b){if(a!=""){dojo.xhrPost({url:this.jsloc+"mgc_cb_evo_ajax.php",handleAs:"xml",preventCache:true,content:{securitytoken:SECURITYTOKEN,action:"ajax_chat",channel_id:this.current_chanid,chat_name:b,chat:PHP.urlencode(a),b:this.ubbcode_b,i:this.ubbcode_i,u:this.ubbcode_u,font:this.ubbcode_font,color:this.ubbcode_color,size:this.ubbcode_size},error:function(c){console.error("Error: ",c)},load:dojo.hitch(this,"wait_send_chat_post")})}};MGCCbEvoNS.wait_send_chat_post=function(send_chat_post_answer_xml){if(send_chat_post_answer_xml){clearTimeout(this.refresh_timeout);clearTimeout(this.refreshPM_timeout);this.already_sending=0;send_chat_result=send_chat_post_answer_xml.getElementsByTagName("sendchat_result")[0].firstChild.nodeValue;this.clear_chat_input();this.focus_chat_input();if(this.char_limit){this.check_char_limit(document.getElementById("mgc_cb_evo_input"),0)}if(this.pm_tabs_on&&this.pm_active_tab!=0&&send_chat_result=="MGCCbEvoNS.chatbox_refresh('forced')"){this.chatbox_pm_refresh()}else{eval(send_chat_result)}}};MGCCbEvoNS.sticky_chat=function(b,a){dojo.xhrPost({url:this.jsloc+"mgc_cb_evo_ajax.php",handleAs:"xml",preventCache:true,content:{securitytoken:SECURITYTOKEN,action:"ajax_sticky_chat",chatid:b,status:a},error:function(c){console.error("Error: ",c)},load:dojo.hitch(this,"wait_sticky_chat")})};MGCCbEvoNS.wait_sticky_chat=function(sticky_chat_answer_xml){if(sticky_chat_answer_xml){stiky_chat_result=sticky_chat_answer_xml.getElementsByTagName("stiky_result")[0].firstChild.nodeValue;eval(stiky_chat_result)}};MGCCbEvoNS.report_chat=function(a){dojo.xhrPost({url:this.jsloc+"mgc_cb_evo_ajax.php",handleAs:"xml",preventCache:true,content:{securitytoken:SECURITYTOKEN,action:"ajax_report_chat",chatid:this.report_chatid,reason:a},error:function(b){console.error("Error: ",b)},load:dojo.hitch(this,"wait_report_chat_post")})};MGCCbEvoNS.wait_report_chat_post=function(report_chat_answer_xml){if(report_chat_answer_xml){xmlresult=report_chat_answer_xml.getElementsByTagName("answer_result")[0].firstChild.nodeValue;eval(xmlresult)}};MGCCbEvoNS.create_chatrow=function(g,a){if(this.small_version){var c=g.getElementsByTagName("chatbit")[0].firstChild.nodeValue;var d=document.createElement("div");d.id="chatrow_"+g.getElementsByTagName("chatid")[0].firstChild.nodeValue;d.innerHTML="<div style='padding: 2px;'>"+c+"</div>";b=d}else{var e=g.getElementsByTagName("chatid")[0].firstChild.nodeValue;var b=document.createElement("tr");b.setAttribute("id","chatrow_"+e);if((this.notifs_display>1)||(a==0)){if(g.getElementsByTagName("col_menu")[0].firstChild!=null){var i=g.getElementsByTagName("col_menu")[0].firstChild.nodeValue}else{var i=""}dojo.create("td",{width:"0",id:"chat_"+e,align:this.left,valign:this.chat_valign,innerHTML:i},b)}else{dojo.create("td",{width:"0",id:"chat_"+e,align:this.left,valign:this.chat_valign,innerHTML:""},b)}if(g.getElementsByTagName("col_sticky")[0].firstChild!=null){var h=g.getElementsByTagName("col_sticky")[0].firstChild.nodeValue}else{var h=""}dojo.create("td",{width:"0",align:this.left,valign:this.chat_valign,innerHTML:h},b);if(this.activate_atusername_icon){if(g.getElementsByTagName("col_atusername")[0].firstChild!=null){var f=g.getElementsByTagName("col_atusername")[0].firstChild.nodeValue}else{var f=""}dojo.create("td",{width:"0",align:this.left,valign:this.chat_valign,innerHTML:f},b)}if(this.avatar_on){dojo.create("td",{width:"0",align:this.left,valign:this.chat_valign,innerHTML:g.getElementsByTagName("col_avatar")[0].firstChild.nodeValue},b)}if(this.align_chats&&((a==0)||!(this.notifs_display>1&&(a==1)&&this.br_after_username))){dojo.create("td",{width:"0",align:this.left,valign:this.chat_valign,noWrap:"nowrap",style:{whiteSpace:"nowrap"},innerHTML:g.getElementsByTagName("col_date")[0].firstChild.nodeValue},b);if(g.getElementsByTagName("col_uname")[0].firstChild!=null){uname_innerHTML=g.getElementsByTagName("col_uname")[0].firstChild.nodeValue}else{uname_innerHTML=""}dojo.create("td",{width:"0",align:this.left,valign:this.chat_valign,noWrap:"nowrap",style:{whiteSpace:"nowrap"},innerHTML:uname_innerHTML},b);dojo.create("td",{width:"100%",align:this.left,valign:this.chat_valign,innerHTML:g.getElementsByTagName("col_chat")[0].firstChild.nodeValue},b)}else{dojo.create("td",{width:"0",align:this.left,valign:this.chat_valign,noWrap:"nowrap",style:{whiteSpace:"nowrap"},innerHTML:g.getElementsByTagName("col_date")[0].firstChild.nodeValue},b);if((this.notifs_display>1)&&(a==1)&&this.br_after_username){chat_innerHTML=g.getElementsByTagName("col_uname")[0].firstChild.nodeValue+"<br />"+g.getElementsByTagName("col_chat")[0].firstChild.nodeValue}else{if(g.getElementsByTagName("col_uname")[0].firstChild!=null){chat_innerHTML=g.getElementsByTagName("col_uname")[0].firstChild.nodeValue+g.getElementsByTagName("col_chat")[0].firstChild.nodeValue}else{chat_innerHTML=g.getElementsByTagName("col_chat")[0].firstChild.nodeValue}}dojo.create("td",{width:"100%",align:this.left,valign:this.chat_valign,innerHTML:chat_innerHTML},b)}}return b};
