function maj_qte(nform, id, valeur) 
{
 artqte = document.forms[nform][id].value;
 artqte = parseInt(artqte) + parseInt(valeur);
 if (artqte < 1) { artqte = 1; }
 if (artqte > 9999) { artqte = 9999; }
 document.forms[nform][id].value = artqte;
}

function emailvalide(field)
{
  bonEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
 if (bonEmail){
   good = true
} else {
   alerte="Please enter a valid e-mail address.\n\n";
   alerte = alerte+"Check that you did not insert spaces\n";
   alerte = alerte+"in or after your e-mail."; 
   alert(alerte); 
   field.focus()
   field.select()
   good = false
   }
}

function verifcoordtot()
{
 nom = document.formcoord.nom.value; 
 prenom = document.formcoord.prenom.value; 
 tel = document.formcoord.tel.value;
 adresse = document.formcoord.adresse.value; 
 codepostal = document.formcoord.codepostal.value;
 ville = document.formcoord.ville.value;
 pays = document.formcoord.pays.value;
 email = document.formcoord.email.value; 
 motpasse = document.formcoord.motpasse.value;
 motpasseconfirm = document.formcoord.motpasseconfirm.value;
 liv_nom = document.formcoord.liv_nom.value; 
 liv_prenom = document.formcoord.liv_prenom.value; 
 liv_tel = document.formcoord.liv_tel.value;
 liv_adresse = document.formcoord.liv_adresse.value; 
 liv_codepostal = document.formcoord.liv_codepostal.value;
 liv_ville = document.formcoord.liv_ville.value;
 liv_pays = document.formcoord.liv_pays.value;
if((!nom) || (!prenom) || (!tel) || (!adresse) || (!codepostal) || (!ville) || (!pays) || (!email) || (!motpasse) || (!motpasseconfirm) || (!liv_nom) || (!liv_prenom) || (!liv_tel) || (!liv_adresse) || (!liv_codepostal) || (!liv_ville) || (!liv_pays))
{ 
  alerte="You have not entered:\n\n"; 
  if(!prenom){ 
  alerte = alerte+"- Your First Name of the billing form\n";}
  if(!nom){ 
  alerte = alerte+"- Your Name of the billing form\n";} 
  if(!tel){ 
  alerte = alerte+"- Your Phone of the billing form\n";}
  if(!adresse){ 
  alerte = alerte+"- Your Address of the billing form\n";}
  if(!codepostal){ 
  alerte = alerte+"- Your Postal Code of the billing form\n";}
  if(!ville){ 
  alerte = alerte+"- Your City of the billing form\n";}
  if(!pays){ 
  alerte = alerte+"- Your Country of the billing form\n";}
  if(!email){ 
  alerte = alerte+"- Your E-mail of the billing form\n";}
  if(!motpasse){ 
  alerte = alerte+"- Your Password of the billing form\n";}
  if(!motpasseconfirm){ 
  alerte = alerte+"- Your Password confirmation of the billing form\n";}
  if(!liv_prenom){ 
  alerte = alerte+"- Your First Name of the delivery form\n";}
  if(!liv_nom){ 
  alerte = alerte+"- Your Name of the delivery form\n";} 
  if(!liv_tel){ 
  alerte = alerte+"- Your Phone of the delivery form\n";}
  if(!liv_adresse){ 
  alerte = alerte+"- Your Address of the delivery form\n";}
  if(!liv_codepostal){ 
  alerte = alerte+"- Your Postal Code of the delivery form\n";}
  if(!liv_ville){ 
  alerte = alerte+"- Your City of the delivery form\n";}
  if(!liv_pays){ 
  alerte = alerte+"- Your Country of the delivery form\n";}
alert(alerte); 
return false; 
}//fin premier if 
if(email)
 { 
   emailvalide(document.formcoord.email) 
   if((motpasse) || (motpasseconfirm)){
   verifnbcaracteres = document.formcoord.motpasse.value
   if(verifnbcaracteres.length>0 && verifnbcaracteres.length<6){
   alerte="Choose a password containing\n";
   alerte = alerte+"between 6 and 16 characters.";
   alert(alerte);
   return false;}	
   if(document.formcoord.motpasse.value != document.formcoord.motpasseconfirm.value){
   alert('The passwords do not correspond, please retry.');
   return false;}}
   return good }
}

function verifcoordfac()
{
 nom = document.formcoord.nom.value; 
 prenom = document.formcoord.prenom.value; 
 tel = document.formcoord.tel.value;
 adresse = document.formcoord.adresse.value; 
 codepostal = document.formcoord.codepostal.value;
 ville = document.formcoord.ville.value;
 pays = document.formcoord.pays.value;
 email = document.formcoord.email.value; 
 motpasse = document.formcoord.motpasse.value;
 motpasseconfirm = document.formcoord.motpasseconfirm.value;
if((!nom) || (!prenom) || (!tel) || (!adresse) || (!codepostal) || (!ville) || (!pays) || (!email) || (!motpasse) || (!motpasseconfirm))
{ 
  alerte="You have not entered:\n\n"; 
  if(!prenom){ 
  alerte = alerte+"- Your First Name\n";}
  if(!nom){ 
  alerte = alerte+"- Your Name\n";} 
  if(!tel){ 
  alerte = alerte+"- Your Phone\n";}
  if(!adresse){ 
  alerte = alerte+"- Your Address\n";}
  if(!codepostal){ 
  alerte = alerte+"- Your Postal Code\n";}
  if(!ville){ 
  alerte = alerte+"- Your City\n";}
  if(!pays){ 
  alerte = alerte+"- Your Country\n";}
  if(!email){ 
  alerte = alerte+"- Your E-mail\n";}
  if(!motpasse){ 
  alerte = alerte+"- Your Password\n";}
  if(!motpasseconfirm){ 
  alerte = alerte+"- Your Password confirmation\n";}
alert(alerte); 
return false; 
}//fin premier if 
if(email)
 { 
   emailvalide(document.formcoord.email) 
   if((motpasse) || (motpasseconfirm)){
   verifnbcaracteres = document.formcoord.motpasse.value
   if(verifnbcaracteres.length>0 && verifnbcaracteres.length<6){
   alerte="Choose a password containing\n";
   alerte = alerte+"between 6 and 16 characters.";
   alert(alerte);
   return false;}	
   if(document.formcoord.motpasse.value != document.formcoord.motpasseconfirm.value){
   alert('The passwords do not correspond, please retry.');
   return false;}}
   return good }
}

function verifcoordliv()
{
 liv_nom = document.formcoord.liv_nom.value; 
 liv_prenom = document.formcoord.liv_prenom.value; 
 liv_tel = document.formcoord.liv_tel.value;
 liv_adresse = document.formcoord.liv_adresse.value; 
 liv_codepostal = document.formcoord.liv_codepostal.value;
 liv_ville = document.formcoord.liv_ville.value;
 liv_pays = document.formcoord.liv_pays.value;
if((!liv_nom) || (!liv_prenom) || (!liv_tel) || (!liv_adresse) || (!liv_codepostal) || (!liv_ville) || (!liv_pays))
{ 
  alerte="You have not entered:\n\n";
  if(!liv_prenom){ 
  alerte = alerte+"- Your First Name of the delivery form\n";}
  if(!liv_nom){ 
  alerte = alerte+"- Your Name of the delivery form\n";} 
  if(!liv_tel){ 
  alerte = alerte+"- Your Phone of the delivery form\n";}
  if(!liv_adresse){ 
  alerte = alerte+"- Your Address of the delivery form\n";}
  if(!liv_codepostal){ 
  alerte = alerte+"- Your Postal Code of the delivery form\n";}
  if(!liv_ville){ 
  alerte = alerte+"- Your City of the delivery form\n";}
  if(!liv_pays){ 
  alerte = alerte+"- Your Country of the delivery form\n";}
alert(alerte); 
return false; 
}//fin premier if 
}

function verifidentifiants()
{
 email = document.formident.email.value;	
 motpasse = document.formident.motpasse.value;
 nouvmotpasse = document.formident.nouvmotpasse.value;
 nouvmotpasseconfirm = document.formident.nouvmotpasseconfirm.value;
if((!email) || (!motpasse))
{
 alerte="You have not entered:\n\n";
 if(!email){ 
 alerte = alerte+"- Your E-mail\n";}
 if(!motpasse){ 
 alerte = alerte+"- Your old password\n";}
 alert(alerte); 
return false; 
}//fin premier if 
if(email)
 { 
   emailvalide(document.formident.email)
   if((motpasse) || (nouvmotpasse) || (nouvmotpasseconfirm)){
   verifnbcaracteres = document.formident.nouvmotpasse.value
   if(verifnbcaracteres.length>0 && verifnbcaracteres.length<6){
   alerte="Choose a password containing\n";
   alerte = alerte+"between 6 and 16 characters.";
   alert(alerte);
   return false;}	
   if(document.formident.nouvmotpasse.value != document.formident.nouvmotpasseconfirm.value){
   alert('The passwords do not correspond, please retry.');
   return false;}}
   return good }
}	
	
function verifinfos()
{
 nom = document.forminfos.nom.value; 
 prenom = document.forminfos.prenom.value; 
 tel = document.forminfos.tel.value;
 adresse = document.forminfos.adresse.value; 
 codepostal = document.forminfos.codepostal.value; 
 ville = document.forminfos.ville.value;
 pays = document.forminfos.pays.value;
if((!nom) || (!prenom) || (!tel) || (!adresse) || (!codepostal) || (!ville) || (!pays))
{ 
  alerte="You have not entered:\n\n"; 
  if(!prenom){ 
  alerte = alerte+"- Your First Name\n";}
  if(!nom){ 
  alerte = alerte+"- Your Name\n";} 
  if(!tel){ 
  alerte = alerte+"- Your Phone\n";}
  if(!adresse){ 
  alerte = alerte+"- Your Address\n";}
  if(!codepostal){ 
  alerte = alerte+"- Your Postal Code\n";}
  if(!ville){ 
  alerte = alerte+"- Your City\n";}
  if(!pays){ 
  alerte = alerte+"- Your Country\n";}
alert(alerte); 
return false; 
}//fin du if
} 
 
function verifsaisieauto()
{
 emailsaisi = document.saisieauto.emailsaisi.value;
 motpassesaisi = document.saisieauto.motpassesaisi.value;
 if((!emailsaisi) || (!motpassesaisi))
 {
  alerte="You have not entered:\n\n";
  if(!emailsaisi){ 
  alerte = alerte+"- Your E-mail\n";}
  if(!motpassesaisi){ 
  alerte = alerte+"- Your Password\n";}
  alert(alerte); 
  return false;
 }//fin premier if 
if(emailsaisi)
 { 
  emailvalide(document.saisieauto.emailsaisi)
  if(motpassesaisi){
  verifnbcaracteres = document.saisieauto.motpassesaisi.value
  if(verifnbcaracteres.length<6){
  alerte="Attention, do not forget that your password\n";
  alerte = alerte+"cannot contain less than 6 characters.";
  alert(alerte);
  return false;}}
  return good }
}

function verifemail()
{
 emailclient = document.mpoublie.emailclient.value;
 if(!emailclient){
  alerte="You have not entered your E-mail";
  alert(alerte); 
  return false;}
 else
 {
  emailvalide(document.mpoublie.emailclient);
  return good; }
}
 
function verifrec()
{
 rec = document.recherche.rec.value;
 if(!rec){
  alerte="You have nothing typed !";
  alert(alerte); 
  return false;}
}

function imprimeFenetre()
{
   VN = parseInt(navigator.appVersion)
   if (VN >= 4) window.print()
}

function PopupCentre(page,nom,largeur,hauteur,option)
{
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  var fenetre=window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+option);
  fenetre.document.close();
  fenetre.focus();
}

function verifqte(page,nom,largeur,hauteur,option)
{
 var q = document.newart.elements.length;
 var qte = 0;
 for (i=0; i<q; i++)
 {
  if ((document.newart.elements[i].type=="text") && (document.newart.elements[i].value > 0))
   {qte = 1;}
  }
  if (qte == 0)
 {alert("Please type at least one quantity");}
 else
  {
   document.cookie = 'scscook';
 if (!document.cookie) 
  {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  var fenetre=window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+option);
  fenetre.document.close();
  fenetre.focus();}
  else
  document.newart.submit();}
}