/* fade */
jQuery.fn.rollover = function(preload) {
    //this.filter(':not([src*="_h."])').each(function() {
    	$('.imgfade').each(function() {
        var a = this.src, b = this.src.replace(/\-a\.(\w+(\?[^$]*)?)$/, '-b.$1');
        $(this).hover(function() { this.src = b; }, function() { this.src = a; });
        if (preload) {
            var i = new Image;
            i.src = b;
        }
    });
    return this;
};

$().ready(function() {
	$('img').rollover(true);
	
	$('#frm_newsletter').click(function(){
		$(this).val('');
	});
	$('#frm_newsletter_ok').click(function(){
		var email = $('#frm_newsletter').val();
		$('#frm_newsletter_text').hide();
		$.ajax({ 
			url: "newsletter-add.php?email="+email, 
			success: function(){
        			$('#frm_newsletter_text').html("Votre demande a &eacute;t&eacute; prise en compte.");
				$('#frm_newsletter_text').show("normal");
			}
		});
	});
	
});
