JS and PHP code style fixes

if(	-> if (
for(	-> for (
else if	-> elseif

Lines greater than 120 chars chomped.

Change-Id: I909d4fe9785a656481878256830ae5965e48a416