function pageScroll() {
    	window.scrollBy(0,1); // horizontal and vertical scroll increments
    	scrolldelay = setTimeout('pageScroll()',100); // scrolls every XX milliseconds

		var tmpvar = getScrollXY();
                var tmpvar2 = getPageSizeWithScroll();

                if (BrowserDetect.browser == "Explorer") {
                     tmpvar2 = tmpvar2 * 2.5;
                 }
                else {
                     tmpvar2 = tmpvar2/2.5;
                }

                //alert(tmpvar2);
		//var tmpvar2 = getHeight_bottom();
		//window.status = tmpvar + ' / ' + tmpvar2;
		//if (tmpvar > tmpvar2-50) {

		if (tmpvar > tmpvar2) {
		   window.scroll(0,0); // horizontal and vertical scroll targets
		} 
}



function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  //return [ scrOfX, scrOfY ];
  // window.alert( scrOfY);
  return [ scrOfY ];
}


function getHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return [myHeight];
}


function stopScroll() {
    	clearTimeout(scrolldelay);
}

function resumeScroll() {
        pause(900);
    	pageScroll();
}


function pause(millis)  {
    var date = new Date();
    var curDate = null;

    do { 
       curDate = new Date(); 
    }  
    while(curDate-date < millis);
} 