moved chat window animations into separate function, added preventDefaults

chat window now properly shows/hides (possibly hiding wrong container)
 fix null chat bug, replace data_id with parseInt(chatId),
Merge pull request #30 from maxkohl88/refactor-mainjs

Refactor mainjs