maxKeys = 1000;
var IE = (document.all) ? 1 : 0;
var DOM = 0;
if (parseInt(navigator.appVersion) >=5) {DOM=1};

function txtshow( txt2show ) 
{
	// Detect Browser
	if (DOM) 
	{
		var viewer = document.getElementById("txtmsg");
	    viewer.innerHTML=txt2show;
	}
	else if(IE) 
	{
	    document.all["txtmsg"].innerHTML=txt2show;
	}
}

function keyup(what)
{
  var str = new String(what.value);
  var len = str.length;
  var showstr = len + " caractères utilisés";
  txtshow( showstr );
}


function TextAreaEstRempli(moncontroletexte, nbcar)
{
  if (moncontroletexte.value.length > nbcar)
      moncontroletexte.value = moncontroletexte.value.substr(0, nbcar);
}

function favoris(nom, url) 
{
	if ( navigator.appName != 'Microsoft Internet Explorer' )
	{
		window.sidebar.addPanel(nom, url, "");
	}
	else
	{
		window.external.AddFavorite(url, nom);
	} 
}

function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
