function Controle() {
	if((document.forms.rachatcredit.email.value =="") || (document.forms.rachatcredit.email.value.indexOf("@") =="-1") || (document.forms.rachatcredit.email.value.indexOf(".") =="-1")) {
		alert('Entrez une adresse mail valide!');
		document.rachatcredit.email.focus();
	}
	else if(document.rachatcredit.nom.value=='') {
		alert('Votre nom est obligatoire !');
		document.rachatcredit.nom.focus();
	}
	else if(document.rachatcredit.telephone.value=='') {
		alert('Votre numéro de téléphone est obligatoire !');
		document.rachatcredit.telephone.focus();
	}
	else if(document.rachatcredit.cp.value=='' || document.rachatcredit.cp.value == '0') {
		alert('Votre code postal est obligatoire !');
		document.rachatcredit.cp.focus();
	}
	else if((document.rachatcredit.conso_nbre.value == '0' && (document.rachatcredit.conso_restant.value == '0' || document.rachatcredit.conso_restant.value == '') && (document.rachatcredit.conso_mensualite.value == '0' || document.rachatcredit.conso_mensualite.value == '')) && (document.rachatcredit.immo_nbre.value == '0' && (document.rachatcredit.immo_restant.value == '0' || document.rachatcredit.immo_restant.value == '') && (document.rachatcredit.immo_mensualite.value == '0' || document.rachatcredit.immo_mensualite.value == '')) && (document.rachatcredit.auto_nbre.value == '0' && (document.rachatcredit.auto_restant.value == '0' || document.rachatcredit.auto_restant.value == '') && (document.rachatcredit.auto_mensualite.value == '0' || document.rachatcredit.auto_mensualite.value == '')) && (document.rachatcredit.autre_nbre.value == '0' && (document.rachatcredit.autre_restant.value == '0' || document.rachatcredit.autre_restant.value == '') && (document.rachatcredit.autre_mensualite.value == '0' || document.rachatcredit.autre_mensualite.value == ''))) {
		alert('Au moins un type de crédit est obligatoire');
		document.rachatcredit.conso_nbre.focus();
	}
	else {
		document.rachatcredit.method = "POST";
		document.rachatcredit.action = "http://www.rachatducredit.com/formulaire/index.php";
		document.rachatcredit.submit();
	}
}

function ControleMini() {
	if((document.forms.rachatcredit.email.value =="") || (document.forms.rachatcredit.email.value.indexOf("@") =="-1") || (document.forms.rachatcredit.email.value.indexOf(".") =="-1")) {
		alert('Entrez une adresse mail valide!');
		document.rachatcredit.email.focus();
	}
	else if(document.rachatcredit.nom.value=='') {
		alert('Votre nom est obligatoire !');
		document.rachatcredit.nom.focus();
	}
	else if(document.rachatcredit.telephone.value=='') {
		alert('Votre numéro de téléphone est obligatoire !');
		document.rachatcredit.telephone.focus();
	}
	else if(document.rachatcredit.cp.value=='' || document.rachatcredit.cp.value == '0') {
		alert('Votre code postal est obligatoire !');
		document.rachatcredit.cp.focus();
	}
	else if((document.rachatcredit.conso_nbre.value == '0' && (document.rachatcredit.conso_restant.value == '0' || document.rachatcredit.conso_restant.value == '') && (document.rachatcredit.conso_mensualite.value == '0' || document.rachatcredit.conso_mensualite.value == '')) && (document.rachatcredit.immo_nbre.value == '0' && (document.rachatcredit.immo_restant.value == '0' || document.rachatcredit.immo_restant.value == '') && (document.rachatcredit.immo_mensualite.value == '0' || document.rachatcredit.immo_mensualite.value == ''))) {
		alert('Au moins un type de crédit est obligatoire');
		document.rachatcredit.conso_nbre.focus();
	}
	else {
		document.rachatcredit.method = "POST";
		document.rachatcredit.action = "http://www.rachatducredit.com/formulaire/index.php";
		document.rachatcredit.submit();
	}
}

function validDatas() 
	{	
		  if (document.question.titre.value == '') {
			alert('indiquez un Titre a votre question');
			document.question.titre.style.backgroundColor = "#E4D9E9";
			document.question.titre.focus();
			return false;
			stop();
			}
			
			if (document.question.titre.value == 'Choisissez le titre de votre question...') {
			alert('indiquez un Titre a votre question');
			document.question.titre.style.backgroundColor = "#E4D9E9";
			document.question.titre.focus();
			return false;
			stop();
			}
			
			if (document.question.question.value.length < 100) {
			alert('Veuillez detailler votre question');
			document.question.question.style.backgroundColor = "#E4D9E9";
			document.question.question.focus();
			return false;
			stop();
			}
			
			if (document.question.email.value == '') {
			alert('indiquez votre Adresse Email');
			document.question.email.style.backgroundColor = "#E4D9E9";
			document.question.email.focus();
			return false;
			stop();
			}
			
			if(document.question.email.value.indexOf('@') == -1) {
		    alert("Ce n'est pas une adresse electronique!");
			document.question.email.style.backgroundColor = "#E4D9E9";
		    document.question.email.focus();
		    return false;
		    stop();
			}
			
			if (document.question.villes.value == '') {
			alert('indiquez les villes alentour');
			document.question.villes.style.backgroundColor = "#E4D9E9";
			document.question.villes.focus();
			return false;
			stop();
			}
			
		  document.getElementById('question').submit();
	}
	
function limiteur()
    {
    maximum = 100;
    champ = document.question.question;
    indic = document.question.indicateur;

      indic.value = champ.value.length;
	}
	
function validformulaire() 
	{	
			
			if (document.formrachatcredit.conso_nbre.value == '0' && document.formrachatcredit.immo_nbre.value == '0' && document.formrachatcredit.auto_nbre.value == '0' && document.formrachatcredit.autre_nbre.value == '0') {
			alert('Indiquez au minimum 1 credit en cours');
			document.formrachatcredit.conso_nbre.style.backgroundColor = "#FF991B";
			document.formrachatcredit.conso_nbre.focus();
			return false;
			stop();
			}
			
			if (document.formrachatcredit.nom.value == '') {
			alert('Indiquez votre Nom');
			document.formrachatcredit.nom.style.backgroundColor = "#FF991B";
			document.formrachatcredit.nom.focus();
			return false;
			stop();
			}

			if(document.formrachatcredit.email.value.indexOf('@') == -1) {
		    alert("Indiquez une adresse electronique valide !");
			document.formrachatcredit.email.style.backgroundColor = "#FF991B";
		    document.formrachatcredit.email.focus();
		    return false;
		    stop();
			}
			
			if (document.formrachatcredit.cp.value == '') {
			alert('Indiquez votre Code postal');
			document.formrachatcredit.cp.style.backgroundColor = "#FF991B";
			document.formrachatcredit.cp.focus();
			return false;
			stop();
			}
			
			if (document.formrachatcredit.telephone.value == '') {
			alert('Indiquez votre Numéro de téléphone');
			document.formrachatcredit.telephone.style.backgroundColor = "#FF991B";
			document.formrachatcredit.telephone.focus();
			return false;
			stop();
			}
			
			if (document.formrachatcredit.emprunteur_salaire.value == '0') {
			alert('Indiquez votre Salaire');
			document.formrachatcredit.emprunteur_salaire.style.backgroundColor = "#FF991B";
			document.formrachatcredit.emprunteur_salaire.focus();
			return false;
			stop();
			}
			
		  document.getElementById('formrachatcredit').submit();
	}

