var sel=0;

function afficher_cacher_div(ident, mode)
{
	if(document.getElementById(ident)!=null)
	{
		if(mode==='inverser')
		{
			mode=document.getElementById(ident).style.display=='block';
			mode = ! mode;
		}
		if(mode)
		{
			document.getElementById(ident).style.display='block';
		}else{
			document.getElementById(ident).style.display='none';
		}
	}
}
function afficher_cacher_span(ident, mode)
{
	if(document.getElementById(ident)!=null)
	{
		if(mode==='inverser')
		{
			mode=document.getElementById(ident).style.display=='none';
		}
		if(mode)
		{
			document.getElementById(ident).style.display='inline';
		}else{
			document.getElementById(ident).style.display='none';
		}
	}
}


function afficher_seulement(ident, valeur)
{
	afficher_cacher_div(ident+'_garder', 0);
	afficher_cacher_div(ident+'_envoyer', 0);
	afficher_cacher_div(ident+'_supprimer', 0);
	afficher_cacher_div(ident+'_oui', 0);
	afficher_cacher_div(ident+'_non', 0);
	afficher_cacher_div(ident+'_actu', 0);
	afficher_cacher_div(ident+'_breve', 0);
	afficher_cacher_div(ident+'_outil', 0);
	afficher_cacher_div(ident+'_0', 0);
	afficher_cacher_div(ident+'_1', 0);
	
	afficher_cacher_div(ident+'_'+valeur, 1);
}

function popupAv(uri, width, Height)
{
	window.open (uri, '', config='height='+Height+', width='+width+', toolbar=no, menubar=yes, scrollbars=yes, resizable=yes, location=no, directories=no, status=yes')
}

function idValue(n) {
	if(document.getElementById(n)!=null)
		return document.getElementById(n).value;
	else
		return '';
}


function mp_aff_mpDetail(mpId, dossier)
{
	if(document.getElementById('mpTd_'+mpId).innerHTML=='')
	{
		document.getElementById('mpTd_'+mpId).style.padding='15px';
		document.getElementById('mpTd_'+mpId).innerHTML='Chargement en cours';
		ChargeZone('voirMpDetail.php?mpId='+mpId+'&dossier='+dossier+'&nonEntete=1', 'mpTd_'+mpId);
	}else{
		document.getElementById('mpTd_'+mpId).style.padding='0px';
		document.getElementById('mpTd_'+mpId).innerHTML='';
	}
	return false;
}


function getHTTPObject()
{
	var xmlhttp=false;
	if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();
	else if (window.ActiveXObject)
		{
			try {xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");}
			catch(e) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
		}
	return xmlhttp;
}

function handleHttpResponse(zonediv, objhttp)
{
	if(objhttp.readyState == 4)
	{
		document.getElementById(zonediv).innerHTML=unescape(objhttp.responseText);
	}
}


function ChargeZone(adresse, zonediv)
{
	var http=getHTTPObject();
	http.open("GET", adresse, true);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
	http.onreadystatechange = function() 
	{
		handleHttpResponse(zonediv, http);
	}
	http.send(null);
}

function affDtlCadr(jour, mode) {
	afficher_cacher_div('dtlCadr'+jour, mode);
}

function affDtlCadr(jour, mode) {
	if(mode === 'clic') {
		sel=jour;
		afficher_cacher_div('dtlCadr'+jour, 1);
		return true;
	}
	if(mode == 0 && sel!=0){}
	else{
		if(sel != 0) 
			afficher_cacher_div('dtlCadr'+sel, 0);
		afficher_cacher_div('dtlCadr'+jour, mode);
		sel=0;
		
	}
}







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];}}
}
<!-- 

 --><!-- 

 -->