// JavaScript Document
function preload()
{
	var imgs = new Array("images/pros.gif","images/pros-over.gif","images/experts.gif","images/experts-over.gif","images/site.gif","images/site-over.gif","images/inscription.gif","images/inscription-over.gif","images/partenaires.gif","images/partenaires-over.gif","images/contact.gif","images/contact-over.gif","images/retour.gif","images/retour-over.gif","images/passe.gif","images/passe-over.gif","images/valider.gif","images/valider-over.gif");
	for (var i = 0; i < imgs.length; i++ )
	{
		var tmp = imgs[i];
		(imgs[i] = new Image()).src = tmp;
	}
}

// Fonction Alerte
function alerte(valeur_champ,nom_champ)
{
 alert("Veuillez renseigner le champ : \""+nom_champ+"\".");
 valeur_champ.focus();
 return (false);
}

// Fonction Validation Accès Pros / Experts - Compagnies d'assurance
function valid_identification(theForm)
{
	if (theForm.login.value == "") return (alerte(theForm.login,'Login'));
	if (theForm.passe.value == "") return (alerte(theForm.passe,'Passe'));
	return (true);
}

// Fonction Validation Formulaire Mot de passe oublié
function valid_passe(theForm)
{
	if (theForm.passe_login.value == "") return (alerte(theForm.passe_login,'Login'));
	if (theForm.passe_mail.value == "") return (alerte(theForm.passe_mail,'Mail'));
	if (theForm.passe_valid.value == "") return (alerte(theForm.passe_valid,'Validation'));
	if (!(confirm('Envoyer ma demande de mot de passe ?'))) { return (false); }
	return (true);
}

// Fonction Validation Formulaire Inscription
function valid_inscription(theForm)
{
	if (theForm.inscription_societe.value == "") return (alerte(theForm.inscription_societe,'Soci\351t\351'));
	if (theForm.inscription_contact.value == "") return (alerte(theForm.inscription_contact,'Contact'));
	if (theForm.inscription_adresse.value == "") return (alerte(theForm.inscription_adresse,'Adresse'));
	if (theForm.inscription_cp.value == "") return (alerte(theForm.inscription_cp,'Code Postal'));
	if (theForm.inscription_ville.value == "") return (alerte(theForm.inscription_ville,'Ville'));
	if (theForm.inscription_tel.value == "") return (alerte(theForm.inscription_tel,'T\351l\351phone'));
	if (theForm.inscription_fax.value == "") return (alerte(theForm.inscription_fax,'T\351l\351copie'));
	if (theForm.inscription_mail.value == "") return (alerte(theForm.inscription_mail,'Mail'));
	if (clic == false) { alert("Vous devez consulter les conditions g\351n\351rales du contrat d'inscription ACCIAUTO.EU"); return (false); }
	if (theForm.valide.checked == false) return (alerte(theForm.valide,'J\'ai lu et accept\351 les CGU ACCIAUTO.EU'));
	if (theForm.inscription_valid.value == "") return (alerte(theForm.inscription_valid,'Validation'));
	if (!(confirm('Envoyer ma demande d\'inscription ?'))) { return (false); }
	return (true);
}

// Fonction Validation Formulaire Contact
function valid_contact(theForm)
{
	if (theForm.contact_nom.value == "") return (alerte(theForm.contact_nom,'Nom'));
	if (theForm.contact_mail.value == "") return (alerte(theForm.contact_mail,'Mail'));
	if (theForm.contact_message.value == "") return (alerte(theForm.contact_message,'Message'));
	if (theForm.contact_valid.value == "") return (alerte(theForm.contact_valid,'Validation'));
	if (!(confirm('Envoyer mon message ?'))) { return (false); }
	return (true);
}
