Index: adsense_managed.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/adsense/managed/adsense_managed.module,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 adsense_managed.module
--- adsense_managed.module	3 Jul 2009 12:05:50 -0000	1.1.2.8
+++ adsense_managed.module	11 Jan 2010 17:38:41 -0000
@@ -48,6 +48,7 @@ function adsense_managed_block($op = 'li
           $title = t('AdSense: unconfigured ') . $count;
         }
         $block[$count]['info'] = $title;
+        $block[$count]['cache'] = BLOCK_CACHE_PER_PAGE;
       }
       break;
 
@@ -163,12 +164,14 @@ function _adsense_managed_get_ad($format
     if ($lang = variable_get('adsense_secret_language', ADSENSE_SECRET_LANGUAGE_DEFAULT)) {
       $secret .= "google_language = '$lang';";
     }
+    $slots = drupal_to_js(array_filter(explode(',', $slot)));
 
     $output = <<<MANAGED_TXT
 <script type="text/javascript"><!--
+shuffle = function(v){ for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x); return v; };
+google_ad_slot = shuffle($slots).pop();
 google_ad_client = "$client";
 /* $format */
-google_ad_slot = "$slot";
 google_ad_width = ${ad['width']};
 google_ad_height = ${ad['height']};
 $secret
