// AFFICHE / CACHE UNE DIV
function affCache(idpr)
{
        var pr = document.getElementById(idpr);

        if (pr.style.display == "") {
                pr.style.display = "none";
        } else {
                pr.style.display = "";
        }
}

// CHANGE LA PHOTO
function change_photo(wcontenu) {
 document.getElementById("laphoto").innerHTML = wcontenu;
}


// FORMULAIRE DES MP
function VerifFormulaire1(which) {
var ok=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var verif1=which.elements[i];
if (verif1.name=="pour" || verif1.name=="message") {
if (((verif1.type=="text"||verif1.type=="textarea"||verif1.type=="password")&&
verif1.value=='')||(verif1.type.toString().charAt(0)=="s"&&
verif1.selectedIndex==0)) {
ok=false;
break;
}
}
}
}
if (!ok) {
NomChamp=verif1.name;
alert("Remplissez le champs "+NomChamp+" s'il vous plaît !");
return false;
}
else
return true;
}

// POUR LE SLIDER DE LA PAGE D'ACCUEIL
var theInt = null;
		var $crosslink, $navthumb;
		var curclicked = 0;

		theInterval = function(cur){
			clearInterval(theInt);

			if( typeof cur != 'undefined' )
				curclicked = cur;

			$crosslink.removeClass("active-thumb");
			$navthumb.eq(curclicked).parent().addClass("active-thumb");
				$(".stripNav ul li a").eq(curclicked).trigger('click');

			theInt = setInterval(function(){
				$crosslink.removeClass("active-thumb");
				$navthumb.eq(curclicked).parent().addClass("active-thumb");
				$(".stripNav ul li a").eq(curclicked).trigger('click');
				curclicked++;
				if( 4 == curclicked )
					curclicked = 0;

			}, 2000);
		};

		$(function(){

			$("#main-photo-slider").codaSlider();

			$navthumb = $(".nav-thumb");
			$crosslink = $(".cross-link");

			$navthumb
			.click(function() {
				var $this = $(this);
				theInterval($this.parent().attr('href').slice(1) - 1);
				return false;
			});

			theInterval();
		});

// POUR LE FORMULAIRE DE NEWSLETTER
function verif_newsletter()
{
 if(document.formulaire.email.value == "") {
   alert("Veuillez entrer votre E-mail");
   document.formulaire.email.focus();
   document.formulaire.email.style.backgroundColor = "#edebeb";
   return false;
  }
 if(document.formulaire.email.value.indexOf('@') == -1) {
   alert("E-Mail invalide !");
   document.formulaire.email.focus();
   document.formulaire.email.style.backgroundColor = "#edebeb";
   return false;
  }
}