var iAutoScroll = 25;

//--- Start Generic ---


var myspeed=0


function scrollwindow(){
window.scrollBy(0,myspeed)
}

function initialize(){
  if (myspeed!=0) {
    scrollwindow();
  }
}
var isOpera = (navigator.userAgent.indexOf('Opera') != -1);
var isIE = (!isOpera && navigator.userAgent.indexOf('MSIE') != -1);
if (document.layers && isIE) document.captureEvents(Event.MOUSEOUT);
if (document.layers && isIE) document.onmouseout = function (evt) { myspeed = 0; }

if (document.all||document.getElementById||document.layers) setInterval("initialize()",20)

function listener( e )
{
   var docX, docY;
   if( e )
   {
      if( typeof( e.pageX ) == 'number' )
      {
         docX = e.pageX;
         docY = e.pageY;
      }
      else
      {
         docX = e.clientX;
         docY = e.clientY;
      }
   }
   else
   {
      e = window.event;
      docX = e.clientX;
      docY = e.clientY;
      if( document.documentElement
        && ( document.documentElement.scrollTop
            || document.documentElement.scrollLeft ) )
      {
         docX += document.documentElement.scrollLeft;
         docY += document.documentElement.scrollTop;
      } 
      else if( document.body
         && ( document.body.scrollTop
             || document.body.scrollLeft ) )
      {
         docX += document.body.scrollLeft;
         docY += document.body.scrollTop;
      }
   }
return docY;
}

if (document.layers) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = function (evt) {
  y = listener(evt);

  //if (bTooltip) positiontip(evt);
  if (document.layers) {
    var ty = window.pageYOffset;
    var by = window.pageYOffset + window.innerHeight;
  }
  else if (window.opera) {
    var ty = window.pageYOffset;
    var by = window.pageYOffset + window.innerHeight;
  }
  else if (document.all) {
    var ty = document.body.scrollTop;
    var by = document.body.scrollTop + document.body.clientHeight;
  }
  else if (document.getElementById) {
    var ty = window.pageYOffset;
    var by = window.pageYOffset + window.innerHeight;
  }
  if (y >= ty && y < ty + 30) {
    myspeed=-3;
    return;
  } else {
    if (y <= by && y > by - 30) {
      myspeed=3;
      return;
    } else {
      myspeed=0;
    }
  }
  if (y >= ty+30 && y < ty + 60) {
    myspeed=-2;
    return;
  } else {
    if (y <= by-30 && y > by - 60) {
      myspeed=2;
      return;
    } else {
      myspeed=0;
    }
  }
  if (y >= ty+60 && y < ty + 90) {
    myspeed=-1;
    return;
  } else {
    if (y <= by-60 && y > by - 90) {
      myspeed=1;
      return;
    } else {
      myspeed=0;
    }
  }
}
