$(document).ready(function(){
	
		$(document).ready(function(){
			$(".video_zigma").colorbox({iframe:true, innerWidth:425, innerHeight:344});
		});

	// Menu Lavalamp
	$("#1, #2").lavaLamp({
		fx: "linear",
		speed: 700
	});
	
	//mascara telefone
	$("#telefone").mask("(99)9999-9999");	
 
	//validação formulário
	$("#formularioContato").submit(function(){
		var campo_nome = $("#nome").val();
		var campo_email = $("#email").val();
		var campo_mensagem = $("#mensagem").val();
		var campo_telefone = $("#telefone").val();
		var campo_newsletter_sim = $("#newsletter_sim:checked").length;
		var campo_newsletter_nao = $("#newsletter_nao:checked").length;
		var erro = 0;
		
		$(".Limpar").next('div').html('');
		$(".Limpar_email").next('div').html('');
		$(".Limpar_nome").next('div').html('');
		$(".Limpar_mensagem").next('div').html('');
		$(".Limpar_newsletter").next('div').html('');
		
		
		if(campo_nome ==""){
			erro=1; 
			$("#nome").next('div').html('Digite seu nome corretamente');		
		}
		if(campo_email.indexOf('@')==-1 && campo_email.indexOf('.com')==-1){
			erro=1; 
			$("#email").next('div').html('Informe o seu email corretamente');
		}
		if(campo_mensagem =="" ){
			erro=1;
			$("#mensagem").next('div').html('Informe uma mensagem com no mínimo 2 caracteres');
		}
		if(campo_newsletter_sim==0 && campo_newsletter_nao==0){
			erro=1;
			$("#mensagem_newsletter").html('For favor marque uma opção Newsletter');
		}

		if(erro > 0){
			return false;
		} else{
			return true;
		}
	});
 
 //formulário validação trabalhe conosco
 
 $("#formularioCurriculo").submit(function(){
	 var campo_nome = $("#nome").val();
	 var campo_email = $("#email").val();
	 var campo_telefone = $("#telefone_curriculo").val();
	 var campo_cidade = $("#cidade").val();
	 var campo_estado = $("#estado").val();
	 var campo_interesse = $("#area-de-interesse").val();
	 var erro = 0;
	 
	 $(".Limpar_nome").next('div').html('');
	 $(".Limpar_email").next('div').html('');
	 $(".Limpar_telefone_curriculo").next('div').html('');
	 $(".Limpar_cidade_curriculo").next('div').html('');
	 $(".Limpar_estado_curriculo").next('div').html('');
	 $(".Limpar-area-de-interesse").next('div').html('');
	 $(".Limpar_curriculo").html('');

	 	 
	 if(campo_nome ==""){
		erro=1; 
		$("#nome").next('div').html('Digite seu nome corretamente');		
	 }
	  if(campo_email.indexOf('@')==-1 && campo_email.indexOf('.com')==-1){
		erro=1; 
		$("#email").next('div').html('Informe o seu email corretamente');
	 }
	  if(campo_cidade =="" ){
		erro=1;
		$("#cidade").next('div').html('Informe o nome de sua cidade');
	 }
	  if(campo_estado =="" ){
		erro=1;
		$("#estado").next('div').html('Informe o nome do seu estado');
	 }
	 if(campo_interesse =="" ){
		erro=1;
		$("#area-de-interesse").next('div').html('Informe a área de interesse');
	 }
	  if(campo_telefone =="" ){
		erro=1;
		$("#telefone_curriculo").next('div').html('Informe um telefone para contato');
	 }

	if(erro>0){
		return false;
	}
	else{
		return true;	
	}
	
 });
 
	//formulário validação receba notícias
 
	$("#receba_noticias").submit(function(){
		var campo_nome = $("#nome_receba").val();
		var campo_email = $("#email_receba").val();
		var erro = 0;

		$("#Limpar_nome_receba").html('');
		$("#Limpar_email_receba").html('');

		if(campo_nome =='Nome'){
			erro=1; 
			$("#Limpar_nome_receba").html('Digite seu nome corretamente');		
	 	}
	  	if(campo_email.indexOf('@')==-1 && campo_email.indexOf('.com')==-1){
			erro=1; 
			$("#Limpar_email_receba").html('Informe o seu email corretamente');
	 	} 
		if(erro>0){
			return false;
		}
		else{
			return true;	
		}
	 });
 
 //Tira nome e e-mail do campo quando a pessoa clica //receba notícias zigma
 
 	$("#nome_receba").focus(function(){if($(this).val() == 'Nome') $(this).val('');});
	$("#nome_receba").blur(function(){if($(this).val() == '') $(this).val('Nome');});
	
	$("#email_receba").focus(function(){if($(this).val() == 'E-mail') $(this).val('');});
	$("#email_receba").blur(function(){if($(this).val() == '') $(this).val('E-mail');});
 
});

