Index: extensions/Autosize/js/JScript.js
===================================================================
--- extensions/Autosize/js/JScript.js	(revision 11912)
+++ extensions/Autosize/js/JScript.js	(revision 11961)
@@ -1,69 +1,97 @@
-﻿jQuery(document).ready(
-function (jQuery) {
-  var stt = jQuery('#scrolltobottom');
-  var stb = jQuery('#scrolltotop');
+﻿function getScrollMaxY() {
+  var innerh;
+  if (window.innerHeight) {
+    innerh = window.innerHeight;
+  } else {
+    innerh = document.body.clientHeight;
+  }
+  if (window.innerHeight && window.scrollMaxY) {
+    // Firefox     
+    yWithScroll = window.innerHeight + window.scrollMaxY;
+  } else if (
+     document.body.scrollHeight > document.body.offsetHeight) {
+    // all but Explorer Mac    
+    yWithScroll = document.body.scrollHeight;
+  } else {
+    // works in Explorer 6 Strict, Mozilla (not FF) and Safari   
+    yWithScroll = document.body.offsetHeight;
+  }
+  return yWithScroll - innerh;
+}
+
+jQuery(document).ready(function (jQuery) {
+  jQuery(window).load(function () {
+    if (jQuery("#scrolltotop").length == 0)
+      jQuery('#scrolltobottom').before('<div id="scrolltotop" ><a title="Revenir en haut de la page" href="#"></a></div>');
+
+  stb = jQuery('#scrolltobottom');
+  stt = jQuery('#scrolltotop');
+  stt.css('opacity', 1 )
+    stb.css('opacity', 1)
+
+    jQuery('#scrolltotop').height(100);
+    jQuery('#scrolltobottom').height(100);
+    jQuery('#scrolltotop').css({
+  });
+  jQuery('#scrolltobottom').css({
+});
+jQuery(window).resize(
+               function (event, ui) {
+                 jQuery(window).scroll();
+               });
+
+               wmax = jQuery("body").height() - jQuery(window).height();
+               scrollTop = jQuery(window).scrollTop();
+               pourcent = (scrollTop / wmax);
+               jQuery(stt).css({ opacity: pourcent });
+               jQuery(stb).css({ opacity: 1 - pourcent });
+           
+//=================================================== 		
+jQuery(window).scroll(function () {
+  maxi = getScrollMaxY();
+  wmax = jQuery("body").height() - jQuery(window).height();
+  scrollTop = jQuery(window).scrollTop();
+    pourcent = (scrollTop / wmax)  ;
 
 
-  stt.css('opacity', 1);
-  var scrollBottom = 0;
+  jQuery(stt).css({ opacity:pourcent });
+  jQuery(stb).css({ opacity:  1-pourcent });
 
-  //===================================================================	  		
-  jQuery(window).load(function (event, ui) {
-    if (typeof (event) == 'undefined') return;
-    scrollBottom = jQuery(window).scrollTop(0);
-    var v_max = jQuery("#the_page").height();
-  //===================================================================	    		
-  jQuery(window).scroll(function () {
-      scrollBottom = jQuery(window).scrollTop();
-      v_max = jQuery("#the_page").height() - jQuery(window).height();
-      if (scrollBottom > 100) {
-        if (stt.css('opacity') == 0) {
-          stt.stop().fadeTo(1000, 1);
-        }
-      }
-      if (scrollBottom > v_max - 100) {
-        if (stb.css('opacity') == 0) {
-          stb.stop().fadeTo(1000, 1);
-        }
-    }
-      return;
 
-      if (scrollBottom < v_max) {
-        if (stb.css('opacity') > 0) {
-          stb.stop().fadeTo(1000, 0);
-          stb.css("display", "none");
-        }
-      } else {
-      if (stb.css('opacity') == 0) {
-        stb.stop().fadeTo(1000, 1);
-        stb.css("display", "block");
-        }
-      }
+  jQuery("#scrollmiddle").css("bottom", maxi + "px");
+ // jQuery("#scrollmiddle").text(pourcent);
+  //====================================================
+    scrollBottom = jQuery(window).scrollTop();
 
-      //=========================================
-      if (scrollBottom < v_max) {
-        if (stt.css('opacity') == 0) {
-          stt.stop().fadeTo(1000, 1);
-          stt.css("display", "block");
-      }
-    } else {
-        if (stt.css('opacity') > 0) {
-          stt.stop().fadeTo(1000, 0);
-          stt.css("display", "none");
+});
+//=====================================================
+jQuery('#scrolltobottom a').mouseover(function () {
+  wmax = jQuery("body").height() - jQuery(window).height();
+  scrollTop = jQuery(window).scrollTop();
+  pourcent = (scrollTop / wmax);
 
-      }
-    }
+  stb.stop().fadeTo(500, 1-pourcent);
 
   });
+jQuery('#scrolltobottom a').mouseout(function () {
+  stb.stop().fadeTo(500, 0);
+
+});
+jQuery('#scrolltotop a').mouseover(function () {
+  wmax = jQuery("body").height() - jQuery(window).height();
+  scrollTop = jQuery(window).scrollTop();
+  pourcent = (scrollTop / wmax);
+  stt.stop().fadeTo(500, pourcent);
+
   });
+jQuery('#scrolltotop a').mouseout(function () {
+  stt.stop().fadeTo(500, 0);
+});
 
   jQuery('#scrolltobottom a').click(function () {
-    pos = jQuery('#the_page').outerHeight();
+  pos = jQuery("body").height() - jQuery(window).height(); ;
     jQuery('html, body').animate({
       scrollTop: pos + 'px'
     }, 1000, function () {
-
-      stt.stop().fadeTo(1000, 0);
-      stb.stop().fadeTo(1000, 1);
 
     });
@@ -71,30 +99,17 @@
 
   jQuery('#scrolltotop a').click(function () {
-
     pos = 0;
     jQuery('html, body').animate({
       scrollTop: pos + 'px'
-    }, 1000, function () {
-      stb.stop().fadeTo(1000, 0);
-      stt.stop().fadeTo(1000, 1);
+  }, 0, function () {
+
+
     });
   });
+//===================================================================	  
 
 
-  function gotoPos(pos) {
-    jQuery('html, body').animate({ scrollTop: jQuery('body').outerHeight() + 'px' },
-     0, function () {
-       scrollBottom = jQuery(window).scrollTop();
 
      });
-
-
-    return false;
-  }
-  //===================================================================	  
-  // jQuery(window).resize();
-  jQuery(window).scroll();
-
-
 }); 
 //=========================================================
