////photos replacement
var flag=0;
    function overReplacePhoto(imgSrc){
       var newImg = new Image();
	   newImg.src =document.getElementById('photo').src;
	 	var ration=newImg.height/newImg.width;	   
	   if(flag==0){
	    document.getElementById('product_photo_wrap').style.height=Math.ceil(300*ration)+"px";	
		flag++;
       }
	   document.getElementById('photo').src=imgSrc.src;
		document.getElementById('photo_over').src=imgSrc.src;
	}
////	
	
	////////////POPUP//////////////
	
	function popUp(URL)
	{
		
		window.open (URL, 'recommander', config='height=550, width=600, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
	}

// menu principal
  $(document).ready(function() {

/***************************************/  

var obj = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];

    jQuery.each(obj, function(i) {
    

$('#sous_menu'+i).hide(); 
 $('li.m'+i).hover(function() { 
							
$('#sous_menu'+i).show(); 
}, 
function() { 
      $('#sous_menu'+i).hide(); 
	});
  $('#sous_menu'+i).hover(function() { 
$('#sous_menu'+i).show(); 
 $('li.m'+i+' a ').addClass('choix'+i);
 $('li.m'+i+' a span').addClass('choix'+i);
}, 
function() { 
      $('#sous_menu'+i).hide();
 $('li.m'+i+' a').removeClass('choix'+i);
	  $('li.m'+i+' a span').removeClass('choix'+i);

	});

});
/***************************************/  


 });
  
      $(document).ready(function() {
		$("#img_inscription").mouseover(function(){
		 $(this).attr("src", "images/inscrivez-vous_2.png");
		 });
		$("#img_inscription").mouseout(function(){
 		 $(this).attr("src","images/inscrivez-vous.png");
	 	}); 
		
		//newsletter
	 	$("#newsletter_inscript").click(function(){
			$("#popup_modal").fancybox({
				'width'				: 718,
				'height'			: 500,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#popup_modal").trigger('click');
		 });
		
$("#newsletter_bas").click(function(){
			$("#popup_modal").fancybox({
				'width'				: 718,
				'height'			: 500,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			$("#popup_modal").trigger('click');
		 });
 });
	  
	  
	  ///////////////////////
	  
	  //// fonction pack asso ////
	  	function pack_assoc(id){
		var bg='';
				
		document.getElementById('content_assoc').style.display='none';
		document.getElementById('content_technique').style.display='none';		
		document.getElementById('content_avis').style.display='none';
		document.getElementById('content_pack').style.display='none';
			
		document.getElementById('accessoires').src='images/accessoires1.gif';
		document.getElementById('technique').src='images/technique1.gif';		
		document.getElementById('noteavis').src='images/noteavis1.gif';
		document.getElementById('nosPacks').src='images/nosPacks1.gif';	
		
		if(id=='content_assoc')		document.getElementById('accessoires').src=	'images/accessoires0.gif';
		
		if(id=='content_technique')document.getElementById('technique').src=	'images/technique0.gif';
		if(id=='content_avis')		document.getElementById('noteavis').src=		'images/noteavis0.gif';
		if(id=='content_pack')		document.getElementById('nosPacks').src=		'images/nosPacks0.gif';
		document.getElementById(id).style.display='block';
	}
	
	//////////////
