// função para facilitar a vida.. heeh
	function gE(ID){
		return document.getElementById(ID);
	}

// classe para validações
/*	
	Os parametros passados para a validação são o ID do input, onde o mesmo deverá estar entre '' (aspas simples).
	Ex. de uso:		
		<form action="acao.php" onsubmit="return Validacao.ValidaItens('campoNome', 'itAssunto', 'frMensagem', 'oEmail', n);" method="post">
		** n -> é possivel iserir quantos campos quiser
*/
var Validacao = {
	ValidaItens: function(){
		var args = Validacao.ValidaItens.arguments; // coloca os parametros em uma variavel no qual se tornará um Array
		if (args.length > 0){ // verifica se há parametros atribuidos a função
			for (var x = 0; x < args.length; x++){
				var vItem = gE(args[x]);
				if (vItem.value == "" || vItem.value == null){
					vItem.focus();
					vItem.style.border = 'solid 1px red';
					alert("Campo en blanco");
					return(false);
				}else{
					vItem.style.border = '';
				}				
				//verifica se há algum campo de e-mail para chamar o validaEmail
				var vCampo = args[x].toLowerCase();		
				if (vCampo.indexOf('email') > 0){
					if (Validacao.ValidaEmail(vItem) == false)
						return(false);
				}				
			} // fim do for			
			return(true);
		}else{
			alert('Se ha producido un error al realizar las operaciones');
			return(false);			
		}// else (args.length > 0){
	}, // fim do ValidaItens
	
	ValidaEmail: function(pCampo){
		var email = pCampo.value;
		var resp = email.search(/(\w[\w\.\+]+)@(.+)\.(\w+)$/)==0;
		
		if (resp == false){
			pCampo.focus();
			pCampo.style.border = 'solid 1px red';
			alert('E-mail no válidos');
			return(false);
		}else{
			return(true);
		}
	}
};

function abrePagina(url){
	window.location = url;
}

// abre pop-up
function abrePopUp(url, id, largura, altura){
	window.open(url, id, 'width='+largura+', height='+altura+', scrollbars=no');
}


/* função para alterar o tamanho das fontes */
	var tam = 11;
	var lin = 1.5;
	function alterarTamanhoFonte(tipo, onde){
		
		var minimo = 7;
		var maximo = 20;
		vardomElement = gE(onde);
												  
		if( tipo == 'mais' ){
			if( tam < 16 ) tam += 2;
		}
		else{
			if( tam > 9 ) tam -= 2 ;
		}
		
		mudaFonte(tipo , document.getElementById(onde)) ;     
	}
	
	
	function mudaFonte( tipo , idM ){		
	  for( var i = 0 ; i < idM.childNodes.length ; i++ ){
		mudaFonte( tipo , idM.childNodes.item( i )  );
	  }
	  if( idM.style )
		idM.style.fontSize = tam+'px';
	}