function etat(img, laSrc)
{
	document.images[img].src = './images/'+ laSrc +'.gif';
}

function submitForm()
{
	document.frmContact.submit();	
}


function valider_form()
{
	document.frmConnexion.submit();	
}


function submitFrmProjet()
{
	if (verifProjet()==true)
	{
	document.frmProjet.submit();
	}
}


function connexion_base()
{
	
	nobug = true;
	msg = "";	
	var tableau = new Array(true,'');
	
	est_la("AA_NOM", tableau, "Vous devez inscrire votre nom");
	est_la("AA_PRENOM", tableau, "Vous devez inscrire votre prénom");
	est_la("AA_COURRIEL", tableau, "Vous devez inscrire une adresse courriel");
	
	if(tableau[0] != false)
	{
		document.frmConnexion.submit();	
	}
}



function est_la(le_id, retour, msg)
{
	var nobug = retour[0];
	var obj = document.getElementById(le_id);
	
	if(trim(obj.value) == "")
		{
			retour[1] += msg;
			// si le champs est vide... renvoyer que ce champs doit être rempli
			if (nobug == true)
			{
				// insérer dans le html le texte informant que c'est un champs obligatoire
				alert(msg);
			}
			retour[0] = false;	
		}
}

function trim(val)
{
	if (!val) return val;

		while(val.charAt(0) == ' ') val = val.substring(1,val.length);
		while(val.charAt(val.length  )==' ')  
		{
			val = val.substring(0,val.length-1);
		}
		
	 return val;
}