$(document).ready(function(){
	
	//Fix Errors - http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/
	
	//Remove outline from links
	$("a").click(function(){
		$(this).blur();
	});
	
	//When mouse rolls over
	$("li.box").mouseover(function(){
		$(this).stop().animate({height:'50px'},{queue:false, duration:1000, easing: 'easeOutBounce'})
	});
	
	//When mouse is removed
	$("li.box").mouseout(function(){
		$(this).stop().animate({height:'20px'},{queue:false, duration:1000, easing: 'easeOutBounce'})
	});
	
});


$(function()
{
    /**
     * newsletter form
     */
    $('#nextimnews .ok').click(function() {
        $('#nextimnews').submit();
    })

    $('#nextimnews').submit(function()
    {
        $.post(
            'newsletter.php',
            $(this).serialize(),
            function(data)
            {
                var feed = $('.nl_feedback');
                if(data.success)
                {
                    $(feed).removeClass('ko').addClass('ok2').html(data.message);
                }
                else
                {
                    $(feed).removeClass('ok2').addClass('ko').html(data.message);
                }
            },
            'json'
        );

          return false;
    });

    /**
     * opens news popin (from rss)
     */
    if($(location).attr('href').match(/\#actus/gi))
    {
        pop_open();
        switch_actu(0);
    }
});

