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);
}
/*cacher/afficher une div*/
function switchMenu(obj)
{
var voir = document.getElementById(obj);
	if(voir.style.display != "block")
	{
	voir.style.display = "block";
	}
	else
	{
	voir.style.display = "none";
	}
}
//div toujours visible suivant choix
function switchMenuVisible(obj)
{
var voir = document.getElementById(obj);
	if(voir.style.display != "block")
	{
	voir.style.display = "block";
	}
	else
	{
	voir.style.display = "block";
	}
}
//div toujours caché suivant choix
function switchMenuHidden(obj)
{
var voir = document.getElementById(obj);
	if(voir.style.display != "block")
	{
	voir.style.display = "none";
	}
	else
	{
	voir.style.display = "none";
	}
}
function makevisible(cur,which)
{

//style="filter:alpha(opacity=40); -moz-opacity: .4;" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)"
	if(document.getElementById)
		{
		if (which==1)
			{
			if(document.all)
				cur.filters.alpha.opacity=100
			else
				cur.style.setProperty("-moz-opacity", 1, "");
			}
		else
			{
			if(document.all)
				cur.filters.alpha.opacity=40
			else
				cur.style.setProperty("-moz-opacity", .4, "");
			}
		}
}
/*BB CODE*/
function formatage(debut,fin,formulaire,champs){
	//var input = document.forms['formulaire'].elements['texte'];//! nom formulaire + nom champs a renseigner pour FIREFOX!!!!!
  	var input = document.forms[formulaire].elements[champs];
  	input.focus();
	/* INTERNET EXPLORER */
	if(typeof document.selection != 'undefined') {
    	/* Insertion du code de formatage */
    	var range = document.selection.createRange();
    	var insText = range.text;
    	range.text = debut + insText + fin;
    	/* Ajustement de la position du curseur  */
    	range = document.selection.createRange();
    	if (insText.length == 0) {
      		range.move('character', -fin.length);
    	} 
    	else {
      		range.moveStart('character', debut.length + insText.length + fin.length);
    	}
    	range.select();
  	}
  	/* FIREFOX */
  	else if(typeof input.selectionStart != 'undefined'){
   		/* Insertion du code de formatage  */
    	var start = input.selectionStart;
    	var end = input.selectionEnd;
    	var insText = input.value.substring(start, end);
    	input.value = input.value.substr(0, start) + debut + insText + fin + input.value.substr(end);
    	/* Ajustement de la position du curseur  */
    	var pos;
    	if (insText.length == 0) {
      		pos = start + debut.length;
    	} 
    	else {
      		pos = start + debut.length + insText.length + fin.length;
    	}
    	input.selectionStart = pos;
    	input.selectionEnd = pos;
  	}
}
