$(document).ready(function(){
	var corAtiva = '#000000';
	
	$("#lateral-pesquise").focus(function(){
		var value = $(this).val();
		if (value === 'Pesquise no site'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#lateral-pesquise").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Pesquise no site');
		}
		$(this).css('color','');
	});

	$("#lateral-nome").focus(function(){
		var value = $(this).val();
		if (value === 'Nome'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#lateral-nome").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Nome');
		}
		$(this).css('color','');
	});

	$("#lateral-email").focus(function(){
		var value = $(this).val();
		if (value === 'E-mail'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#lateral-email").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('E-mail');
		}
		$(this).css('color','');
	});

	$("#fale-nome").focus(function(){
		var value = $(this).val();
		if (value === 'Nome'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#fale-nome").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Nome');
		}
		$(this).css('color','');
	});

	$("#fale-email").focus(function(){
		var value = $(this).val();
		if (value === 'E-mail'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#fale-email").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('E-mail');
		}
		$(this).css('color','');
	});

	$("#fale-cidade").focus(function(){
		var value = $(this).val();
		if (value === 'Cidade'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#fale-cidade").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Cidade');
		}
		$(this).css('color','');
	});

	$("#fale-uf").focus(function(){
		var value = $(this).val();
		if (value === 'UF'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#fale-uf").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('UF');
		}
		$(this).css('color','');
	});

	$("#fale-assunto").focus(function(){
		var value = $(this).val();
		if (value === 'Assunto'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#fale-assunto").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Assunto');
		}
		$(this).css('color','');
	});

	$("#recado-nome").focus(function(){
		var value = $(this).val();
		if (value === 'Nome'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#recado-nome").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Nome');
		}
		$(this).css('color','');
	});

	$("#recado-email").focus(function(){
		var value = $(this).val();
		if (value === 'E-mail'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("#recado-email").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('E-mail');
		}
		$(this).css('color','');
	});

	$("textarea").focus(function(){
		var value = $(this).val();
		if (value === 'Mensagem'){
			$(this).val('');
		}
		$(this).css('color', corAtiva);
	});
	$("textarea").blur(function(){
		var value = $(this).val();
		if (value === ''){
			$(this).val('Mensagem');
		}
		$(this).css('color','');
	});
	
	$('#lateral-submit').click(function(){
		if(($('#lateral-nome').val() != '' && $('#lateral-nome').val() != 'Nome') && ($('#lateral-email').val() != '' && $('#lateral-email').val() != 'E-mail')){
			newsletter($('#lateral-nome').val(),$('#lateral-email').val(),'');
		}
	});
});
