var processamento=0;
$(document).ready(function() 
{
	
	$("#frase1").fadeIn(2500);
	
	setTimeout("$('#frase1').fadeOut(1000, function(){ $('#frase2').fadeIn(2500); });", 5000);
	setTimeout("$('#frase2').fadeOut(1000, function(){ location.href = 'home'; });", 11000);
	
	$(".menusub").hover(function() { $(this).children("div").show(); }, function() { $(this).children("div").hide(); });
	
	$("#bt_send").click(function(){
		if(processamento) return false;
		processamento = 1;
	
		$("#form_msg").html('&bull;').fadeIn(200);
		setTimeout("$('#form_msg').append('&bull;');", 300);
		setTimeout("$('#form_msg').append('&bull;');", 800);

		$.post("http://"+$website_patch+"/processa.php?w=contacta",
		{
			nome:$('#nome').val(),
			telefone:$('#telefone').val(),
			email:$('#email').val(),
			mensagem:$('#mensagem').val()
		},
		function(data)
		{			
			var result = data.split("|");
			if(result[0]==1)
			{
				$("#bt_send").fadeOut(500, function(){
					$("#form_msg").html(result[1]);
					processamento = 0;
				});
			}
			else if(result[0]==2)
			{
				$("#form_msg").html(result[1]);
				processamento = 0;
			}
		});
	});

});



$.fn.disableSelection = function() {
    $(this).attr('unselectable', 'on')
           .css('-moz-user-select', 'none')
           .each(function() { 
               this.onselectstart = function() { return false; };
            });
};

