/* Função para mudar automaticamente de form */
function autotab(atual,destino){
	if (atual.getAttribute&&atual.value.length==atual.getAttribute("maxlength"))
	destino.focus()
}

/*Função para mostrar/ocultar conteúdos de layers*/
function showP(num){
	var i = 1;
	for (i=0;i<1000;i++){
		if (document.getElementById('p'+i)){
			eval("document.getElementById('p" +i+"').style.display = 'none'");
			if (i == num) {
				eval("document.getElementById('p"+num+"').style.display = 'block'");
			}
		}
	}
}

/*Função para redimensionamento automático de popup*/
var arrTemp=self.location.href.split("?"); 
var picUrl = (arrTemp.length>0)?arrTemp[1]:""; 
var NS = (navigator.appName=="Netscape")?true:false; 
function FitPic() { 
	iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
	iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
	iWidth = document.images[0].width - iWidth; 
	iHeight = document.images[0].height - iHeight; 
	if (NS) {
		window.resizeBy(iWidth+35, iHeight);
	} else {
		window.resizeBy(iWidth, iHeight);
	}
	self.focus();
}; 

/* Popup 2.0 --------------------/
x: Nome da página
n: Alias da página (background)
w: Tamanho horizontal
h: Tamanho vertical
s: Scrollbar
Scrpit que chama popup: javascript:pop('nomedapagina.htm','alias_de_background',480,345,'yes');
--------------------------------*/

function pop(x,n,w,h,s) {
	var l = ( (window.screen.width  - w) / 2 );
	var t = ( (window.screen.height - h) / 2 );
    janelinha = window.open(x,n,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+s+',resizable=no,top='+t+',left='+l+',screenX='+l+',screenY='+t+',copyhistory=no,height='+h+',width='+w+'');
	janelinha.focus();
}