
$(document).ready(function() {

	
	$('.menuSubTitulo a').mouseover(function() {
		$(this).parent().css('background-color', '#fff');
	});
	$('.menuSubTitulo a').mouseout(function() {
		$(this).parent().css('background-color', '');
	});
	


    jQuery('#submitNews').click(function () {        
         
        var name = jQuery('input[name=nomeN]');
        var email = jQuery('input[name=emailN]');
 
        var data = 'nomeN=' + name.val() + '&emailN=' + email.val() + '&Rnews=1';
         
        jQuery('.NewsF4x').attr('disabled','true');
         
        jQuery('#newletterLoading').show();
         
        jQuery.ajax({
            
            url: "newsletterSubmit.php", 
             
            type: "GET",
    
            data: data,     
             
            cache: false,
             
            success: function (html) {              
                
                if (html=='sucesso') 
				{                  
                    jQuery('#newletterLoading').fadeOut('slow');
					jQuery('.NewsF4x').removeAttr("disabled");
					jQuery('.NewsF4x').attr('value',''); 
					jQuery('.msgErrox').html('<span style="color:#228d3b">Registou-se com sucesso na nossa Newsletter.</span>');            

                } 
				else 
				{
				jQuery('.NewsF4x').removeAttr("disabled");
				jQuery('#newletterLoading').fadeOut('slow');
				
					if (html=='existe') { 
					jQuery('.msgErrox').html('Este email j&aacute; se encontra inscrito na nossa Newsletter');
					}
					
					if (html=='sem email') { 
					jQuery('.msgErrox').html('Escreva um email v&aacute;lido para se registar na nossa Newsletter');
					}
				}               
            }       
        });
         
        return false;
    }); 


});
