// JavaScript Document

function div_actu(action) {
    

        if (action == 'ouvrir') {
            if (!$.browser.msie) {
                $("#div-box")
	            .css({
	                width: '100%',
	                height: $(document).height()
	            })
	            .show();
	        }
            $(".actualite").show();
        }
        else {
            $("#div-box").hide();
            $(".actualite").hide();
        }
    
}

function selectFromFlash(classSelectCible, ValueToSelect) {
	//Affecte la value 'ValueToSelect' au select ayant la class 'classSelectCible'
	$('.'+classSelectCible).val(ValueToSelect);
}

function labelTurnPage(sens, current) {

    $(".container.labels").find(".label1,.label2,.label3,.label4,.label5").hide();
    labelPage = parseInt(current);

    if ( sens == 'prev' ) {
        labelPage--;
        $(".container.labels").find(".label" + labelPage).show();
    }
    
    if ( sens == 'next' ) {
        labelPage++;
        current = ".label" + labelPage;
        $(".container.labels").find(".label" + labelPage).show();
    }

    calculDesHauteurs();
}

function resetOngletMariage() {
    var source = $('.onglet_mariage_couleur img').each(function() {

        var source = $(this).attr("src").length;
        var oldsource = $(this).attr("src").substring(source - 8, source);
        if (oldsource!= "_off.jpg") {
            var newsource = $(this).attr("src").substring(0, source - 4) + "_off.jpg";
            $(this).attr("src", newsource);
        }

    });
}

function calculDesHauteurs() {
    $(".menu").height($("#content-box").height() + 50);
    $("#content-bottom").css("top", $("#content-box").height() + 6);
    $("#footer").css("top", $("#content").height() + 40);
}

function displayNoyellesMap() {
    $('.list_map, .plan_colomiers').hide();
    $('.plan_noyelles').show();
}
function displayColomiersMap() {
    $('.list_map, .plan_noyelles').hide();
    $('.plan_colomiers').show();
    
}
function displayListMap() {
    $('.list_map').show();
    $('.plan_colomiers, .plan_noyelles').hide();
}

function afficheDate()// fonction pour afficher la date et l'heure
{
    mois = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
    date = new Date();
    dateannee = date.getFullYear();
    datejour = date.getDate();
    heure = date.getHours();
    minute = date.getMinutes();
    seconde = date.getSeconds();
    if (date.getDate() < 10) datejour = "0" + datejour;
    if (heure < 10) heure = "0" + heure;
    if (minute < 10) minute = "0" + minute;
    if (seconde < 10) seconde = "0" + seconde;
    $('#texteDate').html(datejour + "/" + mois[date.getMonth()] + "/" + dateannee + "&nbsp;  " + heure + ":" + minute + ":" + seconde);
    setTimeout("afficheDate()", 1000);
}