﻿var Photo = 'photoinvisible';

function photovisibilite() {
    if (Photo == 'photoinvisible') {
        document.getElementById('contenu').style.visibility = 'hidden';
        document.getElementById('panneau').style.visibility = 'hidden';
		document.getElementById("voirphoto").innerHTML = "Retour au site";
		document.getElementById("imgphoto").className = "photoinvisible";		
        Photo = 'photovisible';
    } else {
        document.getElementById('contenu').style.visibility = 'visible';
        document.getElementById('panneau').style.visibility = 'visible';
		document.getElementById("voirphoto").innerHTML = "Voir les photos";
		document.getElementById("imgphoto").className = "photovisible";
        Photo = 'photoinvisible';
    }
}

function CacherMontrerPhotos() {
    var changement = "hidden";
    if (document.getElementById('contenu').style.visibility == "hidden") {
        changement = "visible";
        document.getElementById('lnkMontrerPhoto').innerHTML = "Voir les photos";
        document.getElementById('lnkPhotoVisible').className = "photovisible curseurmain";
        document.getElementById('imagedoubleclick').style.visibility = "hidden";
    } else {
        document.getElementById('lnkMontrerPhoto').innerHTML = "Revoir le site";
        document.getElementById('lnkPhotoVisible').className = "photoinvisible curseurmain";
        document.getElementById('imagedoubleclick').style.visibility = "visible";
    }
    document.getElementById('contenu').style.visibility = changement;
    if (document.getElementById('panneau') != null)
        document.getElementById('panneau').style.visibility = changement;
}

jQuery(window).load(function() {
    if (window.location.hash.length > 0)
        changeTexte(window.location.hash.substring(1));
});


function changeTexte(nomSection) {
/*
    for (i = 0; i < 20; i++) {
        //alert(i);
        if (document.getElementById('section' + i) == null) break;
        document.getElementById('section' + i).style.display = 'none';
    }
    */
    $("#contenutexte div.sectionX").each(function() {
		//if($(this).id!="")
	        $(this).hide();
    });
    $("#" + nomSection).show();
    //$("div#inspection").show();
    //$("#" + nomSection).css("display", "inline-block");
    //$("#img" + nomSection).removeClass("pngfix");
    //$("#img" + nomSection).addClass("pngfix");
    //$("#img" + nomSection).show("slow");

    //$("#img" + nomSection).attr('src', "images/titre_habitation.png").show('slow'); 

    //alert(nomSection);

    //$('#imgculture').show;
    //$('#imgculture').error(function() {
        //$('#imgculture').attr("style") = "display: none";
        //$('#titrecontenu').append("bonjour");
        //alert();
    //});
    //document.getElementById(nomSection).style.display = 'block';
    //document.getElementById('imgculture').src = 'images/titre_' + nomSection + '.png';
}


