/* DESTOON Copyright (C)2008-2099 www.destoon.com This is NOT a freeware,Use is subject to license.txt */ Dd('word').focus();var chat_time=chat_new_msg=0;var chat_word='';var chat_interval; function unixtime(){return Math.round(new Date().getTime()/1000);} function ec_set(i){if(i==1){Dd('ec1').className='ec';Dd('ec2').className='';Dd('chat_s').title=chat_lang.ec1;}else{Dd('ec1').className='';Dd('ec2').className='ec';Dd('chat_s').title=chat_lang.ec2;}chat_ec=i;set_local('chat_ec', i);Dh('ec');} var chat_ec=get_local('chat_ec');chat_ec=chat_ec==1?1:2;ec_set(chat_ec); function chat_send(msg){ var d = msg ? msg : Dd('word').value; var l=d.length; if(d == chat_lang.tip || l<1){chat_tip(L['chat_msg_empty']);Dd('word').focus();return;} if(l>chat_maxlen){chat_tip(L['chat_len_p0']+chat_maxlen+L['chat_len_p1']+l+L['chat_len_p2']);Dd('word').focus();return;} if(chat_mintime&&(unixtime()-chat_time'+L['chat_record']+'');} for(var i=0;i'; msghtm += ''; msghtm += ''; if(chat_msg[i].self == 1) { msghtm += ''; msghtm += ''; msghtm += ''; msghtm += ''; msghtm += ''; } else { msghtm += ''; msghtm += ''; msghtm += ''; msghtm += ''; msghtm += ''; } msghtm += ''; msghtm += '
'+chat_msg[i].word+'
'+chat_msg[i].word+'
'; $('#chat').append(msghtm); } if(msglen) $('#chat').animate({scrollTop:$('#chat')[0].scrollHeight+1000}, 500); $('#chat_name').html(chat_nick ? chat_nick+'@'+chat_name : chat_name); } }); } function chat_log(){ Dd('chat').innerHTML=''; chat_last=0; chat_load(1); } function chat_save(){ Dd('down_data').value=Dd('chat').innerHTML; Dd('chat_down').submit(); } function chat_off(){ if(confirm(L['chat_msg_close'])){ window.close(); } } function chat_key(e){ if(!e){e=window.event;} if(e.keyCode==13){ if(chat_ec==1){ if(e.ctrlKey){ Dd('word').value=Dd('word').value+"\n"; if(isIE){ var r =Dd('word').createTextRange(); r.moveStart('character', Dd('word').value.length); r.moveEnd("character", 0); r.collapse(true); r.select(); } }else{ chat_send(); return false; } }else{ if(e.ctrlKey) chat_send(); } } } function chat_tip(msg){ Ds('tip'); Dd('tip').innerHTML=msg; Dd('sd').innerHTML=sound('tip'); window.setTimeout("Dh('tip');",5000); } var chat_title_i=0; var title_interval; function chat_new(num){ if(num>0){ Dd('sd').innerHTML=sound('chat_msg'); chat_new_msg=num; if(chat_title_i==0){ title_interval=setInterval('new_tip()',1000); } } } function new_tip(){ chat_title_i++; if(chat_title_i>5){ new_tip_stop(); return; } if(chat_title_i%2==0){ document.title=L['chat_new_p0']+chat_new_msg+L['chat_new_p1']+chat_title; }else{ document.title=chat_title; } } function new_tip_stop(){ try{ clearInterval(title_interval); chat_title_i=0; document.title=chat_title; }catch(e){} } function font_show(){ if(Dd('font').style.display!='none'){ font_hide(); return; } Ds('font'); Dd('tool_font').className='tool_b'; } function font_hide(){ Dh('font'); Dd('tool_font').className='tool_a'; } function font_init(){ if(Dd('word').value==chat_lang.tip){$('#word').val('');$('#word').attr('class', '');} var s=''; if(Dd('font_s').value){s+=' s'+Dd('font_s').value;} if(Dd('font_c').value){s+=' c'+Dd('font_c').value;} if(Dd('tool_font_b').className=='tool_b'){s+=' fb';} if(Dd('tool_font_i').className=='tool_b'){s+=' fi';} if(Dd('tool_font_u').className=='tool_b'){s+=' fu';} if(s){Dd('word').className=s.substring(1);} } function face_show(){ if(Dd('face').style.display!='none'){ face_hide(); return; } Ds('face'); Dd('tool_face').className='tool_b'; } function face_hide(){ Dh('face'); Dd('tool_face').className='tool_a'; } function face_into(s){ if(Dd('word').value==chat_lang.tip){$('#word').val('');$('#word').attr('class', '');} Dd('word').value+=':'+s+')'; } $(function(){ Dd('word').value=chat_lang.tip; chat_interval=setInterval('chat_load()',chat_poll); chat_log(); $('#word').bind('input click',function(){ if($('#word').val().indexOf(chat_lang.tip)!=-1) { $('#word').val($('#word').val().replace(chat_lang.tip,'')); $('#word').attr('class', ''); } }); });