var curFct; var curLine = -1; var scrolling = 5000; var buffer = 40; // le nombre de caractere non ecrit par phrase var vitesse = 10; // nombre de caractere par seconde, vitesse de frappe function ChatLine(){ clearInterval(curFct); curLine=curLine+1; if(document.all){ document.all.chat.innerHTML=document.all.chat.innerHTML+'
'+tabChat[curLine]+'
'; window.scrollTo(0,scrolling); }else if(document.getElementById){ var str=''; for(var i=0;i<=curLine;++i) str+='
'+tabChat[i]+'
'; document.getElementById("chat").innerHTML=str; window.scrollTo(0,scrolling); }else if(document.layers){ var str=''; for(var i=0;i<=curLine;++i) str+='
'+tabChat[i]+'
'; document.layers["chat"].document.close(); document.layers["chat"].document.write(str); document.layers["chat"].document.close(); window.scrollTo(0,scrolling); } if(curLine+1>=tabChat.length) return; curFct = setInterval("ChatLine()",1000*(Math.floor((tabChat[curLine+1].length-buffer)/vitesse)+1)); } function Start(){ if(tabChat.length>0) curFct = setInterval("ChatLine()",1000*(Math.floor((tabChat[0].length-buffer)/vitesse)+1)); }