function OnInputFocus()
{
	// recherche les éléments INPUT de la page
	var INP = document.getElementsByTagName('INPUT');
	// mais seulement ceux dont l'attribut type est "EDIT"
	for (var i=0; i < INP.length; i++) {
		if (INP[i].attributes["type"].value.toLowerCase() == "text")
		{
			INP[i].onfocus = function() { this.style.backgroundColor='#FFFF99';}
			INP[i].onblur = function() { this.style.backgroundColor='#F6F6F6';}
		}
	}
	// pareil avec les élements TEXTAREA
	var TXT = document.getElementsByTagName('TEXTAREA');
	for (var j=0; j < TXT.length; j++) {
		TXT[j].onfocus = function() { this.style.backgroundColor='#FFFF99';}
		TXT[j].onblur = function() { this.style.backgroundColor='#F6F6F6';}
	}
	// actions sur les case à options...
	if (X = document.getElementById('service'))
	{
		X.onchange = function() { SwapFieldsets(); }
		// initialisation au premier passage...
		SwapFieldsets();
		document.forms['formulaire_sav'].elements['nom'].focus();
	}
}

function SwapFieldsets() 
{
	var X = document.getElementById('service');
	var A = document.getElementById('monture');
	var B = document.getElementById('pieces');
	var C = document.getElementById('mention');
	if (X.selectedIndex == 0) 
	{
		A.style.display = 'block';
		B.style.display = 'block';
		C.style.display = 'none';
	}
	else
	{
		A.style.display = 'none';
		B.style.display = 'none';
		C.style.display = 'block';
	}
}


window.onload = function ()
{
	if (document.getElementsByTagName) OnInputFocus();
}

