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

function upImage(image, ext){
	image.src=image.src.substr(0, image.src.length - 4) + "-up." + ext;
}
function downImage(image, ext){
	image.src=image.src.substr(0, image.src.length - 7) + "." + ext;
}

///////////
function changerImage(idImage, srcImage){
	idImage.src=srcImage;
}
///////////
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
		newWin.close();
	}
}
///////////
function popUp(strURL,strType,strHeight,strWidth) {
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(strURL, 'newWin', strOptions);
newWin.focus();
} 
// limiter le nombre de caracteres d'un textarea
function limiterTA(monTA,nbCaracteres,temoin){
	nbActuel=monTA.value.length;
	if(nbActuel>=nbCaracteres+1){
		alert('Vous ne pouvez entrer que '+nbCaracteres+' caractères maximum');
		monTA.value=monTA.value.substr(0,nbCaracteres-2);
	}
	document.getElementById(temoin).innerHTML='<sup>'+ (nbCaracteres-nbActuel) + ' caractères restants</sup>';
}
// masquer un esemble de div et n'en afficher qu'une :
function switcherDiv(famille, quantite, maDiv){
	for(i=0; i< quantite; i++){
		if(i != maDiv){
			document.getElementById(famille+i).style.display='none';
		}
		else{
			document.getElementById(famille+i).style.display='block';
		}
	}
}
















