/**********************************************
 *	AUTHOR: Rubens Daniel Mariuzzo de la Cruz
 *	DATE:	03-April-2007
 *	DESC:	Function to make a smooth scroll
 *			effect into div layers
 *	LICE:	MIT-Licence
 *			(http://www.opensource.org/licenses/mit-license.php)
 *	http://www.mariuzzo.com
 *********************************************/

var timer = 0;
var delay = 5;
	
// Function to scroll up the content of a div layer
function scrollToUp( quantity ){
	if(timer)clearInterval(timer);
	timer = setInterval("scrollToUpByStep("+quantity+")", delay);
}

function scrollToUpByStep( quantity ){
	document.getElementById("at-content").scrollTop-=quantity;
}

// Function to scroll down the content of a div layer
function scrollToDown( quantity ){
	if(timer)clearInterval(timer);
	timer = setInterval("scrollToDownByStep("+quantity+")", delay);
}

function scrollToDownByStep( quantity ){
	document.getElementById("at-content").scrollTop+=quantity;
}

//	Function to stop scrolling
function stopToScroll(){
	if(timer)clearInterval(timer);
}

// Function to positionate the content of a div layer
function positionateTo( index , quantity ){
	var dvcontent = document.getElementById("at-content");
	dvcontent.scrollTop = index*quantity;
}