changed tile display from php to javascript