How to add conditional javascript to theme?
This is how I've added html5shiv in my template.php file:

$html5shiv = array(
  '#tag' =&gt; 'script',
  '#attributes' =&gt; array( // Set up an array of attributes inside the tag
    'src' =&gt; drupal_get_path('theme', 'mythemename') . '/js/lib/html5shiv.js', 
  ),
  '#prefix' =&gt; '&lt;!--[if lte IE 8]&gt;',
  '#suffix' =&gt; '&lt;/script&gt;&lt;![endif]--&gt;',
);
drupal_add_html_head($html5shiv, 'html5shiv');