ajaxified sending text messages and scoped a number of js variables to their functions