(function(){var A=document;jQuery.fn._set_smooth_scroll=function(C,B){return this.each(function(){_self=this;var D={target_x:C,target_y:B};D._x=A.body.scrollLeft||A.documentElement.scrollLeft||window.pageXOffset;if(typeof D._x=="undefined"){D._x=0}D._y=A.body.scrollTop||A.documentElement.scrollTop||window.pageYOffset;if(typeof D._y=="undefined"){D._y=0}D.y=D.target_y-D._y+2;D.x=D.target_x-D._x;D.x=D._x+Math.floor(D.x/2);D.y=D._y+Math.floor(D.y-(D.y*4/5));window.scrollTo(D.x,D.y);if(D.x==D._x&&D.y==D._y){setTimeout("location.href = _self.href",100)}else{setTimeout('jQuery(_self)._set_smooth_scroll("'+D.target_x+'","'+D.target_y+'")',1)}})};jQuery.fn.set_smooth_scroll=function(){var B=location.href.split("#")[0];return this.each(function(){var C=this.href;if(this.href.match(/(.+)#([^?]+)/)){C=RegExp.$1;var D=A.getElementById(RegExp.$2);if(D){if(B==C){this.onclick=function(){var F=0;var G=0;for(var E=D;E.offsetParent;E=E.offsetParent){F+=E.clientTop||0;F+=E.offsetTop||0;G+=E.offsetleft||0}var I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var H=document.documentElement.scrollHeight||document.body.scrollHeight;F=(H-I<F)?H-I:F;jQuery(this)._set_smooth_scroll(G,F);return false}}}}})}})(jQuery);