Index.php JavaScript code restyling

Just the styling, didn't touch anything else. (i.e. variable names etc.
- they are still as is.)