////////////////////////////////////////////////////////////////
// Change la couleur des lignes d'un tableau
function setPointer(theRow, thePointerColor)
{
	if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
		return false;
	}
	if (typeof(document.getElementsByTagName) != 'undefined') {
		var theCells = theRow.getElementsByTagName('td');
	}
	else if (typeof(theRow.cells) != 'undefined') {
		var theCells = theRow.cells;
	}
	else {
		return false;
	}
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) {
	theCells[c].style.backgroundColor = thePointerColor;
	}
	return true;
}

////////////////////////////////////////////////////////////////
 // DEPLIE OU REPLIE UN DIV
function depliRepli(nameDiv)
	{
	if (document.getElementById(nameDiv).style.display == 'none')
	{
		document.getElementById(nameDiv).style.display='block';
	}
	else
	{
		document.getElementById(nameDiv).style.display='none';
	}
}

////////////////////////////////////////////////////////////////
// RECUPÉRATION DES INFO DU NAVIGATEUR
function getNavigateur()
{
	// Récupération des infos du navigateur
	var N=navigator.appName; var V=navigator.appVersion;
	var version="?"; var nom=N; var os="?"; var langue="?";
	if (N=="Microsoft Internet Explorer") 
	{
		langue=navigator.systemLanguage
		version=V.substring(V.indexOf("MSIE",0)+5,V.indexOf(";",V.indexOf("MSIE",0)));
		if (V.indexOf("Win",0)>0) 
		{
			if ( V.indexOf(";",V.indexOf("Win",0)) > 0 ) 
			{
				os=V.substring(V.indexOf("Win",0),V.indexOf(";",V.indexOf("Win",0)));
			} else 
			{
				os=V.substring(V.indexOf("Win",0),V.indexOf(")",V.indexOf("Win",0)));
			}
		}
		if (V.indexOf("Mac",0)>0) 
		{
			os="Macintosh";
			version=V.substring(V.indexOf("MSIE",0)+6,V.indexOf(" ",V.indexOf("MSIE",0)));
		}
	}
	if (N=="Netscape") 
	{
		langue=navigator.systemLanguage
		version=(V.substring(0,V.indexOf("(",0)));
		if (V.indexOf("Mac",0)>0) 
		{
			os="Macintosh";
		}
		if (V.indexOf("Linux",0)>0) 
		{
			os="Linux";
		}
		if (V.indexOf("Win",0)>0) 
		{
			os=V.substring(V.indexOf("Win",0),V.indexOf(";",V.indexOf("Win",0)));
		}
		if (version==5) 
		{
			version="6.0"
		}
	}
	return (nom+"#"+version.substr(0,3)+"#"+os+"#"+langue)
}
////////////////////////////////////////////////////////////////

function confirmSuppr(page,id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cet enregistrement ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprc\" action=\"" + page + "\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSuppr.submit();
		}
		else
		{
			document.location.href = "" + page + "?action=delete&id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function MM_openBrWindow(theURL,winName,width,height,features) 
{ 
	var largeur;
	var hauteur;
	var w_configurateur;
	largeur=screen.width;
	hauteur=screen.height;
	largeur=(largeur-width)/2;
	hauteur=(hauteur-height)/2;
	features=features + ',top='+hauteur+',left='+largeur+',width='+width+',height='+height+'';
	winName=window.open(theURL,winName,features); 
//	window.close();
	winName.focus();
}
