﻿<!--
function sizeText(plusmois){
	var pas = 1 ;
	for(var i = 0 ; i < 25 ; i++){
		if( document.getElementById('text-article_'+i) != null){
			if(plusmois == "+" )
				document.getElementById('text-article_'+i).style.fontSize = (parseFloat(document.getElementById('text-article_'+i).style.fontSize)+pas)+'px' ;
			if(plusmois == "-" )
				document.getElementById('text-article_'+i).style.fontSize = (parseFloat(document.getElementById('text-article_'+i).style.fontSize)-pas)+'px' ;
		} else
			break ;
	}
}

function btToutLeMag(){
	if(document.getElementById('divToutLeMag') != null){
		document.getElementById('divToutLeMag').style.visibility = ( (document.getElementById('divToutLeMag').style.visibility == 'hidden' || document.getElementById('divToutLeMag').style.visibility == '') ? 'visible' : 'hidden');		
	}
	switchBtToutLeMag()
}

function switchBtToutLeMag(){	
	//alert(document.getElementById('divToutLeMag').style.visibility);
	if(document.getElementById('divToutLeMag') != null)
	if(document.getElementById('divToutLeMag').style.visibility == 'hidden' || document.getElementById('divToutLeMag').style.visibility == ''){
		document.getElementById('imgTtLeMag').src = "/commun/images/barre-nav/toutlemag_off.png" ;
	} else {
		document.getElementById('imgTtLeMag').src = "/commun/images/barre-nav/toutlemag_on.png" ;
	}
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function visibleBarreGreen(menu){
	var width = "75px" ;
	var marginleft = "0.5em" ;

	switch(menu){
		case 1:width = "75px"; marginleft = "0.7em"; break;
		case 2:width = "87px"; marginleft = "6.2em"; break;
		case 3:width = "63px"; marginleft = "12.7em"; break;
		case 4:width = "73px"; marginleft = "17.4em"; break;
		case 5:width = "90px"; marginleft = "22.9em"; break;
		case 6:width = "65px"; marginleft = "29.2em"; break;
	}
	document.getElementById('carreRollOver').style.width = width ;
	document.getElementById('carreRollOver').style.marginLeft = marginleft;
	document.getElementById('carreRollOver').style.visibility = "visible";
}
function hiddenBarreGreen(menu){
	document.getElementById('carreRollOver').style.visibility = "hidden";
}

function rollOverMotCles(idMotCles){
	document.getElementById(idMotCles).style.backgroundColor = '#CCFF00' ;
	var tmp = document.getElementById(idMotCles).innerHTML ;
	var reg=new RegExp("(-)", "g"); tmp = tmp.replace(reg,"<img src='http://"+window.location.host+"/commun/images/puce_toutlemag.png'>");	
	document.getElementById(idMotCles).innerHTML = tmp ;	
}
function rollOutMotCles(idMotCles){
	document.getElementById(idMotCles).style.backgroundColor = '#FFFFFF' ;
	var tmp = document.getElementById(idMotCles).innerHTML ;	
	var reg=new RegExp('(<img src="http://'+window.location.host+'/commun/images/puce_toutlemag.png">)', "i"); tmp = tmp.replace(reg,"-");	
	
	document.getElementById(idMotCles).innerHTML = tmp ;
}

function verifMail(adrr){
  var reg= /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
  return (reg.test(adrr)==true);
}
function verifFormInscriptionNewsletter(theForm){
	if ( !verifMail(theForm.email.value) ){
		alert("Veuillez indiquer une adresse valide.");
		theForm.email.focus();
		return false ;
	} else if( !theForm.desincrire.checked && confirm("Confirmez-vous l'inscription à la newsletter ?") ) {
		return true
	} else if( theForm.desincrire.checked && confirm("Confirmez-vous la désincription à la newsletter ?") ) {
		return true
	} else {
		return false ;	
	}
}

//-->