function popupcentree(page,largeur,hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function VerifNum(elmt, msg)
{
	if (isNaN(elmt.value) == true){ 
		alert(msg);
		elmt.focus();
		elmt.style.color = "black";
		elmt.style.backgroundColor = "#CCCCCC";}
	if (isNaN(elmt.value) == false){ 
		elmt.style.color = "black";
		elmt.style.backgroundColor = "";}
	if (elmt.value == ""){
		elmt.style.color = "black";
		elmt.style.backgroundColor = "#CCCCCC";}
}
/*
function verifMail()
{
	var email   = document.contact.eMail.value;
	var verif   = /^[a-zA-Z0-9._.-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
	if (verif.exec(email) == null)
		{
		afficheId('eMailInv');
		document.contact.eMail.focus();
		return false;
		}
}
*/
function Correction(elt)
{
	if (elt.value == "")
		{ 
		elt.style.color = "red";
		elt.style.backgroundColor = "";
		}
	if (elt.value !== "")
		{ 
		elt.style.color = "black";
		elt.style.backgroundColor = "";
		}
}

function afficheId(baliseId)
{
	if (document.getElementById && document.getElementById(baliseId) != null)
		{
		document.getElementById(baliseId).style.visibility='visible';
		}
}

function cacheId(baliseId)
{
	if (document.getElementById && document.getElementById(baliseId) != null)
		{
		document.getElementById(baliseId).style.visibility='hidden';
		}
}

function limitetexte(textarea, max, spanDesc)
{
    if(textarea.value.length >= max)
    {
        textarea.value = textarea.value.substring(0,max);
    }
    var reste = max - textarea.value.length;
    var affichage_reste =  '> '+reste +' caract&egrave;res restants';
    document.getElementById(spanDesc).innerHTML = affichage_reste;
}
