diff --git a/ChangeLog b/ChangeLog
index fca13478c081fbc22835d24fbdcdf4c44d4a39ff..6022577180ac8f317da5cbb252f96ed7a7b14ecc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@ For translators:
 For developers:
 - New: Function yn can show a visual checkbox.
 - New: Introduced select2 jquery plugin.
+- New: Possibility to add javascript in main login page with "getLoginPageOptions" hook
 
 WARNING: Following changes may create regression for some external modules, but was necessary to make
 Dolibarr better:
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index f130ac9f7ef619c0591d52d1cfabf90df39ba416..fc62c5b145f3b14445292f4ef6a3864bd341ce59 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -1,5 +1,5 @@
 <?php
-/* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
+/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
  * Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -245,6 +245,18 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
 
 <?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
 
+<?php
+if (! empty($hookmanager->resArray['options'])) {
+	foreach ($hookmanager->resArray['options'] as $format => $option)
+	{
+		if ($format == 'js') {
+			echo "\n".'<!-- Javascript by hook -->';
+			echo $option."\n";
+		}
+	}
+}
+?>
+
 <?php
 // Google Analytics (need Google module)
 if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))