//Fonction qui vérifie si les champs obligatoires des formulaires ont étés bien remplis et valide l'envoie
function envoyer_connexion(formulaire) {
if ( (document.getElementById('email').value.length>0)
&&(document.getElementById('prenom').value.length>0)
&&(document.getElementById('nom').value.length>0)
&&(document.getElementById('email').value!='exemple@exemple.com')
&&(document.getElementById('prenom').value!='prenom')
&&(document.getElementById('nom').value!='nom')
 ){
formulaire.submit();
} else
alert('INSCRIPTION IMPOSSIBLE, VEUILLEZ REMPLIR TOUS LES CHAMPS DU FORMULAIRE');
}

//
//Fonction qui efface les champs préremplis
function ModifChamp(input)
{
if ( 
 
 (input.value=='exemple@exemple.com')
||(input.value=='Nom')
||(input.value=='Prenom')
){
input.value='' 
}
}



function bgAjust() {
if (($(window).height()*1.8) > $(window).width()) 
{
$('.margin_cacao').css({'margin-right' : $('img.image_prod').width() });
 

$('img#bg').css({'height' : '100%'});
$('img#bg').css({'width' : 'auto'});
//$('table#liste_distrib_table').css({'height' : $(window).height()-123});
} else {
$('.margin_cacao').css({'margin-right' : $('img.image_prod').width() });
 

$('img#bg').css({'width' : '100%'});
$('img#bg').css({'height' : 'auto'});
//$('table#liste_distrib_table').css({'height' : $(window).height()-123 });
}
}



$(document).ready(function(){
							

						   




$('#slider_cacao').css( {bottom :  "-100%"} );

$('.fond_prod').css( {right :  "-100%"} );


 
$('.texte_prod').css( {right :  "-100%"} );





$('.part_left').css( {left :  "-100%"} );




$('#liste_dep').css({marginLeft: "1%", opacity: "0"} );



$('#newsletter_champ').css( {display :  "none", opacity: "0"} );


//$('.content').css( {opacity :  "0"} );


//Animations des sous menus

$("#menuhautulp li a").hover(function() {
$(this).next("ul").stop(true, true).css({bottom : "10px"}, 100)
$(this).next("ul").stop(true, true).animate({opacity: "show",bottom : "33px"}, "fast");

 

}, function() {
$(this).next("ul").animate({opacity: "hide"}, "fast");

});
 
 
$("#menuhautulp li ul").hover(function() {
$(this).stop(true, true).show();
}, function() {
$(this).animate({opacity: "hide"}, "fast");
});



$("ul#menuSocial li a").hover(function() {
$(this).animate({marginTop: 2}, 100) 
}, function() {
$(this).animate({marginTop: 5}, 100) 
});


// loading  des iamges
$("#bg_conteneur>img").load(function(){	
    if($(this).height() > 100) {
    $("#loading").fadeOut();  
  }						   
 
})

$(window).load(function () {
						 
$("#loading").fadeOut();




//Animation des produits
//
//$('.fond_prod').animate({opacity: "1"}, 200)
//.animate({right: "0"}, 500)
//.animate({opacity: "1"}, 500) ;



$('#slider_cacao').animate({bottom :  "-100px"}, 200)
.animate({bottom :  "-100px"}, 500)
.animate({bottom :  "-100px"}, 500)
.animate( {bottom :  "39px"}, 500 );



$('.texte_prod').animate({opacity: "0.9"}, 200)
.animate({right: "0px"}, 500)
.animate({opacity: "0.9"}, 500) ;





//Animation de la partie gauche  

$('.part_left').animate({opacity: "0"}, 500)
.animate({left: "0", opacity: "0.9"}, 500);

//$('.content').animate({opacity: "0"}, 200)
//.animate({opacity: "0"}, 800)
//.animate({opacity: "1"}, 500) ;



});


 


$("#rlizz_plus").toggle(function() {

$('.accueil_left').animate({left: "0"}, 500); return false; }, function() {
 
$(".accueil_left").animate({left: "-482px"}, 300);
return false;
});




$('a#boutique')
	.css( {backgroundPosition :  "0px 0px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition :  "672px 0px"}, 
			{duration:500})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition : "0px 0px"}, 
			{duration:500})
});
	
	
 
$('#newslettet_btn').toggle(function() {
$("#newsletter_champ").show(); 
$("#newsletter_champ").animate({opacity: "1"}, 300);
$("#newslettet_btn").text("X");
 
}, function() {
 $("#newsletter_champ").hide(); 
$("#newsletter_champ").animate({opacity: "0"}, 300);
$("#newslettet_btn").text("Newsletter");
});




  
$("#franceDepart").toggle(function() {
 
$("#liste_dep").animate({marginLeft: "5%", opacity: "1"}, 300);
 
}, function() {
 
$("#liste_dep").animate({marginLeft: "1%", opacity: "0"}, 300);
});

 




 

			
			
$("img, a, h1, h2, li, h3, strong").attr("title", "") ;		
			
$("img, a, h1, h2, li, h3, strong").attr("alt", "") ;

 
/*$("li.animSousMenu").hover(function() {
$(this).children("ul.sousMenu").stop(true, true).animate({opacity: "show", bottom : "10px" }, "fast");
}, function() {
$(this).children("ul.sousMenu").animate({opacity: "hide", bottom : "-86px" }, "fast");
});
 
 
 



$("ul#menuSocial li a").hover(function() {
$(this).animate({marginTop: 2}, 100) 
}, function() {
$(this).animate({marginTop: 5}, 100) 
});
*/


bgAjust();






$("#f1").click(function() {
return hs.htmlExpand(this, { contentId: 'highslide-html-force_1', height: 359,  width: 269, align: 'center', showCredits: false } );
});

$("#f2").click(function() {
return hs.htmlExpand(this, { contentId: 'highslide-html-force_2', height: 359,  width: 269, align: 'center', showCredits: false } );
});
$("#f3").click(function() {
return hs.htmlExpand(this, { contentId: 'highslide-html-force_3', height: 359,  width: 269, align: 'center', showCredits: false } );
});


});




$("#logo").hover(function() {
$("#hometxt").show();
}, function() {
$("#home_txt").hide();
});


 

/*
function jhover_off(id){
	doc = document.getElementById(id);
 
	 
	$(doc).animate({opacity: "hide", paddingTop: "-135"}, "fast");
	doc.style.display = 'none';
	
	 
}

function jhover_on(id){
	doc = document.getElementById(id);
	$(doc).stop(true, true).animate({opacity: "show", paddingTop: "0"}, "slow");
	doc.style.display = 'block';
}


function popup(){
window.open("#",'newpopup','width=423,height=562,toolbar=no,scrollbars=no,resizable=no');
}
 */
 
 
 


 
	
