var timer;
function scrollDown(src){
	topAnt = document.getElementById(src).scrollTop;
	document.getElementById(src).scrollTop += 2;
	
	if (document.getElementById(src).scrollTop==topAnt) {
		scrollStop()
		return false;
	}
	var funcstop = "scrollDown('"+src+"')";
	timer = setTimeout(funcstop, 10);
}

function scrollUp(src){
	document.getElementById(src).scrollTop -= 2;
	if (document.getElementById(src).scrollTop==0) {
		scrollStop()
		return false;
	}
	var funcstop = "scrollUp('"+src+"')";
	timer = setTimeout(funcstop, 10);
}

function scrollStop(){
	clearTimeout(timer);
}
function GoToTop(src) {
	document.getElementById(src).scrollTop = 0;
}
function GoToBottom(src, BoxWidth) {
	elemts = document.getElementById(src);
	bottom = BoxWidth
	document.getElementById(src).scrollTop = bottom;
	scrollStop()
}
function BoxWidth(src) {
	almts = document.getElementById(src);
	width = almts.width;
	if (width==null) {
		width = almts.style.width;
		width = width.replace('px', '');
		width = width.replace('%', '');
	}
	return width;
}

//Cria uma nova janela personalizada
function new_window(slink, iwidth, iheigth) {
	window.open(slink,'','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,menubar=no,width='+iwidth+',height='+iheigth);
}
