//Vérifie le nombre de caractères saisis
function checkChar(fieldObj,maxChars){
	str = fieldObj.value
	nbCharInStr = str.length
	if (nbCharInStr >= maxChars){
		fieldObj.value = fieldObj.value.substring(0, maxChars)
		alert(maxChars+" caractères maximum !");
	}
}

//Fonction qui vérifie que l'expression est un e-mail
function isMail(expression) {
	var myRegExp = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i');
	/*var myRegExp = /^.+@.+\..{2,3}$/*/
	return myRegExp.test(expression);
}

// Check le formulaire de la page support.htm
function verifyData() {
	// N° de client
	if (document.SupportAstral.valeur1.value.length == 0) {
      alert("Bitte geben Sie Ihre Kundennummer an");
      document.SupportAstral.valeur1.focus();
	  return false;
    }
	if (isNaN(document.SupportAstral.valeur1.value) || (document.SupportAstral.valeur1.value.length!=6)) {
      alert("Die Kundennummer besteht aus 6 Ziffern");
      document.SupportAstral.valeur1.value = "";
      document.SupportAstral.valeur1.focus();
	  return false;
    }
	// e-mail
	if (document.SupportAstral.exped.value.length == 0) {
      alert("Sie müssen Ihre E-Mail eingeben");
      document.SupportAstral.exped.focus();
	  return false;
  	}
	// vérification du format de l'e-mail
	if(!isMail(document.SupportAstral.exped.value)){
		alert("Erfassen Sie bitten eine korrekte Email-Adresse");
		document.SupportAstral.exped.value = "";
		document.SupportAstral.exped.focus()
		return false
	}
	// Nom
	if (document.SupportAstral.valeur2.value.length == 0) {
      alert("Sie müssen Ihren Namen eingeben");
      document.SupportAstral.valeur2.focus();
	  return false;
  	}
	// Prénom
	if (document.SupportAstral.valeur3.value.length == 0) {
      alert("Sie müssen Ihren Vornamen eingeben");
      document.SupportAstral.valeur3.focus();
	  return false;
  	}
	// Pays
	if (document.SupportAstral.valeur6.value == "Sélectionnez le pays"){
	  alert("Sie müssen Ihr Land eingeben");
	  document.SupportAstral.valeur6.focus();
	  return false;
	}
	// Système
	if (document.SupportAstral.valeur9.value.length == 0){
	  alert("Wählen Sie Ihr Computersystem aus");
	  document.SupportAstral.valeur9.focus();
	  return false;
	}
	// Type
	if (document.SupportAstral.valeur10.value.length == 0){
	  alert("Wählen Sie die Art Ihres Computers aus");
	  document.SupportAstral.valeur10.focus();
	  return false;
	}
	// Processeur
	if (document.SupportAstral.valeur11.value.length == 0){
	  alert("Wählen Sie die Prozessorart Ihres Computers aus");
	  document.SupportAstral.valeur11.focus();
	  return false;
	}
	// Vitesse
	if (document.SupportAstral.valeur12.value.length == 0){
	  alert("Wählen Sie die Geschwindigkeit Ihres Computers aus");
	  document.SupportAstral.valeur12.focus();
	  return false;
	}
	// OS
	if (document.SupportAstral.valeur13.value.length == 0){
	  alert("Wählen Sie das Betriebssystem Ihres Computers aus");
	  document.SupportAstral.valeur13.focus();
	  return false;
	}
	// RAM
	if (document.SupportAstral.valeur14.value.length == 0){
	  alert("Wählen Sie das RAM aus");
	  document.SupportAstral.valeur14.focus();
	  return false;
	}
	// descriptif
	if (document.SupportAstral.valeur15.value.length == 0){
	  alert("Schildern Sie Ihr Problem");
	  document.SupportAstral.valeur15.focus();
	  return false;
	}
 	return true	
}
