function display(obj,id1) {
            txt = obj.options[obj.selectedIndex].value;
            document.getElementById(id1).style.display = 'none';
            if ( txt.match(id1) ) {
            document.getElementById(id1).style.display = '';
            }
}

function setOther(sel) {
            var selectionValue = sel.value;
                        if (selectionValue == "United States") {
                                    document.distrib_form.AdobeInfoByMail.checked = true;
                                    document.distrib_form.AdobeInfoByEmail.checked = true;
                                    document.distrib_form.AdobeInfoByPhone.checked = true;
                        } else {
                                    document.distrib_form.AdobeInfoByMail.checked = false;
                                    document.distrib_form.AdobeInfoByEmail.checked = false;
                                    document.distrib_form.AdobeInfoByPhone.checked = false;
                        }           
                        
}

function isEmpty(mytext) {
	var re = /^\s{1,}$/g; //match any white space including space, tab, form-feed, etc.
	/* 	REGEXP DOCUMENTATION
		/^ 	 :  Forward slash escapes the "^" character which represents beginning of input line (here matches whitespace)
		\s	 :	A whitespace character (same as [ \t\v\n\r\f])
		{1,} :	Must occur at least 1 time.
		$ 	 : 	Matches at the end of the string.
		\g 	 :	Match all instances of a pattern in a string (any whitespace)
	*/
	if ((mytext.value.length==0) || (mytext.value==null) || ((mytext.value.search(re)) > -1)) {
		return true;
	} else {
		return false;
	}
}

function checkform (form) {

  var v = new VerifyForm();
  
   if ( ! v.hasValue(form.howmany) || isEmpty(form.howmany) ) {
	v.addError(form.howmany,     "Le nombre de copies que vous comptez distribuer est requis. Utilisez un chiffre différent de 0 pour le spécifier.");	
   } else { 
		if ( ! v.validNumeric(v.getValue(form.howmany)) || parseInt(v.getValue(form.howmany)) < 1 )  
    	v.addError(form.howmany,     "Le nombre de copies que vous comptez distribuer est requis. Utilisez un chiffre différent de 0 pour le spécifier.");
   }
   
	
  if ( ! v.hasValue(form.proposeduse) )
    v.addError(form.proposeduse,  "Indiquez lutilisation prvue.");
	
  if (v.hasValue(form.proposeduse) && v.getValue(form.proposeduse) == 'Internal_Web_site_ or_server') {
	  
	  if ( ! v.hasValue(form.web_distrib) )
	  v.addError(form.web_distrib,  "Étant donné que vous avez sélectionné le mode de distribution par \"site web interne ou serveur\", vous devez répondre à la question du gestionnaire de mise à niveau (en dessous).");
  }
   
  if ( ! v.hasValue(form.distrb_platform))
    v.addError(form.distrb_platform,      "Plate-forme de distribution requise");
 
  if ( ! v.hasValue(form.betauser))
    v.addError(form.betauser,      "Une réponse à la question sur le programme bêta d'Adobe Reader est requise");
 
  if ( ! v.hasValue(form.new_version_mail))
    v.addError(form.new_version_mail,      "Une réponse à la question relative aux notifications par e-mail sur les nouvelles versions/mises à niveau est requise");
  if ( ! v.hasValue(form.FirstName) || isEmpty(form.FirstName) )
    v.addError(form.FirstName,       "La mention du prnom est obligatoire.");   
  if ( ! v.hasValue(form.LastName) || isEmpty(form.LastName) )
    v.addError(form.LastName,      "La mention du nom est obligatoire.");
  if ( ! v.hasValue(form.Title) || isEmpty(form.Title) )
    v.addError(form.Title,   "La mention de la fonction est obligatoire.");
  if ( ! v.hasValue(form.JobFunction) )
    v.addError(form.JobFunction,   "La mention du secteur dactivit est obligatoire.");
 // if ( ! v.hasValue(form.Phone) || isEmpty(form.Phone) )
//    v.addError(form.Phone,   "La mention du numro de tlphone est obligatoire.");
	
  if ( ! v.hasValue(form.Email) || isEmpty(form.Email) )
    v.addError(form.Email,   "La mention de ladresse e-mail professionnelle est obligatoire.");	
   if ( v.hasValue(form.Email) && ! v.validEmail(v.getValue(form.Email)) )
    v.addError(form.Email,     "Adresse e-mail incorrecte");
	
  if ( ! v.hasValue(form.Address1)  || isEmpty(form.Address1) )
    v.addError(form.Address1,  "La mention de ladresse est obligatoire."); 
	
   if ( ! v.hasValue(form.City) || isEmpty(form.City) )
    v.addError(form.City,   "La mention de la ville est obligatoire."); 
	
  if ( ! v.hasValue(form.Country) || isEmpty(form.Country) )
    v.addError(form.Country,   "La mention du pays est obligatoire.");  
	
 // if ( ! v.hasValue(form.Zip) && v.hasValue(form.Country) && v.isNA(v.getValue(form.Country)) || isEmpty(form.Zip) )
 //   v.addError(form.Zip, "La mention du code postal est obligatoire si vous rsidez en Amrique du Nord.");  
	
	 if ( ! v.hasValue(form.State) && v.hasValue(form.Country) && v.isNA(v.getValue(form.Country)) )
    v.addError(form.State, "La mention de ltat/Province est obligatoire si vous rsidez en Amrique du Nord."); 
	
  if ( v.hasValue(form.State) && ! v.validState(v.getValue(form.State), v.getValue(form.Country)) )
    v.addError(form.State,     "tat/Province incorrect ( )" + v.getValue(form.Country));  
 

	
 // if ( v.hasValue(form.Zip) && ! v.validZip(v.getValue(form.Zip), v.getValue(form.Country)) || isEmpty(form.Zip) )
 //   v.addError(form.Zip,       "Code postal incorrect ( )" + v.getValue(form.Country)); 
 
 if ( v.hasValue(form.Country) && v.isNA(v.getValue(form.Country)) ) {
 if (! v.hasValue(form.Zip) || isEmpty(form.Zip)) {
   v.addError(form.Zip, "La mention du code postal est obligatoire si vous rsidez en Amrique du Nord.");
  } else {
   if ( ! v.validZip(v.getValue(form.Zip), v.getValue(form.Country)) )
   v.addError(form.Zip,       "tat/code postal incorrect ( ) " + v.getValue(form.Country)); 
  }
 }

	

  return v.showErrors('Les informations saisies dans ce formulaire sont incorrectes:\n',
    '\nveuillez les rectifier et ressayer!');
}

