// JavaScript Document
function meme_adresse()
{
	document.forms[0].adresse_livr.value=document.forms[0].adresse.value;
	document.forms[0].cp_livr.value=document.forms[0].cp.value;
	document.forms[0].ville_livr.value=document.forms[0].ville.value;
	document.forms[0].pays_livr.value=document.forms[0].pays.value;
}

function change_picto(REF )
{
	document.getElementById("picto").src="upload/pictos/" + REF + ".gif";
}

function change_couleur_boitier(REF )
{
	document.getElementById("boitier").src="images/boitiers/vignettes/" + REF + ".jpg";
}


//fonction pr evaluer la puissance du Password
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("weak").className = "nrm";
		document.getElementById("medium").className = "nrm";
		document.getElementById("strong").className = "nrm";
	}
	else if (cmpx == 1)
	{
		document.getElementById("weak").className = "red";
		document.getElementById("medium").className = "nrm";
		document.getElementById("strong").className = "nrm";
	}
	else if (cmpx == 2)
	{
		document.getElementById("weak").className = "yellow";
		document.getElementById("medium").className = "yellow";
		document.getElementById("strong").className = "nrm";
	}
	else
	{
		document.getElementById("weak").className = "green";
		document.getElementById("medium").className = "green";
		document.getElementById("strong").className = "green";
	}
}

function GetId(id)
{
	return document.getElementById(id);
}

var i=false; // La variable i nous dit si la bulle est visible ou non



function move(e) 
{
  if(i) 
  {  

    if (navigator.appName!="Microsoft Internet Explorer") 
	{ 
	    GetId("details").style.left=e.pageX - 250 +"px";
	    GetId("details").style.top=e.pageY + 10+"px";
    }
    else 
	{
	    GetId("details").style.left=window.event.x + 35 +"px";
	    GetId("details").style.top=window.event.y + 10 + document.body.scrollTop+"px"; 
    }

  }
}

function affiche_details(fiche) 
{
  if(i==false) 
  {
	  GetId("details").style.display="block";
	  var text = '<h4>Fiche Descriptive</h4>'
	  var text = text+fiche

	  GetId("details").innerHTML = text;
	  i=true;
  }
}

function cache_details() 
{
	if(i==true) 
	{
		GetId("details").style.display="none"; 
		i=false;
	}
}

document.onmousemove=move;

if ( document.all )
	{
		function blink_show()
		{
			blink_tags  = document.all.tags('blink');
			blink_count = blink_tags.length;
			for ( i = 0; i < blink_count; i++ )
			{	blink_tags[i].style.visibility = 'visible';	}
			window.setTimeout( 'blink_hide()', 700 );
		}
		
		function blink_hide()
		{
			blink_tags  = document.all.tags('blink');
			blink_count = blink_tags.length;
			for ( i = 0; i < blink_count; i++ )
			{	blink_tags[i].style.visibility = 'hidden';	}
			window.setTimeout( 'blink_show()', 250 );
		}
		
		window.onload = blink_show;
	}