function _rob_alerte(libelle,champ) {
  document.getElementById("errormsg").style.visibility = "visible";
  calque = "formsaisie_"+champ;
  pointeur = eval('document.myform.'+champ)
  document.getElementById(calque).className = "libelleerror";
  if (pointeur) pointeur.focus()
}

function _rob_unalerte(champ) {
  calque = "formsaisie_"+champ;
  document.getElementById(calque).className = "libelle";
}

function _rob_alerte_identifiant(libelle,champ) {
  calque = "formsaisie_"+champ;
  pointeur = eval('document.myform.'+champ)
  document.getElementById(calque).className = "libelleerror";
  if (pointeur) pointeur.focus()
}

function recherche() {
	if (document.myform.annee_debut.value !="") {
		if (isNaN(document.myform.annee_debut.value)) {
			document.getElementById("annee_debut").style.backgroundColor = "#f8ced5";		
			document.myform.annee_debut.focus();
			return;
		}
	}
	if (document.myform.annee_fin.value !="") {
		if (isNaN(document.myform.annee_fin.value)) {
			document.getElementById("annee_fin").style.backgroundColor = "#f8ced5";		
			document.myform.annee_fin.focus();
			return;
		}
	}
	if (document.myform.prix_mini.value !="") {
		if (isNaN(document.myform.prix_mini.value)) {
			document.getElementById("prix_mini").style.backgroundColor = "#f8ced5";		
			document.myform.prix_mini.focus();
			return;
		}
	}
	if (document.myform.prix_maxi.value !="") {
		if (isNaN(document.myform.prix_maxi.value)) {
			document.getElementById("prix_maxi").style.backgroundColor = "#f8ced5";		
			document.myform.prix_maxi.focus();
			return;
		}
	}
	document.myform.action="recherche-produits.php";
	document.myform.submit()
}

function contact() {
	if (document.myform.nom.value!="") {_rob_unalerte ("nom")};
	if (document.myform.code_postal.value!="") {_rob_unalerte ("code_postal")};
	if (document.myform.email.value!="") {_rob_unalerte ("email")};
	if (document.myform.telephone.value!="") {_rob_unalerte ("telephone")};
	if (document.myform.nom.value=="") {_rob_alerte ("nom","nom");return}
	if (document.myform.code_postal.value=="") {_rob_alerte ("code postal","code_postal");return}
	if (document.myform.email.value=="") {_rob_alerte ("e-mail","email");return}
	if (document.myform.telephone.value=="") {_rob_alerte ("téléphone","telephone");return}
	document.myform.action="contact-confirmation.php";
	document.myform.submit()
}


function partenaire() {
	if (document.myform.nom.value!="") {_rob_unalerte ("nom")};
	if (document.myform.email.value!="") {_rob_unalerte ("email")};
	if (document.myform.code_postal.value!="") {_rob_unalerte ("code_postal")};
	if (document.myform.telephone.value!="") {_rob_unalerte ("telephone")};
	if (document.myform.nom.value=="") {_rob_alerte ("nom","nom");return}
	if (document.myform.code_postal.value=="") {_rob_alerte ("code postal","code_postal");return}
	if (document.myform.email.value=="") {_rob_alerte ("e-mail","email");return}
	if (document.myform.telephone.value=="") {_rob_alerte ("téléphone","telephone");return}
	document.myform.action="partenaire-confirmation.php";
	document.myform.submit()
}




function gologin() {
	if (document.myform.login.value=="" || document.myform.password.value=="") return;
	document.myform.action="partenaire.php";
	document.myform.submit()
}

//Compte PARTENAIRE
function gologin2() 
{
	if (document.myform.login2.value!="") {_rob_unalerte ("login2")};
	if (document.myform.password2.value!="") {_rob_unalerte ("password2")};
	if (document.myform.login2.value=="") {_rob_alerte_identifiant ("login2","login2");return}
	if (document.myform.password2.value=="") {_rob_alerte_identifiant ("password2","password2");return}
	document.myform.login.value = document.myform.login2.value
	document.myform.password.value = document.myform.password2.value
	document.myform.action="partenaire.php";
	document.myform.submit()
}

//Compte PROMOTEUR
function gologin3() 
{
	if (document.myform.login2.value!="") {_rob_unalerte ("login2")};
	if (document.myform.password2.value!="") {_rob_unalerte ("password2")};
	if (document.myform.login2.value=="") {_rob_alerte_identifiant ("login2","login2");return}
	if (document.myform.password2.value=="") {_rob_alerte_identifiant ("password2","password2");return}
	document.myform.login.value = document.myform.login2.value
	document.myform.password.value = document.myform.password2.value
	document.myform.action="promoteur.php";
	document.myform.submit()
}

function gologin4() {
	document.myform.action="compte-promoteur.php";
	document.myform.submit();
}

//FIN AJOUT

function oublipass() {
	if (document.myform.oubli.value!="") {_rob_unalerte ("oubli")};
	if (document.myform.oubli.value=="") {_rob_alerte_identifiant ("oubli","oubli");return}
	document.myform.action="partenaire-oubli.php";
	document.myform.submit();
}

function disconnect() {
	document.myform.action = "index.php?deconnexion";
	document.myform.submit();
}


function showhidetab(id,colo,colo2) {
	calque = "tr" + id
  etat = document.getElementById(calque).style.display
	if (etat!="none") {
		document.getElementById(calque).style.display = "none";		
		document.getElementById("sub"+calque).style.backgroundColor = colo ;		
		document.getElementById("subtd"+id).style.backgroundImage = "url(media/image/fleche-droite.gif)";		
		}
	else {
		if (navigator.appName == "Microsoft Internet Explorer") document.getElementById(calque).style.display = "block";
		else document.getElementById(calque).style.display = "table-row";
		if (colo2) {
		document.getElementById("sub"+calque).style.backgroundColor = colo2;
		}
		else {
		document.getElementById("sub"+calque).style.backgroundColor = "#c6d2c6";
		}
		document.getElementById("subtd"+id).style.backgroundImage = "url(media/image/fleche-bas.gif)";		
	}
}



