The G2 Hybrid theme writes an inline script that sets some variables, followed immediately by a script include for a js file that will reference those variables. The handling in gallery_set_javascript results in the file include coming before the inline script when embedded in Drupal 6, resulting in script errors due to variables not being set.