Index: modernizr.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modernizr/modernizr.install,v
retrieving revision 1.1
diff -c -r1.1 modernizr.install
*** modernizr.install	16 Aug 2010 12:40:08 -0000	1.1
--- modernizr.install	16 Dec 2010 10:19:38 -0000
***************
*** 8,14 ****
    $requirements = array();
    switch($phase) {
      case 'runtime':
!       $installed = file_exists(drupal_get_path('module', 'modernizr') . '/modernizr.min.js');
        $requirements[] = array(
          'title' => t('Modernizr library'),
          'value' => $installed ? t('Installed') : t('Missing'),
--- 8,15 ----
    $requirements = array();
    switch($phase) {
      case 'runtime':
!       module_load_include('module', 'modernizr');
!       $installed = modernizr_lib_path();
        $requirements[] = array(
          'title' => t('Modernizr library'),
          'value' => $installed ? t('Installed') : t('Missing'),
Index: modernizr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modernizr/modernizr.module,v
retrieving revision 1.1
diff -c -r1.1 modernizr.module
*** modernizr.module	16 Aug 2010 12:40:08 -0000	1.1
--- modernizr.module	16 Dec 2010 10:19:38 -0000
***************
*** 6,12 ****
   */
  function modernizr_init() {
    drupal_add_js(array(
!     'modernizrPath' => drupal_get_path('module', 'modernizr') . '/modernizr.min.js',
    ), 'setting', 'footer');
    drupal_add_js(drupal_get_path('module', 'modernizr') . '/modernizr_loader.js');
  }
\ No newline at end of file
--- 6,33 ----
   */
  function modernizr_init() {
    drupal_add_js(array(
!     'modernizrPath' => modernizr_lib_path(),
    ), 'setting', 'footer');
    drupal_add_js(drupal_get_path('module', 'modernizr') . '/modernizr_loader.js');
+ }
+ 
+ function modernizr_lib_path() {
+   static $path = NULL;
+   if (is_null($path)) {
+     if (module_exists('libraries')) {
+       $path = libraries_get_path('modernizr');
+     }
+     else {
+       $path = drupal_get_path('module', 'modernizr');
+     }
+     
+     $version_agnostic_path = file_exists($path .'/modernizr.min.js') ? $path : FALSE;
+     if (!$version_agnostic_path) {
+       $path = file_exists($path .'/modernizr.js') ? $path .'/modernizr.js' : FALSE;
+     }
+     else {
+       $path = $version_agnostic_path;
+     }
+   }
+   return $path;
  }
\ No newline at end of file
