Taking javascript out of php page

Changed the formatting of HTML in php as well