function AffDeaff(nom, bouton){ 

		if (document.getElementById(nom).style.display=='none')	
        { 
           document.getElementById(nom).style.display='inline'; 
           if (bouton != '')
                {
                    if (bouton != 'nobutton')
                    {
                        document.getElementById(bouton).value = '-';	
                    }
                }
                else if (nom == 'login')
                {
                    document.getElementById('imgLogin').src='/images/CloseLogin.png';
                }
                if (nom == 'divImport')
                {
                    document.getElementById('divImport2').style.display='none';
                    document.getElementById('ddlSession').src='/images/ddlUpLong.png';
                    document.getElementById('ddlParcours').src='/images/ddlDown.png';                    
                }
                if (nom == 'divImport2')
                {
                    document.getElementById('divImport').style.display='none';
                    document.getElementById('ddlParcours').src='/images/ddlUpLong.png';
                    document.getElementById('ddlSession').src='/images/ddlDown.png';
                }
            } 
            else 
            { 
                document.getElementById(nom).style.display='none'; 
                if (bouton != '')
                {
                    if (bouton != 'nobutton')
                    {
                        document.getElementById(bouton).value = '+'; 
                    }
                }
                else if (nom == 'login')
                {
                    document.getElementById('imgLogin').src='/images/Login.png';
                }
                if (nom == 'divImport')
                {
                    document.getElementById('ddlSession').src='/images/ddlDown.png';
                }
                if (nom == 'divImport2')
                {
                    document.getElementById('ddlParcours').src='/images/ddlDown.png';
                }
            }}

function obtenirParametre(szName, theDoc) {
	var retValue = ""; 
	var n2 = theDoc.indexOf(szName) + szName.length; 
	n2 = theDoc.indexOf("=", n2) + 1;
	var n3 = theDoc.indexOf(",", n2+1); 
	if (n3 > n2) {
		retValue = theDoc.substring(n2, n3); 
	} else {
		retValue = theDoc.substring(n2); 
	}
	return retValue.replace(/^\s+|\s+$/g,"");
}
		
function ouvrirPopup(url2, nom, attributs){
    var pop = window.open(url2, nom.replace('.', 'P'), attributs); 
    var width = parseInt(obtenirParametre('width', attributs).replace('px', ''));
    var height = parseInt(obtenirParametre('height', attributs).replace('px', ''));
    var ww = screen.width;
    var wh = screen.height;
    pop.moveTo((ww / 2) - (width / 2), (wh / 2) - (height / 2)); 
    pop.window.focus();
}		

var __tooltip = false;
var __tooltipShadow = false;
var __shadowSize = 2;
var __tooltipMaxWidth = 600;
var __tooltipMinWidth = 100;
var __tooltipMaxHeight = 300;
var __iframe = false;
var tooltip_is_msie = (navigator.userAgent.indexOf('MSIE')>=0 
                        && navigator.userAgent.toLowerCase().indexOf('safari')==-1 
                        && navigator.userAgent.toLowerCase().indexOf('chrome')==-1 
                        && navigator.userAgent.toLowerCase().indexOf('opera')==-1 
                        && navigator.userAgent.toLowerCase().indexOf('firefox')==-1 
                        && document.all) ? true:false;
function showTooltip(e,tooltipTxt)
{
	var bodyWidth = Math.max(document.body.clientWidth,document.documentElement.clientWidth) - 20;
	var bodyHeight = Math.max(document.body.clientHeight,document.documentElement.clientHeight) - 20;
	
	if(!__tooltip){
		__tooltip = document.createElement('DIV');
		__tooltip.id = 'tooltipBox';
		__tooltipShadow = document.createElement('DIV');
		__tooltipShadow.id = 'tooltipShadowBox';
		
		document.body.appendChild(__tooltip);
		document.body.appendChild(__tooltipShadow);	
		
		if(tooltip_is_msie){
			__iframe = document.createElement('IFRAME');
			__iframe.frameborder='5';
			__iframe.style.backgroundColor='#FFFFFF';
			__iframe.src = '#'; 	
			__iframe.style.zIndex = 100;
			__iframe.style.position = 'absolute';
			document.body.appendChild(__iframe);
		}		
	}

	__tooltip.style.display='block';
	__tooltipShadow.style.display='block';
	if(tooltip_is_msie)__iframe.style.display='block';

	var st = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
	
//	if  ((navigator.userAgent.toLowerCase().indexOf('safari')>=0) ||
//	    (navigator.userAgent.toLowerCase().indexOf('chrome')>=0) ||
//	    (navigator.userAgent.toLowerCase().indexOf('opera')>=0) ||
//	    (navigator.userAgent.toLowerCase().indexOf('firefox')>=0))
//	{
//	    st=0; 
//	}
	var leftPos = e.clientX + 10;

	__tooltip.style.width = null;
	__tooltip.innerHTML = tooltipTxt;
	__tooltip.style.left = leftPos + 'px';
	__tooltip.style.top = e.clientY + 10 + st + 'px';


	__tooltipShadow.style.left =  leftPos + __shadowSize + 'px';
	__tooltipShadow.style.top = e.clientY + 10 + st + __shadowSize + 'px';

	if(__tooltip.offsetWidth>__tooltipMaxWidth){
		__tooltip.style.width = __tooltipMaxWidth + 'px';
	}

	var tooltipWidth = __tooltip.offsetWidth;		
	if(tooltipWidth<__tooltipMinWidth)tooltipWidth = __tooltipMinWidth;


	__tooltip.style.width = tooltipWidth + 'px';
	__tooltipShadow.style.width = __tooltip.offsetWidth + 'px';
	__tooltipShadow.style.height = __tooltip.offsetHeight + 'px';		

	if((leftPos + tooltipWidth)>bodyWidth){
		__tooltip.style.left = (__tooltipShadow.style.left.replace('px','') - ((leftPos + tooltipWidth)-bodyWidth)) + 'px';
		__tooltipShadow.style.left = (__tooltipShadow.style.left.replace('px','') - ((leftPos + tooltipWidth)-bodyWidth) + __shadowSize) + 'px';
	}

	if(tooltip_is_msie){
		__iframe.style.left = __tooltip.style.left;
		__iframe.style.top = __tooltip.style.top;
		__iframe.style.width = __tooltip.offsetWidth + 'px';
		__iframe.style.height = __tooltip.offsetHeight + 'px';
	}

}

function hideTooltip()
{
	__tooltip.style.display='none';
	__tooltipShadow.style.display='none';		
	if(tooltip_is_msie) {
		__iframe.style.display='none';
	}
}

function SelectNote(numero, hfName, objName) 
{
    var objHF = document.getElementById(hfName); 
    if (objHF != null) { objHF.value = parseInt(numero); }
    for (i=1; i < 6; i++) {
        var nomImg = 'etoile' + i + '_' + objName;
        if (i <= numero) {
            document.getElementById(nomImg).src='/images/etoile.png';
        } 
        else 
        {
            document.getElementById(nomImg).src='/images/etoileVide.png';
        }
    }
}