//copyleft 2001 Jean-Michel Blondeau jmb@voir.net
function PopUp(adresse,fenetre,x,y,redim,ascen,menu,outil,secteur,adres,etat,cadre) {
posX=screen.availWidth-80;posY=screen.availHeight-80;
var arg = "";
 ha = 0;  la = 0;
	arg = arg + "width=" +x;
	arg = arg + ",height=" + y;
	arg = arg + ",resizable=" + redim;
	arg = arg + ",scrollbars=" + ascen;
	arg = arg + ",menubar=" + menu;
	arg = arg + ",toolbar=" + outil;
	arg = arg + ",locectories=" + secteur;
	arg = arg + ",location=" + adres;
	arg = arg + ",status=" + etat;
var loc=cadre;
if (loc=="bg") {ha=posY-y; la = 0}
else if (loc=="bc") {ha=posY-y; la = (posX-x)/2}
else if (loc=="bd") {ha=posY-y; la= posX-x}
else if (loc=="mg") {ha= (posY-y)/2; la = 0}
else if (loc=="mc") {ha= (posY-y)/2; la = (posX-x)/2}
else if (loc=="md") {ha= (posY-y)/2; la= posX-x}
else if (loc=="hg") {ha=0; la = 0}
else if (loc=="hc") {ha=0; la = (posX-x)/2}
else if (loc=="hd") {ha=0; la= posX-x}
	arg += ",screenX=" + la + ",left=" + la;
	arg += ",screenY=" +ha + ",top=" + ha;

window.open(adresse,fenetre,arg);
}

//Popup centrée
var win=null;
function openfenetre(mypage,myname,w,h,scroll,pos){
if(pos=="random"){
	LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
	TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
if(pos=="center"){
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
else if((pos!="center" && pos!="random") || pos==null){
	LeftPosition=0;TopPosition=20
	}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
}

