rewrote login and home page using javascript