function insert() {
	new Ajax.Updater('chat', '/chat.php?index=chat&chat=insert', {
		method: 'post',
		parameters: $('cform').serialize(),
		onSuccess: function() {
			$('ctext').value = '';
		}
	});
}

function index() {
	new Ajax.Updater('chat', '/chat.php?index=chat&chat=index', {
		onSuccess: function() { window.setTimeout(index, 1000); }
	});
}

index();
