function OuvrirPopup(url,popupdessus,titre,option)
{
	switch(OuvrirPopup.arguments.length)
	{
		case 0:
			url='';
		case 1:
			popupdessus=true;
		case 2:
			titre='_blank';
		case 3:
			option='toolbar=1,location=1,personnalbar=1,status=1,menubar=1,scrollbars=1,resizable=1,height=420,width=760,left=0,top=0,channelmode=0,directories=0';
		default:
	}
	if(url=='')
		url='about:blank';
	fenetre=window.open(url,titre,option);
	if(popupdessus==true)
		fenetre.focus();
	else
		window.focus();
}

function FermerPopup(retoursurparent)
{
	switch(FermerPopup.arguments.length)
	{
		case 0:
			retoursurparent=false;
		case 1:
			fermerfenetre=true;
		default:
	}
	if(window.opener!=null && retoursurparent==true)
		if(!window.opener.closed)
			window.opener.focus();
	if(fermerfenetre)
		window.close();
}

function DimensionnerPopupParId(id)
{
	window.resizeTo(document.getElementById(id).width,document.getElementById(id).height)
}

function fenetre_ouvrir(url,nom,option)
{
	if(option=='')
		option='toolbar=1,location=1,personnalbar=1,status=1,menubar=1,scrollbars=1,resizable=1,height=500,width=500,left='+((screen.width-500)/2)+',top='+((screen.height-500)/2)+',channelmode=0,directories=0';
	fenetre=window.open(url,nom,option);
	fenetre.focus();
}
function fenetre_fermer()
{
	if(opener!=null)
		if(!opener.closed)
			opener.focus();
	window.close();
}
