--- ckeditor.module.org	2010-09-27 19:49:01.000000000 +0700
+++ ckeditor.module	2011-01-03 19:11:20.143549200 +0700
@@ -554,18 +554,18 @@ function ckeditor_process_textarea($elem
       $height = 400;
     }
     if (!$is_running) {
-      drupal_add_js($module_drupal_path .'/includes/ckeditor.utils.js', 'module', variable_get('preprocess_js', FALSE) ? 'header' : 'footer');
+      drupal_add_js($module_drupal_path .'/includes/ckeditor.utils.js', 'module', 'footer');
       /* In D6 drupal_add_js() can't add external JS, in D7 use drupal_add_js(...,'external') */
       if ( $conf['popup'] != 't' ) {
         if (isset($conf['ckeditor_load_method'])) {
-          drupal_set_html_head('<script type="text/javascript" src="'. $editor_path . '/' . $conf['ckeditor_load_method'] . '?I"></script>');
+          drupal_add_js($module_drupal_path .'/ckeditor/'. $conf['ckeditor_load_method'], 'module', 'footer', FALSE, TRUE, FALSE);
           if ($conf['ckeditor_load_method'] == 'ckeditor_basic.js') {
-            drupal_set_html_head('<script type="text/javascript">CKEDITOR.loadFullCoreTimeout = ' . $conf['ckeditor_load_time_out'] . ';</script>');
+            drupal_add_js('CKEDITOR.loadFullCoreTimeout = ' . $conf['ckeditor_load_time_out'], 'inline', 'footer', FALSE, TRUE, FALSE);
             drupal_add_js(array('ckeditor' => array('load_timeout' => TRUE)), 'setting');
           }
         }
         else {
-          drupal_set_html_head('<script type="text/javascript" src="'. $editor_path .'/ckeditor.js?I"></script>');
+          drupal_add_js($module_drupal_path .'/ckeditor/ckeditor.js', 'module', 'footer', FALSE, TRUE, FALSE);
         }
       }
       else {
