var couleurOff='#FFEDF0';
var couleurOn='#E7C1FF';
var champOn = 0;

function changeColor(couleur, champ)
{
    document.getElementById(champ).style.background=couleur;
}

var blink_timer;
var text_visible = 1;
var text_tmp;
var nbr_max_clignotte = 3;
var nbr_clignotte=1;

function clignotte(champ)
{
    if (champOn)
    {
        nbr_clignotte++;
        champOn=0;
        changeColor(couleurOff, champ);
        if (nbr_clignotte>nbr_max_clignotte)
        {
            clearInterval(clignotte_timer);
        }
    }
    else
    {
        champOn=1;
        changeColor(couleurOn, champ);
    }
}

function start_clignotte(champ)
{
    nbr_clignotte=1;
    clignotte_timer = setInterval('clignotte(\'' + champ + '\')', 200);
}

function blink()
{
    if (text_visible)
    {
        text_tmp = document.email_form.email.value;
        document.email_form.email.value = '';
        text_visible = 0;
    }
    else
    {
        document.email_form.email.value = text_tmp;
        text_visible = 1;
    }
}

function start_blink()
{
    if (document.email_form.email.value=='@')
    {
        blink_timer = setInterval('blink()', 500);
    }
}

function stop_blink()
{
    if (blink_timer)
    {
        clearInterval(blink_timer);
    }
}

function email_focus(this_form, blink)
{
    if (blink == 1)
    {
        stop_blink();
    }
    e = this_form.email;
    if (e.value == '@')
    {
        e.value = '';
    }
}

function email_blur(this_form, blink)
{
    var e = this_form.email;
    if (e.value == '@' || e.value == '')
    {
        e.value = '@';
        if (blink == 1)
        {
            start_blink();
        }
    }
}

function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
var $next =  $active.next().length ? $active.next() : $('#slideshow IMG:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 500, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 2000 );
});
