Moved login to layout page
moved js to its own file