// Il faut aussi inclure le fichier ../inc/window.js

var oldURL = '';
var nom_html_file = '';
var oldURL2 = '';


function parent_refresh() {
window.opener.document.location.href = window.opener.document.location.href;
}


function LaunchWithSize(newURL, param, nWidth, nHeight)
{
	if ((nWidth == null) || (nWidth == 0)) nWidth = 600;
	if ((nHeight == null) || (nHeight == 0)) nHeight = -1;
	launch(newURL, 'scrollbars=yes,toolbar=no,resizable=yes,' + SizeCenter(nWidth, nHeight));
}


function launch(newURL, param)
{ 
	var remote;
	if (param == '') param = 'scrollbars=yes,toolbar=no,resizable=yes,' + SizeCenter(600, -1);
	if (param == null) param = 'scrollbars=yes,toolbar=no,resizable=yes,' + SizeCenter(600, -1);

	if ((window.remote == null) || (remote.closed)) {
		remote = top.window.open(newURL, 'new', param);
		if (remote != null)	remote.focus();
		oldURL = newURL;
	}	else {
		if (newURL != oldURL) {
			remote.close();
			remote = top.window.open(newURL, 'new', param);
			remote.focus();
			oldURL = newURL;		
		} else
			remote.focus();
	}
	if (remote != null) 
	{
		if (remote.opener == null) remote.opener = self;
		remote.opener.name = self.name; //'reach'; 
	}
}


function launch_with_name(winname, newURL2, param2)
{ 
	var remote2;
	if ((param2 == '') || (param2 == null)) 
		param2 = 'scrollbars=yes,toolbar=no,resizable=yes,' + SizeCenter(600, -1);

	if ((window.remote2 == null) || (remote2.closed) || (newURL2 != oldURL2)) {
		remote2 = open(newURL2, winname, param2);
		remote2.focus();
		oldURL2 = newURL2;
	}	else {
		if (newURL2 != oldURL2) {
			remote2.close();
			remote2 = open(newURL2, winname, param2);
			remote2.focus();
			oldURL2 = newURL2;		
		} else
			remote2.focus();
	}
	if (remote2.opener == null) {
		remote2.opener = self;}
	remote2.opener.name = self.name; //'reach2'; 
}



function supprime(matable, maref, maval, maref2, maval2){
	supprime1(matable, maref, maval, maref2, maval2, '')
}



function supprime1(matable, maref, maval, maref2, maval2)
{
	isNN = ((navigator.appName).indexOf("Netscape")!=-1);
	if (maref2 != '' && maval2 != '')
	{
		launch('../delete.asp?table=' + matable + '&ref=' + maref + '&id=' + maval + '&ref2=' + maref2 + '&id2=' + maval2,'scrollbars=yes,toolbar=no,resizable=yes,' + SizeCenter(200, 150)); 
	}
	else
	{
	launch('../delete.asp?table=' + matable + '&ref=' + maref + '&id=' + maval, 'scrollbars=yes,toolbar=no,resizable=yes,' + SizeCenter(200, 150)); 
	}
}



/* ---- Effacement d'un champ texte ----- */
function effacer(chp)
{
	if (chp != '') window.document.forms[0].elements[chp].value = '';
}

