I am creating a user input at one of the events:
var throwConnectBox = function() { chat_box = document.getElementById(\'box\'); div = window.parent.
This is one of the reasons why I've decided to use jQuery:
$('') .click( function() { conn.send('$connect\r\n'); } ) .appendTo('') .appendTo('#box');