var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}

function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}


//fonctions 1euro.com
function demarche(page) {
		window.open(page,'demarche','width=400,height=400,toolbar=false,scrollbars=false');	
}

function calculette(page) {
		window.open(page,'calculette','width=600,height=495,toolbar=false,scrollbars=false');	
}


function setCharCounter (a, b, n) 
{
	var o = document.getElementById(a);
	o.charCounterMax= n;
	o.charCounterDisplay = b;
	o.onkeyup = charCounterUpdate;
}
function charCounterUpdate () 
{
	var n = this.value.length;
	if (n > this.charCounterMax)
	{ 
		alert("Vous ne pouvez pas dépasser " + this.charCounterMax + " caractères pour cette zone.");
		return false;
	}
	if (this.charCounterDisplay)
	{
		var o = document.getElementById(this.charCounterDisplay);
		if (o.tagName.toLowerCase()=="input") o.value = n;
		else o.innerHTML = n;
	}

}

function validerpanier(){
	
	form_err=" ";
	
		
	if ( document.formpanier.form_taille.value=="Choix" ) 
	{
		alert('Vous devez choisir une taille ou couleur');
		return false;
	}
	return true;
	
	
}
	