diff --git flag.module flag.module
index 3c413eb..0dc48ac 100644
--- flag.module
+++ flag.module
@@ -320,10 +320,14 @@ function flag_flag_link_types() {
     'toggle' => array(
       'title' => t('JavaScript toggle'),
       'description' => t('An AJAX request will be made and degrades to type "Normal link" if JavaScript is not available.'),
+      'uses standard js' => TRUE,
+      'uses standard css' => TRUE,
     ),
     'normal' => array(
       'title' => t('Normal link'),
       'description' => t('A normal non-JavaScript request will be made and the current page will be reloaded.'),
+      'uses standard js' => FALSE,
+      'uses standard css' => FALSE,
     ),
     'confirm' => array(
       'title' => t('Confirmation form'),
@@ -332,6 +336,8 @@ function flag_flag_link_types() {
         'flag_confirmation' => '',
         'unflag_confirmation' => '',
       ),
+      'uses standard js' => FALSE,
+      'uses standard css' => FALSE,
     ),
   );
 }
@@ -1155,7 +1161,7 @@ function flag_theme() {
  */
 function template_preprocess_flag(&$variables) {
   global $user;
-  static $first_time = TRUE;
+  static $initialized = array();
 
   // Some typing shotcuts:
   $flag =& $variables['flag'];
@@ -1176,14 +1182,20 @@ function template_preprocess_flag(&$variables) {
     unset($link['href']);
   }
 
-  // Tell the template file to add JavaScript/CSS if using the toggle link type.
   // Anonymous users always need the JavaScript to maintain their flag state.
-  if (($flag->link_type == 'toggle' || $user->uid == 0) && $first_time) {
-    $variables['setup'] = $first_time;
-    $first_time = FALSE;
+  if ($user->uid == 0) {
+    $link_type['uses standard js'] = TRUE;
   }
-  else {
-    $variables['setup'] = FALSE;
+
+  // Load the JavaScript/CSS, if the link type requires it.
+  if (!isset($initialized[$link_type['name']])) {
+    if ($link_type['uses standard css']) {
+      drupal_add_css(drupal_get_path('module', 'flag') . '/theme/flag.css');
+    }
+    if ($link_type['uses standard js']) {
+      drupal_add_js(drupal_get_path('module', 'flag') . '/theme/flag.js');
+    }
+    $initialized[$link_type['name']] = TRUE;
   }
 
   $variables['link_href'] = isset($link['href']) ? check_url(url($link['href'], $link)) : FALSE;
@@ -1210,6 +1222,11 @@ function template_preprocess_flag(&$variables) {
     $variables['flag_classes_array'][] = $variables['last_action'];
   }
   $variables['flag_classes'] = implode(' ', $variables['flag_classes_array']);
+
+  // Backward compatibility: if the user has an old flag.tpl.php, we don't want
+  // it to generate E_NOTICEs, so we make sure this variable exists there.
+  // @todo: Remove this sometime.
+  $variables['setup'] = FALSE;
 }
 
 /**
@@ -1695,10 +1712,13 @@ function flag_get_link_types($reset = FALSE) {
       foreach ($module_types as $type_name => $info) {
         $link_types[$type_name] = $info;
         $link_types[$type_name]['module'] = $module;
+        $link_types[$type_name]['name'] = $type_name;
         $link_types[$type_name] += array(
           'title' => '',
           'description' => '',
           'options' => array(),
+          'uses standard js' => TRUE,
+          'uses standard css' => TRUE,
         );
       }
     }
diff --git theme/flag.tpl.php theme/flag.tpl.php
index 94e6333..089a569 100644
--- theme/flag.tpl.php
+++ theme/flag.tpl.php
@@ -27,18 +27,10 @@
  *   flagged. If displaying to the user immediately after flagging, this value
  *   will be boolean TRUE. This is usually used in conjunction with immedate
  *   JavaScript-based toggling of flags.
- * - $setup: TRUE when this template is parsed for the first time; Use this
- *   flag to carry out procedures that are needed only once; e.g., linking to CSS
- *   and JS files.
  *
  * NOTE: This template spaces out the <span> tags for clarity only. When doing some
  * advanced theming you may have to remove all the whitespace.
  */
-
-  if ($setup) {
-    drupal_add_css(drupal_get_path('module', 'flag') .'/theme/flag.css');
-    drupal_add_js(drupal_get_path('module', 'flag') .'/theme/flag.js');
-  }
 ?>
 <span class="<?php print $flag_wrapper_classes; ?>">
   <?php if ($link_href): ?>
