function controle()
{
	if(document.affichage.oui.checked)
        { document.getElementById("doui").style.visibility = 'visible'; }
    else
        { document.getElementById("doui").style.visibility = 'hidden';  }
   
}
//Configuration des infos entrée par le client *******************************************************************--------------
function verifForm(LogClient) {

	// Verification du Login
	if (LogClient.LoginClient.value=="") {
		alert ("Please write your login !");
		LogClient.LoginClient.focus();
		return false;	}
		
	// Verification du pass
	if (LogClient.PasseClient.value=="") {
		alert ("Please write your password !");
		LogClient.PasseClient.focus();
		return false;	}
	
}

//Vérification du Ticket *******************************************************************--------------
function verifFormTicket(TicketCode) {

	// Verification du Login
	if (TicketCode.Code.value=="") {
		alert ("Vous devez saisir votre code de Réduction !");
		TicketCode.Code.focus();
		return false;	}
		
	// Verification du pass
	if (TicketCode.Code.value.length !=5) {
		alert ("Votre code est erroné !");
		TicketCode.Code.focus();
		return false;	}
	
}


// *********************************************************************************************************************
// INSCRIPTION D'UN CLIENT LORS d4UN ACHAT *****************************************************************************
// *********************************************************************************************************************

function verifForm9(InsClient) {

	// Verification civilite
	if (InsClient.civilite.value=="") {
		alert ("Choose your salutation !");
		InsClient.civilite.focus();
		return false;	}
		
	// Verification du nom du client
	if (InsClient.nomClient.value=="") {
		alert ("Please write your name !");
		InsClient.nomClient.focus();
		return false;	}
	
	// Verification du prénom du client
	if (InsClient.prenomClient.value=="") {
		alert ("Please write your first name !");
		InsClient.prenomClient.focus();
		return false;	}

	
	// Verification de l'adresse du client
	if (InsClient.adresseClient.value=="") {
		alert ("Please write your address !");
		InsClient.adresseClient.focus();
		return false;	}
		
	// Verification du code Postal du client
	if (InsClient.CodePoClient.value=="") {
		alert ("Please write your zip code !");
		InsClient.CodePoClient.focus();
		return false;	}
		
	// Verification de la ville du client
	if (InsClient.CommuneClient.value=="") {
		alert ("Please write your city !");
		InsClient.CommuneClient.focus();
		return false;	}

	// Verification de la ville du client
	if (InsClient.PaysClient.value=="") {
		alert ("Please write your country !");
		InsClient.PaysClient.focus();
		return false;	}

		
	// Vérification de lemail et de sa validité
		if (InsClient.MailClient.value=="") {
			alert ("Please write your e-mail !");
			InsClient.MailClient.focus();
			return false;	}
		else {
		mail = /^[a-zA-Z0-0_9][a-zA-Z0-9\.\-_]+@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
		VerifFormeEmail=mail.test(document.InsClient.MailClient.value)
			if(!VerifFormeEmail) {	
				alert ("Please write a valid e-mail !!!");
				InsClient.MailClient.focus();
				return false;	}
				}
		
	// Verification de la Téléphone du client
	if (InsClient.phoneClient.value=="") {
		alert ("Please write your phone !");
		InsClient.phoneClient.focus();
		return false;	}
		
		// Verification de l'acceptation du contrat
	if (InsClient.acceptation.checked==false) {
		alert ("Please accept the terms & conditions !");
		InsClient.acceptation.focus();
		return false;	}
}
function verifForm9Livr(InsClient) {
	if (InsClient.SameAdress[1].checked) {
			
		// Verification du nom du client
		if (InsClient.nomClientLivr.value=="") {
			alert ("Please write your name !");
			InsClient.nomClientLivr.focus();
			return false;	}
		
		// Verification du prénom du client
		if (InsClient.prenomClientLivr.value=="") {
			alert ("Please write your first name !");
			InsClient.prenomClientLivr.focus();
			return false;	}
		
		// Verification de l'adresse du client
		if (InsClient.adresseClientLivr.value=="") {
			alert ("Please write your address !");
			InsClient.adresseClientLivr.focus();
			return false;	}
		
		// Verification du code Postal du client
		if (InsClient.CodePoClientLivr.value=="") {
			alert ("Please write your zip code !");
			InsClient.CodePoClientLivr.focus();
			return false;	}
			
		// Verification de la ville du client
		if (InsClient.CommuneClientLivr.value=="") {
			alert ("Please write your city !");
			InsClient.CommuneClientLivr.focus();
			return false;	}

		if (InsClient.paysClientLivr.value=="") {
			alert ("Please write your country !");
			InsClient.paysClientLivr.focus();
			return false;	}

	}
}

function confirmEffCadd(f){
	return confirm("Please confirm !");
}
function paidChequeKDOajax(){
	var Ref = ID("paidChequeKDO").value;
	if(Ref!="" && Ref!="Code du chèque..."){
		if(document.all) var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		else var XhrObj = new XMLHttpRequest();
		XhrObj.open("post", "/frag/panier_Fra/useKDO.php");
		XhrObj.onreadystatechange = function(){
			if(XhrObj.readyState == 4 && XhrObj.status == 200){
				if(XhrObj.responseText=="ok") window.location.reload();
				else alert("Code du chèque incorrect."+XhrObj.responseText);
			}
		}
		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send("Ref="+Ref);
	}else alert("Veuillez entrer le code de votre chèque cadeau !");
    return false;
}
function paidContreRemb(Etat){
	window.location.href="/panier.php?file=validPanier&CR="+Etat;
	return false;
}

function testTypTrans(){
	var IsOk = false;
	var NbTrans = document.getElementById("TypTransRX").TypTrans.length;
	if(isNaN(NbTrans)){
		IsOk = document.getElementById("TypTransRX").TypTrans.checked;
	}else{
		for(var i=0; i<NbTrans; i++){
			if(document.getElementById("TypTransRX").TypTrans[i].checked == true){
				IsOk = true;
				break;
			}
		}
	}
	if(IsOk) return true;
	else{
		alert("Veuillez choisir votre mode de transport.");
		return false;
	}
}

