send message functions

javascript function not functional