function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Example: preloadImages('file.gif', 'http://www.x.com/y.gif');
function preloadImages()
{
  if(document.images)
  {
    if(!document.imageArray) document.imageArray = new Array();
    var i,j = document.imageArray.length, args = preloadImages.arguments;
    
    for(i=0; i<args.length; i++)
    {
      if (args[i].indexOf("#")!=0)
      {
        document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[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_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_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];}
}
/**************************************************************************************************/

/*************** Permet de faire Clignoter du texte ***************************/
// window.onload = goblink;
// <blink>toto</blink>
goblink_visibility = new Array;
function goblink()
{		
	if(document.getElementById && document.all)
		{
		blink_tab = document.getElementsByTagName('blink');
		for(a=0;a<blink_tab.length;a++)
			{
			if(goblink_visibility[a] != "visible")
				goblink_visibility[a] = "visible";
			else
				goblink_visibility[a] = "hidden";
			blink_tab[a].style.visibility=goblink_visibility[a];
			}
		}
	setTimeout("goblink()", 500);
}

/****************** Donne le Focus sur  un champ ********************/
function DonnerFocus(nom) {
	document.forms[0].elements[nom].focus();
}

/********************* Ouverture d'un Popup ******************************/
function WdwOpen(Url,Name,Width,Height,Left,Top,Scroll,Resizable)
{
	var W=Width?Width:screen.width
	var H=Height?Height:screen.height
	var L=Left?Left:(screen.width-Width)/2
	var T=Top?Top:(screen.height-Height)/2
	var Zz
	Zz="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+Scroll+",resizable="+Resizable+""
	Zz+=",left="+L+",top="+T+",width="+W+",height="+H	
	var Wd=window.open(Url,Name,Zz)
	if(Wd!=null)	Wd.focus()
}

/********************* Fermeture d'une fenêtre dans un délai défini **************************/
function auto_close(delai) 
{
setTimeout('self.close()',delai);
}

/******************* Message de Confirmation **********************/
function Confirm(Message,Url)
{
   var a = confirm(""+Message+"");
   if(a == true){
   	 if (Url == "") {
	  return true;
	 } else {
      window.location.href = ""+Url+"";
	 }
   } else {
      return false;
   }
}

/************** Vérifie que un des checkbox ou des boutons radio est bien coché *************/
function VerifCheck(frm,champ,message) {
	for (i=0; i<frm.elements[champ].length; i++) 
	{
		if(frm.elements[champ][i].checked)
		{
			return false;
		}
	}
	alert(message);
	return true;
}

/************** Vérifie que le champ est bien renseigné *************/
function VerifChamp(frm,champ,message)
{	
	if (frm.elements[champ].value == "")
	{
		alert(message);
		frm.elements[champ].focus();
		return true;
	}
}

/************** Vérifie que l'adresse mail est exacte *************/
function VerifMail(frm,champ,message)
{
	var email = frm.elements[champ].value;
	var verif = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]{2,}[.][a-zA-Z]{2,3}$/
	if (verif.exec(email) == null)
	{
		alert(message);
		frm.elements[champ].focus();
		return true;
	}
}

/*********
Limite le nombre de caractère dans un champ
onKeyDown="Limite(this,46,limite_titre_news)" onKeyUp="Limite(this,46,limite_titre_news)"
*************/
function Limite(Target,max,nomchamp)
{
StrLen = Target.value.length
	if (StrLen > max )
	{
	Target.value = Target.value.substring(0,max);
	CharsLeft = max;								
	} else {
	CharsLeft = StrLen;
	}	
nomchamp.value = CharsLeft;
}

/*********** Affiche ou Masque un champ ou une cellule ************/
function ieCSSblock()
{
	var ns4 = document.layers;
	var ns6 = document.getElementById && !document.all;
	var ie4 = document.all;
	
  if(ie4)
    CSSdisplay = "block";
  else
    CSSdisplay = "table-row";
  return CSSdisplay;
}

function Afficher_Masquer(champ,mode) 
{
	document.getElementById(champ).style.display = mode ; //"table-row" ou "block" ou "none"
}
/******************************************************************/

// Vérifie si le Champ comporte les caractère désirés
function VerifCarac(frm,champ,message,ValidChars)
{
	var AllowedChars = ValidChars
	var form = frm.elements[champ].value
		
	for (i=0; i < form.length;i++)
	{
		if (AllowedChars.indexOf(form.charAt(i)) == -1)
		{
			if (form.charAt(i) == "")
			{
				form.charAt(i)
				alert (message)
				frm.elements[champ].focus()
				return true
			}
		}
	}
}
//---------------------------------------------------------------------------//