// 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=2;
dO.samntX=2;
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-300;
var ty=wy-170;
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()',60);
}

if(!document.layers){
dO.txt='<div id="arrws" style="position:absolute; left:0px; top:-100px; width:110px; height:150px">';
dO.txt+='<img src="arrows_b.gif" width=0 height=0>';
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."><img src="arrows_up.gif" border="0" width=1 height=1></a>';
dO.txt+='<img src="arrows_b.gif" width=1 height=1><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."><img src="arrows_lf.gif" border="0" width=15 height=30></a>';
dO.txt+='<img src="arrows_cntr.gif" width=60 height=130>';
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."><img src="arrows_rt.gif"  border="0" width=15 height=30></a><br>';
dO.txt+='<img src="arrows_b.gif" width=0 height=0>';
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."><img src="arrows_dn.gif" border="0" width=1 height=1></a>';
dO.txt+='<img src="arrows_b.gif" width=1 height=1></div>';
document.write(dO.txt);
}
