magari ti basta la seguente modifica

$('#text').html(markers[index].text);

prova..