


	function sendMessage(msg){
		 var msgobj = {
		   text: msg
		 };

		 $.ajax({
									url: "/messages/topic/chat",
									data: JSON.stringify(msgobj),
									processData: false,
									type: "POST",
									async: true,
									success: function(data) {
										console.log(data)
									}
						});
	}

	function bindEvents(){
		$('#username').val("user" + (1000 + Math.round((Math.random() * 1000)).toString()));
		
		$('#btnSend').click(function(){
			sendMessage($('#txtMessage').val())
		}