// JavaScript Document
$(document).ready(function () {
	style = 'easeOutQuart';
	$('a#trabalho1').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-95},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-144},{duration:100, easing: style});
		}
	);
	$('a#trabalho2').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-95},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-144},{duration:100, easing: style});
		}
	);
	$('a#trabalho3').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-95},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-144},{duration:100, easing: style});
		}
	);
	$('a#destaque_internet').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:0},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-49},{duration:100, easing: style});
		}
	);
	$('#trabalhos_internas .coluna1 a').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:0},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-49},{duration:100, easing: style});
		}
	);
	$('#trabalhos_internas .coluna2 a').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:0},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-49},{duration:100, easing: style});
		}
	);
	$('#trabalhos_internas .coluna3 a').hover(
		function() {
			$(this).children('span').stop(false,true).animate({bottom:0},{duration:300, easing: style});
		},
		function() {
			$(this).children('span').stop(false,true).animate({bottom:-49},{duration:100, easing: style});
		}
	);
});

$(function() {
	$("#tabs_depoimentos").tabs({
		spinner: 'carregando...'
	});
});

$(function() {
	$("#tabs_estrategias").tabs({
		spinner: 'carregando...'
	});
});

/*$(function() {
	$("input").focus(function() {
		$(this).css("background-color", "#f4f4f4");
	});
	$("input").blur(function() {
		$(this).css("background-color", "#fff");
	});
	$("textarea").focus(function() {
		$(this).css("background-color", "#f4f4f4");
	});
	$("textarea").blur(function() {
		$(this).css("background-color", "#fff");
	});
	$("input#form_contato_envie").focus(function() {
		$(this).css("background-color", "#000");
	});
});*/

$(document).ready(function() {
	$('#form_contato .aviso').hide();
	$("#form_contato_envie").click(function() {
		var nome = $("#form_contato_nome").val();
		var email = $("#form_contato_email").val();
		var telefone = $("#form_contato_telefone").val();
		var mensagem = $("#form_contato_mensagem").val();
		if(nome == "") {
				$("#form_contato_nome").focus();
				$("#form_contato_nome").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_contato label.nome").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_contato .aviso').show('normal');
			return false;
		} if(nome > 0) {
				$("#form_contato_nome").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_contato label.nome").css({ color: '#333333', 'font-weight': 'normal' });
				$("#form_contato_email").focus();
			return false;
		} if(email == "") {
				$("#form_contato_email").focus();
				$("#form_contato_email").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_contato label.email").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_contato .aviso').show('normal');
			return false;
		} if(email > 0) {
				$("#form_contato_telefone").focus();
				$("#form_contato_email").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_contato label.email").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		} if(telefone == "") {
				$("#form_contato_telefone").focus();
				$("#form_contato_telefone").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_contato label.telefone").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_contato .aviso').show('normal');
			return false;
		} if(telefone > 0) {
				$("#form_contato_mensagem").focus();
				$("#form_contato_telefone").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_contato label.telefone").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		} if(mensagem == "") {
				$("#form_contato").css({ left: '3px' });
				$("#form_contato_mensagem").focus();
				$("#form_contato_mensagem").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) repeat-y scroll left 20px' });
				$("#form_contato label.mensagem").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_contato .aviso').show('normal');
			return false;
		} if(mensagem > 0) {
				$("#form_contato_envie").focus();
				$("#form_contato_mensagem").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_contato label.mensagem").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		} else {
			$("#form_contato label").css({ color: '#333333', 'font-weight': 'normal' });
			$('#form_contato .aviso').hide();
			return true;
		}
	});
	/* currículo */
	$('#form_curriculo .aviso').hide();
	$("#form_curriculo_envie").click(function() {
		var nome = $("#form_curriculo_nome").val();
		var email = $("#form_curriculo_email").val();
		var telefone = $("#form_curriculo_telefone").val();
		var especialidades = $("#form_curriculo_especialidades").val();
		var anexo = $("#form_curriculo_anexo").val();
		if(nome == "") {
				$("#form_curriculo_nome").focus();
				$("#form_curriculo_nome").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.nome").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_curriculo .aviso').show('normal');
			return false;
		} if(nome > 0) {
				$("#form_curriculo_nome").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.nome").css({ color: '#333333', 'font-weight': 'normal' });
				$("#form_curriculo_email").focus();
			return false;
		} if(email == "") {
				$("#form_curriculo_email").focus();
				$("#form_curriculo_email").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.email").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_curriculo .aviso').show('normal');
			return false;
		} if(email > 0) {
				$("#form_curriculo_telefone").focus();
				$("#form_curriculo_email").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.email").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		} if(telefone == "") {
				$("#form_curriculo_telefone").focus();
				$("#form_curriculo_telefone").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.telefone").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_curriculo .aviso').show('normal');
			return false;
		} if(telefone > 0) {
				$("#form_curriculo_especialidades").focus();
				$("#form_curriculo_telefone").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.telefone").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		} if(especialidades == "") {
				$("#form_curriculo_especialidades").focus();
				$("#form_curriculo_especialidades").css({ background: '#fff url(/img/bg_campos_form_obrigatorio.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.especialidades").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_curriculo .aviso').show('normal');
			return false;
		} if(especialidades > 0) {
				/*$("#form_curriculo_anexo").focus();*/
				$("#form_curriculo_especialidades").css({ background: '#fff url(/img/bg_campos_form.gif) no-repeat scroll left 5px' });
				$("#form_curriculo label.especialidades").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		}  if(anexo == "") {
				$("#form_curriculo_anexo").focus();
				$("#form_curriculo_anexo_2").css({ background: '#fff url(/img/bg_anexo_curriculo_obrigatorio.png) no-repeat scroll -1px 4px' });
				$("#form_curriculo label.anexo").css({ color: '#dd1100', 'font-weight': 'bold' });
				$('#form_curriculo .aviso').show('normal');
			return false;
		} if(anexo > 0) {
				$("#form_curriculo_envie").focus();
				$("#form_curriculo_anexo_2").css({ background: '#fff url(/img/bg_anexo_curriculo.png) no-repeat scroll -1px 4px' });
				$("#form_curriculo label.anexo").css({ color: '#333333', 'font-weight': 'normal' });
			return false;
		} else {
			$("#form_curriculo label").css({ color: '#333333', 'font-weight': 'normal' });
			$('#form_curriculo .aviso').hide();
			return true;
		}
	});
	
});

jQuery(document).ready(function() {
	$('#contato .esquerda #form_contato textarea').maxlength({
		maxCharacters: 350,
		slider: false
		}
	);
});

jQuery(document).ready(function() {
	$('#slideshow_internet_detalhes').cycle({
		fx:      'cover',
		easing:  'jswing',
		speed: 300,
		timeout: 5000,
		prev: '#ant',
		next: '#prox',
		pagerAnchorBuilder: function(idx, slide) {
		return '#nav li:eq(' + idx + ') a';
		}
	});
});

jQuery(document).ready(function() {
	$('#slideshow_idvisual_detalhes').cycle({
		fx:      'cover',
		easing:  'jswing',
		speed: 300,
		timeout: 5000,
		prev: '#ant',
		next: '#prox',
		pagerAnchorBuilder: function(idx, slide) {
		return '#nav li:eq(' + idx + ') a';
		}
	});
});


