/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function showimg1() {
    $("#degustation-window img.img1").fadeIn(2500);
    $("#degustation-window img.img3").fadeOut(2500);
    
    $("#degustation-window img.img2").animate({
        display: "none"}, 10000, function() {
            showimg2();
    });
}

function showimg2() {
    $("#degustation-window img.img2").fadeIn(2500);
    $("#degustation-window img.img1").fadeOut(2500);
    
    $("#degustation-window img.img3").animate({
        display: "none"}, 10000, function() {
            showimg3();
    });
}
function showimg3() {
    $("#degustation-window img.img3").fadeIn(2500);
    $("#degustation-window img.img2").fadeOut(2500);
    
    $("#degustation-window img.img1").animate({
        display: "none"}, 10000, function() {
            showimg1();
    });
}

function diapo_down() {
    $(".mini-diapo img").animate({
        top: '-120px'
    }, 10000, function() {
        diapo_up();
    });
    return false;
}
function diapo_up() {
    $(".mini-diapo img").animate({
        top: '0px'
    }, 10000, function() {
        diapo_down();
    });
    return false;
}

$(document).ready(function(){

    $(".lien.rose").click(function() {
        $("#bloc_poire_prisonniere").fadeIn(2000);
        $("#bloc_lieu_unique").fadeOut(2000);
        return false;
    });
    $(".lien.bleu").click(function() {
        $("#bloc_poire_prisonniere").fadeOut(2000);
        $("#bloc_lieu_unique").fadeIn(2000);
        return false;
    });
    
    $("#degustation-window img.img1").animate({
        display: "normal"}, 6000, function() {
            showimg2();
    });
    if($(".mini-diapo img").length) {
        diapo_down();
    }
    $(".mini-diapo").mouseover(function() {
        $('.show-diapo').css('display', 'block');
    });
    $(".mini-diapo").mouseleave(function() {
        $('.mini-diapo img').css('display', 'block');
        $('.show-diapo').css('display', 'none');
    });
});
