Fixed undefined variable $msg in lpm_write.php.
Added infinite scroll ability to messages. Tidy up some Javascript.