jQuery(document).ready(function($){
/*
 * resizehandle.js (c) Fil 2007, plugin pour jQuery ecrit
 * a partir du fichier resize.js du projet DotClear
 * (c) 2005 Nicolas Martin & Olivier Meunier and contributors
 */
$.fn.resizehandle = function() {
  return this.each(function() {
    var me = jQuery(this);
    me.after(
      jQuery('<div class="resizehandle"></div>')
      .bind('mousedown', function(e) {
        var h = me.height();
        var y = e.clientY;
        var moveHandler = function(e) {
          me
          .height(Math.max(20, e.clientY + h - y));
        };
        var upHandler = function(e) {
          jQuery('html')
          .unbind('mousemove',moveHandler)
          .unbind('mouseup',upHandler);
        };
        jQuery('html')
        .bind('mousemove', moveHandler)
        .bind('mouseup', upHandler);
      })
    );
  });
}
//http://www.nabble.com/ScrollTo-Functionality-tf2391291.html#a6666866
$.fn.scrollInterface = function(s) {
    var $handles = $('a', this).add('a.top'),
        s = s || 300;
    $handles.click(function(){
        this._href = (!this._href) ? "#" + this.href.split('#')[1] : this._href;
        $(this._href).ScrollTo(s);
        return false;
    });
}
});
