/*--------------------------- Inicio do Script by Decio ---------------------------*/
$(document).ready(function() { 
    $('body').hide();
    $('body').fadeIn(2000);
    $('<div id="mask"></div>')
		.css({
		opacity : 0.68,
		width : $(document).width(),
		height : $(document).height()
		})
		.appendTo('body').hide();
    $('#formtraco').css('opacity','0');
    $('#email a').click(function (event) {
	event.preventDefault();
	$('#mask').fadeIn(2000);
	$('#formtraco').hide();
	$('#formtraco').css({
		'z-index': 5,
		opacity: 1
			    });
	$('#formtraco').fadeIn(500);
	});

    //script para placeholder do formulrio :P
    
   /* var textDefault0 = $('#formtraco input:eq(0)').attr('title');
    $('#formtraco input:eq(0)').val(textDefault0)
    .focus(function() {
	if ($(this).val() == textDefault0) {
		$(this).val("");
	}
	}).blur(function() {
	if ($(this).val() =="") {
		$(this).val(textDefault0);	
	}
	});
     var textDefault1 = $('#formtraco input:eq(1)').attr('title');
    $('#formtraco input:eq(1)').val(textDefault1)
    .focus(function() {
	if ($(this).val() == textDefault1) {
		$(this).val("");
	}
	}).blur(function() {
	if ($(this).val() =="") {
		$(this).val(textDefault1);	
	}
	});*/
     var textArea = $('#formtraco textarea').text();
    $('#formtraco textarea').val(textArea)
    .focus(function() {
	if ($(this).val() == textArea) {
		$(this).val("");
	}
	}).blur(function() {
	if ($(this).val() == "") {
		$(this).val(textArea);	
	}
	});//fim do placeholder :P
    

    //inicio da validacao do formulario
    
	$('#formtraco').validate({
    // Define as regras
    rules:{
    nome:{
    // Nome será obrigatório (required) e terá tamanho mínimo (minLength)
    required: true, minlength: 2
    },
    email:{
    // Email será obrigatório (required) e precisará ser um e-mail válido (email)
    required: true, email: true
    },
    mensagem:{
    // Mensagem será obrigatório (required) e terá tamanho mínimo (minLength)
    required: true, minlength: 5
    }
    },
    // Define as mensagens de erro para cada regra
    messages:{
    nome:{
    required: "Digite seu nome >>",
    minLength: "O seu nome deve conter, no mínimo, 2 caracteres"
    },
    email:{
    required: "Digite seu email >>",
    email: "Digite um e-mail válido"
    },
    mensagem:{
    required: "",
    minLength: "A sua mensagem deve conter, no mínimo, 2 caracteres"
    }
    }
    });
	
	$('#formtraco label.error').css('opacity','0.3');
	
	$('#formtraco').fadeOut(300);
	$('#mask').fadeOut(1000);
    
    $('#enviar').css('opacity','0.7');
    $('#enviar').hover(
		       function() {
			$('#enviar').css('opacity','1')},
			function(){
			$('#enviar').css('opacity','0.7')
				});
	
    $('#closeformBtn').click(function() {
	$('#formtraco').fadeOut(300);
	$('#mask').fadeOut(1000);
	});
    $('#mask').click(function() {
	$('#formtraco').fadeOut(300);
	$('#mask').fadeOut(1000);
	});
	
	//Inicio dos scripts da equipe
	//todas div's ".individuo" estao com display none no css
	$('.individuo').css('opacity','0');
	
	$('#ricardolink')
	.hover(function(){
		$(this).append('<img src="img/fotos/ricardo-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#ricardolink img').remove()
		});
	$('#ricardolink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#ricardo')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#ricardo')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#sergiolink')
	.hover(function(){
		$(this).append('<img src="img/fotos/sergio-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#sergiolink img').remove()
		});
	$('#sergiolink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#sergio')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#sergio')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#danilolink')
	.hover(function(){
		$(this).append('<img src="img/fotos/danilo-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#danilolink img').remove()
		});
	$('#danilolink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#danilo')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#danilo')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	
	$('#deciolink')
	.hover(function(){
		$(this).append('<img src="img/fotos/decio-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#deciolink img').remove()
		});
	$('#deciolink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		})
		$('<button id="pessoaBtn"></button>')
		.appendTo('#decio')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#decio')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#meclink')
	.hover(function(){
		$(this).append('<img src="img/fotos/mecchi-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#meclink img').remove()
		});
	$('#meclink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#mec')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
	$('#mec')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#nashalink')
	.hover(function(){
		$(this).append('<img src="img/fotos/nascha-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#nashalink img').remove()
		});
	$('#nashalink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#nasha')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#nasha')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#peterlink')
	.hover(function(){
		$(this).append('<img src="img/fotos/peter-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#peterlink img').remove()
		});
	$('#peterlink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#peter')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#peter')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#prilink')
	.hover(function(){
		$(this).append('<img src="img/fotos/pri-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#prilink img').remove()
		});
	$('#prilink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#pri')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#pri')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#tomlink')
	.hover(function(){
		$(this).append('<img src="img/fotos/tom-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#tomlink img').remove()
		});
	$('#tomlink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#tom')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#tom')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#mayconlink')
	.hover(function(){
		$(this).append('<img src="img/fotos/maycon-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#mayconlink img').remove()
		});
	$('#mayconlink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#maycon')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#maycon')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#fabilink')
	.hover(function(){
		$(this).append('<img src="img/fotos/fabio-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#fabilink img').remove()
		});
	$('#fabilink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#fabi')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#fabi')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});

	$('#alinelink')
	.hover(function(){
		$(this).append('<img src="img/fotos/aline-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#alinelink img').remove()
		});
	$('#alinelink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#aline')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#aline')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#gabilink')
	.hover(function(){
		$(this).append('<img src="img/fotos/gab-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#gabilink img').remove()
		});
	$('#gabilink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#gabi')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#gabi')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	$('#verolink')
	.hover(function(){
		$(this).append('<img src="img/fotos/veronica-foto.jpg" />')
		.hide()
		.fadeIn(300)
		},
		function(){
		$('#verolink img').remove()
		});
	$('#verolink').click(function(event){
		event.preventDefault();
		$('#mask')
		.fadeIn(800)
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('<button id="pessoaBtn"></button>')
		.appendTo('#vero')
		.click(function() {
		$('#mask').fadeOut(100)
		$('.individuo').fadeOut(400)
		$('#pessoaBtn').remove()
		});
		$('#vero')
		.css({
			opacity: 1,
			zIndex: '5'})
		.hide()
		.fadeIn(600);
	});
	
	//fim do script da equipe 
	
	//Inicio do script da pagina de cases
	
	/*
	
	$('<div id="visor"><img /><p id="legendaVisor"></p></div>').prependTo('#tramposcontent');
	$('#visor img').attr({
		src: $('.projetosLista li a img:eq(0)').attr('src'),
		alt: $('.projetosLista li a img:eq(0)').attr('alt')
		});
	$('#legendaVisor').text($('.projetosLista li a img:eq(0)').attr('alt'));
	$('.projetosLista img')
	 .hover(
	function() {
	 $('#tooltipimg').remove()
	 $('<span id="tooltipimg"></span>')
	 .text($(this).attr('alt')).insertAfter(this)
	 .hide().fadeIn(600)
	 },
	 function(){
	$('#tooltipimg').remove()
		 });
	 $('.projetosLista li a img:eq(0)').attr('id','atual');
	 $('.projetosLista img').click(function(event){
		event.preventDefault();
			$('#visor img').remove();
			$('<img />')
			.attr({
				'src': $(this).attr('src'),
				'alt': $(this).attr('alt')
			})
			.appendTo('#visor')
			.hide().fadeIn(100)
			$('#visor p').remove();
			$('<p id="legendaVisor"></p>')
			.text($(this).attr('alt'))
			.appendTo('#visor')
			.hide().fadeIn(1000)
			$('.projetosLista img').removeAttr('id')
			$(this).attr('id','atual')
		       });
	*/
	
	$('.clientesLista a')
	 .hover(
		function() {
			$('#tooltipimg').remove()
			$('<span id="tooltipimg"></span>')
			.text($(this).text()).insertAfter(this)
			.hide().fadeIn(300)
			},
			function(){
		       $('#tooltipimg').remove()
		 });
	$('.clientesLista a').click(function(){
        window.open(this.href);
        return false;
	});
	
	$('#copyright h6 a').click(function(){
        window.open(this.href);
        return false;
	});
    });
	 
	 
	 
	 
	 
	 
	 
