function abreForm( vfnURL, vfnAltura, vfnLargura ){
	var vT;
	var vL;
	var vNome;
	var vVetor;
	vT = ( window.screen.height / 2 ) - ( vfnAltura / 2  );
	vT = ( vT - 40 );
	vL = ( window.screen.width / 2 ) - ( vfnLargura / 2 );	
	window.open( vfnURL, '_blank', 'width=' + vfnLargura + ', height=' + vfnAltura + ', left=' + vL + ', top=' + vT );	
}

function abrePopupFoto( foto, vfnAltura, vfnLargura ){
	var vT;
	var vL;
	var vNome;
	var vVetor;
	vT = ( window.screen.height / 2 ) - ( vfnAltura / 2  );
	vT = ( vT - 40 );
	vL = ( window.screen.width / 2 ) - ( vfnLargura / 2 );	
	window.open( "../util/popup-foto.php?foto=" + foto, '_blank', 'width=' + vfnLargura + ', height=' + vfnAltura + ', left=' + vL + ', top=' + vT );	
}

function abreGalUploader( serv, itm, largPerm, altPerm, maxFotos, tamMax, tipoVal ){
	abreForm( "../img-uploader/galeria.php?servico=" + serv + "&item=" + itm + "&larguraPermitida=" + largPerm + "&alturaPermitida=" + altPerm + "&maxFotos=" + maxFotos + "&tipoValidacao=" + tipoVal + "&tamanhoMaximoPermitido=" + tamMax, 490, 500 );
}

function abreImgUploader( foto, elSrc, elCod, largPerm, altPerm, tamMax, tipoVal ){
	abreForm( "../img-uploader/foto.php?codImg=" + foto + "&elSrc=" + elSrc + "&elCod=" + elCod + "&larguraPermitida=" + largPerm + "&alturaPermitida=" + altPerm + "&tipoValidacao=" + tipoVal + "&tamanhoMaximoPermitido=" + tamMax, 270, 250 );
}

function abreScrollForm( vfnURL, vfnAltura, vfnLargura ){
	var vT;
	var vL;
	var vNome;
	var vVetor;
	vT = ( window.screen.height / 2 ) - ( vfnAltura / 2  );
	vT = ( vT - 40 );
	vL = ( window.screen.width / 2 ) - ( vfnLargura / 2 );	
	window.open( vfnURL, '_blank', 'scrollbars=yes, width=' + vfnLargura + ', height=' + vfnAltura + ', left=' + vL + ', top=' + vT );	
}

function MaskEdit( src, mask ){
	var i = src.value.length;
	var saida = mask.substring( 0, 1 );
	var texto = mask.substring( i )
	if (texto.substring( 0, 1 ) != saida ){
		src.value += texto.substring( 0, 1 );
	};
}

function SoNumero(){
	if( event.keyCode < 48 || event.keyCode > 57 ){
		event.returnValue = false;
	};
}
