function popup(url,nom,largeur,hauteur,scrol,status)
{
	window.open(url,nom,"width="+largeur+",height="+hauteur+",scrollbars="+scrol+",status="+status);
}


function MM_swapImgRestore() 
{ 
  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() 
{ 
  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) 
{ 
  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() 
{ 
  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_nbGroup(event, grpName) 
{ 
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) 
  {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) 
    {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) 
      {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
      }
    }
  } 
  else if (event == "over") 
  {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) 
    {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } 
  else if (event == "out" ) 
  {
    for (i=0; i < document.MM_nbOver.length; i++) 
    {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; 
    }
  } 
  else if (event == "down") 
  {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) 
    {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
    } 
  }
}





function movedown(){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
		crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
	movedownvar=setTimeout("movedown()",20)
}

function moveup(){
	if (window.movedownvar) clearTimeout(movedownvar)
	if (parseInt(crossobj.style.top)<=0)
		crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
	moveupvar=setTimeout("moveup()",20)
}

function stopscroll(){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (window.movedownvar) clearTimeout(movedownvar)
}

function movetop(){
stopscroll()
if (iens6)
crossobj.style.top=0+"px"
else if (ns4)
crossobj.top=0
}

function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}

function control_mail(email)
{
	var regExpEmailAdress=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;	

	var resultat = email.match(regExpEmailAdress);

	if(resultat!=null && resultat.length==1) 
	{	
		return true;
	}
	else
	{
		return false;
	}
}

function control_int(chiffre)
{
	var regExpInt=/^[0-9]+$/g;	
	var resultat = chiffre.match(regExpInt);

	if(resultat!=null && resultat.length==1) 
	{	
		return true;
	}
	else
	{
		return false;
	}
}


function fncKeyStop() 
{
	// Check if the control key is pressed.
	// If the Netscape way won't work (event.modifiers is undefined),
	// try the IE way (event.ctrlKey)
	var ctrl = typeof event.modifiers == 'undefined' ?
	event.ctrlKey : event.modifiers & Event.CONTROL_MASK;

	// Check if the 'V' key is pressed.
	// If the Netscape way won't work (event.which is undefined),
	// try the IE way (event.keyCode)
	var v = typeof event.which == 'undefined' ?
	event.keyCode == 86 : event.which == 86;

	// If the control and 'V' keys are pressed at the same time
	if ( ctrl && v ) 
	{
		// ... discard the keystroke and clear the text box
		//document.form.elements['myText'].value = '';
		return false;
	}
	return true;
}



function DecomposeDate(LeParam1){ 

// Sépare les jours, les mois et les années dans une date de type "22/05/1981"
// Renvoye le tout dans un tableau de taille 3

LeRetour = new Array(3);
LeJour="";
LeMois="";
LeAnnee="";

// Extraction du jour
i=0;
while((LeParam1.charAt(i)!="/")&&(i<10)){
LeJour+=LeParam1.charAt(i);
i++;
}
if(LeJour.charAt(0)=="0"){
LeJour=LeJour.charAt(1);
}
LeParam1=LeParam1.substring(i+1,LeParam1.length);

// Extraction du mois
i=0;
while((LeParam1.charAt(i)!="/")&&(i<10)){
LeMois+=LeParam1.charAt(i);
i++;
}
if(LeMois.charAt(0)=="0"){
LeMois=LeMois.charAt(1);
}
LeParam1=LeParam1.substring(i+1,LeParam1.length);


// Extraction de l'année
LeAnnee=LeParam1;
LeRetour[0]=LeJour;
LeRetour[1]=LeMois;
LeRetour[2]=LeAnnee;
return LeRetour;
}


// Renvoye une date en format anglais avec le séparateur choisi "02/03/1981" -> "1981-3-2"
// Le premier paramètre est la date a convertir, le second est le caractère de séparation choisi
function DateAnglaise(LeParam1,LeParam2)
{

LaDate = new Array(3);
LaDate = DecomposeDate(LeParam1);

LeRetour = LaDate[2]+LeParam2+LaDate[1]+LeParam2+LaDate[0];
return LeRetour;
}



function ComparerDates(LeParam1,LeParam2)
{

	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2

	var LeParam1 = DateAnglaise(LeParam1,"/");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript

	var LeParam2 = DateAnglaise(LeParam2,"/");
	LeParam1 = Date.parse(LeParam1);
	LeParam2 = Date.parse(LeParam2);

	if (LeParam1 == LeParam2) 
	{ 
		return 0;
	}

	if (LeParam1 > LeParam2)
	{
		return 1;
	}
	else
	{
		return 2;
	}
}




