--- fckeditor.module.old	Wed Mar 10 09:43:32 2010
+++ fckeditor.module	Mon May 10 19:02:31 2010
@@ -621,8 +621,14 @@
       $toolbar = FCKEDITOR_FORCE_SIMPLE_TOOLBAR_NAME;
     }
 
-    if (!empty($conf['theme_config_js']) && $conf['theme_config_js'] == 't' && file_exists($themepath .'fckeditor.config.js')) {
-      $fckeditor_config_path = $host . $themepath .'fckeditor.config.js?'. @filemtime($themepath .'fckeditor.config.js');
+	// Loads a more specific config file if it exists
+	$textarea_id_no_numbers = preg_replace('([0-9])', '', $textarea_id);
+    if (!empty($conf['theme_config_js']) && $conf['theme_config_js'] == 't' && file_exists($themepath .'fckeditor/'. $textarea_id_no_numbers. '.fckeditor.config.js')) {
+      $fckeditor_config_path = $host . $themepath .'fckeditor/'. $textarea_id_no_numbers. '.fckeditor.config.js?'. @filemtime($themepath .'fckeditor/'. $textarea_id_no_numbers. '.fckeditor.config.js');
+    }
+	// moved the config files to a subdirectory "fckeditor" of the theme directory
+    else if (!empty($conf['theme_config_js']) && $conf['theme_config_js'] == 't' && file_exists($themepath .'fckeditor/fckeditor.config.js')) {
+      $fckeditor_config_path = $host . $themepath .'fckeditor/fckeditor.config.js?'. @filemtime($themepath .'fckeditor/fckeditor.config.js');
     }
     else {
       $fckeditor_config_path = $module_full_path ."/fckeditor.config.js?". @filemtime($module_drupal_path ."/fckeditor.config.js");
@@ -791,9 +797,10 @@
     }
 
     // add custom xml stylesheet if it exists
+	// moved to a subdirectory "fckeditor" of the theme directory
     if (!empty($conf['css_style']) && $conf['css_style'] == 'theme') {
-      if (file_exists($themepath .'fckstyles.xml')) {
-        $styles_xml_path = $host . $themepath .'fckstyles.xml';
+      if (file_exists($themepath .'fckeditor/fckstyles.xml')) {
+        $styles_xml_path = $host . $themepath .'fckeditor/fckstyles.xml';
         $js .= $js_id .".Config['StylesXmlPath'] = \"". $styles_xml_path ."\";\n";
       }
     }
