--- jquery_ui/jquery_ui.module	2009-03-02 15:11:57.000000000 +0530
+++ jquery_ui/jquery_ui_new.module	2009-03-02 15:10:36.000000000 +0530
@@ -25,11 +25,19 @@ define('JQUERY_UI_PATH', drupal_get_path
  *   An array of what additional files (other than UI core) should be loaded
  *   on the page, or a string with a single file name.
  */
-function jquery_ui_add($files = array(),$compression_type=False) {
+function jquery_ui_add($files = array(),$theme='base',$compression_type=False) {
   static $loaded_files, $ui_core, $effects_core;
   $jquery_ui_path = JQUERY_UI_PATH . '/ui';
   $compression = $compression_type ? $compression_type : variable_get('jquery_update_compression_type', 'mini');
 
+  $jquery_ui_css_path = drupal_get_path('module','jquery_ui')."/jquery.ui/themes/$theme/";
+
+  if(!is_array($ui_css_core)){
+    $ui_css_core = TRUE;
+    drupal_add_css($jquery_ui_css_path.'ui.core.css');
+    drupal_add_css($jquery_ui_css_path.'ui.theme.css');
+  }
+
   // Convert file to an array if it's not one already, to compensate for
   // lazy developers. ;)
   if (!is_array($files)) {
@@ -39,7 +47,7 @@ function jquery_ui_add($files = array(),
   // If core hasn't been added yet, add it.
   if (!isset($ui_core)) {
     $ui_core = TRUE;
-    jquery_ui_add(array('ui.core'),$compression_type);
+    jquery_ui_add(array('ui.core'),$theme,$compression_type);
   }
 
   // Loop through list of files to include and add them to the page.
@@ -47,7 +55,7 @@ function jquery_ui_add($files = array(),
     // Any effects files require the effects core file.
     if (!isset($effects_core) && strpos($file, 'effects.') === 0) {
       $effects_core = TRUE;
-      jquery_ui_add(array('effects.core'),$compression_type);
+      jquery_ui_add(array('effects.core'),$theme,$compression_type);
     }
   
     // Load other files.
@@ -66,6 +74,8 @@ function jquery_ui_add($files = array(),
       }
       $js_path = $jquery_ui_path . '/' . $file_path;
       drupal_add_js($js_path);
+      $css_path = $jquery_ui_css_path."$file.css";
+      drupal_add_css($css_path);
       $loaded_files[$file] = $js_path; // or TRUE...
     }
   }
