// JavaScript Document
	function couleur(obj) {
     obj.style.backgroundColor = "#FFFFFF";
	}
	
	function valider() {
		var msg = "";
		
		/*EFFACE LES COMMENTAIRES DEJA AFFICHES SI LE FORMULAIRE N'EST DE NOUVEAU PAS VALIDE*/
		if(document.getElementById('hiddenblock_usertype').style.display == 'block'){document.getElementById('hiddenblock_usertype').style.display = 'none';}
		if(document.getElementById('hiddenblock_box').style.display == 'block'){document.getElementById('hiddenblock_box').style.display = 'none';}
		if(document.getElementById('hiddenblock_email').style.display == 'block'){document.getElementById('hiddenblock_email').style.display = 'none';}
		if(document.getElementById('hiddenblock_unvalid_email').style.display == 'block'){document.getElementById('hiddenblock_unvalid_email').style.display = 'none';}
		if(document.getElementById('hiddenblock_firstname').style.display == 'block'){document.getElementById('hiddenblock_firstname').style.display = 'none';}
		if(document.getElementById('hiddenblock_lastname').style.display == 'block'){document.getElementById('hiddenblock_lastname').style.display = 'none';}
		if(document.getElementById('hiddenblock_password').style.display == 'block'){document.getElementById('hiddenblock_password').style.display = 'none';}
		if(document.getElementById('hiddenblock_unvalid_password').style.display == 'block'){document.getElementById('hiddenblock_unvalid_password').style.display = 'none';}
		if(document.getElementById('hiddenblock_unvalid_passwordconf').style.display == 'block'){document.getElementById('hiddenblock_unvalid_passwordconf').style.display = 'none';}
		if(document.getElementById('hiddenblock_passwordconf').style.display == 'block'){document.getElementById('hiddenblock_passwordconf').style.display = 'none';}
		if(document.getElementById('hiddenblock_address').style.display == 'block'){document.getElementById('hiddenblock_address').style.display = 'none';}
		if(document.getElementById('hiddenblock_town').style.display == 'block'){document.getElementById('hiddenblock_town').style.display = 'none';}
		if(document.getElementById('hiddenblock_zipcode').style.display == 'block'){document.getElementById('hiddenblock_zipcode').style.display = 'none';}
		if(document.getElementById('hiddenblock_country').style.display == 'block'){document.getElementById('hiddenblock_country').style.display = 'none';}
		if(document.getElementById('hiddenblock_iagree').style.display == 'block'){document.getElementById('hiddenblock_iagree').style.display = 'none';}
		/**/
		
		/* TEST BOUTONS RADIOS */
		test = 1;
		for (i=0; i<document.formulaire.user_type.length; i++){
		if (document.formulaire.user_type[i].checked==true){
				test += 1;
				}
		}
		if(test == 1){
			msg += "You must fill in this field.\n";
			document.getElementById('hiddenblock_usertype').style.display = 'block';
		}
		/* FIN TEST BOUTONS RADIOS */
		
		/*TEST DES CHECKBOX*/
		if(document.getElementById("end_user").checked || document.getElementById("distributors").checked || document.getElementById("other").checked){
		vtest = 0;
		var all = document.all ? document.all :
		document.getElementsByTagName('*');
		var elements = new Array();
		for (var e = 0; e < all.length; e++){
			if (all[e].className == 'hiddencheckbox'){
			  if(all[e].checked){
				  vtest += 1;
			  }
			}
		}
		if(vtest == 0){  
			msg += "You must fill in the firstname field\n";
			document.getElementById('hiddenblock_box').style.display = 'block';
		}
		}
		/*FIN TEST DES CHECKBOX*/
		
		if (document.formulaire.email.value != "")	{
			indexAroba = document.formulaire.email.value.indexOf('@');
			indexPoint = document.formulaire.email.value.indexOf('.');
			if ((indexAroba < 0) || (indexPoint < 0))	{
				document.formulaire.email.style.backgroundColor = "#e8e4f2";
				msg += "This is not a valid email adress\n";
				document.getElementById('hiddenblock_unvalid_email').style.display = 'block';
			}
		}
		else	{
			document.formulaire.email.style.backgroundColor = "#e8e4f2";
			msg += "You must fill in this field.\n";
			document.getElementById('hiddenblock_email').style.display = 'block';
		}
	
		if (document.formulaire.firstname.value == "")	{
				msg += "You must fill in the firstname field\n";
				document.formulaire.firstname.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_firstname').style.display = 'block';
			}
		
		if (document.formulaire.lastname.value == "")	{
				msg += "You must fill in the name field\n";
				document.formulaire.lastname.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_lastname').style.display = 'block';
			}
		
		if (document.formulaire.address.value == "")	{
				msg += "You must fill in the name field\n";
				document.formulaire.address.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_address').style.display = 'block';
			}
		
		if (document.formulaire.zipcode.value == "")	{
				msg += "You must fill in the zipcode field\n";
				document.formulaire.zipcode.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_zipcode').style.display = 'block';
			}
		
		if (document.formulaire.town.value == "")	{
				msg += "You must fill in the town field\n";
				document.formulaire.town.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_town').style.display = 'block';
			}
		
		if (document.formulaire.password.value != "")	{
				pass = document.formulaire.password.value;
				if(pass.length < 4){
				msg += "You must fill in the town field\n";
				document.formulaire.password.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_unvalid_password').style.display = 'block';}
			}
		else	{
			document.formulaire.password.style.backgroundColor = "#e8e4f2";
			msg += "You must fill in this field.\n";
			document.getElementById('hiddenblock_password').style.display = 'block';
		}
		
		if (document.formulaire.passwordconf.value != "")	{
			pass = document.formulaire.password.value;
			passconf = document.formulaire.passwordconf.value;
			if(pass != passconf){
				msg += "You must fill in the town field\n";
				document.formulaire.passwordconf.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_unvalid_passwordconf').style.display = 'block';
				}
		}
		else	{
			document.formulaire.passwordconf.style.backgroundColor = "#e8e4f2";
			msg += "You must fill in this field.\n";
			document.getElementById('hiddenblock_passwordconf').style.display = 'block';
		}
				
		if (document.formulaire.iagree.checked == false)	{
				msg += "You must fill in the town field\n";
				document.getElementById('hiddenblock_iagree').style.display = 'block';
			}
			
		if (document.formulaire.country.selectedIndex == 0)	{
				msg += "You must fill in the town field\n";
				document.formulaire.country.style.backgroundColor = "#e8e4f2";
				document.getElementById('hiddenblock_country').style.display = 'block';
			}
		
		
		if (msg == "") return(true);
		else	{
				/*alert(msg);*/
				return(false);
			}
	}
	
	function valider_unsubscribe() {
		var msg = "";
		
		/*EFFACE LES COMMENTAIRES DEJA AFFICHES SI LE FORMULAIRE N'EST DE NOUVEAU PAS VALIDE*/
		if(document.getElementById('hiddenblock_email').style.display == 'block'){document.getElementById('hiddenblock_email').style.display = 'none';}
		if(document.getElementById('hiddenblock_unvalid_email').style.display == 'block'){document.getElementById('hiddenblock_unvalid_email').style.display = 'none';}
		/**/
		
		if (document.formulaire.email.value != "")	{
			indexAroba = document.formulaire.email.value.indexOf('@');
			indexPoint = document.formulaire.email.value.indexOf('.');
			if ((indexAroba < 0) || (indexPoint < 0))	{
				document.formulaire.email.style.backgroundColor = "#e8e4f2";
				msg += "This is not a valid email adress\n";
				document.getElementById('hiddenblock_unvalid_email').style.display = 'block';
			}
		}
		else	{
			document.formulaire.email.style.backgroundColor = "#e8e4f2";
			msg += "You must fill in this field.\n";
			document.getElementById('hiddenblock_email').style.display = 'block';
		}		
		
		if (msg == "") return(true);
		else	{
				/*alert(msg);*/
				return(false);
			}
	}
