function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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 MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var ie4 = document.all;
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all; 

var affiche = new Array();
function afficher(id)
{
	obj=MM_findObj("details_"+id);
	if (ns4 || ns6) obj.style.display="table-row";
	else obj.style.display="inline";
	affiche[id] = true;
}
function cacher(id)
{
	obj=MM_findObj("details_"+id);
	obj.style.display="none";
	affiche[id] = false;
}
function afficher_cacher(id)
{
	if (affiche[id]) cacher(id);
	else afficher(id);
}
var listeitem=new Array();
var nbitem=0;
function additem(id)
{
	listeitem[nbitem++]=id;
}
function toutvoir()
{
	for (i=0;i<nbitem;i++) afficher(listeitem[i]);
}
function toutcacher()
{
	for (i=0;i<nbitem;i++) cacher(listeitem[i]);
}
function champ_input(nom,err)
{
	this.Nom = nom;
	this.Err = err;
}
function setbgcolor(quart,place,bgcolor)
{
	obj=MM_findObj("cellule_"+quart+"_"+place);
	obj.style.backgroundColor=bgcolor;
}
function getbgcolor(quart,place)
{
	obj=MM_findObj("cellule_"+quart+"_"+place);
	return obj.style.backgroundColor;
}
function tronque(texte,taille,idarea,idnb)
{
	t = texte.substr(0,taille);
	obj=MM_findObj(idarea);
	obj.value = t;
	obj=MM_findObj(idnb);
	obj.innerHTML = taille-t.length;
}
function FormatNumber(num,format,comma)
{
	p = Math.pow(10,format);
	n = String((Math.round(num*p))/p).replace(".",comma);
	a = n.split(comma);
	if (n.indexOf(comma)==-1) {n += comma; for (i=0; i<format; i++) n += "0";}
	if (String(a[1]).length < format) {for (i=1; i<format; i++) n += "0";}
	return ((n));
}
function IsBissextile(annee)
{
	if ((annee%4==0) && ((annee%100!=0) || (annee%400==0))) return true;
	else return false;
}
function IsFrDate(str)
{
	var expressionReguliere = /^[0123]?[0-9]{1}\/[01]?[0-9]{1}\/[12][90][0-9][0-9]/
	if (!expressionReguliere.test(str)) return false;
	aDate = str.split("/");
	j = parseInt(aDate[0],10);
	m = parseInt(aDate[1],10);
	a = parseInt(aDate[2],10);
	if (m==0 || m>12) return false;
	if (m==1||m==3||m==5||m==7||m==8||m==10||m==12) jmax=31;
	else if (m==2) {if (IsBissextile(a)) jmax=29; else jmax=28;}
	else jmax=30;
	if (j==0 || j>jmax) return false;
	if (a<1900 || a>2019) return false;
	return true;
}
function IsFrShortDate(str)
{
	var expressionReguliere = /^[0123]?[0-9]{1}\/[01]?[0-9]{1}\/[0-9][0-9]/
	if (!expressionReguliere.test(str)) return false;
	aDate = str.split("/");
	j = parseInt(aDate[0],10);
	m = parseInt(aDate[1],10);
	a = parseInt(aDate[2],10);
	if (m==0 || m>12) return false;
	if (m==1||m==3||m==5||m==7||m==8||m==10||m==12) jmax=31;
	else if (m==2) {if (IsBissextile(a)) jmax=29; else jmax=28;}
	else jmax=30;
	if (j==0 || j>jmax) return false;
	return true;
}
function IsHourMinute(str)
{
	var expressionReguliere = /^[012]?[0-9]{1}[hH:]{1}[05]?[0-9]{1}/
	if (!expressionReguliere.test(str)) return false;
	aHour = str.split(":");
	h = parseInt(aHour[0],10);
	m = parseInt(aHour[1],10);
	if (h<0 || h>23) return false;
	if (m<0 || m>59) return false;
	return true;
}
function blinkon(elmt,coloron,coloroff,millisec)
{
	document.getElementById(elmt).style.backgroundColor=coloron;
	proc = "blinkoff('" + elmt + "','" + coloron + "','" + coloroff + "'," + millisec + ")";
	setTimeout(proc,millisec);
}
function blinkoff(elmt,coloron,coloroff,millisec) 
{
	document.getElementById(elmt).style.backgroundColor=coloroff;
	proc = "blinkon('" + elmt + "','" + coloron + "','" + coloroff + "'," + millisec + ")";
	setTimeout(proc,millisec);
}
function toZeroString(s)
{
	n=parseInt(s);
	if (n<10) str="0"+s;
	else str=""+s;
	return (str);
}

