Questo è il codice che uso come lo modifico per fare il focus sulla finestra?

Codice PHP:
function handlehHttpReceiveChat() {
    
currentDest document.forms['chatForm'].elements['dest'].value;
    
currentName document.forms['chatForm'].elements['name'].value;

  if (
httpReceiveChat.readyState == 4) {
    
results httpReceiveChat.responseText.split('---'); //the fields are seperated by ---
    
if (results.length 2) {
        for(
i=0;< (results.length-1);i=i+3) { //goes through the result one message at a time
            
insertNewContent(results[i+1],results[i+2]); //inserts the new content into the page
            
        
}
        
lastID results[results.length-4];
        
//window.open('http://www.spritzlandia.it/chat.php?dest=' + currentDest,'miaFinestra','');
    
}
    
setTimeout('receiveChatText();',4000); //executes the next data query in 4 seconds
  
}