$(document).ready(function(){

// função para controle do menu header
	$("#menu2 li a").wrapInner( '<span class="out"></span>' );
		$("#menu2 li a").each(function() {
			$( '<span class="over">' +  $(this).text() + '</span>' ).appendTo( this );
});

	$("#menu2 li a").hover(function() {
		$(".out",	this).stop().animate({'top':	'45px'},	200); // move down - hide
			$(".over",	this).stop().animate({'top':	'0px'},		200); // move down - show

}, function() {
	$(".out",	this).stop().animate({'top':	'0px'},		200); // move up - show
		$(".over",	this).stop().animate({'top':	'-45px'},	200); // move up - hide
});




//função para envio do formulario 2
	$(".enviar2").click(function() {
		
		$(".erro").remove();
		var ret = false;
		$('#form2 .need').each(function() {
			if(jQuery.trim($(this).val()) == '' ) {
				var labelTexto = $(this).prev('label').text();
				var s = $(this).next("span");
				s.append('<div class="erro">Este campo ('+labelTexto+') é obrigatório.</div>');
				ret = true;
			}
			if( jQuery.trim($(this).val()) == 'Selecione' ){
				var s = $(this).next("span");
				s.text("");
				s.append('<div class="erro">Por favor selecione uma opção.</div>');
				ret = true;
			}
		});
		if(ret) {
			return false;
		}
		

// Início do código de Aumentar/ Diminuir a letra
// Para usar coloque o comando: "javascript:mudaTamanho('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:mudaTamanho('tag_ou_id_alvo', +1);" para aumentar
 
var tagAlvo = new Array('p'); //pega todas as tags p//
 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array( '10px','11px','12px','13px' );
var tamanhoInicial = 2;
 
function mudaTamanho( idAlvo,acao ){
  if (!document.getElementById) return
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho += acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 6 ) tamanho = 6;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
  selecionados.style.fontSize = tamanhos[ tamanho ];
  
  for ( i = 0; i < tagAlvo.length; i++ ){
    tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );
    for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];
  }
}
// Fim do código de Aumentar/ Diminuir a letra






