/*
moo.fx pack, effects extensions for moo.fx.
by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE
for more info visit (http://moofx.mad4milk.net).
Friday, April 14, 2006
v 1.2.4
*/

//smooth scroll
fx.Scroll = Class.create();
fx.Scroll.prototype = Object.extend(new fx.Base(), {
 initialize: function(options) {
 this.setOptions(options);
 },

 scrollTo: function(el){
 var dest = Position.cumulativeOffset($(el))[1];
 var client = window.innerHeight || document.documentElement.clientHeight;
 var full = document.documentElement.scrollHeight;
 var top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
 if (dest+client > full) this.custom(top, dest - client + (full-dest));
 else this.custom(top, dest);
 },

 increase: function(){
 window.scrollTo(0, this.now);
 }
});
