Index: /extensions/ContactForm/admin/themes/cf_config.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/themes/cf_config.tab.tpl	(revision 10034)
+++ /extensions/ContactForm/admin/themes/cf_config.tab.tpl	(revision 10035)
@@ -1,6 +1,3 @@
-{html_head}
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.tabs" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.tabs.packed.js"}
-{/html_head}
+{combine_script id="jquery.ui.tabs"}
 
 <div class="titrePage">
@@ -71,10 +68,8 @@
 <p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p>
 </form>
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 $(document).ready(function() {
     $(".infos").fadeOut(800).fadeIn(1200).fadeOut(400).fadeIn(800).fadeOut(400);
     $(".errors").fadeOut(200).fadeIn(200).fadeOut(300).fadeIn(300).fadeOut(400).fadeIn(400); 
   });
-</script>
-{/literal}
+{/literal}{/footer_script}
Index: /extensions/ContactForm/admin/themes/cf_emails.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/themes/cf_emails.tab.tpl	(revision 10034)
+++ /extensions/ContactForm/admin/themes/cf_emails.tab.tpl	(revision 10035)
@@ -1,6 +1,3 @@
-{html_head}
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.tabs" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.tabs.packed.js"}
-{/html_head}
+{combine_script id="jquery.ui.tabs"}
 
 <div class="titrePage">
@@ -43,11 +40,9 @@
 <p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p>
 </form>
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 $(document).ready(function() {
     $(".infos").fadeOut(800).fadeIn(1200).fadeOut(400).fadeIn(800).fadeOut(400);
     $(".errors").fadeOut(200).fadeIn(200).fadeOut(300).fadeIn(300).fadeOut(400).fadeIn(400); 
   });
-</script>
-{/literal}
+{/literal}{/footer_script}
 {$CF_DEBUG}
Index: tensions/ContactForm/admin/themes/cf_language.tab.tpl
===================================================================
--- /extensions/ContactForm/admin/themes/cf_language.tab.tpl	(revision 10034)
+++ 	(revision )
@@ -1,55 +1,0 @@
-{html_head}
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.tabs" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.tabs.packed.js"}
-{/html_head}
-
-<script type="text/javascript">
-function set_active(key) {ldelim}
-  var element = document.getElementById('cf_selected');
-  element.value = key;
-}
-jQuery().ready(
-  function(){ldelim}
-    jQuery('#cf-keys').accordion({ldelim}
-      header: '.cf-label',
-      event: 'click',
-      active: {$CF_CONFIG_KEYS_SELECTED}
-    });
-  }
-);
-</script>
-<div class="titrePage">
-    <h2>{$CF.TITLE}<br>{'cf_language'|@translate}</h2>
-</div>
-<h3 style="width: 100%;">{'cf_language_desc'|@translate}</h3>
-
-<form method="post" action="{$CF.F_ACTION}" id="update" enctype="multipart/form-data">
-<div id="cf-keys">
-<input type="hidden" id ="cf_selected" name="cf_selected" value="{$CF_CONFIG_KEYS_SELECTED}">
-{foreach from=$CF_CONFIG_VALUES item=config_value key=config_key name=config_values}
-  <div class="cf-label" onclick="set_active({$smarty.foreach.config_values.index});">
-    {$config_value.KEY}
-  </div>
-  <div>
-    <table class="checking">
-    {foreach from=$config_value.VALUE item=language_values key=language_key}
-      <tr>
-        <td class="cf-lang">{$language_values.NAME}</td>
-        <td class="cf-input"><input type="text" name="cf_item[{$config_key}][{$language_key}]" value="{$language_values.VALUE}" size="30"/></td>
-      </tr>
-    {/foreach}
-    </table>
-  </div>
-{/foreach}
-</div>
-{* ----------- LANGUAGES ----------- *}
-<p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p>
-</form>
-{literal}
-<script type="text/javascript">
-$(document).ready(function() {
-    $(".infos").fadeOut(800).fadeIn(1200).fadeOut(400).fadeIn(800).fadeOut(400);
-    $(".errors").fadeOut(200).fadeIn(200).fadeOut(300).fadeIn(300).fadeOut(400).fadeIn(400); 
-  });
-</script>
-{/literal}
Index: /extensions/ContactForm/classes/cf_plugin.class.php
===================================================================
--- /extensions/ContactForm/classes/cf_plugin.class.php	(revision 10034)
+++ /extensions/ContactForm/classes/cf_plugin.class.php	(revision 10035)
@@ -187,13 +187,5 @@
         'cf_messages' => realpath(cf_get_template('cf_messages.tpl')),
       ));
-    $template->block_html_head( '',
-              '<link rel="stylesheet" type="text/css" '.
-              'href="' . CF_INCLUDE . 'contactform.css' . '">',
-              $smarty, $repeat);
-    $template->block_html_head( '',
-              '<script type="text/javascript" '.
-              'src="' . CF_INCLUDE . 'contactform.js' . '">'.
-              '</script>',
-              $smarty, $repeat);
+    
     $cf = array(
         'TITLE'     => 'contact_form_title',
@@ -207,5 +199,5 @@
         'SUBJECT'   => $infos['cf_subject'],
         'MESSAGE'   => $infos['cf_message'],
-        'KEY'       => get_comment_post_key($infos['cf_id']),
+        'KEY'       => get_ephemeral_key(2, $infos['cf_id']),
       );
     if (!empty($infos['errors'])) {
@@ -463,14 +455,6 @@
       $id = trim( stripslashes($_POST['cf_id']));
     }
-    
-    $key = explode( ':', $key );
-    if ( count($key)!=2
-          or $key[0]>time()-2 // page must have been retrieved more than 2 sec ago
-          or $key[0]<time()-3600 // 60 minutes expiration
-          or hash_hmac(
-                'md5', $key[0].':'.$id, $conf['secret_key']
-              ) != $key[1]
-        )
-    {
+
+    if (!verify_ephemeral_key($key, $id)) {
       return false;
     }
Index: /extensions/ContactForm/include/cf_functions.inc.php
===================================================================
--- /extensions/ContactForm/include/cf_functions.inc.php	(revision 10034)
+++ /extensions/ContactForm/include/cf_functions.inc.php	(revision 10035)
@@ -53,5 +53,4 @@
   I.user_id =  U.'.$conf['user_fields']['id'].' and
   I.status in (\'webmaster\',  \'admin\') and
-  I.adviser = \'false\' and
   '.$conf['user_fields']['email'].' is not null and
   I.user_id <> '.$user['id'].'
@@ -88,5 +87,4 @@
   I.user_id =  U.'.$conf['user_fields']['id'].' and
   I.status in (\'webmaster\',  \'admin\') and
-  I.adviser = \'false\' and
   '.$conf['user_fields']['email'].' is not null 
 order by
Index: /extensions/ContactForm/include/contactform.css
===================================================================
--- /extensions/ContactForm/include/contactform.css	(revision 10034)
+++ /extensions/ContactForm/include/contactform.css	(revision 10035)
@@ -43,27 +43,3 @@
 }
 
-/* jQuery ui resizable */
-.ui-resizable { position: relative; }
-.ui-wrapper { border: 0; }
-.ui-wrapper input, .ui-wrapper textarea { border: 0; }
-
-/* Global handle styles */
-.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; }
-.ui-resizable .ui-resizable-handle { display: block; }
-body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
-body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
-.ui-resizable-n {
-    cursor: n-resize;
-    height: 6px;
-    width: 100%;
-    top: 0px;
-    left: 0px;
-    background: transparent url('../images/resizable-n.gif') no-repeat scroll center top;
-}
-.ui-resizable-s { cursor: s-resize; height: 6px; width: 100%; bottom: 0px; left: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-s.gif) no-repeat scroll center top; }
-.ui-resizable-e { cursor: e-resize; width: 6px; right: 0px; top: 0px; height: 100%; background: transparent url(../../../admin/themes/roma/images/resizable-e.gif) no-repeat scroll right center; }
-.ui-resizable-w { cursor: w-resize; width: 6px; left: 0px; top: 0px; height: 100%; background: transparent url(../../../admin/themes/roma/images/resizable-w.gif) no-repeat scroll right center; }
-.ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-se.gif); }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-sw.gif); }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: 0px; top: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-nw.gif); }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: 0px; top: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-ne.gif); }
+#cf_message {width:400px;height:200px;}
Index: /extensions/ContactForm/themes/cf_button.tpl
===================================================================
--- /extensions/ContactForm/themes/cf_button.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/cf_button.tpl	(revision 10035)
@@ -1,11 +1,7 @@
-{html_head}
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-{/html_head}
-
 <div class="cf-button">
 <input type="button" value="{'cf_hide'|@translate}" onclick="hide('cf_messages');">
 </div>
-{literal}
-<script type="text/javascript">
+
+{footer_script require="jquery"}{literal}
 function hide(id) {
   var element = document.getElementById(id);
@@ -15,4 +11,3 @@
   }
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
Index: /extensions/ContactForm/themes/cf_form.tpl
===================================================================
--- /extensions/ContactForm/themes/cf_form.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/cf_form.tpl	(revision 10035)
@@ -1,37 +1,6 @@
-{html_head}
-  {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
-{/html_head}
+{combine_css path="plugins/ContactForm/include/contactform.css"}
+{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"}
 
-{literal}
-<script type="text/javascript">
-jQuery().ready(function(){
-    // Resize possible for textarea
-    jQuery("#cf_message").resizable({
-        handles: "all",
-        animate: true,
-        animateDuration: "slow",
-        animateEasing: "swing",
-        preventDefault: true,
-        preserveCursor: true,
-        autoHide: true,
-        ghost: true
-      });
-  });
-jQuery().ready(function(){
-  // Resize possible for textarea
-  jQuery(".cf-input").resizable({
-        handles: "e",
-        animate: true,
-        animateDuration: "slow",
-        animateEasing: "swing",
-        preventDefault: true,
-        preserveCursor: true,
-        autoHide: true,
-        ghost: true
-      });
-  });
-
+{footer_script}{literal}
 function cf_validate() {
   var items = new Array('cf_from_name','cf_from_mail','cf_subject','cf_message');
@@ -58,6 +27,6 @@
   return true;
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
+
 <div id="autre_content" class="contact-form">
   <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
Index: /extensions/ContactForm/themes/simple-black/cf_form.tpl
===================================================================
--- /extensions/ContactForm/themes/simple-black/cf_form.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/simple-black/cf_form.tpl	(revision 10035)
@@ -1,10 +1,6 @@
-{html_head}
-  <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -->
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
-{/html_head}
+{combine_css path="plugins/ContactForm/include/contactform.css"}
+{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"}
 
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 jQuery().ready(function(){
     // Resize possible for textarea
@@ -58,6 +54,6 @@
   return true;
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
+
 <div id="subcontent" class="contact-form">
   <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
Index: /extensions/ContactForm/themes/simple-sunset/cf_form.tpl
===================================================================
--- /extensions/ContactForm/themes/simple-sunset/cf_form.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/simple-sunset/cf_form.tpl	(revision 10035)
@@ -1,10 +1,6 @@
-{html_head}
-  <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -->
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
-{/html_head}
+{combine_css path="plugins/ContactForm/include/contactform.css"}
+{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"}
 
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 jQuery().ready(function(){
     // Resize possible for textarea
@@ -58,6 +54,6 @@
   return true;
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
+
 <div id="subcontent" class="contact-form">
   <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
Index: /extensions/ContactForm/themes/simple-white/cf_form.tpl
===================================================================
--- /extensions/ContactForm/themes/simple-white/cf_form.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/simple-white/cf_form.tpl	(revision 10035)
@@ -1,10 +1,6 @@
-{html_head}
-  <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -->
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
-{/html_head}
+{combine_css path="plugins/ContactForm/include/contactform.css"}
+{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"}
 
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 jQuery().ready(function(){
     // Resize possible for textarea
@@ -58,6 +54,6 @@
   return true;
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
+
 <div id="subcontent" class="contact-form">
   <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
Index: /extensions/ContactForm/themes/simple/cf_form.tpl
===================================================================
--- /extensions/ContactForm/themes/simple/cf_form.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/simple/cf_form.tpl	(revision 10035)
@@ -1,10 +1,6 @@
-{html_head}
-  <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -->
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
-{/html_head}
+{combine_css path="plugins/ContactForm/include/contactform.css"}
+{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"}
 
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 jQuery().ready(function(){
     // Resize possible for textarea
@@ -58,6 +54,6 @@
   return true;
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
+
 <div id="subcontent" class="contact-form">
   <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
Index: /extensions/ContactForm/themes/stripped/cf_form.tpl
===================================================================
--- /extensions/ContactForm/themes/stripped/cf_form.tpl	(revision 10034)
+++ /extensions/ContactForm/themes/stripped/cf_form.tpl	(revision 10035)
@@ -1,10 +1,6 @@
-{html_head}
-  <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -->
-  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
-  {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
-{/html_head}
+{combine_css path="plugins/ContactForm/include/contactform.css"}
+{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"}
 
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 jQuery().ready(function(){
     // Resize possible for textarea
@@ -58,6 +54,6 @@
   return true;
 }
-</script>
-{/literal}
+{/literal}{/footer_script}
+
 <div id="subcontent" class="contact-form">
   <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();">
