// GESTION des formulaires et de la soumission de ceux ci ----------------------------------
document.onkeypress = envoiForm;
var defaultForm='';

function setForms()
{
	tb=document.getElementsByTagName('form');
	
	for(i=0;i<tb.length;i++)
	{
		for(j=0;j<tb[i].elements.length;j++)
		{
			if(tb[i].elements[j].type == 'radio' || tb[i].elements[j].type == 'checkbox')
			{
				tb[i].elements[j].onfocus= function (event) { setForm(this.form); };
				tb[i].elements[j].onkeypress= function (event) { setForm(this.form); };
			}
			else
			{
				tb[i].elements[j].onfocus= function (event) { setForm(this.form); changeColor(this); };
				tb[i].elements[j].onkeypress= function (event) { setForm(this.form); changeColor(this); };
				tb[i].elements[j].onblur= function (event) { resetColor(this); };
			}	
		}
	}
}
function changeColor(obj)
{
	obj.style.backgroundColor = '#f4f6ba';
}
function resetColor(obj)
{
	obj.style.backgroundColor = '#fff';
}
function setForm(obj)
{
	defaultForm = obj;
}
function envoiForm(e)
{
	if(defaultForm != '')
	{
		if (!e) var e = window.event;
		if (e.keyCode == 13) {defaultForm.submit();} //IE
		else if (e.which == 13) {defaultForm.submit();} // Firefox
	}
	defaultForm = '';
}

function liensurblock(destination) {
	window.location.href = destination;
}
