$(document).ready(function() {	
	$("#menu .programa").click(function(){
		$('#logo').stop(true,true).animate({'left':'100%', 'margin-left':'-420px','top':'100%','margin-top':'-400px'},'slow');
		$('#listras').stop(true,true).animate({'left':'100%', 'margin-left':'-1400px','top':'100%','margin-top':'-1200px'},'slow');
		$('.home').stop(true,true).css({'background':'none'});
		$('#titulo').stop(true,true).fadeOut('fast',function(){
				$('#titulo').html('Programação').css({'text-align':'left','left':'30px','margin-top':'-10px'}).fadeIn('fast',function(){
			$('#tbprogramacao').fadeIn('fast')
		});
		});
		$('#texto').stop(true,true).fadeOut('fast');
		$('#inscricao').stop(true,true).fadeOut('fast');
		$('#faleconosco').stop(true,true).fadeOut('fast');
	});
	$("#menu .ficha").click(function(){
		$('#logo').stop(true,true).animate({'left':'30px', 'margin-left':'0px','top':'100%','margin-top':'-520px'},'slow');
		$('#listras').stop(true,true).animate({'left':'0', 'margin-left':'-930px','top':'100%','margin-top':'-1330px'},'slow');
		$('.home').stop(true,true).css({'background':'none'});
		$('#titulo').stop(true,true).fadeOut('fast',function(){
				$('#titulo').html('Inscreva<span>-</span>se').css({'text-align':'right','left':'0','margin-top':'40px'}).fadeIn('fast',function(){
			$('#inscricao').fadeIn('fast')
		});
		});
		$('#texto').stop(true,true).fadeOut('fast');
		$('#tbprogramacao').stop(true,true).fadeOut('fast');
		$('#faleconosco').stop(true,true).fadeOut('fast');
	});
	$("#menu .fale").click(function(){
		$('#logo').stop(true,true).animate({'left':'100%', 'margin-left':'-420px','top':'100%','margin-top':'-600px'},'slow');
		$('#listras').stop(true,true).animate({'left':'100%', 'margin-left':'-1400px','top':'100%','margin-top':'-1400px'},'slow');
		$('.home').stop(true,true).css({'background':'none'});
		$('#titulo').stop(true,true).fadeOut('fast',function(){
				$('#titulo').html('<span>Fale</span> Conosco').css({'text-align':'left','left':'30px','margin-top':'-10px'}).fadeIn('fast',function(){
			$('#faleconosco').fadeIn('fast')
		});
		});
		$('#texto').stop(true,true).fadeOut('fast');
		$('#tbprogramacao').stop(true,true).fadeOut('fast');
		$('#inscricao').stop(true,true).fadeOut('fast');
	});
	$("#linkhome").click(function(){
		$('#logo').stop(true,true).animate({'left':'30px', 'margin-left':'0','top':'20px','margin-top':'0'},'slow');
		$('#listras').stop(true,true).animate({'left':'0', 'margin-left':'-930px','top':'0','margin-top':'-780px'},'slow');
		$('.home').stop(true,true).css({'background':'none'});
		$('#titulo').stop(true,true).fadeOut('fast',function(){
				$('#titulo').html('<span>18º</span> Dia D').css({'text-align':'right','right':'0px','margin-top':'70px'}).fadeIn('fast',function(){
			$('#texto').fadeIn('fast')
		});
		});
		$('#tbprogramacao').stop(true,true).fadeOut('fast');
		$('#inscricao').stop(true,true).fadeOut('fast');
		$('#faleconosco').stop(true,true).fadeOut('fast');
		$('.home').stop(true,true).css({'background':''});
	});

	$("#s_inscricao").click(function() {
		
		var name = $("#i_name").val();
		var email = $("#i_email").val();
		var phone = $("#i_phone").val();
		var informations = $("#i_informations").val();

		$.post('register.php', {name: name, email: email, phone: phone, informations: informations }, 
		function(resposta) {
				if (resposta != false) {
					$("#inscricao").html(resposta);
				}
				else {
					$("#inscricao").html("<h2>Você foi inscrito no evento!</h2>");
					$("#nome").val("");
					$("#email").val("");
					$("#phone").val("");
					$("#informations").val("");
				}
		});

		});


	$("#s_faleconosco").click(function() {
		
		var name = $("#f_name").val();
		var email = $("#f_email").val();
		var message = $("#f_message").val();


		$.post('contact.php', {name: name, email: email, message: message }, 
		function(resposta) {
				if (resposta != false) {
					$("#faleconosco").html(resposta);
				}
				else {
					$("#faleconosco").html("<h2>Sua mensagem foi enviada com sucesso!</h2>");
					$("#name").val("");
					$("#email").val("");
					$("#message").val("");

				}
		});

		});
		


});





