/*
	popupWin
	Ouvre un popup avec des paramètres précis et y met le focus

	IN:
		popupName: Nom de la fenêtre
		url: URL du contenu de la fenêtre
		popupWidth: Largeur de la fenêtre
		popupHeight: Hauteur de la fenêtre

	OUT:
		AUCUN
*/
function popupWin(popupName,url,popupWidth,popupHeight) {
	popupDef = window.open(url, popupName,"width=" + popupWidth + ",height=" + popupHeight + ",resizable=no,scrollbars=no,toolbar=no,status=no,location=no,directories=no");
	if ((navigator.appName == "Microsoft Internet Explorer") && (popupDef != null)) {
		popupDef.focus();
	}
}

function popupWin2(popupName,url,popupWidth,popupHeight) {
	popupDef = window.open(url, popupName,"width=" + popupWidth + ",height=" + popupHeight + ",resizable=no,scrollbars=yes,toolbar=no,status=no,location=no,directories=no");
	if ((navigator.appName == "Microsoft Internet Explorer") && (popupDef != null)) {
		popupDef.focus();
	}
}


/*
	popupRzSc
	Ouvre un popup avec des paramètres précis (avec scroll et resize) et y met le focus

	IN:
		popupName: Nom de la fenêtre
		url: URL du contenu de la fenêtre
		popupWidth: Largeur de la fenêtre
		popupHeight: Hauteur de la fenêtre

	OUT:
		AUCUN
*/
function popupRzSc(popupName,url,popupWidth,popupHeight){
	popupDef = window.open(url, popupName,"width=" + popupWidth + ",height=" + popupHeight + ",resizable=yes,scrollbars=yes,toolbar=no,status=no,location=no,directories=no");
	/*if ((navigator.appName == "Microsoft Internet Explorer") && (popupDef != null)) {
		popupDef.focus();
	}*/
	
	//Mathieu V  01-04-24
	setTimeout('popupDef.focus();',250);
}

/*
	closeAndLoad
	Ferme un popup et charge un url dans la page qui avait déclanchée le popup

	IN:
		link: URL du contenu qui sera envoyé à la page parent

	OUT:
		AUCUN
*/
function closeAndLoad(link) {
	var popwin = window.close();
	window.opener.location = (link);
}

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.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}


