 //AFFICHAGE D'UNE POPUP AVEC OPTIONS
   var PopUpWindow;
   function PopUp(src,name,width, height, screenx, screeny, scrollbar, resize, toolbar, status, menubar, location, directories)
   {
	var size, pos;
	size = '';
	pos = '';
      //width, height : dimensions de la fene^tre
     if (width > 0)
		size = ',width='+width;
	 if (height > 0)
		size = size + ',height='+height;
     //screenx, screeny : position sur l'e'cran
     if (screenx >= 0)
		pos = ',screenX='+screenx+',left='+screenx;
	 if (screeny >= 0)
		pos = pos + ',screenY='+screeny+',top='+screeny;
     //scrollbar : barre de de'filement
     if (scrollbar == 1)
		scrollbar = 'yes';
	else
		scrollbar = 'yes';
	//resize : redimensionnement
	if (resize == 1)
		resize = 'yes';
	else
		resize = 'no';
	//toolbar : barre d'outils
     if (toolbar == 1)
		toolbar = 'yes';
	else
		toolbar = 'no';
	//status : barre d'e'tat
	if (status == 1)
		status = 'yes';
	else
		status = 'no';
	//menubar : menu
	if (menubar == 1)
		menubar = 'yes';
	else
		menubar = 'no';
	//location : barre d'adresse
	if (location == 1)
		location = 'yes';
	else
		location = 'no';
	//directories : liens persos
	if (directories == 1)
		directories = 'yes';
	else
		directories = 'no';

	//Ouverture du pop-up
    PopUpWindow = window.open(src, name,'scrollbars='+scrollbar+',resizable='+resize+',toolbar='+toolbar+',status='+status+',menubar='+menubar+',location='+location+',directories='+directories+size+pos)
    PopUpWindow.focus();
   }

function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

function AffichePopup() {
    vu = Get_Cookie("pdi");
    if (vu == null) {
	var today = new Date();
	var expires = new Date(today.getTime() + (30 * 60 * 1000));
	Set_Cookie("pdi","vu",expires);
	PopUp('popup.php','PopUp',352,240);
	}
}
