//VERIF_INSCRIPTION_1
function verif_inscription_1 ()
{
	var check_all=document.form.check_all.value;
	var pseudo=document.form.pseudo.value;
	var mdp=document.form.mdp.value;
	var civilite=document.form.civilite.value;
	var nom=document.form.nom.value;
	var prenom=document.form.prenom.value;
	var adresse=document.form.adresse.value;
	var cp=document.form.cp.value;
	var mail=document.form.mail.value;
	var tel=document.form.tel.value;
	var acceptation=document.form.acceptation.checked;
	
	if (acceptation==true)
	{
		if ((check_all!=1) || (pseudo=="") || (mdp=="") || (civilite=="") || (nom=="") || (prenom=="") || (adresse=="") || (cp=="") || (mail=="") || (tel==""))
		{
			return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=1');
		}
		else
		{
			document.form.check_all.value=2;
			document.form.submit();
		}
	}
	else
	{
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=2');
	}
}

//VERIF_INSCRIPTION_2
function verif_inscription_2 ()
{
	var check_all=document.form.check_all.value;
	var civilite=document.form.civilite.value;
	var nom=document.form.nom.value;
	var prenom=document.form.prenom.value;
	var adresse=document.form.adresse.value;
	var cp=document.form.cp.value;
	var mail=document.form.mail.value;
	var tel=document.form.tel.value;
	var acceptation=document.form.acceptation.checked;
	
	if (acceptation==true)
	{
		if ((check_all!=1) || (civilite=="") || (nom=="") || (prenom=="") || (adresse=="") || (cp=="") || (mail=="") || (tel==""))
		{
			return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=1');
		}
		else
		{
			document.form.check_all.value=2;
			document.form.submit();
		}
	}
	else
	{
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=2');
	}
}

//VERIF_CMD
function verif_cmd ()
{
	if ((document.form.mp) && (document.form.id_commande) && (document.form.num_commande) && (document.form.id_client) && (document.form.montant) && (document.form.type))
	{	
		var id_commande=document.form.id_commande.value;
		var num_commande=document.form.num_commande.value;
		var id_client=document.form.id_client.value;
		var montant=document.form.montant.value;
		var type=document.form.type.value;
		
		if (document.form.mp[0].checked==false)
		{
			var mp="CB";
		}
		else
		{
			var mp="CH";
		}
		
		if ((id_commande!="") && (num_commande!="") && (id_client!="") && (montant!="") && (type!=""))
		{
			if (mp=="CH")
			{
				//alert ("CH");
				document.form.action="finalise_1.php";
				document.form.submit ();
			}
			else if (mp=="CB")
			{
				//alert ("CB");
				document.form.action="mercanet/0001_A.php";
				document.form.submit ();
			}
			else
			{
				//window.location.replace ('index.php');
			}
		}
		else
		{
			//window.location.replace ('index.php');
		}
	}
	else
	{
		//window.location.replace ('index.php');
	}
}

// VERIF_CONNEXION_VENDRE
function verif_connexion_vendre()
{
	login=document.form_connexion_vendre.login.value;
	passe=document.form_connexion_vendre.passe.value;
	if(login=="")
	{ 
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=3');
		return false;
	}
	if(passe=="")
	{
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=4');
		return false;
	}
	document.form_connexion_vendre.submit();
}

//VERIF_CONTACTS
function verif_contacts ()
{
	var check_all=document.form.check_all.value;
	var civilite=document.form.civilite.value;
	var nom=document.form.nom.value;
	var prenom=document.form.prenom.value;
	var mail=document.form.mail.value;
	var message=document.form.message.value;

	if ((check_all!=1) || (civilite=="") || (nom=="") || (prenom=="") || (mail=="") || (message==""))
	{
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=1');
	}
	else
	{
		document.form.check_all.value=2;
		document.form.submit();
	}
}

// VERIF_CONNEXION_VENDRE
function verif_forget_pass ()
{
	mail=document.form.mail.value;
	
	if(mail=="")
	{ 
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=7');
	}
	else
	{
		test=false ;
		
		for (var j=1 ; j<(mail.length) ; j++)
		{
			if (mail.charAt(j)=='@')
			{
				if (j<(mail.length-4))
				{
					for (var k=j ; k<(mail.length-2) ; k++)
					{
						if (mail.charAt(k)=='.') 
						{
							test = true;
						}
					}
				}
			}
		}
		if (test==false) 
		{
			return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=7');
		}
		else
		{
			document.form.submit();
		}
	}
}

//VERIF_COMMENTAIRE
function verif_commentaire ()
{
	var check_all=document.form.check_all.value;
	var produit=document.form.produit.value;
	var anonymat=document.form.anonymat.value;
	var num_commande=document.form.num_commande.value;
	var commentaire=document.form.commentaire.value;

	if ((check_all!=1) || (produit=="") || (anonymat=="") || (num_commande=="") || (commentaire==""))
	{
		return GB_showCenter('ERREUR', 'pop_up/confirm_form.php?type=1');
	}
	else
	{
		document.form.submit();
	}
}
