function popupWindow(url) {window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=800,screenX=50,screenY=50,top=50,left=50')}


// JavaScript verify Form newsletter
function verify(form) {
var passed = false;
var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;
	if (form.Email){
			   intAtSign=form.Email.value.indexOf("@");
			    intDot=form.Email.value.indexOf(".",intAtSign);
			    intComma=form.Email.value.indexOf(",");
			    intSpace=form.Email.value.indexOf(" ");
			    intLastDot=form.Email.value.lastIndexOf(".");
			    intDomain=intDot-intAtSign;
			    intStrLen=form.Email.value.length;
		 /*** CHECK FOR BLANK EMAIL VALUE*/
		    if (form.Email.value == "" )
		    {
		 alert('Vous n\'avez pas entré d\'adresse mail.');
		 form.Email.focus();
		 passed = false;
		 }
		 /**** CHECK FOR THE  @ SIGN?*/
		 else if (intAtSign == -1)
		 {
		 alert('Votre adresse mail ne contient pas @');
			    form.Email.focus();
		 passed = false;
		 }
		 /**** Check for commas ****/
		 else if (intComma != -1)
		 {
		 alert('Votre adresse email ne contient pas de "."');
		 form.Email.focus();
		 passed = false;
		 }
		 /**** Check for a space ****/
		 else if (intSpace != -1)
		 {
		 alert('Une adresse email ne doit pas contenir d\'espace.');
		 form.Email.focus();
		 passed = false;
		 }
		 /* **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot *****/
		 else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2))
		 {
		 alert('Merci de rentrer une adresse email valide.');
		form.Email.focus();
		 passed = false;
		 }
		 else {
			    passed = true;
		 }
	} else {
		 passed = true;
	}
return passed;
}

function majQuantity(qty, field) {
   quantity = document.getElementById(field).value;
   quantity = parseInt(quantity) + parseInt(qty)
   if (quantity < 1) {
      quantity = 1;
   }
   document.getElementById(field).value = quantity;
}

function charlimit(champ) {
   var caractere = champ.value.substr(champ.value.length - 1, 1);
   var autorises = '0123456789';

   if(autorises.indexOf(caractere) == -1) {
      champ.value = champ.value.substr(0, champ.value.length - 1);
   }
}