// Script:  Page Scroller Script - Version 3.1
// Author:  Brian Gosselin
// Site:    scriptasylum.com
// E-mail:  scriptasylum@hotmail.com

// RELEASE INFO:
// V3.1 FIXED SCROLLING BUG. 

var dO=new Object();

// IF THE VALUES BELOW ARE SET TO ANYTHING EXCEPT null, THE SCRIPT WILL
// USE THESE COORDINATES TO POSITION THE ARROWS.

dO.xPos=null;
dO.yPos=null;

//******** NO NEED TO EDIT BELOW THIS LINE *********\\

dO.w3c=(document.getElementById)? true : false;
dO.ns4=(document.layers)? true : false;
dO.ie4=(document.all && !dO.w3c)? true : false;
dO.ns6=(dO.w3c&&navigator.appName.indexOf("Netscape")>=0)? true: false;
dO.arrows=0;
dO.okScrY=false;
dO.okScrX=false;
dO.godn=0; dO.golf=0;
dO.samntY=7;
dO.samntX=7;
dO.dx=0; dO.dy=0;

function dOsetscroll(updn,ismore){
if(updn)dO.samntY=(ismore)?Math.min(7,dO.samntY+2):Math.max(1,dO.samntY-2);
else dO.samntX=(ismore)?Math.min(7,dO.samntX+2):Math.max(1,dO.samntX-2);
}

function dOscrollpage(){
var wx=(dO.ns4||dO.ns6)?window.innerWidth:document.body.clientWidth;
var wy=(dO.ns4||dO.ns6)?window.innerHeight:document.body.clientHeight;
var tx=wx-380;
var ty=wy-80;
if((dO.xPos!=null)&&(dO.yPos!=null)){
tx=dO.xPos;
ty=dO.yPos;
}
dO.dx=(dO.ns4||dO.ns6)?window.pageXOffset:document.body.scrollLeft;
dO.dy=(dO.ns4||dO.ns6)?window.pageYOffset:document.body.scrollTop;
var dw=(dO.ns4||dO.ns6)?document.width:document.body.scrollWidth;
var dh=(dO.ns4||dO.ns6)?document.height:document.body.scrollHeight;
if(dO.ns4)dO.arrows.moveTo(dO.dx+tx,dO.dy+ty)
else{
dO.arrows.style.left=dO.dx+tx+'px';
dO.arrows.style.top=dO.dy+ty+'px';
}
if(dO.okScrY)dO.dy=(dO.godn)?Math.min(dO.dy+dO.samntY,dh):Math.max(0,dO.dy-dO.samntY);
if(dO.okScrX)dO.dx=(dO.golf)?dO.dx-dO.samntX:dO.dx+dO.samntX;
if(dO.okScrY||dO.okScrX)scroll(dO.dx,dO.dy);
}

window.onload=function(){
dO.arrows=(dO.ns4)?document.layers['arrws']:(dO.ie4)?document.all['arrws']:document.getElementById('arrws');
setInterval('dOscrollpage()',5);
}

if(!document.layers){
dO.txt='<div id="arrws" style="position:absolute; left:0px; top:-100px; width:70px; height:30px">';
dO.txt+='<img src="Gifs/arrow-blind.gif" width=10 height=30>';
dO.txt+='<a href="javascript:dOsetscroll(true,true)" style="cursor:default" onmouseover="dO.okScrY=true; dO.godn=false; status=\'\'; return true" onmouseout="dO.okScrY=false" alt="Click to slow vertical speed." onfocus="if (this.blur) this.blur()"><img src="Gifs/arrow-blind.gif" width=10 height=30 border="0"></a>';
dO.txt+='<img src="Gifs/arrow-blind.gif" width=10 height=30><br>';
dO.txt+='<a href="javascript:dOsetscroll(false,false)" style="cursor:default" onmouseover="dO.okScrX=true; dO.golf=true; status=\'\'; return true" onmouseout="dO.okScrX=false" alt="Click to slow horizontal speed." onfocus="if (this.blur) this.blur()"><img src="Gifs/arrow-left.gif" width=30 height=10 border="0"></a>';
dO.txt+='<img src="Gifs/arrow-point-pic.gif" width=10 height=10>';
dO.txt+='<a href="javascript:dOsetscroll(false,true)" style="cursor:default" onmouseover="dO.okScrX=true; dO.golf=false; status=\'\'; return true" onmouseout="dO.okScrX=false" alt="Click to increase horizontal speed." onfocus="if (this.blur) this.blur()"><img src="Gifs/arrow-right.gif" width=30 height=10 border="0"></a><br>';
dO.txt+='<img src="Gifs/arrow-blind.gif" width=10 height=30>';
dO.txt+='<a href="javascript:dOsetscroll(true,false)" style="cursor:default" onmouseover="dO.okScrY=true; dO.godn=true; status=\'\'; return true" onmouseout="dO.okScrY=false" alt="Click to increase vertical speed." onfocus="if (this.blur) this.blur()"><img src="Gifs/arrow-blind.gif" width=10 height=30 border="0"></a>';
dO.txt+='<img src="Gifs/arrow-blind.gif" width=10 height=30></div>';
document.write(dO.txt);
}
