diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b5ec392817e..93e11c3722d 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -867,8 +867,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
// Output standard javascript links
if (! $disablejs && $conf->use_javascript_ajax)
{
- print ''."\n";
-
// Other external js
require_once DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php';
@@ -876,7 +874,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) { $mini='_mini'; $ext='.jgz'; } // mini='_mini', ext='.gz'
// JQuery. Must be before other includes (prototype/scriptaculous/...)
- print ''."\n";
+ print ''."\n";
print ''."\n";
print ''."\n";
print ''."\n";
@@ -889,14 +887,18 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
// CKEditor
if (! empty($conf->global->FCKEDITOR_EDITORNAME) && $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor')
{
+ print ''."\n";
print ''."\n";
}
+ // Global js function
+ print ''."\n";
+ print ''."\n";
}
// Output module javascript
if (is_array($arrayofjs))
{
- print ''."\n";
+ print ''."\n";
foreach($arrayofjs as $jsfile)
{
if (! preg_match('/^\//',$jsfile)) $jsfile='/'.$jsfile; // For backward compatibility