function FieldRef(cObjet) {
// contrôle si la fenêtre n'est pas déjà ouverte
 	if (self.opener == null) {
		if (parent.document.all) {
			if (cObjet.indexOf('(') == -1) {
				return parent.document.all(cObjet);
			} else {
				var lnPos = cObjet.substr(cObjet.indexOf('(') + 1, 2);
				return parent.document.all(cObjet.substr(0, cObjet.indexOf('('))).item(parseInt(lnPos.substr(0, lnPos.indexOf(')'))))
			}
		} else {
			if (cObjet.indexOf('(') == -1) {
				return document.all(cObjet);
			} else {
				var lnPos = cObjet.substr(cObjet.indexOf('(') + 1, 2);
				return document.all(cObjet.substr(0, cObjet.indexOf('('))).item(parseInt(lnPos.substr(0, lnPos.indexOf(')'))))
			}
		}
	} else {
		//ouverture fenetre
		if (cObjet.indexOf('(') == -1) {
			return self.opener.document.all(cObjet);
		} else {
			var lnPos = cObjet.substr(cObjet.indexOf('(') + 1, 2);
			return self.opener.document.all(cObjet.substr(0, cObjet.indexOf('('))).item(parseInt(lnPos.substr(0, lnPos.indexOf(')'))))
		}
	}
}


// Retourne une chaine avec la position Top et Left pour centrer la page
function SizeCenter(nWidth, nHeight)
{
if (nHeight == -1) nHeight = window.screen.availHeight - 60;
return 'width=' + nWidth + 
		', height=' + nHeight + 
		', top=' + (window.screen.availHeight - nHeight) / 2 + 
		', left=' + (window.screen.availWidth - nWidth) / 2
}


// Retourne une chaine avec la position Top et Left pour centrer la page
function SizeDialogCenter(nWidth, nHeight)
{
if (nHeight == -1) nHeight = window.screen.availHeight - 60;
return 'dialogWidth:' + nWidth + 
		'px; dialogHeight:' + nHeight + 'px'
}


// Redimensionne verticalement la fenêtre au plkus juste et la centre verticalement
function Window_Resize(lnEcartWidth) {
	return;		// A activer quand on veut
	var loBasDePage = document.createElement('DIV')
	document.body.appendChild(loBasDePage);
	var lnEcart = loBasDePage.offsetTop - document.body.clientHeight + document.body.clientTop * 8
	document.body.removeChild(loBasDePage);
	if (document.body.clientHeight + lnEcart < window.screen.availHeight)	{
		window.resizeBy(0, lnEcart);
		if (lnEcartWidth == null) lnEcartWidth = 0;
		window.moveBy(lnEcartWidth, -1 * lnEcart / 2)
	}
}


