/*function imageVisus(){
	var imgZoom = new Array();
	$('#visuels_additionnels img').each(function(i){
		imagePrincipale = $(this).attr("src");
		imgZoom[i] = imagePrincipale;
		chaine = imagePrincipale.split("/");
		newChaine = "/" + chaine[1] + "/thumbnails/" + chaine[2];
		$(this).attr({src:newChaine});
	  
	});
	$('#visuels_additionnels a').each(function(i){
		$(this).attr({
   		href: imgZoom[i]
  	 });
 	});
}*/

var f ="";
function imprimerLightBox(qui){
	// Définit la zone à imprimer
	var zi = document.getElementById(qui).innerHTML;
	var Headers = '<!DOCTYPE HTML PUBLIC ><HTML><HEAD><title></title><style type="text/css"><!-- .itineraire {display:none;} --></style></HEAD><BODY style="padding:0px;" onload="window.print();window.close();">';
	var Footers = "</body></html>";
	// Ouvre une nouvelle fenetre
	var f = window.open("", "ZoneImpr", "width=520, height=600, toolbar=0, menubar=0, scrollbars=0, resizable=0, status=0, location=0, left=0, top=0");
	
	// Ajoute les Données
	f.document.write ("" + Headers + zi +Footers);
	f.document.close();
	return;
}



function imageVisusAdd(){
	var imgZoom = new Array();
	$('#visuels_additionnels img').each(function(i){
		imagePrincipale = $(this).attr("src");
		imgZoom[i] = imagePrincipale;
		chaine = imagePrincipale.split("/");
		newChaine = "/" + chaine[1] + "/thumbnails/" + chaine[2];
		$(this).attr({src:newChaine});	  
	});
	$('#visuels_additionnels2 a').each(function(i){
		$(this).attr({
   		href: imgZoom[i]
  	 });
 	});
}

function imagePlan(){
	var imagePrincipale = $('#colGauche img').attr("src");
	var chaine = imagePrincipale.lastIndexOf("/");
  var imgZoom = imagePrincipale.substring(chaine+1,imagePrincipale.length);
  $('#colGauche a').attr({
   		href: '/images/gamme/'+imgZoom
   });
}

function selectPresse(){
		var destination = $("#directory #titre h1");
		var source = "/revue-de-presse/"+"getpagecontent";
		var cequejeveux = source +" #directory #titre";
    destination.load(cequejeveux);
    var destination2 = $("#filtrage_presse");
		var cequejeveux2 = source +" #filtrage_presse";
    destination2.load(cequejeveux2);
    return false;
}

function imageVisusActus(){ 
	var imgZoom = new Array();
	$('#news_events_list img, #mmnews_events_list img, .boxActualites img, .boxRecupActualites img').each(function(i){
		imagePrincipale = $(this).attr("src");
		imgZoom[i] = imagePrincipale;
		chaine = imagePrincipale.split("/");
		newChaine = "/" + chaine[1] + "/" + chaine[3];
	  $(this).attr({src:newChaine});	  
	});
}

function imageActus(){
	var imgZoom = new Array();
	$('#news img').each(function(i){
		imagePrincipale = $(this).attr("src");
		imgZoom[i] = imagePrincipale;
		chaine = imagePrincipale.split("/");
		newChaine = "/" + chaine[1] + "/" + chaine[3];
	  $(this).attr({src:newChaine});	  
	});
}

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")
					 });
		}
	});
};
