drupal_add_js in html template file I am using a zen subtheme and I am trying to add some javascript using the drupal_add_js
 on a certain node.
When I use the drupal_add_js from within the html--node--XX.tpl.php file, it does not work. 

But when I use it in the page--node--XX.tpl.php it does. I don't understand what causes the difference in the behavior. I thought that this would be the same.
These are the lines I am adding in both cases:

drupal_add_css("sites/all/libraries/shadowbox/shadowbox.css", $type = 'file', $media = 'all', $preprocess = FALSE);
drupal_add_js("sites/all/libraries/shadowbox/shadowbox.js", array('type' =&gt; 'file', 'scope' =&gt; 'header', 'weight' =&gt; 5));
drupal_add_js("Shadowbox.init({skipSetup: true});", array('type' =&gt; 'inline', 'scope' =&gt; 'header', 'weight' =&gt; 6));


Can anyone illuminate me here?
You can try to insert the JS files by the preprocess function in your theme's template.php file:

Here goes an example:

function MYTHEME_preprocess_page(&amp;$variables) {
  drupal_add_js(drupal_get_path('theme', 'MYTHEME') .'/mytheme.js', 'file');
}


You can use an if() to validate the current path in the $variables in order to prevent the script to be loaded on every page.

To debug the $variables values you can install the devel module an use the dpm() function.

For example:

function MYTHEME_preprocess_page(&amp;$variables) {
  dpm($variables);
}