
function Question() {
return confirm ('Etes-vous sűr de vouloir supprimer ces données?');
}

 function checkDate(select_jour, select_mois, select_annee) {
     //alert('checkDate :' + select_jour.value + "/" + select_mois.value + "/"+ select_annee.value);
    jour  = select_jour.value;
    mois  = select_mois.value;
    annee = select_annee.value;

    nb_jour_mois = 0;
    switch(mois){
    case '1' : case '3' : case '5' : case '7' : case '8' : case '10' : case
  '12' : nb_jour_mois = 31; break;
    case '4': case '6' : case '9' : case '11' : nb_jour_mois = 30; break;
    case '2' :
      if (annee % 4 == 0)
        nb_jour_mois = 29;
      else
        nb_jour_mois = 28;
      break;
    } // switch

     if ((mois!="")&&(nb_jour_mois < jour)) {
      alert('Ce jour du mois n\'existe pas !');
      select_jour.value=nb_jour_mois;
    }
}

function format_price(value, format_value) { // format_price
  res = value;

  switch (format_value) {
  case 'cents' : 
    value = value * 1;
    before_point = parseInt(value / 100 , 10);
    after_point  = parseInt(value % 100 , 10);
    break;
    
  default : 
    alert('pretty_printing/format_price(' + value + ', ' + format_value + ') : the format value ' +  format_value + ' in unknown');
  }
  
  res = before_point + '.' + (after_point < 10 ? '0' : '') +  after_point;
  // alert('pretty_printing/format_price(' + value + ', ' + format_value + ') : ' + before_point + '#' + after_point + ' res=' + res);
  
  return res;
} // format_price

function get_champ(the_form, elt_name) {
  var i;
  var res = false;
  // var tmp = "";
  for (i=0; i < the_form.elements.length; i++) {
    var elt = the_form.elements[i];
    // tmp = tmp + ' elt=' + elt + ' elt.name=' + elt.name + '\n';
    if (elt.name == elt_name) {
      res = elt;
      break;
    }
  }

  // alert(tmp);
  // alert('get_champ(' + the_form + ',' + elt_name + ' ==> ' + res);
  return res;
}


/**********************************
get_radio_value
Wait   : a radio button object
Job    : found the selected radio and return its value
Return : radio button value or false if no radio selected
**********************************/
function get_radio_value(obj_radio) {
  var i;
  var res = false;

  for (i=0; i < obj_radio.length; i++){
    if (obj_radio[i].checked) {
      res = obj_radio[i].value;
    }
  }
  return res;
} /// get_radio_value




function get_select_value(name) {
  return name.options[name.selectedIndex].value;
}

function check_date(input_obj, field_name) {
  // alert('check_date : ' + input_obj + ',' + field_name);
  var tmp = input_obj.value.split('/');
  if (tmp.length != 3) {
    alert('Le format de date est jj/mm/aaaa');
    return false;
  } 

  var day   = parseInt( tmp[0] , 10);
  var month = parseInt( tmp[1] , 10);
  var year  = parseInt( tmp[2] , 10);

  if (false) alert('check_date ' + input_obj.value + '==> tmp.length=' + tmp.length + ' :  '  + 
		   tmp[0] + "->" + day + " " + 
		   tmp[1] + "->" + month + " " + 
		   tmp[2] + "->" + year );

  if (isNaN(day)) { 
    alert('Le jour ne peut pas ętre ' + tmp[0] + ' dans le champ ' + field_name);
    return false;
  }

  if (isNaN(month)) { 
    alert('Le mois ne peut pas ętre ' + tmp[1] + ' dans le champ ' + field_name);
    return false;
  }

  if (isNaN(year)) { 
    alert('L\'année ne peut pas ętre ' + tmp[2] + ' dans le champ ' + field_name);
    return false;
  }
  
  
  nb_day_month = 0;
  switch ( month) {
  case 1 : case 3 : case 5 : case 7 : case 8 : case 10 : case 12 : nb_day_month = 31; break;
  case 4: case 6 : case 9 : case 11 : nb_day_month = 30; break;
  case 2 : 
    if (year % 4 == 0) 
      nb_day_month = 29; 
    else 
      nb_day_month = 28;
    break;
  } // switch
  
  if (nb_day_month < day) {
    alert('Ce jour du mois n\'existe pas ' + '\n' + ' dans le champ'+ ' ' + field_name);
    // alert('month=' + month + ' => nb_day_month < day : ' + nb_day_month + ' < '+ day);
    return false;
  }

  return true;
}

function LTrim(str)
/*
   PURPOSE: Remove leading blanks from our string.
   IN: str - the string we want to LTrim
*/
{
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      // We have a string with leading blank(s)...

      var j=0, i = s.length;

      // Iterate from the far left of string until we
      // don't have any more whitespace...
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;

      // Get the substring from the first non-whitespace
      // character to the end of the string...
      s = s.substring(j, i);
   }
   return s;
}


function RTrim(str)
/*
   PURPOSE: Remove trailing blanks from our string.
   IN: str - the string we want to RTrim

*/
{
   // We don't want to trip JUST spaces, but also tabs,
   // line feeds, etc.  Add anything else you want to
   // "trim" here in Whitespace
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      // We have a string with trailing blank(s)...

      var i = s.length - 1;       // Get length of string

      // Iterate from the far right of string until we
      // don't have any more whitespace...
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;


      // Get the substring from the front of the string to
      // where the last non-whitespace character is...
      s = s.substring(0, i+1);
   }

   return s;
}


function Trim(str)
/*
   PURPOSE: Remove trailing and leading blanks from our string.
   IN: str - the string we want to Trim

   RETVAL: A Trimmed string!
*/
{
   return RTrim(LTrim(str));
}





function SubmitFormUser(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.nom_contact.value == '') {
			theform.nom_contact.focus();
			alert("Veuillez entrer un nom !");
			return;
		}
		
		if (theform.identifiant.value == '') {
			theform.identifiant.focus();
			alert("Veuillez entrer un identifiant !");
			return;
		}
		if (theform.mot_de_passe.value == '') {
			theform.mot_de_passe.focus();
			alert("Veuillez entrer un mot de passe !");
			return;
		}
		
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Veuillez entrer un email !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}

	theform.submit();
}	


function SubmitFormCategorie(theform) {
var reInteger = /^[0-9]+$/

		if (theform.libelle.value == '') {
			theform.libelle.focus();
			alert("Veuillez entrer un libellé !");
			return;
		}
		if ((theform.pos.value != '')&&(!reInteger.test(theform.pos.value))) {
			theform.pos.focus();
			alert("Veuillez entrer un entier !");
			return;
		}
		

	theform.submit();
}


function SubmitFormClient(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.identifiant.value == '') {
			theform.identifiant.focus();
			alert("Veuillez entrer un identifiant !");
			return;
		}
		if (theform.mot_de_passe.value == '') {
			theform.mot_de_passe.focus();
			alert("Veuillez entrer un mot de passe !");
			return;
		}

	theform.submit();
}	


function SubmitFormContact_fra(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Veuillez entrer votre nom !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Veuillez entrer un numéro de téléphone !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Veuillez entrer un email !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormContact_eng(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Please enter a name !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Please enter a phone number !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormContact_ger(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Das Feld Nachname es wurde nicht eingefügt !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Das Feld Telefon es wurde nicht eingefügt !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Das Feld E-Mail es wurde nicht eingefügt !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormContact_spa(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("El campo Nombre es requerido !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("El campo Teléfono es requerido !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("El campo E-mail es requerido !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("El campo E-mail no es válido !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormContact_ita(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Il campo Cognome non č stato inserito !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Il campo Telefono non č stato inserito !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Il campo E-mail non č stato inserito !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Indirizzo di posta elettronica non corretto !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormContact_pol(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Please enter a name !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Please enter a phone number !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormContact_cze(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Please enter a name !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Please enter a phone number !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormNewsletter_fra(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Vous devez cocher la case de demande d'abonnement  !");
			return;
		}
		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Veuillez entrer votre nom !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Veuillez entrer un numéro de téléphone !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Veuillez entrer un email !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormNewsletter_eng(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Would you like to receive information by email ?");
			return;
		}		
		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Please enter a name !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Please enter a phone number !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormNewsletter_ger(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Ohne Zustimmung können keine Dienstleistungen übermittelt werden.");
			return;
		}		
		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Das Feld Nachname es wurde nicht eingefügt !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Das Feld Telefon es wurde nicht eingefügt !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Das Feld E-Mail es wurde nicht eingefügt !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormNewsletter_spa(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Desea recibir la información vía e-mail ?");
			return;
		}
		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("El campo Nombre es requerido !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("El campo Teléfono es requerido !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("El campo E-mail es requerido !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("El campo E-mail no es válido !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormNewsletter_ita(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Desidera ricevere le informazioni via email? ");
			return;
		}
		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Il campo Cognome non č stato inserito !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Il campo Telefono non č stato inserito !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Il campo E-mail non č stato inserito !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Indirizzo di posta elettronica non corretto !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormNewsletter_pol(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Would you like to receive information by email ?");
			return;
		}		
		if (theform.nom.value == '') {
			theform.nom.focus();
			alert("Please enter a name !");
			return;
		}
		if (theform.tel.value == '') {
			theform.tel.focus();
			alert("Please enter a phone number !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}




function SubmitFormDocument(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.reference.value == '') {
			theform.reference.focus();
			alert("Veuillez entrer une référence !");
			return;
		}
		if (theform.titre.value == '') {
			theform.titre.focus();
			alert("Veuillez entrer un titre !");
			return;
		}
		if ((theform.version.value != '')&&(!reFloat.test(theform.version.value))) {
			theform.version.focus();
			alert("Veuillez entrer un nombre !");
			return;
		}
		
		

	theform.submit();
}




function SubmitFormChangeEmail(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		if (theform.new_email.value == '') {
			theform.new_email.focus();
			alert("Veuillez entrer un email !");
			return;
		}
		if ((theform.new_email.value != '')&&(!validemail.test(theform.new_email.value))) {
			theform.new_email.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}

	theform.submit();
}

function SubmitFormCatalogue_fra(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.reference.value == '') {
			theform.reference.focus();
			alert("Veuillez entrer une référence !");
			return;
		}
		if (theform.libelle_fra.value == '') {
			theform.libelle_fra.focus();
			alert("Veuillez entrer un libellé en français !");
			return;
		}
		if (theform.descriptif_fra.value == '') {
			theform.descriptif_fra.focus();
			alert("Veuillez entrer un descriptif en français !");
			return;
		}
		if ((theform.stock.value != '')&&(!reInteger.test(theform.stock.value))) {
			theform.stock.focus();
			alert("Veuillez entrer un entier !");
			return;
		}
		

	theform.submit();
}

/*
function SubmitFormCatalogue_fra(theform, lang) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

res = true;
for(i = 0; i < lang.length; i++) {
	if(theform.elements[lang[i]].value == '') {
		
		res = false;
	}
}
		if (theform.reference.value == '') {
			theform.reference.focus();
			alert("Veuillez entrer une référence !");
			return;
		}
		if ((theform.stock.value != '')&&(!reInteger.test(theform.stock.value))) {
			theform.stock.focus();
			alert("Veuillez entrer un entier !");
			return;
		}
		if (!res) {
			alert("Veuillez entrer le(s) libellé(s) !");
			return;
		}		

	theform.submit();
}
*/
/*
function SubmitFormRubrique_fra(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if ((theform.titre_fra.value == '')&&(theform.titre_eng.value == '')&&(theform.titre_ger.value == '')&&(theform.titre_spa.value == '')&&(theform.titre_ita.value == '')) {
			theform.titre_fra.focus();
			alert("Veuillez entrer au moins un titre !");
			return;
		}
		
		

	theform.submit();
}
*/
function SubmitFormRubrique_fra(theform, lang) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
res = true;
for(i = 0; i < lang.length; i++) {
	if(theform.elements[lang[i]].value == '') {
		res = false;
	}
}
		if (!res) {
			/*theform.lang.focus();*/
			alert("Veuillez entrer le titre manquant !");
			return;
		}
	theform.submit();
}



function SubmitFormEnvoiNewsletter(theform) {


	theform.todo.value = "envoyer";
	theform.submit();
}


function SubmitFormTestNewsletter(theform) {
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		theform.todo.value = "tester";
		
		if (theform.email_test.value == '') {
			theform.email_test.focus();
			alert("Veuillez entrer un email de test !");
			return;
		}
		if ((theform.email_test.value != '')&&(!validemail.test(theform.email_test.value))) {
			theform.email_test.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}
	theform.submit();
}

function SubmitFormNewsletterTexte(theform) {
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		
		if (theform.titre.value == '') {
			theform.titre.focus();
			alert("Veuillez entrer un titre !");
			return;
		}
		if (theform.from_email.value == '') {
			theform.from_email.focus();
			alert("Veuillez entrer un email !");
			return;
		}		
		if ((theform.from_email.value != '')&&(!validemail.test(theform.from_email.value))) {
			theform.from_email.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}
		
	theform.action="newsletter_texte.php";
	theform.target="_top";
	theform.submit();
}

function SubmitFormNewsletterTexteTest(theform) {
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;


		
		if (theform.html.value == '') {
			theform.html.focus();
			alert("Veuillez entrer du texte !");
			return;
		}
	theform.action="visualiser_html_sans_db.php";
	theform.target="_blank";
		
	theform.submit();
}

function SubmitFormDesabonner_fra(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Vous devez cocher la case de demande de désabonnement  !");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Veuillez entrer un email !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Veuillez entrer un email valide !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormDesabonner_eng(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Would you like to unsubscribe from the newsletter ?");
			return;
		}		
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormDesabonner_ger(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Newsletter abbestellen.");
			return;
		}		
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Das Feld E-Mail es wurde nicht eingefügt !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormDesabonner_spa(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("No desea recibir la información vía e-mail más ?");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("El campo E-mail es requerido !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("El campo E-mail no es válido !");
			return;
		}
		
		

	theform.submit();
}


function SubmitFormDesabonner_ita(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Desidera disdire l'abbonamento alle newsletter? ");
			return;
		}
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Il campo E-mail non č stato inserito !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Indirizzo di posta elettronica non corretto !");
			return;
		}
		
		

	theform.submit();
}

function SubmitFormDesabonner_pol(theform) {

var reInteger = /^[0-9]+$/
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
var reFloatb = /^((\d+(\,\d*)?)|((\d*\,)?\d+))$/
var validemail=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

		if (theform.is_abonne.checked == false) {
			alert("Would you like to unsubscribe from the newsletter ?");
			return;
		}		
		if (theform.email.value == '') {
			theform.email.focus();
			alert("Please enter an email address !");
			return;
		}
		if ((theform.email.value != '')&&(!validemail.test(theform.email.value))) {
			theform.email.focus();
			alert("Please enter a valid email address !");
			return;
		}
		
		

	theform.submit();
}
