$(document).ready(function() {
	$('.propagandaflutuante').width('100%');
	$('.propagandaflutuante').height($(document).height());
	$('.propagandaflutuante').click(function() {
		$(this).fadeOut('slow');
	});
	
	$('.propagandaflutuante div').css('left', ($(document).width() / 2) - ($('.propagandaflutuante div img').width() / 2));
	$('.propagandaflutuante div').css('top', 80);
	
	$('.propagandas').cycle({fx: 'fade'});
	
	$('#carrosel').jcarousel();
	
	// Formatação dos campos em trabalhe conosco.
	$('#nascimento').mask('99/99/9999');
	$('#cpf').mask('999.999.999-99');
	$('#telefone').mask('(99)9999-9999');
	$('#celular').mask('(99)9999-9999');
	$('#uf').mask('**');
	$('#cep').mask('99999-999');
	$('#dataentrada1').mask('99/99/9999');
	$('#datasaida1').mask('99/99/9999');
	$('#dataentrada2').mask('99/99/9999');
	$('#datasaida2').mask('99/99/9999');
	$('#dataentrada3').mask('99/99/9999');
	$('#datasaida3').mask('99/99/9999');
});

function focar(elemento) {
	elemento.value = '';
}

function desfocar(elemento, texto) {
	if (elemento.value == '') elemento.value = texto;
}

function validarNewsletter() {
	var doc = document.forms[0];
	
	if (doc.nome.value == '') {
		alert('Preencha o nome.');
		doc.nome.focus();
		return false;
	} else if (doc.email.value == '') {
		alert('Preencha o e-mail.');
		doc.email.focus();
		return false;
	} else return true;
}

function validarCurriculo() {
	var doc = document.forms[0];
	
	if (doc.nome.value == '') {
		alert('Preencha o nome.');
		doc.nome.focus();
		return false;
	} else if (doc.cpf.value == '') {
		alert('Preencha o cpf.');
		doc.cpf.focus();
		return false;
	} else if (doc.email.value == '') {
		alert('Preencha o e-mail.');
		doc.email.focus();
		return false;
	} else return true;
}

function validarContato() {
	var doc = document.forms[0];
	
	if (doc.nome.value == '') {
		alert('Preencha o nome.');
		doc.nome.focus();
		return false;
	} else if (doc.telefone.value == '') {
		alert('Preencha o telefone.');
		doc.telefone.focus();
		return false;
	} else if (doc.email.value == '') {
		alert('Preencha o e-mail.');
		doc.email.focus();
		return false;
	} else if (doc.mensagem.value == '') {
		alert('Preencha a mensagem.');
		doc.mensagem.focus();
		return false;
	} else return true;
}

function exibirImagem(img) {
	document.getElementById('imagem').src = img;
}
