var win=null;
function openfenetre(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}

function AfficheHomePage2()
	{
	if (document.all && document.getElementById)
		{
		document.write('<table cellpadding=0 cellspacing=0><tr><td><img src="images/home.gif" border=0></td><td> <A HREF="#" onClick="HomePage(this);return(false);" class="lientitre2">Page de démarrage</A></td></tr></table>');
		}
	}
function AfficheHomePage()
	{
	if (document.all && document.getElementById)
		{
		document.write('<A HREF="#" onClick="HomePage(this);return(false);">Mettre <?= $boutique;?> en page de démarrage</A>');
		}
	}
function HomePage(obj)
	{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage('http://www.<?= $boutique; ?>');
	}
function ValidaFORM(theForm)
	{
	if (theForm.email.value == "")
		{
		alert("Vous avez oublié de saisir votre adresse email !");
		theForm.email.focus();
		return (false);
		}


	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(theForm.email.value)))
		{
		alert("Adresse E-mail invalide ! Réessayez.")
		theForm.email.focus();
		return (false)
		}

	return (true);
	}
	
function qplus(compose, cas, theForm, limite)	{
	if(theForm.quantite.value<limite)	{
		theForm.quantite.value++;
	
			
			
			if(cas=="1")	{
				document.frmValidation.quant.setAttribute("value", theForm.quantite.value);
			}
			
			if(cas=="2")	{
					document.frmValidation.quant2.setAttribute("value", theForm.quantite.value);
			}		
	}
	return (true);
}

function qmoins(compose, cas, theForm)	{
	
	if(compose)	{
		if(theForm.quantite.value>0)	{
			theForm.quantite.value--;
			
			if(cas==1)	{
				document.frmValidation.quant.setAttribute("value", theForm.quantite.value);
			}
			
			if(cas==2)	{
				document.frmValidation.quant2.setAttribute("value", theForm.quantite.value);
			}	
		}
	}
	else	{
		if(theForm.quantite.value>1)	{
			theForm.quantite.value--;
			if(cas==1)	{
				document.frmValidation.quant.setAttribute("value", theForm.quantite.value);
			}
			
			if(cas==2)	{
				document.frmValidation.quant2.setAttribute("value", theForm.quantite.value);
			}	
			
		}
	}
	
	return (true);
}