var time=18;var speed=1.1;function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);return[curleft,curtop];}}
function abcoStopAnimation(){clearInterval(abcoIntScroll);clearTimeout(abcoTimScroll);return;}
function abcoGetWebsiteSize(){return[document.getElementById('body').offsetHeight,document.getElementById('body').offsetWidth];}
function abcoGetScreenSize(){if(window.innerHeight){return[window.innerHeight,window.innerWidth];}else if(document.documentElement&&document.documentElement.clientHeight){return[window.document.documentElement.clientHeight,window.document.documentElement.clientWidth];}else{}}
function abcoGetPageOffset(){if(typeof(window.pageXOffset)=='number'){return[window.pageXOffset,window.pageYOffset];}else if(document.documentElement){return[document.documentElement.scrollLeft,document.documentElement.scrollTop];}else{}}
function abcoScrollAnimation(x,y){website=abcoGetWebsiteSize();websiteHeight=website[0]+ 8;websiteWidth=website[1];screenSize=abcoGetScreenSize();screenHeight=screenSize[0];screenWidth=screenSize[1];offset=abcoGetPageOffset();xOffset=offset[0];yOffset=offset[1];if(xOffset>=x&&yOffset>=y){x=Math.floor(xOffset/speed);y=Math.floor(yOffset/speed);if(xOffset<=x&&yOffset<=y){abcoStopAnimation();}
window.scrollTo(x,y);}else if(xOffset>=x&&yOffset<=y){x=Math.floor(xOffset/speed);y=Math.floor(y+ Math.floor((yOffset- y)/speed));if(screenHeight>(websiteHeight- y)){if(xOffset<=x){abcoStopAnimation();}}else{if(xOffset<=x&&yOffset>=y){abcoStopAnimation();}}
window.scrollTo(x,y);}else if(xOffset<=x&&yOffset>=y){x=Math.floor(x+ Math.floor((xOffset- x)/(speed)));y=Math.floor(yOffset/(speed));if(screenWidth>(websiteWidth- x)){if(yOffset<=y){abcoStopAnimation();}}else{if(xOffset>=x&&yOffset<=y){abcoStopAnimation();}}
window.scrollTo(x,y);}else if(xOffset<=x&&yOffset<=y){x=Math.floor(x+ Math.floor((xOffset- x)/speed));y=Math.floor(y+ Math.floor((yOffset- y)/speed));if(screenHeight>(websiteHeight- y)){if(screenWidth>(websiteWidth- x)){abcoStopAnimation();}else{if(xOffset>=x){abcoStopAnimation();}}}else if(screenWidth>(websiteWidth- x)){if(screenHeight>(websiteHeight- y)){abcoStopAnimation();}else{if(yOffset>=y){abcoStopAnimation();}}}else{if(xOffset>=x&&yOffset>=y){abcoStopAnimation();}}
window.scrollTo(x,y);}else{abcoStopAnimation();}}
function abcoScroll(x,y){clearInterval(abcoIntScroll);abcoIntScroll=setInterval("abcoScrollAnimation(x,y)",time);abcoTimScroll=setTimeout("abcoStopAnimation()",3000);}
function abcoGoTop(){clearInterval(abcoIntScroll);abcoIntScroll=setInterval("abcoScrollAnimation(0,0)",time);abcoTimScroll=setTimeout("abcoStopAnimation()",3000);}
function abcoGoto(id){var xandy=findPos(window.document.getElementById(id));x=xandy[0];y=xandy[1];abcoScroll(x,y);}
