function evalPwd(s) {
	var cmpx = 0;
	if (s.length >= 6) {
		cmpx++;
	if (s.search("[A-Z]") != -1) {
		cmpx++;
		}
	if (s.search("[0-9]") != -1) {
		cmpx++;
		}
		if (s.length >= 8 || s.search("[\x20-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]") != -1) {
		cmpx++;
		}
	}
	if (cmpx == 0) {
		document.getElementById("faible").className = "nrm";
		document.getElementById("moyen").className = "nrm";
		document.getElementById("fort").className = "nrm";
	}
	else if (cmpx == 1) {
		document.getElementById("faible").className = "red";
		document.getElementById("moyen").className = "nrm";
		document.getElementById("fort").className = "nrm";
	}
	else if (cmpx == 2) {
		document.getElementById("faible").className = "yellow";
		document.getElementById("moyen").className = "yellow";
		document.getElementById("fort").className = "nrm";
	} else {
		document.getElementById("faible").className = "green";
		document.getElementById("moyen").className = "green";
		document.getElementById("fort").className = "green";
	}
}


function Popup(h, l, uneUrl, fenetre)
	{
		// var h = 500; // hauteur de la popup
		// var l = 600; // largeur de la popup
		if (h==0) h=screen.availWidth;
		if (l==0) l=screen.availHeight;
		var PosX = ( screen.availWidth - h ) / 2; 
		var PosY = ( screen.availHeight - l ) / 2; 
		var option = "resizable=yes,toolbar=no,scrollbars=yes,menubar=yes,top="+PosY+",left="+PosX+",width="+h+",height="+l; 
		window.open(uneUrl,fenetre,option); 
	}


function confirmation() {
	var answer = confirm("Attention le contenu de votre panier sera totalement efface apres deconnection.")
	if (answer){
		alert("Votre panier EST vide!")
		window.location = "out.php";
	}
}

function afficheMenu(obj){
	
	var idMenu     = obj.id;
	var idSousMenu = 'sous' + idMenu;
	var sousMenu   = document.getElementById(idSousMenu);
	
	/*****************************************************/
	/**	on cache tous les sous-menus pour n'afficher    **/
	/** que celui dont le menu correspondant est cliqué **/
	/** où 4 correspond au nombre de sous-menus         **/
	/*****************************************************/
	for(var i = 1; i <= 7; i++){
		if(document.getElementById('sousmenu' + i) && document.getElementById('sousmenu' + i) != sousMenu){
			document.getElementById('sousmenu' + i).style.display = "none";
		}
	}
	
	if(sousMenu){
		//alert(sousMenu.style.display);
		if(sousMenu.style.display == "block"){
			sousMenu.style.display = "none";
		}
		else{
			sousMenu.style.display = "block";
		}
	}
	
}

function afficher_cacher(id)
{
        if(document.getElementById(id).style.visibility=="hidden")
        {
                document.getElementById(id).style.visibility="visible";
                document.getElementById('bouton_'+id).innerHTML='Cacher le texte';
        }
        else
        {
                document.getElementById(id).style.visibility="hidden";
                document.getElementById('bouton_'+id).innerHTML='Afficher le texte';
        }
        return true;
}

         
var cmpt = 0;
         function add(){
            inp = document.createElement("input");
            inp.type = "file";
            inp.name = "userfile[]";
            lediv = document.createElement("div");
            lediv.id = "fichier"+cmpt;
            check = document.createElement("input");
            check.type = "checkbox";
            check.name = cmpt;
            check.onclick = function(){
               elt = document.getElementById("fichier"+this.name);
               elt.parentNode.removeChild(elt);
            }
            lab = document.createElement("label");
            lab.appendChild(document.createTextNode("Supprimer"));
            lediv.appendChild(inp);
            lediv.appendChild(check);
            lediv.appendChild(lab);
            document.getElementById("fichiers").appendChild(lediv);
            cmpt++;
         }

var oZoom = new Zoom();
	function Zoom(){
	this.id = null;
	this.oTimer = 0;
	this.stop = function(){window.clearInterval(oZoom.oTimer);}
	this.zoomer = function(wAdd, wId){
	if (wId != null){oZoom.id = wId;}
	if (oZoom.id != null){
	if(document.getElementById(oZoom.id)){
	var oEl = document.getElementById(oZoom.id);
		oEl.style.width=(parseFloat(oEl.style.width)+wAdd).toString()+"px";
		oEl.style.height=(parseFloat(oEl.style.height)+wAdd).toString()+"px";
	if(parseFloat(oEl.style.width) >= 600){oZoom.stop();}
	if(parseFloat(oEl.style.width) <= 200){oZoom.stop();}
	}
    }
}
	this.plus = function(wId){
	if(document.getElementById(wId)){
	if(parseFloat(document.getElementById(wId).style.width) >= 600){return false;}
	oZoom.id = wId;
	oZoom.oTimer = window.setInterval("oZoom.zoomer(5)", 10);
	}
}
	this.moins = function(wId){
	if(document.getElementById(wId)){
	if(parseFloat(document.getElementById(wId).style.width) <= 200){return false;}
	oZoom.id = wId;
	oZoom.oTimer = window.setInterval("oZoom.zoomer(-5)", 10);
	}
}
}


	var currentScroller;

	function myScroll2(content, value) {
		document.getElementById(content).scrollLeft += value;
		}


