function popup(caminho,nome,largura,altura,rolagem) 
{
    var esquerda = (screen.width - largura) / 2;
    var cima = (screen.height - altura) / 2 -50; 
    window.open(caminho,nome,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + rolagem + ',resizable=no,copyhistory=no,top=' + cima + ',left=' + esquerda + ',width=' + largura + ',height=' + altura + ", scrollbars=no");
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

/**********************************/
var speed=50;
 
var loop, timer;

function moveArea(nome, move)
{ 
	if (document.all)
	{
		layer = document.all[nome];
					
		var temp_top = parseInt(layer.style.top.substr(0, layer.style.top.length - 2));
	
		var clip = layer.style.clip.split(" ");
		
		var temp_clip_top = parseInt(clip[0].substr(5, clip[0].length - 7));
			
		var temp_width = parseInt(layer.style.width.substr(0, layer.style.width.length - 2));

		var temp_clip_bottom = parseInt(clip[2].substr(0, clip[2].length - 2));	
		
		var height = temp_clip_bottom - temp_clip_top;
		
		var new_clip_top = temp_clip_top + move;
		var new_clip_bottom = new_clip_top + height;

		var temp_height = parseInt(layer.style.height.substr(0, layer.style.height.length - 2));

		if (new_clip_top >= 0 && new_clip_bottom <= temp_height)
		{
			layer.style.clip = "rect(" + new_clip_top + " " + temp_width + " " + new_clip_bottom + " 0)" ;
			layer.style.top = (parseInt(layer.style.top.substr(0, layer.style.top.length - 2)) - move);			
		}
	}
	else
	{
		layer = document.layers[nome];
		
		var height = layer.clip.bottom - layer.clip.top;
		var auxTop = layer.clip.top + move;
		var auxBottom = auxTop + height;
		
		if (auxTop >= 0 && auxBottom <= layer.document.height)
		{
			layer.clip.top = auxTop;
			layer.clip.height = height;
			layer.top -= move;			
		}
	}
	
	if (loop) timer = setTimeout("moveArea('" + nome + "', " + move + ")", speed);
} 

function PerformScroll(nome, move)
{ 
	loop=true; 
		
	moveArea(nome, move);
} 
 
function CeaseScroll()
{ 
    loop = false;
    if (timer) clearTimeout(timer) ;

		timer = false;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
