//scrolling(350,2);
	var scrollCount;//count scroll in pixels
	var scrollJump;//jump in pixels
	var maxScroll;//max scroll
   
   function scrolling(scro,tiempo){//first parameter: where to stop scrolling, second time in seconds
		scrollCount = 0;
		maxScroll = scro;       
		scrollJump=(tiempo*1000)/maxScroll;
		autoScroll();
   }
      
	function autoScroll(){
		if (scrollCount < maxScroll) {
			scrollCount+=scrollJump;
			scroll(0,scrollCount);
			timer=setTimeout("autoScroll()",1);   
		}       
	}

	function scrollUp(scro,tiempo){//first parameter: where to stop scrolling, second time in seconds
		returnPageDimensions();
		returnScrollOffset();
		scrollCount = y;
		maxScroll = scro;       
		scrollJump=(scrollCount/(tiempo*1000))*20;
		autoScrollMinus();
	}
      
	function autoScrollMinus(){
		if ( scrollCount> maxScroll) {
			scrollCount-=scrollJump;
			scroll(0,scrollCount);
			setTimeout("autoScrollMinus()",1);   
		}       
	}


	function returnInnerDimensions(){
			if (self.innerHeight) // all except Explorer
			{
				x = self.innerWidth;
				y = self.innerHeight;
			}
			else if (document.documentElement && document.documentElement.clientHeight)
				// Explorer 6 Strict Mode
			{
				x = document.documentElement.clientWidth;
				y = document.documentElement.clientHeight;
			}
			else if (document.body) // other Explorers
			{
				x = document.body.clientWidth;
				y = document.body.clientHeight;
			}
	}
	
	function returnScrollOffset(){
			if (self.pageYOffset) // all except Explorer
			{
				x = self.pageXOffset;
				y = self.pageYOffset;
			}
			else if (document.documentElement && document.documentElement.scrollTop)
				// Explorer 6 Strict
			{
				x = document.documentElement.scrollLeft;
				y = document.documentElement.scrollTop;
			}
			else if (document.body) // all other Explorers
			{
				x = document.body.scrollLeft;
				y = document.body.scrollTop;
			}
	}
	
	function returnPageDimensions(){
			var test1 = document.body.scrollHeight;
			var test2 = document.body.offsetHeight
			if (test1 > test2) // all but Explorer Mac
			{
				x = document.body.scrollWidth;
				y = document.body.scrollHeight;
			}
			else // Explorer Mac;
					 //would also work in Explorer 6 Strict, Mozilla and Safari
			{
				x = document.body.offsetWidth;
				y = document.body.offsetHeight;
			}
	}