title: unable to add multiple .JS files to template.php in Drupal 7
body: <p>In my template.php that exists in my theme directory I have this method:</p>
  
  <pre><code>            function vocabt_process_page(&amp;$vars) {
  
          drupal_flush_all_caches();
  
          // Try to add js per page
          $alias = drupal_get_path_alias($_GET['q']);
          $file = $vars['directory'].'/js/'.str_replace('/', '-', $alias).'.js';
          if(file_exists($file)) {
              drupal_add_js($vars['directory'].'/anythingslider/anythingslider.js');
              drupal_add_js($vars['directory'].'/anythingslider/jquery.anythingslider.video.min.js');
              drupal_add_js($file);
  
          }
  
          $vars['title_sub'] = '';
          $vars['page_icon'] = '';
          $content_class = array();
          switch($alias) {
              case 'home':
                  drupal_add_css(drupal_get_path('theme', 'vocabt') . '/anythingslider/css/anythingslider.css');
                  $test = drupal_add_js(NULL, NULL, NULL);
                  error_log(print_r($test,1));
                  unset($vars['title']);
              break;
              //other pages
          }
          if(drupal_match_path($alias, 'scores/admin/*')) {
      //      $vars['title_sub'] = 'Check your student\'s scores by entering your information below.';
              $vars['page_icon'] = 'graph';
          }
  
          if($vars['page_icon']) {
              $content_class[] = 'icon-65';
          }
          if($vars['page']['sidebar_right']) {
              $content_class[] = 'twocol';
          }
          $vars['content_class'] = implode(' ', $content_class);
  
          // Since the title and the shortcut link are both block level elements,
          // positioning them next to each other is much simpler with a wrapper div.
          if (!empty($vars['title_suffix']['add_or_remove_shortcut']) &amp;&amp; $vars['title']) {
              // Add a wrapper div using the title_prefix and title_suffix render elements.
              $vars['title_prefix']['shortcut_wrapper'] = array(
                  '#markup' =&gt; '&lt;div class="shortcut-wrapper clearfix"&gt;',
                  '#weight' =&gt; 100,
              );
              $vars['title_suffix']['shortcut_wrapper'] = array(
                  '#markup' =&gt; '&lt;/div&gt;',
                  '#weight' =&gt; -99,
              );
              // Make sure the shortcut link is the first item in title_suffix.
              $vars['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
          }
      }
  </code></pre>
  
  <p>Essentially the home page loads jquery, anythingslider.js, then home.js</p>
  
  <p>within home.js I simply have:</p>
  
  <pre><code>    (function($) {
  
          $(document).ready(function() {
              alert('asdf');      
              $('#gallery').anythingSlider();
  
          });
  
      })(jQuery);
  </code></pre>
  
  <p>My problem is that when I load the home page... I get a JS error saying:</p>
  
  <pre><code>Uncaught TypeError: Object [object Object] has no method 'anythingSlider' 
  </code></pre>
  
  <p>This leads me to believe that the anythingslider library has not been correctly imported.  Can someone tell me how to do this quick/dirty import of anythingslider.js successfully? (while keeping in mind it already is placed AFTER home.js).  Thank you!</p>