/*---------------------------------------------------------------

 jQuery.slideScroll.js
 
 jQuery required (tested on version 1.2.6)
 encoding UTF-8

 Copyright (c) 2008 nori (norimania@gmail.com)
 5509 - http://moto-mono.net
 Licensed under the MIT
 
 Document Archive:
 http://moto-mono.net/2008/12/23/jqueryslidescrolljs.html

 $Update: 2008-12-24 20:00
 $Date: 2008-12-22 23:30
 
 ----------------------------------------------------------------*/

$.fn.slideScroll=function(l){var g=$.extend({interval:20,easing:0.6,comeLink:false},l);var f=document;var b;var h;function k(){return {x:f.body.scrollLeft||f.documentElement.scrollLeft,y:f.body.scrollTop||f.documentElement.scrollTop};}function e(){var m=f.documentElement.clientHeight;var c=f.documentElement.clientWidth;var d=f.documentElement.scrollHeight;var n=f.documentElement.scrollWidth;h.top=((d-m)<h.top&&h.top<d)?d-m:h.top;h.left=((n-c)<h.left&&h.left<n)?n-c:h.left;}function i(){var c=k().x;var o=k().y;var n=Math.ceil((c-h.left)/(5*g.easing));var m=Math.ceil((o-h.top)/(5*g.easing));return {x:c-n,y:o-m,ax:n,ay:m};}function j(){b=setInterval(function(){i();if(Math.abs(i().ax)<1&&Math.abs(i().ay)<1){clearInterval(b);window.scroll(h.left,h.top);}window.scroll(i().x,i().y);},g.interval);}function a(){if(location.hash){if($(location.hash)&&$(location.hash).length>0){h=$(location.hash).offset();e();window.scroll(0,0);if($.browser.msie){setTimeout(function(){j();},50);}else{j();}}}}if(g.comeLink){a();}$(this).each(function(){if(this.hash&&$(this.hash).length>0&&this.href.match(new RegExp(location.href.split("#")[0]))){var c=this.hash;$(this).click(function(){h=$(c).offset();clearInterval(b);e();j();return false;});}});};