PHP 5.2 or 5.3 for Drupal 6.22?
Drupal 6.22 is compatible with PHP 5.3, but some contributed modules may not support 5.3. That said, I have been developing D6 sites on 5.3 for more than a year without any problems.

Usually, the PHP version is not the cause of JS problems, so I would start to look for the solution elsewhere (Firebug?).