Moved all JavaScript in mess.php to main.js