diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b20c8c9474a..711da264f83 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -976,32 +976,33 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print ''."\n";
print ''."\n";
}
+
// Global js function
print ''."\n";
print ''."\n";
+
+ // Add datepicker default options
+ print ''."\n";
+
+ // Output module javascript
+ if (is_array($arrayofjs))
+ {
+ print ''."\n";
+ foreach($arrayofjs as $jsfile)
+ {
+ if (preg_match('/^http/i',$jsfile))
+ {
+ print ''."\n";
+ }
+ else
+ {
+ if (! preg_match('/^\//',$jsfile)) $jsfile='/'.$jsfile; // For backward compatibility
+ print ''."\n";
+ }
+ }
+ }
}
- // Output module javascript
- if (is_array($arrayofjs))
- {
- print ''."\n";
- foreach($arrayofjs as $jsfile)
- {
- if (preg_match('/^http/i',$jsfile))
- {
- print ''."\n";
- }
- else
- {
- if (! preg_match('/^\//',$jsfile)) $jsfile='/'.$jsfile; // For backward compatibility
- print ''."\n";
- }
- }
- }
-
- // Add datepicker default options
- print ''."\n";
-
if (! empty($head)) print $head."\n";
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."\n";