/* EMPTY FILE *//* EMPTY FILE */

jQuery(function(){
	
	jQuery('input[type!=submit], textarea', '#box_newsletter').one('focus', function(){jQuery(this).val('');});
    
    jQuery('#box_form_newsletter').submit(function(){
        
        jQuery.ajax({
            url:jQuery(this).attr('action'),
            data: jQuery(this).serializeArray(),
            dataType: 'json',
            type: 'post',
            cache: false,
            success: function(response){
                if(response == 'ok') {
                    jQuery.myFrontAllert.alert("Your application to the newsletter has been saved. In few minutes you will receive an email with a request for confirmation");
                } else if ( response == 'ko' ) {
                    jQuery.myFrontAllert.alert("There is an error: email address is needed, check if it is correct");
                } else jQuery.myFrontAllert.alert("There os am error: retry later and if the issue persist contact us via email");
            }
        });
        
        return false;
    });
    
});



