    FreiChat.init_chatrooms=function(){FreiChat.chatroom.dcSlick({location:"left",classWrapper:"frei_chatroom",classContent:"frei_chatroom-content",align:"left",offset:"100px",speed:"slow",classTab:"frei_tab",tabText:"Chat Room",autoClose:true});$jn("#frei_userpanel").html("LOADING ............................WaiT");FreiChat.in_room=1;FreiChat.my_name='<div></div><div id="frei_userlist" class="frei_userlist" onmouseover="$jn(this).addClass(\'frei_userlist_onhover\');" onmouseout="$jn(this).removeClass(\'frei_userlist_onhover\');"><span class="freichat_userscontentname">'+
    freidefines.GEN.fromname+"</span></div>";FreiChat.getchatroomloadtime()};FreiChat.chatroom_off=function(){$jn("#dc-slick-9").hide()};FreiChat.getchatroomloadtime=function(){if(freidefines.GEN.time>+3600)FreiChat.load_chatroom_complete=true};FreiChat.send_chatroom_message=function(a){FreiChat.checkChatBoxInputKey(null,a,null,null,"chatroom")};
    FreiChat.usercreator=function(a){FreiChat.chatroom_users.length>0&&(FreiChat.chatroom_users[a]&&$jn("#frei_userpanel").html(FreiChat.chatroom_users[a]),FreiChat.chatroom_users[a]=="<div></div>"&&$jn("#frei_userpanel").html(FreiChat.my_name))};
    FreiChat.loadchatroom=function(a,b){FreiChat.chatroom_changed=true;FreiChat.usercreator(b);var e=FreiChat.in_room;FreiChat.in_room=b;FreiChat.title=a;FreiChat.last_chatroom_usr_id=null;FreiChat.setCookie("selected_chatroom",b);FreiChat.roomcreator(a,b);$jn.getJSON(freidefines.GEN.url+"server/freichat.php?freimode=loadchatroom",{xhash:freidefines.xhash,id:freidefines.GEN.getid,first:FreiChat.first,time:FreiChat.time,chatroom_mesg_time:FreiChat.chatroom_mesg_time,custom_mesg:FreiChat.custom_mesg,in_room:b},
    function(a){if(a.time!=null)FreiChat.time=a.time;if(a.chatroom_mesg_time!=null)FreiChat.chatroom_mesg_time=a.chatroom_mesg_time;FreiChat.room_array=a.room_array;FreiChat.chatroom_users[a.in_room]=a.chatroom_users_div;FreiChat.usercreator(a.in_room);for(var c=0;c<a.chatroom_messages.length;c++);e!=b&&FreiChat.append_chatroom_message_div(a.chatroom_messages,"clear")},"json")};
    FreiChat.append_chatroom_message_div=function(a,b){typeof b=="undefined"&&(b="nclear");var e=a.length,d=0,c="",c=false,h=$jn("#frei_chatroommsgcnt"),g=FreiChat.last_chatroom_msg_type[FreiChat.in_room],g=FreiChat.first_message==false?false:true,i=FreiChat.in_room,f=FreiChat.last_chatroom_msg_type[FreiChat.in_room];b=="clear"&&h.html("");for(d=0;d<e;d++)if(FreiChat.chatroom_written[FreiChat.in_room]=true,g==true&&(f=true),a[d].from==FreiChat.last_chatroom_usr_id&&FreiChat.chatroom_written[FreiChat.in_room]==
    true)$jn("#"+FreiChat.last_chatroom_msg_id).append("<br/>"+a[d].message),c=true;else{c=a[d].from_name;if(c==freidefines.GEN.fromname)c=freidefines.TRANS.chat_message_me;c=f===true?'<div id = "'+a[d].room_id+'_chatroom_message"  class="frei_chatroom_message"><span style="display:none" id="'+i+'_message_type">LEFT</span><p class="triangle-right frei_room_left_arrow"><span id="room_msg_'+FreiChat.unique+'" class="frei_chatroom_msgcontent">'+a[d].message+'</span></p><span class="chatroom_messagefrom_left">'+
    c+"</span></div>":'<div id = "'+a[d].room_id+'_chatroom_message" class="frei_chatroom_message"><span style="display:none" id="'+i+'_message_type">RIGHT</span><p class="triangle-right frei_room_right_arrow"><span id="room_msg_'+FreiChat.unique+'" class="frei_chatroom_msgcontent">'+a[d].message+'</span></p><span class="chatroom_messagefrom_right">'+c+"</span></div>";h.append(c);c=true;FreiChat.last_chatroom_msg_id="room_msg_"+FreiChat.unique;FreiChat.unique++;g=false;FreiChat.last_chatroom_usr_id=a[d].from;
    f=!f}FreiChat.last_chatroom_msg_type[FreiChat.in_room]=f;c==true&&$jn("#frei_chatroommsgcnt").scrollTop($jn("#frei_chatroommsgcnt")[0].scrollHeight);FreiChat.first_message=false};
    FreiChat.roomcreator=function(){$jn("#frei_roomtitle").html(FreiChat.title);for(var a="frei_lobby_room",b=0,e="",b=0;b<FreiChat.room_array.length;b++)a=FreiChat.in_room==FreiChat.room_array[b].room_id?"frei_selected_room":"frei_lobby_room",e+='<div id="cometchat_userlist_1" class="'+a+'" onmouseover="jQuery(this).addClass(\'frei_chat_userlist_hover\');" onmouseout="jQuery(this).removeClass(\'frei_chat_userlist_hover\');" onclick="FreiChat.loadchatroom(\''+FreiChat.room_array[b].room_name+"',"+FreiChat.room_array[b].room_id+
    ')" >\n<span class="frei_lobby_room_1">'+FreiChat.room_array[b].room_name+"</span>",e+=FreiChat.room_array[b].online_count==0&&FreiChat.in_room==FreiChat.room_array[b].room_id?'<span class="frei_lobby_room_2">1 online</span>':'<span class="frei_lobby_room_2">'+FreiChat.room_array[b].online_count+" online</span>",e+='<span class="frei_lobby_room_3"></span>\n<span class="frei_lobby_room_4"></span>\n<div style="clear:both"></div></div>';$jn("#frei_roompanel").html(e)};
    FreiChat.frei_branding=function(){var a=Math.floor(Math.random()*1001),b=Math.floor(Math.random()*1002),a="<div id='evnix"+a+"power' class='evnix"+b+"power'><font size='1'>"+freidefines.pwdby+" <a href='http://evnix.com' target='_blank'>EvNix</a></font></div>";if(FreiChat.frei_branding_done==false){if($jn("#frei_user_brand").length>0){if(FreiChat.frei_branding_done==false)$jn("#frei_user_brand").append(a),FreiChat.frei_branding_done=true}else FreiChat=$jn=null;if(freidefines.PLUGINS.showchatroom==
    "enabled")$jn("#chatroom_branding").length>0?($jn("#chatroom_branding").html(a),FreiChat.frei_branding_done=true):FreiChat=$jn=null}};FreiChat.frei_branding_done=false;