/* ---------------------------------------------------------------
:: Permet de mettre les valeurs des champs du formulaire
:: à leur valeur par défaut
//	=> Nom_Formulaire : nom du formulaire
---------------------------------------------------------------- */
function Formulaire_Defaut(Nom_Formulaire)
{
	document.inscription.action="abonnement.php";
	document.inscription.submit();	
}

/* ---------------------------------------------------------------
:: Permet l'annulation du formulaire récapitulatif
---------------------------------------------------------------- */
function Annulation_Formulaire()
{
	document.Formulaire_Recapitulatif.submit();
}

/* ---------------------------------------------------------------
:: Permet l'annulation du formulaire récapitulatif
---------------------------------------------------------------- */
function Validation_Formulaire()
{
	document.Formulaire_Recapitulatif.action="abonnement.php?Confirmation=1";
	document.Formulaire_Recapitulatif.submit();
}

/* ---------------------------------------------------------------
:: Permet l'apparition/masquage du bloc contenant les champs adresse, complt d'adresse..
:: Dans le cas d'une adresse de jardin != de l'adresse personnelle
---------------------------------------------------------------- */
// Ces variables permettent de savoir si on affiche ou masque le bloc
var Flag_Affichage_Bloc_Autre_Adresse = 0;
var Flag_Affichage_Bloc_Autre_Adresse_Facturation = 0;
var Flag_Affichage_Bloc_Autre_Contact = 0;
var Flag_Affichage_Bloc_Autre_Origine_Contact = 0;


function Affichage_Bloc_Autre_Adresse()
{
	if(Flag_Affichage_Bloc_Autre_Adresse == 0 && document.getElementById("Check_Autre_Adresse").checked == true)
	{
		document.getElementById("Bloc_Autre_Adresse").style.display="";
		Flag_Affichage_Bloc_Autre_Adresse = 1;
	}
	else if(document.getElementById("Check_Autre_Adresse").checked == false)
	{
		document.getElementById("Bloc_Autre_Adresse").style.display="none";
		Flag_Affichage_Bloc_Autre_Adresse = 0;
	}

	
}


/* ---------------------------------------------------------------
:: Permet l'apparition/masquage dynamique du bloc ADRESSE DE FACTURATION
---------------------------------------------------------------- */
function Affichage_Bloc_Autre_Adresse_Facturation()
{
	if(Flag_Affichage_Bloc_Autre_Adresse_Facturation == 0 && document.getElementById("Check_Autre_Adresse_Facturation").checked == true)
	{
		document.getElementById("Bloc_Autre_Adresse_Facturation").style.display="";
		Flag_Affichage_Bloc_Autre_Adresse_Facturation = 1;
	}
	else if(document.getElementById("Check_Autre_Adresse_Facturation").checked == false)
	{
		document.getElementById("Bloc_Autre_Adresse_Facturation").style.display="none";
		Flag_Affichage_Bloc_Autre_Adresse_Facturation = 0;
	}
}


/* ---------------------------------------------------------------
:: Permet l'apparition/masquage dynamique du bloc AUTRE CONTACT
---------------------------------------------------------------- */	
function Affichage_Bloc_Autre_Contact()
{
	if(Flag_Affichage_Bloc_Autre_Contact == 0 && document.getElementById("Check_Autre_Contact").checked == true)

	{
		document.getElementById("Bloc_Autre_Contact").style.display="";
		Flag_Affichage_Bloc_Autre_Contact = 1;
	}
	else if(document.getElementById("Check_Autre_Contact").checked == false)
	{
		document.getElementById("Bloc_Autre_Contact").style.display="none";
		Flag_Affichage_Bloc_Autre_Contact = 0;
	}
	
}

/********************************************************************************
*			FONCTION AFFICHAGE_BLOC_AUTRE_ORIGINE_CONTACT
:: Permet l'affichage/masquage du champ texte autre origine
*********************************************************************************/
function Affichage_Bloc_Autre_Origine_Contact()
{
	if(	Flag_Affichage_Bloc_Autre_Origine_Contact == 0 && 
		document.getElementById("Origine_Contact['Autre']").checked == true)
	{
		document.getElementById("Bloc_Autre_Origine_Contact").style.display="";
		Flag_Affichage_Bloc_Autre_Origine_Contact = 1;
	}
	else if(document.getElementById("Origine_Contact['Autre']").checked == false)
	{
		document.getElementById("Bloc_Autre_Origine_Contact").style.display="none";
		Flag_Affichage_Bloc_Autre_Origine_Contact = 0;
	}
}
