function Voir(){	
	$('.catalog .familly a.voir').each(function(i){
		$(this).css({background:'#808080'});
		
		$(this).hover(
	      function () {
	        $(this).css({background:'#000000',color:'#FFFFFF'});
	      }, 
	      function () {
	        $(this).css({background:'#808080',color:'#000000'});
	      }
	    );
		if(i%2){
			$(this).css({background:'#bfbfbf'});
			
			$(this).hover(
		      function () {
		        $(this).css({background:'#000000',color:'#FFFFFF'});
		      }, 
		      function () {
		        $(this).css({background:'#bfbfbf',color:'#000000'});
		      }
	    	);
		}
	});
}
function VoirProd(){
	$('.short_product .prod_resume').each(function(i){
		$(this).css({background:'#808080'});		
		if(i%2)
		$(this).css({background:'#bfbfbf'});
	});
}
function VoirProdAssocie(){
	$('#product #produits_associes .short_product .prod_resume').each(function(i){
		$(this).css({background:'#808080'});		
		if(i%2)
		$(this).css({background:'#bfbfbf'});
	});
}
function Masquer(){
	if ($("body").attr("class") != "catalogue"){
	 		$("#banner").hover(
				function() {	
					$("#banner .box").css({
						filter : 'alpha(opacity=100)',
	  				opacity : '1'
	  				});
				},
		    function () {
					$("#banner .box").css({
						filter : 'alpha(opacity=30)',
	  				opacity : '0.3'
	  				});
	  			$("#banner .boxNavHaute").css({
						filter : 'alpha(opacity=100)',
	  				opacity : '1'
	  				});
		    }
			);
		}
};
function imageVisusAdd(){
	
	var imgZoom = new Array();
	$('#productPicture .vignette img, #visuels_additionnels .vignette img').each(function(i){
			imagePrincipale = $(this).attr("src");
			imgZoom[i] = imagePrincipale;
			chaine = imagePrincipale.split("/");
			newChaine = "/" + chaine[1] + "/thumbnails/" + chaine[3];
			$(this).attr({src:newChaine});
	});
	$('#productPicture .vignette a, #visuels_additionnels .vignette a').each(function(i){
			var imgBig = imgZoom[i].replace("thumbnails/", "");
			$(this).attr({
	   		href: imgBig
  	 		});
 	});
}
jQuery.fn.vjustify=function() {
	var maxHeight=0;
	this.each(function(){
		if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
	});
	this.each(function(){
		$(this).height(maxHeight + "px");
		if (this.offsetHeight>maxHeight) {
		//$(this).height((maxHeight-(this.offsetHeight-maxHeight))+"px");
		$(this).css({
      		height: ((maxHeight-(this.offsetHeight-maxHeight))+"px")
		});
		}
	});
};
function changeVisu(nb) {
	$("#visuels_additionnels .vignette img").each(function(i){
		if (i == nb) {
			$("#gauche .vignette img").attr({src:$(this).attr("src")});
		}
	});
}
function replaceVisu() {
	//$("#productPicture .vignette img").attr({src:$("#visuels_additionnels .vignette img:first").attr("src")});
}
/*function imageVisus(){
	var imgZoom = new Array();
	$('.catalog .short_product .visu .vignette img').each(function(i){
		imagePrincipale = $(this).attr("src");
		imgZoom[i] = imagePrincipale;
		chaine = imagePrincipale.split("/");
		newChaine = "/" + chaine[1] + "/" + chaine[3];
	  $(this).attr({src:newChaine});	  
});

function makeActiveLink(){
	var listLink = $("#leftbar a");
	var CurrentUrl = document.location.href;
	listLink.each(function (index, domEle) {
		if(CurrentUrl == domEle){
			$(this).attr("class","active");
		}
	});
}

function openZoom() {
	$("#product .zoom_picture").click(function() {
		var dest = this.href;
		var index = dest.lastIndexOf('-');
		var linkZoom = dest.substring('0',index)+"getpagecontent-zoom.html";
		var imagePrincipale = $('#main #vig img').attr("src");
		$.get(linkZoom, function(data){
			$('#zoompicture').html(data);
			$('#main #zoompicture #zoomzoom img').attr({
					src: imagePrincipale
					});
					$('#zoompicture').css({
										top: '5%'
					 });
					$(".jqmClose + .jqmClose").css("display", "none") 
		});
		$('#zoompicture').jqm().jqmShow();
		return false;
	});
}

function openZoom2() {
	$("#visuels_additionnels .zoom_additionnals img").click(function() {
		var dest = $("#product .zoom_picture").attr("href");
		var imageAdditionnelle = $(this).attr("src");
		var index = dest.lastIndexOf('-');
		var linkZoom = dest.substring('0',index)+"getpagecontent-zoom.html";
		$.get(linkZoom, function(data){
			$('#zoompicture').html(data);
			$('#main #zoompicture #zoomzoom img').attr({
					src: imageAdditionnelle
					});
					$('#zoompicture').css({
										top: '5%'
					 });
					$(".jqmClose + .jqmClose").css("display", "none") 
		});
		$('#zoompicture').jqm().jqmShow();
		return false;
	});
}

function average_note(){
	var average = $('#star_note img').attr("alt");
	if(average.indexOf(',')!=-1){
		var index = average.lastIndexOf(',');
		var note='';
 		var decimal = average.substring(index+1,average.length);
		if( decimal >= 5){
			note = parseInt(average.substring('0',index))+1;
		}else{
			note = average.substring('0',index);
		}
		$('#star_note img').attr({
			src: '/images/note/note_'+note+'.jpg',
			alt:note
		});
		
	}
}

function closeZoom(){
$('#main #zoompicture #zoomzoom img').attr({
					src: ''
					});
$('#zoompicture').jqm().jqmHide();
}

function TakePut(sourceURL, sourceZone, destinationZone) {
  var ListElem = $(sourceURL);
	ListElem.each(function (index, domEle) {	
					var source = $(domEle).attr("href")+"getpagecontent";
					var dest = $(domEle).parent().children(destinationZone);
					var cequejeveux = source +" #product #produits_commentaires #toggle_left #star_note";
					$(dest).load(cequejeveux);
	});
	
	
}
*/






