/* Loïc Pennamen pour Magnana.com */

// cette fonction masque tous les elements d'une liste standardisée par un nom commun, et un dénominateur de zéro à total / mais affiche le bloc correspondant à la cible
function upUnSurN(commun, total, cible){
	for(i=0; i < total; i++){
		if(i != cible)		document.getElementById(commun + i).style.border='2px solid white';
		else				document.getElementById(commun + i).style.border='2px solid #0A1DC1';
	}
}
function unSurN(commun, total, cible){
	for(i=0; i < total; i++){
		if(i != cible)		masquer(commun + i);
		else				afficherInline(commun + i);
	}
}
// pour le menu :
function upImage(image, ext){
	//alert(typeof image);
	if(typeof image != 'object')	image = document.getElementById(image);
	
	// si la chaine ne contient pas deja le -up
	// if(image.src.substr(image.src.length - 7, 0) != "-up." + ext){
	if(image.src.indexOf('-up.' + ext) <= 0){
		image.src=image.src.substr(0, image.src.length - 4) + "-up." + ext;
	}
}
function downImage(image, ext){
	//alert(typeof image);
	if(typeof image != 'object')	image = document.getElementById(image);
	
	// si la chaine contient le -up
	if(image.src.indexOf('-up.' + ext) > 0){
		image.src=image.src.substr(0, image.src.length - 7) + "." + ext;
	}
}
///////////
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
		newWin.close();
	}
}

///////////
function changerImage(image, srcImage){
	//alert(typeof image);
	if(typeof image != 'object')	image = document.getElementById(image);
	
	image.src=srcImage;
}
///////////
function popUp(strURL,strType,strHeight,strWidth,absolute) {
if(!absolute) var absolute = '';
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(absolute + strURL, 'newWin', strOptions);
newWin.focus();
} 
// onOffBlock fonctionne comme un interrupteur sur un bloc donné par son id
function onOffBlock(afficher){
	if(document.getElementById(afficher).style.display=='block') {		document.getElementById(afficher).style.display='none';	}
	else if(document.getElementById(afficher).style.display=='none') {	document.getElementById(afficher).style.display='block';	}
}
function onOffBlockInline(afficher){
	if(document.getElementById(afficher).style.display=='inline') {		document.getElementById(afficher).style.display='none';	}
	else if(document.getElementById(afficher).style.display=='none') {	document.getElementById(afficher).style.display='inline';	}
}

function invisible(idAMasquer){
	if(document.getElementById(idAMasquer)) document.getElementById(idAMasquer).style.visibility='hidden';
}
function visible(idAAfficher){
	if(document.getElementById(idAAfficher)) document.getElementById(idAAfficher).style.visibility='visible ';
}


function masquer(idAMasquer){
	if(document.getElementById(idAMasquer)) document.getElementById(idAMasquer).style.display='none';
}
function afficher(idAAfficher){
	if(document.getElementById(idAAfficher)) document.getElementById(idAAfficher).style.display='block';
}
function afficherInline(idAAfficher){
	document.getElementById(idAAfficher).style.display='inline';
}















